Kurulum
Sistemi Güncelleme
apt update && apt upgrade -y
Gerekli Kütüphanelerin Kurulması
apt install make clang pkg-config libssl-dev libclang-dev build-essential git curl ntp jq llvm tmux htop screen gcc lz4 -y < "/dev/null"
Go Kurulumu
ver="1.21.5"
wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz"
rm -rf /usr/local/go
tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz"
rm -rf "go$ver.linux-amd64.tar.gz"
echo 'export GOROOT=/usr/local/go' >> $HOME/.bash_profile
echo 'export GOPATH=$HOME/go' >> $HOME/.bash_profile
echo 'export GO111MODULE=on' >> $HOME/.bash_profile
echo 'export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin' >> $HOME/.bash_profile
source $HOME/.bash_profile
go version
Değişkenleri Yükleme
Aşağıda değiştirmeniz gereken yerler belirtilmiştir.
$CROWD_NODENAME
validator adınız$CROWD_WALLET
cüzdan adınız- Eğer portu başka bir node kullanıyorsa aşağıdan değiştirebilirsiniz.
11
yazan yere farklı bir değer girmelisiniz yine iki haneli olacak şekilde.
echo "export CROWD_NODENAME=$CROWD_NODENAME" >> $HOME/.bash_profile
echo "export CROWD_WALLET=$CROWD_WALLET" >> $HOME/.bash_profile
echo "export CROWD_PORT=11" >> $HOME/.bash_profile
echo "export CROWD_CHAIN_ID=cardtestnet-12" >> $HOME/.bash_profile
source $HOME/.bash_profile
Örnek
Node (CROWD_NODENAME
) ve Cüzdan (CROWD_WALLET
) adımızın Anatolian-Guide
olduğunu ve kullanacağınız portun (CROWD_PORT
) da 16656
olacağını varsayalım. Kod aşağıdaki şekilde düzenlenecektir.
echo "export CROWD_NODENAME=Anatolian-Guide" >> $HOME/.bash_profile
echo "export CROWD_WALLET=Anatolian-Guide" >> $HOME/.bash_profile
echo "export CROWD_PORT=16" >> $HOME/.bash_profile
echo "export CROWD_CHAIN_ID=cardtestnet-12" >> $HOME/.bash_profile
source $HOME/.bash_profile
Cardchain'in Kurulması
git clone https://github.com/DecentralCardGame/Cardchain
cd Cardchain
git checkout v0.16.0
make install
Versiyon çıktısı 0.16.0
olacak.
Uygulamayı Yapılandırma ve Başlatma
We copy and paste the codes below without making any changes.
Cardchaind config keyring-backend test
Cardchaind config chain-id $CROWD_CHAIN_ID
Cardchaind init --chain-id $CROWD_CHAIN_ID $CROWD_NODENAME
# Genesis ve addrbook Dosyalarını Kopyalama
curl -L https://testnet.anatolianteam.com/crowdcontrol/genesis.json > $HOME/.cardchaind/config/genesis.json
curl -L https://testnet.anatolianteam.com/crowdcontrol/addrbook.json > $HOME/.cardchaind/config/addrbook.json
# Minimum GAS Ücretinin Ayarlanması
sed -i 's|^minimum-gas-prices *=.*|minimum-gas-prices = "0.0ubpf"|g' $HOME/.cardchaind/config/app.toml
# Indexer Kapatma -Opsiyonel
indexer="null"
sed -i -e "s/^indexer *=.*/indexer = \"$indexer\"/" $HOME/.cardchaind/config/config.toml
# SEEDS ve PEERS Ayarlaması
SEEDS=""
sed -i 's|^seeds *=.*|seeds = "'$SEEDS'"|; s|^persistent_peers *=.*|persistent_peers = "'$PEERS'"|' $HOME/.cardchaind/config/config.toml
# Prometheus'u Aktif Etme
sed -i 's|^prometheus *=.*|prometheus = true|' $HOME/.cardchaind/config/config.toml
# Pruning Ayarlama
pruning="custom"
pruning_keep_recent="100"
pruning_keep_every="0"
pruning_interval="50"
sed -i -e "s/^pruning *=.*/pruning = \"$pruning\"/" $HOME/.cardchaind/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"$pruning_keep_recent\"/" $HOME/.cardchaind/config/app.toml
sed -i -e "s/^pruning-keep-every *=.*/pruning-keep-every = \"$pruning_keep_every\"/" $HOME/.cardchaind/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"$pruning_interval\"/" $HOME/.cardchaind/config/app.toml
# Portları Ayarlama
sed -i.bak -e "
s%:26658%:${CROWD_PORT}658%g;
s%:26657%:${CROWD_PORT}657%g;
s%:6060%:${CROWD_PORT}060%g;
s%:26656%:${CROWD_PORT}656%g;
s%:26660%:${CROWD_PORT}660%g
" $HOME/.cardchaind/config/config.toml
sed -i.bak -e "
s%:8545%:${CROWD_PORT}545%g;
s%:8546%:${CROWD_PORT}546%g;
s%:6065%:${CROWD_PORT}065%g;
s%:1317%:${CROWD_PORT}317%g;
s%:8080%:${CROWD_PORT}080%g;
s%:9090%:${CROWD_PORT}090%g;
s%:9091%:${CROWD_PORT}091%g
" $HOME/.cardchaind/config/app.toml
sed -i.bak -e "s%:26657%:${CROWD_PORT}657%g" $HOME/.cardchaind/config/client.toml
# Harici Adres Ekleme
PUB_IP=`curl -s -4 icanhazip.com`
sed -e "s|external_address = \".*\"|external_address = \"$PUB_IP:${CROWD_PORT}656\"|g" ~/.cardchaind/config/config.toml > ~/.cardchaind/config/config.toml.tmp
mv ~/.cardchaind/config/config.toml.tmp ~/.cardchaind/config/config.toml
# Servis Dosyası Oluşturma
tee /etc/systemd/system/Cardchaind.service > /dev/null << EOF
[Unit]
Description=Cardchaind
After=network-online.target
[Service]
User=$USER
ExecStart=$(which Cardchaind) start
Restart=on-failure
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
Hizmeti Etkinleştirme ve Başlatma
systemctl daemon-reload
systemctl enable Cardchaind
systemctl start Cardchaind