Local testnet
Below you can find the guide how to setup local Swisstronik testnet with one or multiple validators using Docker
Single validator testnet
Apple M1 and M2 are not supported, even using QEMU. To fix it, we're working on fork of hardhat with enabled encryption which will simulate Swisstronik node behaviour
For convenient development and testing of your dApps we've prepared the ghcr.io/sigmagmbh/swisstronik-chain:latest Docker image which contains preconfigured network with one validator.
You can start local node by running:
docker run --rm -it -p 0.0.0.0:26657:26657 \
-p 0.0.0.0:8545:8545 -p 0.0.0.0:8546:8546 \
ghcr.io/sigmagmbh/swisstronik-chain:latest swisstronikd start --minimum-gas-prices=0uswtr \
--json-rpc.api eth,txpool,personal,net,debug,web3 \
--api.enable --enclave.address 0.0.0.0:8999 \
--json-rpc.address 0.0.0.0:8535 --json-rpc.ws-address 0.0.0.0:8546Multiple validators testnet
Prerequisites
Installed
swisstronikdbinaryCloned https://github.com/SigmaGmbH/swisstronik-chain repo
Build and start
Before starting a local testnet run following command to generate genesis.json file with initial state of blockchain and multiple validator configs
This command will create .testnets folder with validator private keys, configuration, etc.
Now you can start your local testnet using Docker and docker-compose by running command below from root directory of clonedswisstronik-chain repo:
The command above will run docker containers in the background using docker-compose. You will see created network and containers
Stop local testnet
Once you are done, execute:
Logging
To see what happening inside node you can use following command:
The logs will look like:
Follow logsβ
You can also watch logs as they are produced via Docker with the --follow (-f) flag, for example:
Ethereum JSON-RPC & Websocket Portsβ
To interact with the testnet via WebSockets or RPC/API, you will send your request to the corresponding ports:
8545
8546
You can send a curl command such as:
Last updated