Chain ID Latest Version Tag Custom Port
swisstronik_1291-1 genesis 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


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 | sudo tar -xzf - -C /usr/local
eval $(echo 'export PATH=$PATH:/usr/local/go/bin' | sudo tee /etc/profile.d/
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
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

# Create service
sudo tee /etc/systemd/system/swisstronik-testnet.service > /dev/null << EOF
Description=swisstronik node service

ExecStart=$(which cosmovisor) run start

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

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 > $HOME/.swisstronik/config/genesis.json
curl -Ls > $HOME/.swisstronik/config/addrbook.json

# Add seeds
sed -i -e "s|^seeds *=.*|seeds = \"\"|" $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"|' \

# Set custom ports
sed -i -e "s%^proxy_app = \"tcp://\"%proxy_app = \"tcp://\"%; s%^laddr = \"tcp://\"%laddr = \"tcp://\"%; s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:17560\"%; s%^laddr = \"tcp://\"%laddr = \"tcp://\"%; s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":17566\"%" $HOME/.swisstronik/config/config.toml
sed -i -e "s%^address = \"tcp://\"%address = \"tcp://\"%; s%^address = \":8080\"%address = \":17580\"%; s%^address = \"\"%address = \"\"%; s%^address = \"\"%address = \"\"%; s%:8545%:17545%; s%:8546%:17546%; s%:6065%:17565%" $HOME/.swisstronik/config/app.toml

Download latest chain snapshot

curl -L | 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