Swisstronik Docs
  • 🇨🇭About Swisstronik
    • What is Swisstronik?
    • Swisstronik vs Ethereum
    • Useful links
  • 🌐General
    • Intel SGX
    • Governance
      • On-Chain Proposal
      • Formatting a Proposal
      • Submitting a Proposal
      • Governable Parameters
    • Community Pool
    • Accounts
    • Transactions
    • Gas and Fees
    • Coin & Tokens
  • ⚒️Development
    • Endpoints
    • Connect wallets
      • MetaMask (EVM) - Manual
      • Keplr (Cosmos)
      • Testnet Metamask (EVM) - Chainlist
      • Testnet MetaMask (EVM) - Manual
      • Testnet Keplr (Cosmos)
    • Get test coins
    • SwisstronikJS SDK
      • SwisstronikJS Functions
      • Swisstronik & Ethereum transactions
      • Transaction - code sample
      • Swisstronik & Ethereum calls
      • Call - code sample
    • Swisstronik CLI
      • Installation
      • Configuration
      • Key management
      • Queries
      • Sending SWTR
      • For SDI Issuers
    • Guides
      • Contract deployment - Hardhat
        • 1. Setting up the Hardhat environment
        • 2. Configure hardhat.config.js
        • 3. Write and compile the smart contract
        • 4. Deploy the smart contract
        • 5. Interact with the contract - Transaction
        • 6. Interact with the contract - Call
      • Contract deployment - Remix IDE
      • Deployment & Interaction PERC-20
        • ERC-20 & PERC-20
        • Sample PERC20 contract
        • Deployment & Interaction with contract
        • How to use encryption
      • Contract verification
      • SDI for dapp developers
    • Local testnet
    • Web3JS, Ethers, Viem and other third-party libraries
  • 🖥️Node setup
    • Setup SGX
      • Supported Hardware
      • Setup Intel SGX
    • Setup node
      • Mainnet
        • v1.0.1 Upgrade
      • Testnet
        • Install from .deb package
        • Configure node
        • Upgrade your testnet node
          • Swisstronik v3 Testnet
          • Swisstronik v4 Testnet
          • Swisstronik v5 Testnet
          • Swisstronik v5.1 Testnet
          • Swisstronik v6 Testnet
          • Swisstronik v7 Testnet
          • Swisstronik v8 Testnet
        • Seed Node
        • Live Peers
        • Genesis Mirror Download
    • CLI Cheatsheet
  • 🤝Delegators
    • What is a delegator?
    • Delegator Guide (CLI)
    • Delegators Security
Powered by GitBook
On this page
  • Upgrade plan for v1.0.4
  • Backup
  • Manually
  • Using Cosmovisor
  1. Node setup
  2. Setup node
  3. Testnet
  4. Upgrade your testnet node

Swisstronik v5 Testnet

PreviousSwisstronik v4 TestnetNextSwisstronik v5.1 Testnet

Last updated 9 months ago

Upgrade plan for v1.0.4

The upcoming v1.0.4 upgrade includes the following bug fixes:

  • Fixed a nasty bug with logIndex for EVM events that previously caused issues with EVM block explorers;

  • Disabled EIP712 functionality as it was unused and could potentially introduce bugs and vulnerabilities.

Backup

Prior to the upgrade, validators are encouraged to take a full data snapshot. Snapshotting depends heavily on infrastructure, but generally, this can be done by backing up the .swisstronik directory. If you use Cosmovisor to upgrade, by default, Cosmovisor will back up your data upon upgrade. See the "" section below.

It is critically important for validator operators to back up the .swisstronik/data/priv_validator_state.json file after stopping the gaiad process. This file is updated every block as your validator participates in consensus rounds. It is a critical file needed to prevent double-signing in case the upgrade fails and the previous chain needs to be restarted.

Manually

If you're not using Cosmovisor, you can perform the upgrade manually.

Prepare New Binary

Download the new binary:

wget https://github.com/SigmaGmbH/swisstronik-chain/releases/download/testnet-v1.0.4/swisstronikd.zip

Extract the downloaded archive:

unzip swisstronikd.zip

In the bin folder, you will find the required files.

Copy the libsgx_wrapper_v1.0.4.x86_64.so library:

sudo cp bin/libsgx_wrapper_v1.0.4.x86_64.so /usr/lib

Copy v1.0.4_enclave.signed.so to the ENCLAVE_HOME directory (by default, it is $HOME/.swisstronik-enclave):

cp bin/v1.0.4_enclave.signed.so $ENCLAVE_HOME

During Upgrade: Modify Your .service File

Once your validator reaches the upgrade height, it will automatically stop producing new blocks. After your node stops, switch the binary you're using to swisstronikd v1.0.4 at ExecStart in your .service file.

Note: swisstronikd v1.0.4 is located in the bin folder from the previous step of unpacking the .zip archive.

Then run:

sudo systemctl daemon-reload

Restart your validator:

sudo systemctl restart your-validator-service

Using Cosmovisor

If you're running your node using Cosmovisor, please follow these steps.

Download Binaries

Download the new binary:

wget https://github.com/SigmaGmbH/swisstronik-chain/releases/download/testnet-v1.0.4/swisstronikd.zip

Extract the downloaded archive:

unzip swisstronikd.zip

In the bin folder, you will find the required files.

Copy the libsgx_wrapper_v1.0.4.x86_64.so library:

sudo cp bin/libsgx_wrapper_v1.0.4.x86_64.so /usr/lib

Copy v1.0.4_enclave.signed.so to the ENCLAVE_HOME directory (by default, it is $HOME/.swisstronik-enclave):

cp bin/v1.0.4_enclave.signed.so $ENCLAVE_HOME

Setup Cosmovisor

If you haven't configured Cosmovisor before, follow these steps.

Install the latest version of Cosmovisor (1.5.0):

go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@latest
cosmovisor version
# cosmovisor version: v1.5.0

Rename and copy swisstronikd_v1.0.3 to swisstronikd:

cp $(whereis swisstronikd_v1.0.3) .

Initialize Cosmovisor:

export DAEMON_HOME=/path/to/.swisstronik
export DAEMON_NAME=swisstronikd

cosmovisor init swisstronikd

Put v1.0.4 Binaries

Copy swisstronikd v1.0.4 to $HOME/.swisstronik/cosmovisor/upgrades/v1.0.4/bin:

mkdir -p $HOME/.swisstronik/cosmovisor/upgrades/v1.0.4/bin
cp swisstronikd $HOME/.swisstronik/cosmovisor/upgrades/v1.0.4/bin

Note: swisstronikd v1.0.4 is located in the bin folder from the previous step of unpacking the .zip archive.

Check Folder Structure

At this point, you should have the following structure:

.
├── current -> genesis or upgrades/<name>
├── genesis
│   └── bin
│       └── swisstronikd  # old: v1.0.3
└── upgrades
    └── v1.0.4
        └── bin
            └── swisstronikd  # new: v1.0.4

Export the environmental variables:

export DAEMON_NAME=swisstronikd
# please change to your own swisstronik home dir
# please note `DAEMON_HOME` has to be an absolute path
export DAEMON_HOME=$HOME/.swisstronik
export DAEMON_RESTART_AFTER_UPGRADE=true

Disable Auto-Downloading of Binaries

Set DAEMON_ALLOW_DOWNLOAD_BINARIES to false to avoid Cosmovisor trying to download binaries.

Start the Node

Start the node:

cosmovisor run start --x-crisis-skip-assert-invariants --home $DAEMON_HOME

Skipping the invariant checks is strongly encouraged since it decreases the upgrade time significantly and since there are some other improvements coming to the crisis module in the next release of the Cosmos SDK.

🖥️
Upgrade with Cosmovisor