Skip to content

Commit 0091197

Browse files
authored
Merge pull request #32 from router-protocol/mainnet-docs
add mainnet docs
2 parents d22f898 + e32e731 commit 0091197

File tree

4 files changed

+248
-1
lines changed

4 files changed

+248
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# On Mainnet
2+
3+
## Hardware Requirements
4+
Validators should be able to host one or more data center locations with redundant power, networking, firewalls, HSMs, and servers. The initial minimum recommended hardware specifications are specified below. These may change as network usage increases.
5+
6+
```jsx
7+
-> 6+ vCPU x64 2.0+ GHz
8+
-> 16 to 32+ GB RAM
9+
-> 1TB+ SSD
10+
```
11+
12+
:::tip
13+
To check you system configuration, run the following command on your terminal/command prompt:
14+
- **On Linux:** `lshw` or `cat /proc/cpuinfo`
15+
:::
16+
17+
## Running a Validator on Router Mainnet
18+
To run a validator on Router chain's mainnet, follow these 3 steps:
19+
- [Run a Sentry Node on Mainnet](./on-mainnet/run-a-sentry-node)
20+
- [Setup a Validator Account](./on-mainnet/setup-a-validator-account)
21+
- [Configure and Run an Orchestrator Instance](./on-mainnet/configure-and-run-an-orchestrator-instance)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
title: Step 1) Run a Sentry Node
3+
sidebar_position: 1
4+
---
5+
6+
Before running a Sentry node on, install the following prerequisites:
7+
- [Golang](https://go.dev/doc/install) (version > `1.21.0`)
8+
- [Python](https://www.python.org/downloads/) (version > `3.9.1`)
9+
10+
Once all the required dependencies are installed, create a JSON file
11+
`config.json` with the following content:
12+
13+
```json
14+
{
15+
"snapshot_url": "https://ss.router.nodestake.org/2024-08-11_router_8721632.tar.lz4",
16+
"seed_peers": "ebc272824924ea1a27ea3183dd0b9ba713494f83@router-mainnet-seed.autostake.com:27336,[email protected]:3656,[email protected]:15656,[email protected]:26656,[email protected]:23756,[email protected]:26656,[email protected]:26656,[email protected]:26656",
17+
"genesis": "https://sentry.tm.rpc.routerprotocol.com/genesis",
18+
"genesis_checksum": "34de3eda1e4d9cce80328b96256629817c3baa0643413175e372077b027e9781",
19+
"snap_rpc_url":"https://sentry.tm.rpc.routerprotocol.com/"
20+
}
21+
```
22+
23+
execute the following `curl` request from your terminal/command prompt to run a Sentry node on Router's mainnet:
24+
25+
```bash
26+
curl -L https://bit.ly/48BNjm4 > r.sh && bash r.sh config.json
27+
```
28+
29+
:::info
30+
After running the script, you'll be prompted to choose one of the following two options:
31+
- **Option 1) Install Router -** Installs both the orchestrator and the validator.
32+
- **Option 2) Install Orchestrator -** Installs just the orchestrator.
33+
34+
In case you are following this setup for the first time, select **option 1**.
35+
:::
36+
37+
38+
This script will automatically:
39+
1. Clone the `routerd` binary
40+
2. Initialize the chain config
41+
3. Update the default configuration using mainnet's genesis file
42+
4. Configure `systemd` service for `cosmovisor`
43+
5. Start syncing the chain
44+
45+
:::info
46+
Wait for the chain to sync to the latest block before moving to the next step.
47+
:::
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
---
2+
title: Step 2) Setup a Validator Account
3+
sidebar_position: 2
4+
---
5+
6+
Before creating a validator account, make sure you are running a Sentry node with the chain synced to the latest block as specified in this [step](./run-a-sentry-node).
7+
8+
9+
### Setup validator
10+
11+
1. Create validator account
12+
13+
```bash
14+
export VALIDATOR_KEY_NAME="my-validator-name"
15+
routerd keys add $VALIDATOR_KEY_NAME --chain-id router_9600-1 --keyring-backend file
16+
```
17+
18+
2. Copy routerd address
19+
20+
```bash
21+
routerd keys show $VALIDATOR_KEY_NAME -a --keyring-backend file
22+
export VALIDATOR_ADDRESS=<routerd-address>
23+
```
24+
25+
3. Fund routerd address with some $ROUTE tokens and check balance
26+
27+
```bash
28+
routerd q bank balances $VALIDATOR_ADDRESS --chain-id router_9600-1 --keyring-backend file
29+
```
30+
31+
4. Create validator: Initialize new validator with self delegation of $ROUTE tokens.
32+
33+
```bash
34+
export VALIDATOR_MONIKER="my-validator-moniker"
35+
36+
routerd tx staking create-validator \
37+
--amount=1000000000000000000route \
38+
--pubkey=$(routerd tendermint show-validator) \
39+
--moniker=$VALIDATOR_MONIKER \
40+
--chain-id=router_9600-1 \
41+
--commission-rate="0.10" \
42+
--commission-max-rate="0.20" \
43+
--commission-max-change-rate="0.01" \
44+
--min-self-delegation="1000000" \
45+
--gas="auto" \
46+
--fees="100000000000000route" \
47+
--from=$VALIDATOR_KEY_NAME \
48+
--gas-adjustment=1.5 \
49+
--keyring-backend=file
50+
```
51+
52+
- `amount` flag is the initial amount of ROUTE you're willing to bond
53+
- `pubkey` is the validator public key created earlier
54+
- `moniker` is the human readable name you choose for your validator
55+
- `chain-id` is the network id of the chain you are working with (in the case of Router mainnet: `router_9600-1`)
56+
- `commission-rate` is the initial commission rate you will charge your delegates
57+
- `commission-max-rate` is the highest rate you are allowed to charge your delegates
58+
- `commission-max-change-rate` is how much you can increase your commission rate in a 24 hour period
59+
- `min-self-delegation` is the lowest amount of personal funds the validator is required to have in their validator to stay bonded
60+
- `from` flag is the KEY_NAME you created while initializing the key on your keyring
61+
62+
5. Verify validator status
63+
64+
```bash
65+
routerd q staking validator $VALIDATOR_ADDRESS --chain-id router_9600-1 --keyring-backend file
66+
```
67+
68+
If you see your validator in the list of validators, then congratulations, you have officially joined the Router mainnet as a staking validator! 🎉
69+
70+
71+
After setting up the validator, immediately proceed to setup the orchestrator. This is a necessary step in order to prevent the validator from being slashed.
72+
73+
74+
### Setup Orchestrator
75+
76+
1. Create orchestrator account
77+
78+
```bash
79+
export ORCHESTRATOR_KEY_NAME="my-orchestrator-name"
80+
routerd keys add $ORCHESTRATOR_KEY_NAME --chain-id router_9600-1 --keyring-backend file
81+
```
82+
83+
get Orchestrator address
84+
85+
```bash
86+
routerd keys show $ORCHESTRATOR_KEY_NAME -a --keyring-backend file
87+
export ORCHESTRATOR_ADDRESS=<routerd-address>
88+
```
89+
90+
2. Get funds to orchestrator account, check balance after getting funds
91+
92+
```bash
93+
routerd q bank balances $ORCHESTRATOR_ADDRESS --chain-id router_9600-1 --keyring-backend file
94+
```
95+
96+
3. Map orchestrator address to validator address.
97+
98+
`EVM-KEY-FOR-SIGNING-TXNS` is the public ethereum address. You can create one in Metamask, it doesnt need to have funds. We use it to sign transactions on EVM chains. Make sure to save the private key of this address somewhere safe.
99+
100+
```bash
101+
export EVM_ADDRESS_FOR_SIGNING_TXNS=<EVM-ADDRESS-FOR-SIGNING-TXNS>
102+
routerd tx attestation set-orchestrator-address $ORCHESTRATOR_ADDRESS $EVM_ADDRESS_FOR_SIGNING_TXNS --from my-validator-key \
103+
--chain-id router_9600-1 \
104+
--fees 1000000000000000route \
105+
--keyring-backend file
106+
```
107+
108+
### Add config.json for Orchestrator
109+
110+
```json
111+
{
112+
"chains": [
113+
{
114+
"chainId": "137",
115+
"chainType": "CHAIN_TYPE_EVM",
116+
"chainName": "Polygon",
117+
"chainRpc": "www.polygon-rpc.com",
118+
"blocksToSearch": 1000,
119+
"blockTime": "5s"
120+
}
121+
],
122+
"globalConfig": {
123+
"logLevel": "debug",
124+
"networkType": "mainnet",
125+
"dbPath": "orchestrator.db",
126+
"batchSize": 25,
127+
"batchWaitTime": 4,
128+
"routerChainTmRpc": "http://0.0.0.0:26657",
129+
"routerChainGRpc": "tcp://0.0.0.0:9090",
130+
"evmAddress": "",
131+
"cosmosAddress": "",
132+
"ethPrivateKey": "",
133+
"cosmosPrivateKey": ""
134+
}
135+
}
136+
```
137+
138+
- `routerChainTmRpc` and `routerChainGRpc`, point it to your validator IP
139+
- `cosmosAddress` is Router address of orchestrator // router5678abcd
140+
- `cosmosPrivateKey` is private key for your orchestrator cosmos address (private key of above `cosmosAddress`)
141+
- `evmAddress` is EVM address of orchestrator which created in above step in Metamask //0x1234abcd
142+
- `ethPrivateKey` is private key for the the above `evmAddress` wallet you created
143+
- `loglevel` currently kept it as "debug" can be set as "info" evmAddress is EVM address of orchestrator //0x1234abcd
144+
145+
### Start Validator and Orchestrator
146+
147+
1. Start validator
148+
149+
```bash
150+
sudo systemctl start cosmovisor.service
151+
sudo systemctl status cosmovisor.service
152+
153+
# check logs
154+
journalctl -u cosmovisor -f
155+
```
156+
157+
2. Start orchestrator
158+
159+
```bash
160+
sudo systemctl start orchestrator.service
161+
sudo systemctl status orchestrator.service
162+
163+
# check logs
164+
journalctl -u orchestrator -f
165+
```
166+
167+
### Check validator and orchestrator status
168+
169+
1. Check if node is syncing, make sure it is not stuck at some block height
170+
171+
```bash
172+
routerd status | jq .SyncInfo.latest_block_height
173+
```
174+
175+
2. Check if orchestrator health is ok
176+
177+
```bash
178+
curl localhost:8001/health
179+
```

docs/validators/running-a-validator/on-testnet/run-a-sentry-node.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sidebar_position: 1
44
---
55

66
Before running a Sentry node on , install the following prerequisites:
7-
- [Golang](https://go.dev/doc/install) (version > `1.19`)
7+
- [Golang](https://go.dev/doc/install) (version > `1.21.0`)
88
- [Python](https://www.python.org/downloads/) (version > `3.9.1`)
99

1010
Once all the required dependencies are installed, execute the following `curl` request from your terminal/command prompt to run a Sentry node on Router's testnet:

0 commit comments

Comments
 (0)