How to access CodeChain Corgi testnet

Park Juhyung
CodeChain
Published in
2 min readApr 18, 2019

Corgi is a test network of CodeChain. You can participate in the network by following the instructions below.

Download CodeChain

You can download the latest CodeChain binary from this link.

Run CodeChain

Please run CodeChain with the following command:

ENABLE_ORDER=true ENABLE_DELEGATIONS=true ./codechain --chain corgi\
--no-miner \
--bootstrap-addresses "52.68.160.158:3485" "52.87.80.242:3485" "13.52.125.202:3485" "18.184.72.190:3485" "13.124.7.55:3485"
  • chain: option to select which chain to use. The testnet uses Corgi chain
  • bootstrap-address: default node address for finding a peer when a node is first launched
  • no-miner: option to disable to create a block. This option is needed because we are running a non-validating node.

Check the CodeChain node

You can check the node status by using JSON RPC. chain_getBestBlock RPC is the RPC that returns the biggest block number. By calling this RPC, you can check whether your node is in sync with the network or whether it is participating in the network without errors. The RPC can be called by using the following curl command:

curl -XPOST localhost:8080 \
-H ‘Content-type: application/json’ \
--data '{"jsonrpc":"2.0","id":1,"method":"chain_getBestBlockNumber","params":[]}'

If you have successfully called the RPC, the following result will be returned:

{"jsonrpc":"2.0","result": 137,"id":1}

The above output represents the latest block number. The output will increase each time you call the RPC until the value matches with the latest block number in the testnet. You can check the latest block number in the testnet block explorer (https://corgi.codechain.io/explorer/).

Caution

Your computer must have a public IP to participate in the testnet. If a node does not have a public IP, other nodes cannot access the network. Also, make sure that port 3485, which is used for P2P communication in CodeChain, is not blocked by a firewall.

Conclusion

It’s effortless to run CodeChain in your machine. Try to download and run it. You can use your CodeChain node by using RPC calls or CodeChain SDK.

--

--