Tools to orchestrate and run ethermint network tests
- Make sure AWS credentials are stored in the default directory.
- Install packer
- Install tendermint and ethermint:
go install github.com/tendermint/ethermint/cmd/ethermint
go install github.com/tendermint/ethermint/vendor/github.com/tendermint/tendermint/cmd/tendermint
- Clone repo and
pip install -r requirements.txt
- Make sure
tendermint
,ethermint
,packer
are in your path
From ethermint-testing
directory:
Create an ethermint network spanning 2 regions:
python api.py create -r us-west-1 -r us-east-1 files/chain1.json
NOTE In this and following commands input/output files can be
-
for unix-style indication to read from stdin/out.
Relevant data about the chain are dumped to the json file. Use this file to reference the chain in subsequent commands.
After running this command, a network is running in AWS.
A network can be chainshot (a snapshot of each node's chain data can be saved) and later thawed from a chainshot.
To chainshot a network:
python api.py chainshot files/chain1.json files/chainshot1.json
Thawing can be done using the chainshot file like so:
python api.py thaw files/chainshot1.json files/thawed_chain1.json
Thawing creates new instances from snapshots, loads the chain data snapshots and resumes the consensus process.
To generate a roster file from a set of chains for processing using salt-ssh
do:
python api.py roster files/chain1.json > files/roster
and then:
sudo salt-ssh --roster-file=files/roster --priv <PATH TO PRIV KEY> -i '*' test.ping
To quickly check the liveness of a chain:
python api.py isalive files/chain1.json
or to get more elaborate status report:
python api.py status files/chain1.json
create
-
input: list of AWS regions given in commandline:
-r us-east-1 -r -us-west-1 -r -us-west-1 ...
-
output: chain
.json
file:{ "instances": [ { "instance": { "key_name": "salt-instance-1490723614_e7752aa786bc4f2b901c5cdf11a47e26", "region": "us-west-1", "id": "i-06f49a63e848bcb6f" } }, ... ], "type": "ethermint", "name": "" }
-
output: ssh key
.pem
file
chainshot
-
input: chain
.json
file -
output: chainshot
.json
file{ "instances": [ { "instance": { "availablility_zone": "us-west-1b", "ami": "ami-29a3f849", "key_name": "salt-instance-1490723614_e7752aa786bc4f2b901c5cdf11a47e26", "tags": [ { "Value": "test-ethermint-ami-29a3f8490", "Key": "Name" } ], "vpc_id": "vpc-0835e76c", "region": "us-west-1", "id": "i-06f49a63e848bcb6f", "security_groups": [ "ethermint-security_group-salt-ssh-2017-03-28 19:53:27.612893" ] }, "snapshot": { "to": "2017-03-30T12:03:54+00:00", "from": "2017-03-28T17:53:35+00:00", "id": "snap-08358ddeefd7a0ec8" } }, ... ], "chainshot_name": "Ethermint-network-chainshot" }
thaw
- input: chainshot
.json
file - output: chain
.json
file
status
-
input: chain
.json
file (or files forroster
) -
output: status
.json
{ "is_alive" : true, "height" : 107338, "nodes" : [ { "instance_region" : "us-west-1", "is_alive" : true, "last_block_time" : "2017-03-30T14:13:12.993000+0000", "instance_id" : "i-06f49a63e848bcb6f", "name" : "test-ethermint-ami-29a3f8490", "height" : 107337, "last_block_height" : 107337 }, ... ], "age" : null }
history
- input: chain
.json
file (or files forroster
) - output: history
.csv
(? - WIP)
roster
- input: chain
.json
file (or files forroster
) - output: salt-ssh roster YAML
isalive
- input: chain
.json
file (or files forroster
) - output:
True
/False
TODO make issues out of this?
- rethink input/output formats
- proper organization of chain/chainshot data like: chain names, tags on aws, ethermint versions, keys, owners
- using a fork of
ethermint
- using remote
ethermint
install toethermint init
- same for
tenderint gen_validator
? - installing a different version of
ethermint
onthaw