You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/run-a-node/storage-node.md
+89-24Lines changed: 89 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,9 @@ For detailed instructions on setting up and operating your Storage Node or Stora
30
30
Before setting up your storage node:
31
31
32
32
- Understand that 0G Storage interacts with on-chain contracts for blob root confirmation and PoRA mining.
33
-
- Check [here](../developer-hub/testnet/testnet-overview.md) for deployed contract addresses.
33
+
- Choose your network: [Testnet](../developer-hub/testnet/testnet-overview.md) or [Mainnet](../developer-hub/mainnet/mainnet-overview.md)
34
+
- Check the respective network overview pages for deployed contract addresses and RPC endpoints.
35
+
-**For mainnet deployment**: Ensure you have real OG tokens for transaction fees and mining rewards.
34
36
35
37
36
38
## Install Dependencies
@@ -78,61 +80,124 @@ Start by installing all the essential tools and libraries required to build the
78
80
79
81
This compiles the Rust code into an executable binary. The `--release` flag optimizes the build for performance.
80
82
81
-
## Configuration
83
+
## Setup and Configuration
84
+
85
+
Navigate to the run directory and configure your storage node for either testnet or mainnet.
86
+
87
+
:::info Config File References
88
+
The official configuration files are available in the [0G Storage Node GitHub repository](https://github.com/0gfoundation/0g-storage-node/tree/main/run):
89
+
- Testnet: `config-testnet-turbo.toml`
90
+
- Mainnet: `config-mainnet-turbo.toml`
82
91
83
-
Navigate to the run directory and open config.toml for editing. Follow the steps below.
92
+
Always use the latest versions from the repository as they contain the most up-to-date network parameters.
93
+
:::
94
+
95
+
<Tabs>
96
+
<TabItemvalue="testnet"label="Testnet">
84
97
85
-
1. Edit the configuration file:
98
+
### Configuration
99
+
100
+
1. Copy the testnet configuration:
86
101
87
102
```bash
88
103
cd run
89
-
nano config.toml
104
+
cp config-testnet-turbo.toml config.toml
90
105
```
91
106
92
-
2. Update configuration with your preferred settings:
# Your private key for mining (64 chars, no '0x' prefix)
121
+
miner_key = "YOUR_PRIVATE_KEY"
99
122
```
100
-
# Peer nodes: A list of peer nodes to help your node join the network. Check inside 0g-storage/run directory for suggested configurations.
101
-
network_boot_nodes = []
102
123
103
-
# Contract addresses
104
-
log_contract_address = "CONTRACT_ADDRESS" #flow contract address, see testnet information
105
-
mine_contract_address = "CONTRACT_ADDRESS" #Address of the smart contract on the host blockchain that manages mining.
124
+
3. Optional: Configure network settings if needed:
106
125
107
-
# L1 host blockchain RPC endpoint URL. See testnet information page for RPC endpoints
108
-
blockchain_rpc_endpoint = "RPC_ENDPOINT"
126
+
```toml
127
+
# Target number of connected peers (can be increased for better connectivity)
128
+
network_target_peers = 50
129
+
```
109
130
110
-
# Start sync block number: The block number from which your node should start synchronizing the log data.
111
-
log_sync_start_block_number = BLOCK_NUMBER
131
+
### Running the Node
112
132
113
-
# Your private key (64 chars, no '0x' prefix, include leading zeros): Your private key (without the `0x` prefix) if you want to participate in PoRA mining and earn rewards.
# Your private key for mining (64 chars, no '0x' prefix)
114
171
miner_key = "YOUR_PRIVATE_KEY"
172
+
```
115
173
116
-
# Max chunk entries in db (affects storage size): The maximum number of chunk entries (each 256 bytes) to store in the database. This effectively limits the database size.
117
-
db_max_num_chunks = MAX_CHUNKS
174
+
3. The mainnet configuration includes predefined boot nodes for network connectivity:
118
175
119
-
# ENR address: Your node's public IP address, essential for other nodes to discover and connect to you. Currently automatically set by the node.
0 commit comments