# Installation

**Chain ID**: swisstronik\_1291-1 | **Latest Version Tag**: v1.1.1 | **Wasm**: OFF

{% hint style="info" %}
Before installing the node you should enable SGX and confirm your system ready by installing SGX and obtain masterkey : \
<https://swisstronik.gitbook.io/swisstronik-docs/node-setup/setup-sgx/setup-intel-sgx>
{% endhint %}

## Installation

## Install dependencies

**Setting up variable**

```
echo "export SWISSTRONIK_CHAIN_ID=swisstronik_1291-1" >> $HOME/.bash_profile
source $HOME/.bash_profile
```

**Update system and install build tools**

```
sudo apt -q update
sudo apt -qy install curl git jq lz4 build-essential tmux libgmp3-dev flex bison
sudo apt -qy upgrade
```

**Install Go**

```
rm -rf $HOME/go
sudo rm -rf /usr/local/go
cd $HOME
curl https://dl.google.com/go/go1.21.4.linux-amd64.tar.gz | sudo tar -C/usr/local -zxvf -
cat <<'EOF' >>$HOME/.profile
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export GO111MODULE=on
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin
EOF
source $HOME/.profile
go version
```

**Download and build binaries**

```
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
```

**Change your moniker**&#x20;

```
swisstronikd init <Moniker> --chain-id=swisstronik_1291-1
```

**Download Genesis**

```
curl https://rpc.testnet.swisstronik.com/genesis? | jq ".result.genesis" > ~/.swisstronik/config/genesis.json
```

#### Set the gas prices

```
sed -i.bak -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"7uswtr\"/;" ~/.swisstronik/config/app.toml
external_address=$(wget -qO- eth0.me) 
sed -i.bak -e "s/^external_address *=.*/external_address = \"$external_address:26656\"/" $HOME/.swisstronik/config/config.toml
sed -i.bak -e "s/^seeds =.*/seeds = \"$seeds\"/" $HOME/.swisstronik/config/config.toml
```

#### Specify prunning option

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

#### Create a service

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

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

[Install]
WantedBy=multi-user.target
EOF

sudo systemctl daemon-reload
sudo systemctl enable swisstronikd
```

#### Start service and check the logs

```
sudo systemctl start swisstroonikd && sudo journalctl -u swisstronikd -f --no-hostname -o cat
```

{% hint style="danger" %}
If you got enclave error you should obtain master key :&#x20;

```
mkdir $HOME/.swisstronik-enclave/
sudo cp /usr/lib/enclave.signed.so $HOME/.swisstronik-enclave/
swisstronikd enclave request-master-key rpc.testnet.swisstronik.com:46789
```

{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.logosnodos.online/testnet-node/swisstronik/installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
