Installation

This not official guide for installation full node Swisstronik.

System Requirements

  • Intel CPU 24 Core with Intel SGX Support

  • 64 GB RAM

  • SSD 1 TB

SGX Install

wget https://download.01.org/intel-sgx/sgx-linux/2.22/distro/ubuntu22.04-server/sgx_linux_x64_driver_2.11.54c9c4c.bin 
chmod +x sgx_linux_x64_driver_2.11.54c9c4c.bin
sudo ./sgx_linux_x64_driver_2.11.54c9c4c.bin

Install AESM

echo "deb https://download.01.org/intel-sgx/sgx_repo/ubuntu $(lsb_release -cs) main" | sudo tee -a /etc/apt/sources.list.d/intel-sgx.list >/dev/null
curl -sSL "https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key" | sudo -E apt-key add -
sudo apt update
sudo apt install sgx-aesm-service libsgx-aesm-launch-plugin libsgx-aesm-epid-plugin

Update Package

sudo apt update && sudo apt upgrade -y

Install Dependencies

sudo apt install libsgx-launch libsgx-urts libsgx-epid libsgx-quote-ex sgx-aesm-service libsgx-aesm-launch-plugin libsgx-aesm-epid-plugin libsgx-quote-ex libsgx-dcap-ql libsnappy1v5

Install Rust

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"

Build SGX Tools

cargo install sgxs-tools
sudo $(which sgx-detect)

Result:

Detecting SGX, this may take a minute...
✔  SGX instruction set
  ✔  CPU support
  ✔  CPU configuration
  ✔  Enclave attributes
  ✔  Enclave Page Cache
  SGX features
    ✔  SGX2  ✔  EXINFO  ✔  ENCLV  ✔  OVERSUB  ✔  KSS  
    Total EPC size: 92.2MiB
✔  Flexible launch control
  ✔  CPU support
  ✔  CPU configuration
  ✔  Able to launch production mode enclave
✔  SGX system software
  ✔  SGX kernel device (/dev/sgx_enclave)
  ✔  libsgx_enclave_common
  ✔  AESM service
  ✔  Able to launch enclaves
    ✔  Debug mode
    ✔  Production mode
    ✔  Production mode (Intel whitelisted)

You're all set to start running SGX programs!

Install Golang

if ! [ -x "$(command -v go)" ]; then
  ver="1.21.5"
  cd $HOME
  wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz"
  sudo rm -rf /usr/local/go
  sudo tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz"
  rm "go$ver.linux-amd64.tar.gz"
  echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> ~/.bash_profile
  source ~/.bash_profile
fi

Download Binary from Source

cd $HOME
wget https://github.com/SigmaGmbH/swisstronik-chain/releases/download/v1.0.1/swisstronikd.deb.zip 
unzip swisstronikd.deb.zip  
dpkg -i swisstronik_1.0.1-updated-binaries_amd64.deb
swisstronikd version

Setting Enclave

mkdir -p /root/.swisstronik-enclave/
cp /usr/lib/enclave.signed.so /root/.swisstronik-enclave/enclave.signed.so

Request Master Key

swisstronikd enclave request-master-key rpc.testnet.swisstronik.com:46789

Init Node

swisstronikd init YOUR_MONIKER --chain-id swisstronik_1291-1

Download Configuration

wget -O $HOME/.swisstronik/config/genesis.json "https://sync.rawakinode.tech/swisstronik/genesis.json"
wget -O $HOME/.swisstronik/config/addrbook.json "https://sync.rawakinode.tech/swisstronik/addrbook.json"

Set Minimum Gas Price

sed -i.bak -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"7uswtr\"/;" ~/.swisstronik/config/app.toml

Set Seed & Peers

SEEDS="54b1092174218aad93a22f7ac2eaa74bb2326bbc@testnet-seed.konsortech.xyz:29165"
PEERS="7c42a55317deda257fee06bc48574fa3444967db@testnet-swisstronik.konsortech.xyz:27656"
sed -i -e "s/^seeds *=.*/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.swisstronik/config/config.toml

DIsable Indexing

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

Set Prunning

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

Create Services

sudo tee /etc/systemd/system/swisstronikd.service > /dev/null <<EOF
[Unit]
Description=swisstronik node
After=network-online.target

[Service]
User=$USER
ExecStart=$(which swisstronikd) start
Restart=on-failure
RestartSec=3
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target
EOF

Register Services

sudo systemctl daemon-reload
sudo systemctl enable swisstronikd

Start Services

sudo systemctl restart swisstronikd && sudo journalctl -u swisstronikd -f -o cat

Last updated