Join Testnet from your GCP
1.) Download node binary from Github
- Go to https://github.com/UnitCode-org/Unit-Network-Chain/releases
- Download the same binary version deployed by the bootnode.
- Download the customSpecRaw.json
2.) Expose your P2P port
Run terminal command ufw (Uncomplicated Firewall) to expose the P2P port for each of your nodes.
In this example we are running one node with P2P port: 30333
sudo ufw allow 30333/tcp
3.) Add firewall policy for exposed P2P ports
-
Go to firewall policies in GCP.
-
Add an Engress firewall policy so nodes can send data.
-
Add an Ingress firewall policy so nodes can receive data.
4.) Start node to test connection to bootnode
Include the details collected from the bootnode operator to the command for running your node.
For example: A bootnode operator provides the following details about itself:
- Local ID: 12D3KooWBzWscCLMT4UfGrXViAKXEJyQJJm8Hccd6o5xpwZvzwgR
- Public IP: 34.16.183.82
- P2P port: 30333
This would be the command for running your node and connecting to the bootnode:
./target/release/node-unitchain \
--base-path /tmp/node01 \
--chain ./customSpecRaw.json \
--port 30333 \
--rpc-port 9944 \
--bootnodes /ip4/34.16.183.82/tcp/30333/p2p/12D3KooWBzWscCLMT4UfGrXViAKXEJyQJJm8Hccd6o5xpwZvzwgR \
--validator \
--rpc-methods Unsafe \
--rpc-cors all \
--rpc-external
After verifying that the node works, Ctrl-C to stop the node.
5.) Insert keys into keystore using node binary
Aura
./node-unitchain key insert \
--base-path /tmp/node01 \
--chain customSpecRaw.json \
--scheme Sr25519 \
--suri PRIVATE KEY \
--key-type aura
Grandpa
./node-unitchain key insert \
--base-path /tmp/node01 \
--chain customSpecRaw.json \
--scheme Ed25519 \
--suri PRIVATE KEY \
--key-type gran
Verify you have inserted the keys correctly.
ls /tmp/node01/chains/local_testnet/keystore
6.) Run node in background
Make sure to include details from bootnode operator.
nohup ./node-unitchain \
--base-path /tmp/node01 \
--chain ./customSpecRaw.json \
--port 30333 \
--rpc-port 9944 \
--bootnodes /ip4/34.16.183.82/tcp/30333/p2p/12D3KooWBzWscCLMT4UfGrXViAKXEJyQJJm8Hccd6o5xpwZvzwgR \
--validator \
--rpc-methods=Unsafe \
--name MyNode01 \
--rpc-cors all \
--rpc-external >/dev/null 2>&1 &