Skip to main content

Card Chain

Minimum Specifications

SpecSize
CPU2
RAM8 GB
SSD200 GB

Install Dependencies

sudo apt -q update
sudo apt -qy install curl git jq lz4 build-essential
sudo apt -qy upgrade
sudo rm -rf /usr/local/go
curl -Ls https://go.dev/dl/go1.21.3.linux-amd64.tar.gz | sudo tar -xzf - -C /usr/local
eval $(echo 'export PATH=$PATH:/usr/local/go/bin' | sudo tee /etc/profile.d/golang.sh)
eval $(echo 'export PATH=$PATH:$HOME/go/bin' | tee -a $HOME/.profile)

Build

wget https://github.com/DecentralCardGame/Cardchain/releases/download/v0.13.0/Cardchaind
chmod +x Cardchaind
mv $HOME/Cardchaind /usr/local/bin

Setup

  • Init
edit YourNAME
Cardchaind config node tcp://localhost:13957
Cardchaind config keyring-backend test
Cardchaind init YourNAME --chain-id cardtestnet-8
Cardchaind config chain-id cardtestnet-8
wget http://45.136.28.158:3000/genesis.json -O $HOME/.Cardchain/config/genesis.json

Add wallet / recover

Cardchaind keys add wallet

Set minimum gas etc.

sed -i.bak -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.0ubpf\"/;" ~/.Cardchain/config/app.toml
external_address=$(wget -qO- eth0.me)
sed -i.bak -e "s/^external_address *=.*/external_address = \"$external_address:26656\"/" $HOME/.Cardchain/config/config.toml
peers="58bb9f1dcde0408fe4c3e7f8c6ccb7f8e410ca9c@202.61.225.157:26656"
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" $HOME/.Cardchain/config/config.toml
seeds=""
sed -i.bak -e "s/^seeds =.*/seeds = \"$seeds\"/" $HOME/.Cardchain/config/config.toml

Prunning

pruning="custom" && \
pruning_keep_recent="1000" && \
pruning_keep_every="0" && \
pruning_interval="10" && \
sed -i -e "s/^pruning *=.*/pruning = \"$pruning\"/" $HOME/.Cardchain/config/app.toml && \
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"$pruning_keep_recent\"/" $HOME/.Cardchain/config/app.toml && \
sed -i -e "s/^pruning-keep-every *=.*/pruning-keep-every = \"$pruning_keep_every\"/" $HOME/.Cardchain/config/app.toml && \
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"$pruning_interval\"/" $HOME/.Cardchain/config/app.toml

Indexer

indexer="null" && \
sed -i -e "s/^indexer *=.*/indexer = \"$indexer\"/" $HOME/.Cardchain/config/config.toml

Custom Port

sed -i -e "s%^proxy_app = \"tcp://127.0.0.1:26658\"%proxy_app = \"tcp://127.0.0.1:13958\"%; s%^laddr = \"tcp://127.0.0.1:26657\"%laddr = \"tcp://127.0.0.1:13957\"%; s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:13960\"%; s%^laddr = \"tcp://0.0.0.0:26656\"%laddr = \"tcp://0.0.0.0:13956\"%; s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":13966\"%" $HOME/.Cardchain/config/config.toml
sed -i -e "s%^address = \"tcp://localhost:1317\"%address = \"tcp://0.0.0.0:13917\"%; s%^address = \":8080\"%address = \":13980\"%; s%^address = \"localhost:9090\"%address = \"0.0.0.0:13990\"%; s%^address = \"localhost:9091\"%address = \"0.0.0.0:13991\"%; s%:8545%:13945%; s%:8546%:13946%; s%:6065%:13965%" $HOME/.Cardchain/config/app.toml

Create Service

sudo tee <<EOF >/dev/null /etc/systemd/system/Cardchaind.service
[Unit]
Description=Cardchain Daemon
After=network-online.target
[Service]
User=$USER
ExecStart=$(which Cardchaind) start
Restart=always
RestartSec=10
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF

Run

sudo systemctl daemon-reload
sudo systemctl enable Cardchaind
sudo systemctl restart Cardchaind && sudo journalctl -u Cardchaind -f -o cat

Check logs

sudo journalctl -fu Cardchaind -o cat

Check syncInfo

Cardchaind status 2>&1 | jq .SyncInfo

Explorer

faucet

  • Here
  • Connect wallet, complete capthca, done

Register validator

  • After Sync
change YourNAME

Jangan lupa edi YourNAME ke Nama mu

Cardchaind tx staking create-validator \
--amount 1000000ubpf \
--from wallet \
--commission-max-change-rate "0.2" \
--commission-max-rate "1" \
--commission-rate "0.1" \
--min-self-delegation "1" \
--details="" \
--identity="" \
--security-contact "emailmu@email.co" \
--pubkey $(Cardchaind tendermint show-validator) \
--moniker YourNAME \
--fees 300ubpf \
--chain-id cardtestnet-8 -y

Hal Penting yang wajib di backup

  1. MNEMONIC Pharse
  2. /.Cardchain/data/priv_validator_state.json file

Delete

Delete nodes

⚠️ Jika ingin menghapus node ⚠️

cd $HOME
sudo systemctl stop Cardchaind
sudo rm /etc/systemd/system/Cardchaind.service
sudo rm -rf $HOME/.Cardchain/
sudo rm -rf Cardchain
sudo rm -rf $(which Cardchaind)