Croeseid 5 Testnet: Running Nodes
Croeseid 5 Testnet is Cronos PoS Chain Testnet. It is a new chain based on Croeseid Testnet and runs in parallel with Croeseid 4. It serves as an alpha testnet for exploring new features, instead of the upgraded version of Croeseid 4 testnet.
This is detailed documentation for setting up a Validator or a full node on Cronos PoS Croeseid 5 testnet testnet-croeseid-5.
Pre-requisites
Supported OS
We officially support macOS, Windows, and Linux only. Other platforms may work but there is no guarantee. We will extend our support to other platforms after we have stabilized our current architecture.
Prepare your machine
To run Cronos PoS Chain nodes in the testnet, you will need a machine with the following minimum requirements:
Archive Node:
RAM: 16GB (goleveldb)
Disk: 281GB
CPU: 4 cores
Default pruned node
RAM 16GB (goleveldb)
Disk: 83GB (Depends on how long the node is running for)
CPU: 4 cores
Step 1. Get the Cronos PoS Chain testnet binary
To simplify the following step, we will be using Linux (Intel x86) for illustration. Binary for Mac (Intel x86 / M1 and Windows are also available.
To install Cronos PoS Chain released testnet binaries from GitHub:
$ curl -LOJ https://github.com/crypto-org-chain/chain-main/releases/download/v4.2.2-croeseid/chain-main_4.2.2-croeseid_Linux_x86_64.tar.gz $ tar -zxvf chain-main_4.2.2-croeseid_Linux_x86_64.tar.gzYou can verify the installation by checking the version of the chain-maind, the current version is
4.2.2-croeseid.
$./chain-maind version
4.2.2-croeseidStep 2. Configure chain-maind
chain-maindBefore kick-starting your node, we will have to configure your node so that it connects to the Croeseid testnet:
Step 2-0 (Optional) Clean up the old blockchain data
If you would like to clean up the old blockchain data for Croeseid Testnet and start over again, it can be done by running:
$ ./chain-maind unsafe-reset-alland remove the old Genesis file by
$ rm ~/.chain-maind/config/genesis.jsonYou can not override the previous validator through
chain-maind init. If you want to have a new validator, you need to manually remove thepriv_validator_key.json:rm ~/.chain-maind/config/priv_validator_key.jsonThen, in Step 2-1,
chain-maind initshould help you to generate a new validator key file.
Step 2-1 Initialize chain-maind
chain-maindFirst of all, you can initialize chain-maind by:
$ ./chain-maind init [moniker] --chain-id testnet-croeseid-5This
monikerwill be the displayed ID of your node when connected to the Cronos PoS Chain network. When providing the moniker value, make sure you drop the square brackets since they are not needed. The example below shows how to initialize a node namedpegasus-node:$ ./chain-maind init pegasus-node --chain-id testnet-croeseid-5
Step 2-2 Configure chain-maind
Download and replace the Croeseid Testnet
genesis.jsonby:$ curl https://raw.githubusercontent.com/crypto-com/testnets/main/testnet-croeseid-5/genesis.json > ~/.chain-maind/config/genesis.jsonVerify sha256sum checksum of the downloaded
genesis.json. You should seeOK!if the sha256sum checksum matches.$ if [[ $(sha256sum ~/.chain-maind/config/genesis.json | awk '{print $1}') = "cf20fb923be3bc565e49a57e81a47ca969e8a973be7b3ed44e2734e369118b6c" ]]; then echo "OK"; else echo "MISMATCHED"; fi; OK!In
~/.chain-maind/config/app.toml, update minimum gas price to avoid transaction spamming$ sed -i.bak -E 's#^(minimum-gas-prices[[:space:]]+=[[:space:]]+)""$#\1"0.025basetcro"#' ~/.chain-maind/config/app.tomlFor network configuration, in
~/.chain-maind/config/config.toml, please modify the configurations ofpersistent_peers,create_empty_blocks_intervalandtimeout_commitby:$ sed -i.bak -E 's#^(persistent_peers[[:space:]]+=[[:space:]]+).*$#\1"71d2a4727bf574d5d368c343e37edff00cd556b1@seed-0.testnet-croeseid-4.cronos-pos.org:26656,8af7c92277f3edce58aa828cf1026cfa74fd6569@seed-1.testnet-croeseid-4.cronos-pos.org:26656"#' ~/.chain-maind/config/config.toml $ sed -i.bak -E 's#^(create_empty_blocks_interval[[:space:]]+=[[:space:]]+).*$#\1"5s"#' ~/.chain-maind/config/config.toml $ sed -i.bak -E 's#^(timeout_commit[[:space:]]+=[[:space:]]+).*$#\1"2s"#' ~/.chain-main
Note: We suggest using persistent_peers instead of seeds to provide a stable state-sync experience.
Step 2-3 Enable STATE-SYNC
STATE-SYNC is supported in our testnet.
With state sync, your node will download data related to the head or near the head of the chain and verify the data. This leads to drastically shorter times for joining a network for validator.
However, you should keep in mind that the block before state-sync trust height will not be queryable. So if you want to run a full node, better not use state-sync feature to ensure your node has every data on the blockchain network.
For validator, it will be fast to sync the near head of the chain and join the network.
Follow the below optional steps to enable state-sync.
For state-sync configuration, in
~/.chain-maind/config/config.toml, please modify the configurations of [statesync]enable,rpc_servers,trust_heightandtrust_hashby:$ LATEST_HEIGHT=$(curl -s https://testnet-croeseid-5.crypto.org:26657/block | jq -r .result.block.header.height); \ BLOCK_HEIGHT=$((LATEST_HEIGHT - 1000)); \ TRUST_HASH=$(curl -s "https://testnet-croeseid-5.crypto.org:26657/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash) $ sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \ s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"https://testnet-croeseid-5.crypto.org:26657,https://testnet-croeseid-5.crypto.org:26657\"| ; \ s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \ s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"| ; \ s|^(seeds[[:space:]]+=[[:space:]]+).*$|\1\"\"|" ~/.chain-maind/config/config.toml
Step 3. Run everything
CAUTION
This page only shows the minimal setup for a validator node.
Furthermore, you may want to run full nodes as sentries (see Tendermint), restrict your validator connections to only connect to your full nodes, test secure storage of validator keys, etc.
Step 3-1. Create a new key and address
Run the following to create a new key. For example, you can create a key with the name Default by:
$ ./chain-maind keys add DefaultYou should obtain an address with tcro prefix, e.g. tcro1quw5r22pxy8znjtdkgqc65atrm3x5hg6vycm5n. This will be the address for performing transactions.
Step 3-2. Obtain test token
Croeseid 5 faucet is on the way. If you need testing tokens, you can send a message on Discord #request-tcro-croeseid channel, stating who you are and your tcro..... address for Croeseid 5.
Step 3-3. Obtain the validator public key
You can obtain your validator public key by:
$ ./chain-maind tendermint show-validatorThe public key should be in a json format, for example:
{
"@type": "/cosmos.crypto.ed25519.PubKey",
"key": "[The_validator_key]"
}Step 3-4. Run everything
Once the chain-maind has been configured, we are ready to start the node and sync the blockchain data:
Start chain-maind, e.g.:
$ ./chain-maind start(Optional for Linux) Start chain-maind with systemd service, e.g.:
$ git clone https://github.com/crypto-org-chain/chain-main.git && cd chain-main
$ ./networks/create-service.sh
$ sudo systemctl start chain-maind
# view log
$ journalctl -u chain-maind -fIt should begin fetching blocks from the other peers. Please wait until it is fully synced before moving onto the next step.
You can query the node syncing status by
$ ./chain-maind status 2>&1 | jq '.SyncInfo.catching_up'If the above command returns
false, It means that your node is fully synced; otherwise, it returnstrueand implies your node is still catching up.One can check the current block height by querying the public full node by:
curl -s https://testnet-croeseid-5.crypto.org:26657/commit | jq "{height: .result.signed_header.header.height}"and you can check your node's progress (in terms of block height) by
$ ./chain-maind status 2>&1 | jq '.SyncInfo.latest_block_height'
Step 3-5. Send a create-validator transaction
create-validator transactionOnce the node is fully synced, we are now ready to send a create-validator transaction and join the network, for example:
$ ./chain-maind tx staking create-validator \
--from=[name_of_your_key] \
--amount=500000tcro \
--pubkey='{"@type":"/cosmos.crypto.ed25519.PubKey","key":"PUBLIC_KEY"}' \
--security-contact="[security contact email/contact method]" \
--chain-id="testnet-croeseid-5" \
--commission-rate="0.10" \
--commission-max-rate="0.20" \
--commission-max-change-rate="0.01" \
--min-self-delegation="1" \
--gas 80000000 \
--gas-prices 0.1basetcro
{"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgCreateValidator"...}
confirm transaction before signing and broadcasting [y/N]: yYou will be required to insert the following:
--from: Thetrco...address that holds your funds;--pubkey: The validator public key( See Step 3-3 above );--moniker: A moniker (name) for your validator node;--security-contact: Security contact email/contact method.
Step 3-6. Check your validator status
Once the create-validator transaction completes, you can check if your validator has been added to the validator set:
$ ./chain-maind tendermint show-address
## [tcrocnclcons... address] ##
$ ./chain-maind query tendermint-validator-set | grep -c [tcrocnclcons...]
## 1 = Yes; 0 = Not yet added ##To further check if the validator is signing blocks, kindly run this script, for example:
$ curl -sSL https://raw.githubusercontent.com/crypto-com/chain-docs/master/docs/getting-started/assets/signature_checking/check-validator-up.sh | bash -s -- \
--tendermint-url https://testnet-croeseid-5.crypto.org:26657 \
--pubkey $(cat ~/.chain-maind/config/priv_validator_key.json | jq -r '.pub_key.value')
The validator is in the active validator set under the address <YOUR_VALIDATOR_ADDRESS>
The validator is signing @ Block#<BLOCK_HEIGHT> π$ curl -sSL https://raw.githubusercontent.com/crypto-com/chain-docs/master/docs/getting-started/assets/signature_checking/check-validator-up.sh | bash -s -- \
--tendermint-url https://testnet-croeseid-5.crypto.org:26657 \
--bechpubkey [tcrocnclconspub1....]
The validator is in the active validator set under the address <YOUR_VALIDATOR_ADDRESS>
The validator is signing @ Block#<BLOCK_HEIGHT> πAlternatively, you can run it on this browser based IDE, by specifying your validator public key in the "YOUR_PUBKEY" field, where this key can be obtained by running
$ cat ~/.chain-maind/config/priv_validator_key.json | jq -r '.pub_key.value'Step 4. Perform Transactions
Step 4-1. query bank balances - Check your transferable balance
query bank balances - Check your transferable balanceYou can check your transferable balance with the balances command under the bank module.
Step 4-2. tx bank send - Transfer operation
tx bank send - Transfer operationTransfer operation involves the transfer of tokens between two addresses.
Send Funds [tx bank send <from_key_or_address> <to_address> <amount> <network_id>]
tx bank send <from_key_or_address> <to_address> <amount> <network_id>]Step 4-3. tx staking - Staking operations
tx staking - Staking operationsStaking operations involve the interaction between an address and a validator. It allows you to create a validator and lock/unlock funds for staking purposes.
Delegate your funds to a validator [tx staking delegate <validator-addr> <amount>]
tx staking delegate <validator-addr> <amount>]To bond funds for staking, you can delegate funds to a validator by the delegate command
Unbond your delegated funds [tx staking unbond <validator-addr> <amount>]
tx staking unbond <validator-addr> <amount>]On the other hand, we can create a Unbond transaction to unbond the delegated funds
Reward related transactions and queries
After you have delegated or created a validator, the reward will be accumulated, you can check/ withdraw it by:
query distribution validator-outstanding-rewards - Query un-withdrawn rewards for a validator
query distribution validator-outstanding-rewards - Query un-withdrawn rewards for a validatorWe can check the distribution outstanding (un-withdrawn) rewards for a validator and all of their delegations by operator address.
tx distribution validator-outstanding-rewards - Query un-withdrawn rewards for a validator
tx distribution validator-outstanding-rewards - Query un-withdrawn rewards for a validatorthe We can check distribution outstanding (un-withdrawn) rewards for a validator and all of their delegations by operator address.
Slashing related transaction
tx slashing unjail - Unjail a validator
tx slashing unjail - Unjail a validatorValidator could be punished and jailed due to network misbehaviour, we can check the jailing status of a validator, for example:
$ ./chain-maind query staking validators -o json | jq
................................
"operator_address": "tcrocncl1hct8ye56gk80qjxvrx299yu9v98aqaxe0y5kvg",
"consensus_pubkey": {
"@type": "/cosmos.crypto.ed25519.PubKey",
"key": "P1/aHuScW5myVs+xH10R8yFT2u0wwaCKXfDKSuVTl60="
},
"jailed": true,
................................Where "jailed": true implies that the validator has been jailed. After the jailing period has passed, one can broadcast a unjail transaction to unjail the validator and resume its normal operations by
$ ./chain-maind tx slashing unjail --from [key_name] --chain-id "testnet-croeseid-5" --gas-prices 0.1basetcro
{"body":{"messages":[{"@type":"/cosmos.slashing.v1beta1.MsgUnjail"...}]}
confirm transaction before signing and broadcasting [y/N]: yCongratulations! You've successfully set up a Croeseid 5 Testnet node and performed some basic transactions! You may refer to Wallet Management for more advanced operations and transactions.
Croeseid 5 testnet explorer and endpoint
You can lookup data within the
testnet-croeseid-5network by the explorer;Tendermint:
https://rpc-c5.crypto.org/;REST:
https://rest-c5.crypto.org.
Last updated