testnet
April 12, 2024

CrossFi Chain TESTNET

Useful info for participate in CrossFi Chain TESTNET


Install Node

Do system update and upgrade:

sudo apt update && sudo apt upgrade -y

Download binary & config

wget https://github.com/crossfichain/crossfi-node/releases/download/v0.3.0-prebuild3/crossfi-node_0.3.0-prebuild3_linux_amd64.tar.gz && tar -xf crossfi-node_0.3.0-prebuild3_linux_amd64.tar.gz
git clone https://github.com/crossfichain/testnet.git

Try to start node:

./bin/crossfid start --home ./testnet

Create systemd service file:

sudo tee /etc/systemd/system/xfi.service > /dev/null <<EOF
[Unit]
Description=crossfid Daemon
After=network-online.target

[Service]
User=$USER
ExecStart=/$USER/bin/crossfid start --home /$USER/testnet
Restart=always
RestartSec=3
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target
EOF 

Start node as service:

sudo systemctl daemon-reload 
sudo systemctl enable xfi 
sudo systemctl start xfi

Set variables:

WALLET=WALLET #Enter validator wallet name
CHAIN=crossfi-evm-testnet-1
echo "export WALLET="${WALLET}"" >> $HOME/.bash_profile 
echo "export CHAIN="${CHAIN}"" >> $HOME/.bash_profile 
source $HOME/.bash_profile

Create or recover CrossFi validator wallet:

./bin/crossfid --home ./testnet keys add $WALLET #Create new wallet 
./bin/crossfid --home ./testnet umeed keys add $WALLET --recover #Recover wallet from seed phrase

Create validator:

./bin/crossfid --home ./testnet tx staking create-validator \
--amount=1000000000000000000mpx \
--pubkey=$(./bin/crossfid --home ./testnet tendermint show-validator) \
--moniker=“MONIKER” \
--identity= \
--details= \
--chain-id=$CHAIN \
--commission-rate="0.10" \
--commission-max-rate="0.20" \
--commission-max-change-rate="0.01" \
--min-self-delegation="1000000" \
--gas="auto" \
--gas-prices="10000000000000mpx" \
--gas-adjustment=1.5 \
--from=$WALLET

Wallets

Wallets list:

./bin/crossfid --home ./testnet keys list

Wallet address:

./bin/crossfid --home ./testnet $WALLET -a 

Valoper address:

./bin/crossfid --home ./testnet keys show $WALLET -a --bech=val

Wallet balance:

./bin/crossfid q bank balances $WALLET

Export EVM Private key:

./bin/crossfid --home ./testnet keys unsafe-export-eth-key $WALLET

Transaction

Sending TX:

./bin/crossfid --home ./testnet tx bank send FROM_WALLET_ADDRESS TO_WALLET_ADDRESS AMOUNTmpx -from=$WALLET --chain-id=$CHAIN  --gas auto --gas-adjustment 1.5 --gas-prices 10000000000000mpx

Validator

Edit validator:

./bin/crossfid --home ./testnet tx staking edit-validator \ 
--moniker=$NODENAME \
--identity=<your_keybase_id> \
--website="<your_website>" \
--details="<your_validator_description>" \ 
--chain-id=$CHAIN \ 
--from=$WALLET \
--gas auto \
--gas-adjustment 1.5 \
--gas-prices 10000000000000mpx

Delegate to validator:

./bin/crossfid --home ./testnet tx staking delegate VALOPER_ADDRESS 1000000mpx --from=$WALLET --chain-id=$CHAIN --gas auto --gas-adjustment 1.5 --gas-prices 10000000000000mpx

Self Delegate:

./bin/crossfid --home ./testnet tx staking delegate $(crossfid keys show $WALLET -a --bech val) AMOUNTmpx --from=$WALLET --chain-id=$CHAIN --gas auto --gas-adjustment 1.5 --gas-prices 10000000000000mpx

Redelegate:

./bin/crossfid --home ./testnet tx staking redelegate FROM_VALOPPER_ADDRESS TO_VALOPPER_ADDRESS AMOUNTmpx --from=$WALLET --chain-id=$CHAIN --gas auto --gas-adjustment 1.5 --gas-prices 10000000000000mpx

Undelegate (unbond):

./bin/crossfid --home ./testnet tx staking unbond VALOPPER_ADDRESS AMOUNTmpx --from=$WALLET --chain-id=$CHAIN --gas auto --gas-adjustment 1.5 --gas-prices 10000000000000mpx

Withdraw all rewards:

./bin/crossfid --home ./testnet tx distribution withdraw-all-rewards --from=$WALLET --chain-id=$CHAIN --gas auto --gas-adjustment 1.5 --gas-prices 10000000000000mpx

Withdraw rewards and commission:

./bin/crossfid --home ./testnet tx distribution withdraw-rewards VALOPER_ADDRESS --from=$WALLET --commission --chain-id=$CHAIN --gas auto --gas-adjustment 1.5 --gas-prices 10000000000000mpx

Unjail validator:

./bin/crossfid --home ./testnet tx slashing unjail \
--broadcast-mode=block \ 
--from=$WALLET \ 
--chain-id=$CHAIN \ 
--gas auto \
--gas-adjustment 1.5 \
--gas-prices 10000000000000mpx

Governance

Show available proposals:

./bin/crossfid --home ./testnet q gov proposals

Vote for proposal:

./bin/crossfid --home ./testnet tx gov vote PROPOSAL_NUMBER yes --from $WALLET --chain-id=$CHAIN  --gas auto --gas-adjustment 1.5 --gas-prices 10000000000000mpx -y

Show votes for proposal:

./bin/crossfid --home ./testnet q gov votes PROPOSAL_NUMBER

Submit proposal:

./bin/crossfid --home ./testnet tx gov submit-proposal \
--title=PROPOSAL TITLE\
--description=PROPOSAL DESCRIPTION \
--type=Text \
--deposit=1000000mpx \
--from=$WALLET \ 
--chain-id=$CHAIN \
--gas auto \
--gas-adjustment 1.5 \
--gas-prices 10000000000000mpx

Deposit proposal:

./bin/crossfid --home ./testnet tx gov deposit PROPOSAL_NUMBER AMOUNTmpx --from=$WALLET --chain-id=$CHAIN --gas auto --gas-adjustment 1.5 --gas-prices 10000000000000mpx

Monitoring:

Logs:

# Current logs: 
journalctl -u xfi -f -o cat 
# Since some moment (UTC): 
journalctl -u xfi -f -o cat --since "Y-M-D H:M:S"

Some examples of using Tendermint PRC:

# Check node overall status: 
curl -s localhost:26657/status 
# Check node syncing status: 
curl -s localhost:26657/status | jq .result.sync_info.catching_up 
# Check node peers:
curl -s localhost:26657/net_info | jq -r .result.n_peers 
# Show timestamp of any block height: 
curl -s localhost:26657/block?height=(NETWORK_HEIGHT) | grep timestamp | head -1
# Consensus state: 
curl -s localhost:26657/consensus_state | jq -r".result.round_state.height_vote_set[0].prevotes_bit_array"

Slashing parameters:

./bin/crossfid --home ./testnet q slashing params

Jailing info:

./bin/crossfid --home ./testnetq slashing signing-info $(crossfid tendermint show-validator)

Signing info:

./bin/crossfid --home ./testnetq q slashing signing-info $(crossfid tendermint show-validator)

Sync info:

./bin/crossfid --home ./testnetq status 2>&1 | jq .SyncInfo

Node info:

./bin/crossfid --home ./testnetq  status 2>&1 | jq .NodeInfo

Check validator status:

./bin/crossfid --home ./testnet q staking validator $(crossfid keys show $WALLET -a --bech val)

Show list of available validators:

./bin/crossfid --home ./testnet q staking validators --limit 1000 -o json | jq -r '.validators[] | [.operator_address, .status, (.tokens|tonumber / pow(10; 6)), .description.moniker] | @csv' | column -t -s"," | sort -k3 -n -r | nl

Show node ID:

./bin/crossfid --home ./testnet tendermint show-node-id

Useful links

https://test.xfiscan.com/dashboard

https://testpad.xfi.foundation/

https://test.xficonsole.com/