Skip to content

Install

Website | Twitter | Discord | Explorer


Public Endpoints | Genesis | Addrbook

https://cardchain-test.rpc.moonbridge.team
Chain ID: cardtestnet-12 | Latest Version: v0.16.0 | Custom Port: 124
Specify the name of your “MONIKER” (validator) which will be visible in the explorer
MONIKER="YOUR_MONIKER_NAME"

Update system and install tools

sudo apt update && sudo apt upgrade -y
sudo apt install curl build-essential git jq lz4 ncdu bashtop -y

Install GO

cd $HOME
version="1.21.5"
wget "https://golang.org/dl/go$version.linux-amd64.tar.gz"
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "go$version.linux-amd64.tar.gz"
rm "go$version.linux-amd64.tar.gz"
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile
source $HOME/.bash_profile

Install Cosmovisor

go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@v1.5.0

Download and install

cd $HOME
git clone https://github.com/DecentralCardGame/Cardchain
wget https://github.com/DecentralCardGame/Cardchain/releases/download/v0.16.0/cardchaind
chmod +x cardchaind
mv cardchaind $HOME/go/bin
cardchaind version --long | grep -e commit -e version

Config and Init node

# Set node configuration
cardchaind config chain-id cardtestnet-12
cardchaind config keyring-backend test
cardchaind config node tcp://localhost:12457
# Initialize node
cardchaind init $MONIKER --chain-id cardtestnet-12
# Download genesis and addrbook
curl -Ls https://snapshots.moonbridge.team/testnet/cardchain/genesis.json > $HOME/.cardchaind/config/genesis.json
curl -Ls https://snapshots.moonbridge.team/testnet/cardchain/addrbook.json > $HOME/.cardchaind/config/addrbook.json
# Set seeds and peers
SEEDS=""
PEERS=""
sed -i -e "s/^seeds *=.*/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.cardchaind/config/config.toml
# Setting minimum gas price
sed -i -e "s|^minimum-gas-prices *=.*|minimum-gas-prices = \"0ubpf\"|" $HOME/.cardchaind/config/app.toml
# Setting pruning
sed -i -e 's|^pruning *=.*|pruning = "custom"|' $HOME/.cardchaind/config/app.toml
sed -i -e 's|^pruning-keep-recent *=.*|pruning-keep-recent = "100"|' $HOME/.cardchaind/config/app.toml
sed -i -e 's|^pruning-keep-every *=.*|pruning-keep-every = "0"|' $HOME/.cardchaind/config/app.toml
sed -i -e 's|^pruning-interval *=.*|pruning-interval = "10"|' $HOME/.cardchaind/config/app.toml
# Disable indexer
sed -i -e 's|^indexer *=.*|indexer = "null"|' $HOME/.cardchaind/config/config.toml
# Enable Prometheus
sed -i -e "s/prometheus = false/prometheus = true/" $HOME/.cardchaind/config/config.toml
# Setting custom ports
sed -i -e "s%^proxy_app = \"tcp://127.0.0.1:26658\"%proxy_app = \"tcp://127.0.0.1:12458\"%; s%^laddr = \"tcp://127.0.0.1:26657\"%laddr = \"tcp://0.0.0.0:12457\"%; s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:12460\"%; s%^laddr = \"tcp://0.0.0.0:26656\"%laddr = \"tcp://0.0.0.0:12456\"%; s%^external_address = \"\"%external_address = \"$(wget -qO- eth0.me):12456\"%; s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":12466\"%" $HOME/.cardchaind/config/config.toml
sed -i -e "s%:1317%:12417%g; s%:8080%:12480%g; s%:9090%:12490%g; s%:9091%:12491%g; s%:8545%:12445%g; s%:8546%:12446%g; s%:6065%:12465%g" $HOME/.cardchaind/config/app.toml

Configure Cosmovisor

mkdir -p $HOME/.cardchaind/cosmovisor/genesis/bin
mkdir -p $HOME/.cardchaind/cosmovisor/upgrades
cp $HOME/go/bin/cardchaind $HOME/.cardchaind/cosmovisor/genesis/bin/

Create service

sudo tee /etc/systemd/system/cardchaind.service > /dev/null << EOF
[Unit]
Description=Cardchain Node
After=network-online.target
[Service]
User=$USER
ExecStart=$(which cosmovisor) run start
Restart=always
RestartSec=5
LimitNOFILE=65535
Environment="DAEMON_NAME=cardchaind"
Environment="DAEMON_HOME=$HOME/.cardchaind"
Environment="UNSAFE_SKIP_BACKUP=true"
Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=false"
Environment="DAEMON_RESTART_AFTER_UPGRADE=true"
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable cardchaind

Download latest snapshot

curl -o - -L https://snapshots.moonbridge.team/testnet/cardchain/snapshot_latest.tar.lz4 | lz4 -dc - | tar -x -C $HOME/.cardchaind
[[ -f $HOME/.cardchaind/data/upgrade-info.json ]] && cp $HOME/.cardchaind/data/upgrade-info.json $HOME/.cardchaind/cosmovisor/genesis/upgrade-info.json

Start service and check the logs

sudo systemctl start cardchaind && sudo journalctl -u cardchaind -f --no-hostname -o cat

Create wallet

cardchaind keys add wallet

Check wallet balance

cardchaind q bank balances $(cardchaind keys show wallet -a)

Create validator

cardchaind tx staking create-validator \
--amount 1000000ubpf \
--pubkey $(cardchaind tendermint show-validator) \
--moniker "YOUR_MONIKER_NAME" \
--identity "YOUR_KEYBASE_ID" \
--details "YOUR_DETAILS" \
--website "YOUR_WEBSITE_URL" \
--security-contact "YOUR_EMAIL_ADDRESS" \
--chain-id cardtestnet-12 \
--commission-rate 0.10 \
--commission-max-rate 0.20 \
--commission-max-change-rate 0.01 \
--min-self-delegation 1 \
--from wallet \
--gas-adjustment 1.4 \
--gas auto \
--gas-prices 0ubpf \
-y

Delete node

sudo systemctl stop cardchaind
sudo systemctl disable cardchaind
sudo rm -rf /etc/systemd/system/cardchaind.service
sudo systemctl daemon-reload
sudo rm -f $(which cardchaind)
sudo rm -rf $HOME/.cardchaind
sudo rm -rf $HOME/Cardchain