logo
ANDROMEDA

Installation

Recommended Hardware: 4 Cores, 8GB RAM, 200GB of storage (NVME)

Node Name
Wallet
Port
Add
# set environment variables
echo "export WALLET="wallet"" >> $HOME/.bash_profile
echo "export MONIKER="moniker"" >> $HOME/.bash_profile
echo "export CHAIN_ID="cardtestnet-10"" >> $HOME/.bash_profile
echo "export PROJECT="cardchain"" >> $HOME/.bash_profile
echo "export NETWORK="testnet"" >> $HOME/.bash_profile
echo "export DIRECTORY="$HOME/.cardchaind"" >> $HOME/.bash_profile
source $HOME/.bash_profile

# install dependencies
sudo apt -q update
sudo apt -qy install curl git jq lz4 build-essential fail2ban ufw
sudo apt -qy upgrade

# install go
cd $HOME
bash <(curl -s "https://raw.githubusercontent.com/Andromeda-node/utils/main/auto_go_install.sh") -v 1.19.3
source ~/.bash_profile

# download binary
cd $HOME
cd && rm -rf Cardchain
git clone https://github.com/DecentralCardGame/Cardchain
cd Cardchain
git checkout v0.14.2
make install

# config and init app
Cardchaind config keyring-backend os
Cardchaind config chain-id cardtestnet-10
Cardchaind init "moniker" --chain-id cardtestnet-10

# download genesis and addrbook
wget -O $HOME/.cardchaind/config/genesis.json https://snapshots-testnet.nodejumper.io/cardchain-testnet/genesis.json
wget -O $HOME/.cardchaind/config/addrbook.json https://snapshots-testnet.nodejumper.io/cardchain-testnet/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


# config 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-interval *=.*/pruning-interval = \"50\"/" $HOME/.cardchaind/config/app.toml

# set minimum gas price, enable prometheus and disable indexing
sed -i 's|minimum-gas-prices =.*|minimum-gas-prices = "0.0ubpf"|g' $HOME/.cardchaind/config/app.toml
sed -i -e "s/prometheus = false/prometheus = true/" $HOME/.cardchaind/config/config.toml
sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $HOME/.cardchaind/config/config.toml

# create and enable service file
sudo tee /etc/systemd/system/Cardchaind.service > /dev/null <<EOF
[Unit]
Description=Cardchain node
After=network-online.target
[Service]
User=$USER
WorkingDirectory=$HOME/.cardchaind
ExecStart=$(which Cardchaind) start --home $HOME/.cardchaind
Restart=on-failure
RestartSec=5
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable Cardchaind

# download latest chain data snapshot
if curl -s --head https://files.andromedanode.co/cardchain/snap_cardchain.tar.lz4 | head -n 1 | grep "200" > /dev/null; then
    curl https://files.andromedanode.co/cardchain/snap_cardchain.tar.lz4 | lz4 -dc - | tar -xf - -C $HOME/.cardchaind
else
    bash <(curl -s https://raw.githubusercontent.com/Andromeda-node/utils/main/snapshot_finder.sh)
fi

# start service
sudo systemctl restart Cardchaind && sudo journalctl -u Cardchaind -f --no-hostname -o cat

Create validator

Moniker
Identity
Details
Amount, ubpf
Commission rate
Commission max rate
Commission max change rate
Website
Cardchaind tx staking create-validator \
--amount 1000000ubpf \
--pubkey $(Cardchaind tendermint show-validator) \
--chain-id cardtestnet-10 \
--moniker "moniker" \
--identity "" \
--details "A heartfelt shoutout to Andromeda for their amazing support! Your contributions shine brightly, guiding us forward. We are deeply grateful. And to the world of blockchain, our love knows no bounds. ❤️ Thank you, Andromeda, for being such a vital part of our journey." \
--website "https://andromedanode.co/" \
--from $WALLET \
--commission-rate 0.1 \
--commission-max-rate 0.2 \
--commission-max-change-rate 0.01 \
--min-self-delegation 1 \
--gas auto --gas-adjustment 1.5 \
-y

Security

Firewall security

Set the default to allow outgoing connections, deny all incoming, allow ssh and node p2p port

sudo apt install -y ufw
sudo ufw default allow outgoing 
sudo ufw default deny incoming 
sudo ufw allow ssh/tcp 
sudo ufw allow 26656/tcp
sudo ufw enable

Delete node

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