-
Notifications
You must be signed in to change notification settings - Fork 364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: node.store usage updates for celestia-node #1532
Changes from 8 commits
cd248bb
e66f5b5
a0cef63
78b52bd
2c4a124
44cb6aa
710a312
010ce58
bf5084f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -462,8 +462,14 @@ Where: | |||||||
For example, to submit a blob to Celestia, you can use this command | ||||||||
once your node store is set: | ||||||||
|
||||||||
:::note | ||||||||
Previously, the `node.store` flag had to be specified manually for each | ||||||||
request. This has changed in v0.14.0+ and you can | ||||||||
[read more about the implementation in celestia-node troubleshooting](../nodes/celestia-node-troubleshooting.md#changing-the-location-of-your-node-store). | ||||||||
::: | ||||||||
|
||||||||
```bash | ||||||||
celestia blob submit 0x42690c204d39600fddd3 'gm' --node.store $NODE_STORE | ||||||||
celestia blob submit 0x42690c204d39600fddd3 'gm' | ||||||||
``` | ||||||||
|
||||||||
Alternatively, you could use the `--token` flag to set your auth token: | ||||||||
|
@@ -479,7 +485,8 @@ and how to use the node store to set it. | |||||||
### Basic flags | ||||||||
|
||||||||
All RPC CLI commands have basic flags that can be used to | ||||||||
interact with the API. | ||||||||
interact with the API; however, none are necessary using | ||||||||
default configurations. | ||||||||
Comment on lines
+271
to
+272
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Simplify language to enhance clarity. - All RPC CLI commands have basic flags that can be used to interact with the API; however, none are necessary using default configurations.
+ All RPC CLI commands have basic flags, but they are optional with default configurations. Committable suggestion
Suggested change
|
||||||||
|
||||||||
These include: | ||||||||
|
||||||||
|
@@ -528,12 +535,13 @@ In order to interact with the API using RPC CLI, | |||||||
you can also use your node store to set your auth token. This will | ||||||||
allow you to interact with the API without | ||||||||
setting an authentication token directly. | ||||||||
This is only required if you are using a non-default node store path. | ||||||||
|
||||||||
To set your node store for a light node on {{constants.mochaChainId}}, | ||||||||
To set a custom node store for a light node on {{constants.mochaChainId}}, | ||||||||
you can use the following command: | ||||||||
|
||||||||
```bash-vue | ||||||||
export NODE_STORE=$HOME/.celestia-light-{{constants.mochaChainId}} | ||||||||
export NODE_STORE=$HOME/your-custom-path/celestia-light-{{constants.mochaChainId}} | ||||||||
Comment on lines
+321
to
+327
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Clarify the need for custom node store paths. The instructions for setting a custom node store path are clear, but adding a brief explanation of why a user might need or want to use a custom path can provide better context and help users make informed decisions. |
||||||||
``` | ||||||||
|
||||||||
Then, set the `--node.store` flag to the `$NODE_STORE` variable | ||||||||
|
@@ -548,12 +556,12 @@ celestia <module> <method> [args...] --node.store $NODE_STORE | |||||||
This section is for users who are using a `CELESTIA_CUSTOM` or private network. | ||||||||
|
||||||||
:::tip | ||||||||
If you are using a private and custom network, you will **need to set | ||||||||
the location of the node store in your auth command.** | ||||||||
If you are using a private and custom network with a custom node store path, | ||||||||
you will **need to set the location of the node store in your auth command.** | ||||||||
::: | ||||||||
|
||||||||
```bash | ||||||||
--node.store $HOME/.celestia-light-private) | ||||||||
--node.store $HOME/your-custom-path/.celestia-light-private | ||||||||
Comment on lines
+342
to
+347
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Emphasize the necessity of setting the node store location in custom networks. The tip about needing to set the node store location for custom and private networks is crucial and should be highlighted or made more prominent to ensure users do not overlook this requirement. |
||||||||
``` | ||||||||
|
||||||||
The above is an example from the following custom network set up with: | ||||||||
|
@@ -576,7 +584,7 @@ CELESTIA_CUSTOM=robusta-22 celestia light init | |||||||
|
||||||||
# Set auth token | ||||||||
export AUTH_TOKEN=$(celestia light auth admin --p2p.network private \ | ||||||||
--node.store $HOME/.celestia-light-robusta-22) | ||||||||
--node.store $HOME/your-custom-path/.celestia-light-robusta-22) | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ensure consistency in custom network setup instructions. The instructions for setting up a custom network and the associated auth token use different node store paths. This inconsistency could confuse users. It would be helpful to standardize the node store path across these instructions. |
||||||||
``` | ||||||||
|
||||||||
### Submitting data | ||||||||
|
@@ -602,14 +610,13 @@ Here is an example of the format of the `blob.Submit` transaction: | |||||||
|
||||||||
```bash | ||||||||
celestia blob submit <hex-encoded namespace> <hex-encoded data> \ | ||||||||
[optional: fee] [optional: gasLimit] [node store | auth token] | ||||||||
[optional: fee] [optional: gasLimit] [optional: node store | auth token] | ||||||||
``` | ||||||||
|
||||||||
We run the following to submit a blob to the network in hexadecimal format: | ||||||||
|
||||||||
```bash | ||||||||
celestia blob submit 0x42690c204d39600fddd3 0x676d \ | ||||||||
--node.store $NODE_STORE | ||||||||
``` | ||||||||
|
||||||||
We get the following output: | ||||||||
|
@@ -634,7 +641,7 @@ celestia blob submit <hex-encoded namespace> <'data'> \ | |||||||
And an example to submit "gm" as the plain-text data: | ||||||||
|
||||||||
```bash | ||||||||
celestia blob submit 0x42690c204d39600fddd3 'gm' --node.store $HOME/.celestia-light-mocha-4/ | ||||||||
celestia blob submit 0x42690c204d39600fddd3 'gm' | ||||||||
``` | ||||||||
|
||||||||
Output: | ||||||||
|
@@ -680,8 +687,7 @@ Here is an example command to retrieve the data from above, on `{{constants.arab | |||||||
<!-- markdownlint-disable MD013 --> | ||||||||
|
||||||||
```bash | ||||||||
celestia blob get 252614 0x42690c204d39600fddd3 IXg+08HV5RsPF3Lle8PH+B2TUGsGUsBiseflxh6wB5E= \ | ||||||||
--node.store $NODE_STORE | ||||||||
celestia blob get 252614 0x42690c204d39600fddd3 IXg+08HV5RsPF3Lle8PH+B2TUGsGUsBiseflxh6wB5E= | ||||||||
``` | ||||||||
|
||||||||
Will generate the following output: | ||||||||
|
@@ -704,7 +710,7 @@ To see the base64 response, use the `--base64` flag set to `TRUE` | |||||||
|
||||||||
```bash | ||||||||
celestia blob get 252614 0x42690c204d39600fddd3 IXg+08HV5RsPF3Lle8PH+B2TUGsGUsBiseflxh6wB5E= \ | ||||||||
--base64=TRUE --node.store $NODE_STORE | ||||||||
--base64=TRUE | ||||||||
``` | ||||||||
|
||||||||
<!-- markdownlint-enable MD013 --> | ||||||||
|
@@ -726,8 +732,7 @@ To get all blobs in the namespace at the block height, use `get-all` instead | |||||||
of `get`: | ||||||||
|
||||||||
```bash | ||||||||
celestia blob get-all 252614 0x42690c204d39600fddd3 \ | ||||||||
--node.store $NODE_STORE | ||||||||
celestia blob get-all 252614 0x42690c204d39600fddd3 | ||||||||
``` | ||||||||
|
||||||||
This will return the following: | ||||||||
|
@@ -749,7 +754,7 @@ To display the response in base64, use: | |||||||
|
||||||||
```bash | ||||||||
celestia blob get-all 252614 0x42690c204d39600fddd3 \ | ||||||||
--base64=TRUE --node.store $NODE_STORE | ||||||||
--base64=TRUE | ||||||||
``` | ||||||||
|
||||||||
Which will return: | ||||||||
|
@@ -783,8 +788,7 @@ Learn [more about gas fees and limits](../developers/submit-data.md). | |||||||
To set a higher gas price of 0.004 utia, use the `--gas.price 0.004` flag: | ||||||||
|
||||||||
```bash | ||||||||
celestia blob submit 0x42690c204d39600fddd3 'gm' --gas.price 0.004 \ | ||||||||
--node.store $NODE_STORE | ||||||||
celestia blob submit 0x42690c204d39600fddd3 'gm' --gas.price 0.004 | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Clarify the usage of the The introduction of the |
||||||||
``` | ||||||||
|
||||||||
You will receive the height and commitment of the block in which the | ||||||||
|
@@ -808,7 +812,7 @@ Let's query our node for the balance of its default account | |||||||
key we generated above): | ||||||||
|
||||||||
```bash | ||||||||
celestia state balance --node.store $NODE_STORE | ||||||||
celestia state balance | ||||||||
``` | ||||||||
|
||||||||
The response will look similar to: | ||||||||
|
@@ -829,17 +833,15 @@ The response will look similar to: | |||||||
Here is an example of the format of the `balance-for-address` command: | ||||||||
|
||||||||
```bash | ||||||||
celestia state balance-for-address <address> \ | ||||||||
--node.store $NODE_STORE | ||||||||
celestia state balance-for-address <address> | ||||||||
``` | ||||||||
|
||||||||
Let's query our node for the balance of another address: | ||||||||
|
||||||||
<!-- markdownlint-disable MD013 --> | ||||||||
|
||||||||
```bash | ||||||||
celestia state balance-for-address celestia10rtd9lhel2cuh6c659l25yncl6atcyt37umard \ | ||||||||
--node.store $NODE_STORE | ||||||||
celestia state balance-for-address celestia10rtd9lhel2cuh6c659l25yncl6atcyt37umard | ||||||||
``` | ||||||||
|
||||||||
The response will be the balance of the address you queried: | ||||||||
|
@@ -860,7 +862,7 @@ The response will be the balance of the address you queried: | |||||||
This is an RPC call in order to get your node's peerId information: | ||||||||
|
||||||||
```bash | ||||||||
celestia p2p info --node.store $NODE_STORE | ||||||||
celestia p2p info | ||||||||
``` | ||||||||
|
||||||||
The node ID is in the `ID` value from the response: | ||||||||
|
@@ -888,7 +890,7 @@ The node ID is in the `ID` value from the response: | |||||||
This is an RPC call in order to get your node's account address: | ||||||||
|
||||||||
```bash | ||||||||
celestia state account-address --node.store $NODE_STORE | ||||||||
celestia state account-address | ||||||||
``` | ||||||||
|
||||||||
Response: | ||||||||
|
@@ -906,17 +908,16 @@ Response: | |||||||
Here is an example of the format of the `GetByHeight` command: | ||||||||
|
||||||||
```bash | ||||||||
celestia header get-by-height <height> \ | ||||||||
--node.store $NODE_STORE | ||||||||
celestia header get-by-height <height> | ||||||||
``` | ||||||||
|
||||||||
Now, let's get the block header information. | ||||||||
|
||||||||
Here we will get the header from Block 1: | ||||||||
|
||||||||
````bash | ||||||||
celestia header get-by-height 1 \ | ||||||||
--node.store $NODE_STORE``` | ||||||||
celestia header get-by-height 1 | ||||||||
``` | ||||||||
|
||||||||
It will output something like this: | ||||||||
|
||||||||
|
@@ -1010,15 +1011,13 @@ It will output something like this: | |||||||
#### Combined commands | ||||||||
|
||||||||
```bash | ||||||||
celestia share get-by-namespace "$(celestia header get-by-height 147105 \ | ||||||||
--node.store $NODE_STORE | jq '.result.dah' -r)" 0x42690c204d39600fddd3 \ | ||||||||
--node.store $NODE_STORE | ||||||||
celestia share get-by-namespace "$(celestia header get-by-height 147105 | jq '.result.dah' -r)" 0x42690c204d39600fddd3 | ||||||||
``` | ||||||||
|
||||||||
#### Get data availability sampler stats | ||||||||
|
||||||||
```bash | ||||||||
celestia das sampling-stats --node.store $NODE_STORE | ||||||||
celestia das sampling-stats | ||||||||
``` | ||||||||
|
||||||||
#### Transfer balance of utia to another account | ||||||||
|
@@ -1034,29 +1033,27 @@ recipient's address, gas fee, and gasLimit. This is what the format will | |||||||
look like: | ||||||||
|
||||||||
```bash | ||||||||
celestia state transfer $ADDRESS <amount in utia> <gas fee in utia> <gas fee in utia> \ | ||||||||
--node.store $NODE_STORE | ||||||||
celestia state transfer $ADDRESS <amount in utia> <gas fee in utia> <gas fee in utia> | ||||||||
``` | ||||||||
|
||||||||
Here is an example, sending 0.1 TIA, with a gas fee of 0.008 TIA, and a gas limit of 0.08: | ||||||||
|
||||||||
```bash | ||||||||
celestia state transfer $ADDRESS 100000 8000 80000 \ | ||||||||
--node.store $NODE_STORE | ||||||||
celestia state transfer $ADDRESS 100000 8000 80000 | ||||||||
``` | ||||||||
|
||||||||
If you'd just like to return the transaction hash, you can use jq: | ||||||||
|
||||||||
```bash | ||||||||
celestia state transfer $ADDRESS 100000 8000 80000 --node.store $NODE_STORE | jq .result.txhash | ||||||||
celestia state transfer $ADDRESS 100000 8000 80000 | jq .result.txhash | ||||||||
``` | ||||||||
|
||||||||
#### API version | ||||||||
|
||||||||
To query your node's API version, you can use the following command: | ||||||||
|
||||||||
```bash | ||||||||
celestia node info --node.store $NODE_STORE | ||||||||
celestia node info | ||||||||
``` | ||||||||
|
||||||||
#### Help | ||||||||
|
@@ -1067,10 +1064,10 @@ To get help and view the CLI menu, use the following command: | |||||||
celestia --help | ||||||||
``` | ||||||||
|
||||||||
To view help menu for a specific method, use the following command: | ||||||||
To view the help menu for a specific method, use the following command: | ||||||||
|
||||||||
```bash | ||||||||
celestia <module> <method> --node.store $NODE_STORE --help | ||||||||
celestia <module> <method> --help | ||||||||
``` | ||||||||
|
||||||||
### Advanced example | ||||||||
|
@@ -1081,8 +1078,8 @@ used in `celestia share get-by-namespace`: | |||||||
|
||||||||
```bash | ||||||||
celestia share get-by-namespace \ | ||||||||
"$(celestia header get-by-height 252614 --node.store $NODE_STORE | jq '.result.dah' -r)" \ | ||||||||
0x42690c204d39600fddd3 --node.store $NODE_STORE | ||||||||
"$(celestia header get-by-height 252614 | jq '.result.dah' -r)" \ | ||||||||
0x42690c204d39600fddd3 | ||||||||
``` | ||||||||
|
||||||||
## Additional resources | ||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,6 +78,33 @@ If you would like to use them anyway, you can | |
|
||
## Changing the location of your node store | ||
|
||
### Background | ||
|
||
An [enhancement has been made in v0.14.0+](https://github.com/celestiaorg/celestia-node/pull/3246) | ||
to automate the detection of the running node, eliminating the need to | ||
manually specify the `--node.store` flag for each RPC request. | ||
|
||
**Assumptions:** | ||
|
||
- The presence of a lock signifies a running node. | ||
jcstein marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- Networks are ordered as Mainnet, Mocha, Arabica, private, custom. | ||
- Node types are ordered as bridge, full, and light. | ||
- Each network has only one running node type. | ||
- Multiple nodes of the same network and type are prohibited | ||
(resulting in an `Error: node: store is in use`). | ||
|
||
Comment on lines
+89
to
+95
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Revise the assumptions section for clarity and accuracy. The assumptions listed about the ordering of networks and node types, as well as the prohibition of multiple nodes of the same network and type, are crucial for understanding the operational constraints. Consider expanding on why these assumptions are necessary and how they impact the node's operation to provide clearer guidance to users. |
||
**Key Points:** | ||
|
||
- Authentication token and other flags maintain their previous behavior | ||
and take precedence. | ||
- Address and port details are fetched from the configuration. | ||
- `skipAuth` allows bypassing authentication for trusted setups and follows | ||
jcstein marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Unix daemon conventions. | ||
- Non-default node store and cel-key configurations still require specific | ||
flags in the configuration settings. | ||
Comment on lines
+101
to
+104
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ensure the The |
||
|
||
### Demonstration | ||
|
||
In this section, we'll guide you through starting your node using a | ||
node store in a different location than you originally started with. | ||
|
||
|
@@ -113,6 +140,57 @@ To show the keys you should add `--keyring-dir` like this example: | |
--keyring-dir /home/user/celestia-<node-type>-location/keys/ | ||
``` | ||
|
||
### Examples | ||
|
||
#### Mainnet Beta full and Mocha light | ||
|
||
This example uses a Mainnet Beta full node and a Mocha light node. When | ||
making the request: | ||
|
||
```bash | ||
❯ celestia blob get 1318129 0x42690c204d39600fddd3 0MFhYKQUi2BU+U1jxPzG7QY2BVV1lb3kiU+zAK7nUiY= | ||
{ | ||
"result": "RPC client error: sendRequest failed: http status 401 Unauthorized unmarshaling response: EOF" | ||
} | ||
``` | ||
|
||
The request will go to the Mainnet Beta node, and a 401 will show in | ||
this node's logs. Note that a 401 is expected because this blob was | ||
posted to Mocha and neither the namespace nor the blob exist on Mainnet. | ||
|
||
#### Mocha full and Arabica light | ||
|
||
This example uses a Mocha full node and an Arabica light node. When | ||
making the request: | ||
|
||
```bash | ||
❯ celestia blob get 1318129 0x42690c204d39600fddd3 0MFhYKQUi2BU+U1jxPzG7QY2BVV1lb3kiU+zAK7nUiY= | ||
{ | ||
"result": { | ||
"namespace": "AAAAAAAAAAAAAAAAAAAAAAAAAEJpDCBNOWAP3dM=", | ||
"data": "0x676d", | ||
"share_version": 0, | ||
"commitment": "0MFhYKQUi2BU+U1jxPzG7QY2BVV1lb3kiU+zAK7nUiY=", | ||
"index": 23 | ||
} | ||
} | ||
``` | ||
|
||
The request will go to the Mocha full node, and result shown as expected. | ||
|
||
#### Using a custom rpc.config address | ||
|
||
When using a custom RPC config address `0.0.0.1` and port `25231`, | ||
the CLI accurately routes to the custom address and port, where no | ||
node is running. It fails as expected: | ||
|
||
```bash | ||
❯ celestia blob get 1318129 0x42690c204d39600fddd3 0MFhYKQUi2BU+U1jxPzG7QY2BVV1lb3kiU+zAK7nUiY= | ||
{ | ||
"result": "RPC client error: sendRequest failed: Post \"http://0.0.0.1:25231\": dial tcp 0.0.0.1:25231: connect: no route to host" | ||
} | ||
``` | ||
Comment on lines
+143
to
+192
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Enhance the examples section with more detailed outcomes. The examples provided for different node setups and their expected results are very useful. To enhance understanding, consider adding more context about why certain results are expected, such as the 401 Unauthorized error, and how users can resolve or investigate these issues further. ToolsLanguageTool
|
||
|
||
## Resetting your config | ||
|
||
If you an encounter an error, it is likely that an old config file is present: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarification and link addition needed for
node.store
flag change.While the note mentions the change in the usage of the
node.store
flag, it would be beneficial for users if a direct link to the section discussing this change in detail is provided.