Giter VIP home page Giter VIP logo

ics-simulation-tests's Introduction

Interchain Simulation Tests

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

Hardware Requirements

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.)

Sofware Requirements

Prerequisites

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.

Setup

  1. Clone this repository:
git clone https://github.com/clemensgg/ics-simulation-tests
cd ics-simulation-tests
git switch ics-consumer-migration

Configuration

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.

Running the Test

Run tests:

bash test.sh

-> please note node provision with vagrant takes about 15mins

The script will perform the following steps:

  1. Load environment variables from the .env file.
  2. Start the provider chain and wait for it to produce blocks.
  3. Propose a consumer addition proposal from provider validator 1.
  4. Vote "yes" on the consumer addition proposal from all provider validators.
  5. Prepare the consumer chain by copying private validator keys and finalizing the genesis.
  6. Test key assignment pre consumer chain launch.
  7. Start the consumer chain.
  8. Create IBC paths between provider and consumer chain.
  9. Start a persistent IBC relayer.
  10. Test key assignment post consumer chain launch.
  11. 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

License

This project is licensed under the Apache License 2.0.

ics-simulation-tests's People

Contributors

clemensgg avatar monopauli avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.