Chain ID | Latest Version Tag | Custom Port |
---|---|---|
swisstronik_1291-1 | v1.0.6 | 175 |
Supported Hardware
Swisstronik uses Intel SGX to protect user transactions and smart contract state. Since Intel SGX is a hardware solution, you should have appropriate hardware to run it.
Find supported Cloud Providers and Intel SGX setup instructions at official docs
Hardware requirements
- For now, you can use any Intel CPU which supports SGX via SPS and EPID remote attestation
- 32GB RAM
- 500 GB SSD
Setup validator name
Replace YOUR_MONIKER_GOES_HERE with your validator name
MONIKER="YOUR_MONIKER_GOES_HERE"
Install dependencies
Update system and install build tools
sudo apt -q update
sudo apt -qy install curl git jq lz4 build-essential
sudo apt -qy upgrade
Install Go
sudo rm -rf /usr/local/go
curl -Ls https://go.dev/dl/go1.23.2.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)
Download binaries
# Download project binaries
mkdir -p $HOME/.swisstronik/cosmovisor/genesis/bin
wget -O $HOME/.swisstronik/cosmovisor/genesis/bin/swisstronikd https://snapshots.kjnodes.com/swisstronik-testnet/swisstronikd_v1.0.6-linux-amd64
chmod +x $HOME/.swisstronik/cosmovisor/genesis/bin/swisstronikd
# Create application symlinks
sudo ln -s $HOME/.swisstronik/cosmovisor/genesis $HOME/.swisstronik/cosmovisor/current -f
sudo ln -s $HOME/.swisstronik/cosmovisor/current/bin/swisstronikd /usr/local/bin/swisstronikd -f
Install Cosmovisor and create a service
# Download and install Cosmovisor
go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@v1.6.0
# Create service
sudo tee /etc/systemd/system/swisstronik-testnet.service > /dev/null << EOF
[Unit]
Description=swisstronik node service
After=network-online.target
[Service]
User=$USER
ExecStart=$(which cosmovisor) run start
Restart=on-failure
RestartSec=10
LimitNOFILE=65535
Environment="DAEMON_HOME=$HOME/.swisstronik"
Environment="DAEMON_NAME=swisstronikd"
Environment="UNSAFE_SKIP_BACKUP=true"
Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:$HOME/.swisstronik/cosmovisor/current/bin"
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable swisstronik-testnet.service
Obtain master key
Before starting your node, you should obtain master key, which will be used to encrypt and decrypt transactions and smart contract state.
swisstronikd enclave request-master-key rpc.testnet.swisstronik.com:46789
The command above will pass Remote Attestation, during which, another node checks whether the correct software and hardware are used. If the command returns you same output as shown below, it means your node is ready to work:
[Enclave] Seed successfully sealed
Remote Attestation passed. Node is ready for work
Initialize the node
# Set node configuration
swisstronikd config chain-id swisstronik_1291-1
swisstronikd config keyring-backend test
swisstronikd config node tcp://localhost:17557
# Initialize the node
swisstronikd init $MONIKER --chain-id swisstronik_1291-1
# Download genesis and addrbook
curl -Ls https://snapshots.kjnodes.com/swisstronik-testnet/genesis.json > $HOME/.swisstronik/config/genesis.json
curl -Ls https://snapshots.kjnodes.com/swisstronik-testnet/addrbook.json > $HOME/.swisstronik/config/addrbook.json
# Add seeds
sed -i -e "s|^seeds *=.*|seeds = \"3f472746f46493309650e5a033076689996c8881@swisstronik-testnet.rpc.kjnodes.com:17559\"|" $HOME/.swisstronik/config/config.toml
# Set minimum gas price
sed -i -e "s|^minimum-gas-prices *=.*|minimum-gas-prices = \"7aswtr\"|" $HOME/.swisstronik/config/app.toml
# Set pruning
sed -i \
-e 's|^pruning *=.*|pruning = "custom"|' \
-e 's|^pruning-keep-recent *=.*|pruning-keep-recent = "100"|' \
-e 's|^pruning-keep-every *=.*|pruning-keep-every = "0"|' \
-e 's|^pruning-interval *=.*|pruning-interval = "19"|' \
$HOME/.swisstronik/config/app.toml
# Set custom ports
sed -i -e "s%^proxy_app = \"tcp://127.0.0.1:26658\"%proxy_app = \"tcp://127.0.0.1:17558\"%; s%^laddr = \"tcp://127.0.0.1:26657\"%laddr = \"tcp://127.0.0.1:17557\"%; s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:17560\"%; s%^laddr = \"tcp://0.0.0.0:26656\"%laddr = \"tcp://0.0.0.0:17556\"%; s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":17566\"%" $HOME/.swisstronik/config/config.toml
sed -i -e "s%^address = \"tcp://0.0.0.0:1317\"%address = \"tcp://0.0.0.0:17517\"%; s%^address = \":8080\"%address = \":17580\"%; s%^address = \"0.0.0.0:9090\"%address = \"0.0.0.0:17590\"%; s%^address = \"0.0.0.0:9091\"%address = \"0.0.0.0:17591\"%; s%:8545%:17545%; s%:8546%:17546%; s%:6065%:17565%" $HOME/.swisstronik/config/app.toml
Download latest chain snapshot
curl -L https://snapshots.kjnodes.com/swisstronik-testnet/snapshot_latest.tar.lz4 | tar -Ilz4 -xf - -C $HOME/.swisstronik
[[ -f $HOME/.swisstronik/data/upgrade-info.json ]] && cp $HOME/.swisstronik/data/upgrade-info.json $HOME/.swisstronik/cosmovisor/genesis/upgrade-info.json
Start service and check the logs
sudo systemctl start swisstronik-testnet.service && sudo journalctl -u swisstronik-testnet.service -f --no-hostname -o cat