Skip to content

Commit 7692507

Browse files
Udhay/storage node mainnet docs (#210)
* fix * docs: enhance mainnet and storage node documentation with contract addresses and configuration details
1 parent 81b35fc commit 7692507

File tree

2 files changed

+96
-24
lines changed

2 files changed

+96
-24
lines changed

docs/developer-hub/mainnet/mainnet-overview.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,12 @@ Build and run production workloads on the 0G Mainnet.
5656
For redundancy in production apps, consider adding multiple RPC providers where available.
5757
:::
5858

59+
## Contract Addresses
60+
61+
**0G Storage**
62+
- Flow: `0x62D4144dB0F0a6fBBaeb6296c785C71B3D57C526`
63+
- Mine: `0xCd01c5Cd953971CE4C2c9bFb95610236a7F414fe`
64+
- Reward: `0x457aC76B58ffcDc118AABD6DbC63ff9072880870`
65+
5966
## Developer Tools
6067
- **Chain Explorer**: `https://chainscan.0g.ai (https://chainscan.0g.ai)`

docs/run-a-node/storage-node.md

Lines changed: 89 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ For detailed instructions on setting up and operating your Storage Node or Stora
3030
Before setting up your storage node:
3131

3232
- 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.
3436

3537

3638
## Install Dependencies
@@ -78,61 +80,124 @@ Start by installing all the essential tools and libraries required to build the
7880

7981
This compiles the Rust code into an executable binary. The `--release` flag optimizes the build for performance.
8082

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`
8291

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+
<TabItem value="testnet" label="Testnet">
8497

85-
1. Edit the configuration file:
98+
### Configuration
99+
100+
1. Copy the testnet configuration:
86101

87102
```bash
88103
cd run
89-
nano config.toml
104+
cp config-testnet-turbo.toml config.toml
90105
```
91106

92-
2. Update configuration with your preferred settings:
107+
2. Update the following fields in `config.toml`:
93108

109+
```toml
110+
# Contract addresses for testnet
111+
log_contract_address = "0x22E03a6A89B950F1c82ec5e74F8eCa321a105296" # Flow contract
112+
mine_contract_address = "0x00A9E9604b0538e06b268Fb297Df333337f9593b" # Mine contract
94113

95-
Below is just an example configuration for illustration purposes.
96-
For official default values, copy over the `config-testnet-turbo.toml` file to your `config.toml` file.
114+
# Testnet RPC endpoint
115+
blockchain_rpc_endpoint = "https://evmrpc-testnet.0g.ai"
97116

117+
# Start sync block number for testnet
118+
log_sync_start_block_number = 326165
98119

120+
# Your private key for mining (64 chars, no '0x' prefix)
121+
miner_key = "YOUR_PRIVATE_KEY"
99122
```
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 = []
102123

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:
106125

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+
```
109130

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
112132

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.
133+
1. Check configuration options:
134+
```bash
135+
../target/release/zgs_node -h
136+
```
137+
138+
2. Run the testnet storage service:
139+
```bash
140+
cd run
141+
../target/release/zgs_node --config config.toml --miner-key <your_private_key>
142+
```
143+
144+
</TabItem>
145+
<TabItem value="mainnet" label="Mainnet">
146+
147+
### Configuration
148+
149+
1. Copy the mainnet configuration:
150+
151+
```bash
152+
cd run
153+
cp config-mainnet-turbo.toml config.toml
154+
```
155+
156+
2. Update the following fields in `config.toml`:
157+
158+
```toml
159+
# Contract addresses for mainnet
160+
log_contract_address = "0x62D4144dB0F0a6fBBaeb6296c785C71B3D57C526" # Flow contract
161+
mine_contract_address = "0xCd01c5Cd953971CE4C2c9bFb95610236a7F414fe" # Mine contract
162+
reward_contract_address = "0x457aC76B58ffcDc118AABD6DbC63ff9072880870" # Reward contract
163+
164+
# Mainnet RPC endpoint
165+
blockchain_rpc_endpoint = "https://evmrpc.0g.ai"
166+
167+
# Start sync block number for mainnet
168+
log_sync_start_block_number = 2387557
169+
170+
# Your private key for mining (64 chars, no '0x' prefix)
114171
miner_key = "YOUR_PRIVATE_KEY"
172+
```
115173

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:
118175

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.
120-
# network_enr_address = ""
176+
```toml
177+
network_boot_nodes = ["/ip4/34.66.131.173/udp/1234/p2p/16Uiu2HAmG81UgZ1JJLx9T2HqELgJNP36ChHzYkCdA9HdxvAbb5jQ","/ip4/34.60.163.4/udp/1234/p2p/16Uiu2HAmL3DoA7e7mbxs7CkeCPtNrAcfJFFtLpJDr2HWuR6QwJ8k","/ip4/34.169.236.186/udp/1234/p2p/16Uiu2HAm489RdhEgZUFmNTR4jdLEE4HjrvwaPCkEpSYSgvqi1CbR","/ip4/34.71.110.60/udp/1234/p2p/16Uiu2HAmBfGfbLNRegcqihiuXhgSXWNpgiGm6EwW2SYexfPUNUHQ"]
121178
```
122179

123-
## Running the Storage Node
180+
### Running the Node
124181

125182
1. Check configuration options:
126183
```bash
127184
../target/release/zgs_node -h
128185
```
129186

130-
2. Run the storage service:
187+
2. Run the mainnet storage service:
131188
```bash
132189
cd run
133190
../target/release/zgs_node --config config.toml --miner-key <your_private_key>
134191
```
135192

193+
**Important Mainnet Notes**:
194+
- Ensure your miner key has sufficient OG tokens for transaction fees
195+
- Mainnet nodes should have stable internet connectivity and sufficient bandwidth
196+
- Monitor your node's performance and logs regularly
197+
198+
</TabItem>
199+
</Tabs>
200+
136201
## Snapshot
137202
Make sure to only include `flow_db` and delete `data_db` under `db` folder when you use a snapshot from a 3rd party !
138203
> Using others' `data_db` will make the node mine for others!

0 commit comments

Comments
 (0)