testnet
April 12, 2024
CrossFi Chain TESTNET
Useful info for participate in CrossFi Chain TESTNET
Install Node
sudo apt update && sudo apt upgrade -y
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
./bin/crossfid start --home ./testnet
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
sudo systemctl daemon-reload sudo systemctl enable xfi sudo systemctl start xfi
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
./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
./bin/crossfid --home ./testnet keys list
./bin/crossfid --home ./testnet $WALLET -a
./bin/crossfid --home ./testnet keys show $WALLET -a --bech=val
./bin/crossfid q bank balances $WALLET
./bin/crossfid --home ./testnet keys unsafe-export-eth-key $WALLET
Transaction
./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
./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
./bin/crossfid --home ./testnet tx staking delegate VALOPER_ADDRESS 1000000mpx --from=$WALLET --chain-id=$CHAIN --gas auto --gas-adjustment 1.5 --gas-prices 10000000000000mpx
./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
./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
./bin/crossfid --home ./testnet tx staking unbond VALOPPER_ADDRESS AMOUNTmpx --from=$WALLET --chain-id=$CHAIN --gas auto --gas-adjustment 1.5 --gas-prices 10000000000000mpx
./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
./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
./bin/crossfid --home ./testnet q gov proposals
./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
./bin/crossfid --home ./testnet q gov votes PROPOSAL_NUMBER
./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
./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:
# 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"
./bin/crossfid --home ./testnet q slashing params
./bin/crossfid --home ./testnetq slashing signing-info $(crossfid tendermint show-validator)
./bin/crossfid --home ./testnetq q slashing signing-info $(crossfid tendermint show-validator)
./bin/crossfid --home ./testnetq status 2>&1 | jq .SyncInfo
./bin/crossfid --home ./testnetq status 2>&1 | jq .NodeInfo
./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
./bin/crossfid --home ./testnet tendermint show-node-id
Useful links
https://test.xfiscan.com/dashboard
https://testpad.xfi.foundation/