This repository contains a test suite for a simulated process of bootstrapping an ICS consumer chain that is being secured by a provider chain.
--> Find the sovereign-to-consumer migration on the ics-consumer-migration
branch.
For clarification purposes:
- Provider Chain = a blockchain that provides security to a consumer chain by sharing it's validator set
- Consumer Chain = a blockchain which is being secured by the validator set of a provider chain
The test suite bootstraps a local provider testnet.
The provider chains proposes a consumer-addition-proposal
. Additionally, key-assignment
features can be tested.
A test journal is written to files/logs/result.log
For a recommended setup with 5 consumer nodes and 5 provider nodes, the following requirements apply:
- 16GB RAM and a 4-core CPU (Minimum)
- 32GB RAM and an 8-core CPU (Recommended)
- (The test suite can be run with less than 5 validators, but then weird behaviour may appear.)
If the test suite is run with the default IP-Address ranges for the virtual machines,
the /etc/vbox/networks.conf
file must be altered to include the following line:
* 0.0.0.0/0 ::/0
If the file does not exist, it needs to be created first.
- Clone this repository:
git clone https://github.com/clemensgg/ics-simulation-tests
cd ics-simulation-tests
git switch ics-consumer-migration
Modify the .env
file to set up the required environment variables. These variables determine the number of validators and the provider and consumer chains' repositories, versions, applications, home directories, Go sources, and genesis sources
If you wish to use your own genesis file for the consumer chain, it needs to be put into files/user
.
To lessen the strain on your internet connection and to speed up the setup process, it is recommended to use a caching server on your host machine.
In the .env
file, change the variable CACHE_SERVER
to true
. Squid caching server needs to be installed on your machine.
On debian, you can install it with this command:
apt install squid
An example configuration file can be found in config/squid_example.conf.
Run tests:
bash test.sh
-> please note node provision with vagrant takes about 15mins
The script will perform the following steps:
- Load environment variables from the .env file.
- Start the provider chain and wait for it to produce blocks.
- Propose a consumer addition proposal from provider validator 1.
- Vote "yes" on the consumer addition proposal from all provider validators.
- Prepare the consumer chain by copying private validator keys and finalizing the genesis.
- Test key assignment pre consumer chain launch.
- Start the consumer chain.
- Create IBC paths between provider and consumer chain.
- Start a persistent IBC relayer.
- Test key assignment post consumer chain launch.
- Upon successful completion, you should see the message "All tests passed!".
Watch node output on validators:
tail -f /var/log/chain.log
Watch relayer output on provider-chain-validator1
:
tail -f /var/log/hermes.log
Clean up:
bash destroy.sh
Destroy manually:
VBoxManage list runningvms | awk '{print $2;}' | xargs -I vmid VBoxManage controlvm vmid poweroff
VBoxManage list vms | awk '{print $2;}' | xargs -I vmid VBoxManage unregistervm --delete vmid
rm .provisioned
This project is licensed under the Apache License 2.0.