istanbul-tools/README.md

91 lines
3.5 KiB
Markdown
Raw Normal View History

# istanbul-tools
2017-06-23 02:21:11 -07:00
2017-09-14 19:26:45 -07:00
[![Test Status](https://travis-ci.org/getamis/istanbul-tools.svg?branch=feature%2Fadd-travis-yml)](https://travis-ci.org/getamis/istanbul-tools)
Istanbul tools contain tools for configuring `extraData` field for istanbul BFT (IBFT) network, integration tests for both IBFT Geth and Quorum, and load testing utilities for IBFT Geth.
Command line tools
---
2017-06-23 02:21:11 -07:00
Genesis extra-data encoder and decoder library for Istanbul consensus.
istanbul-tools is used to generate extra-data field of genesis due to extra-data is combined signer vanity with RLP encoded `Istanbul extra data`. The `Istanbul extra data` struct is defined as follows:
2017-06-23 02:21:11 -07:00
```go
type IstanbulExtra struct {
Validators []common.Address // Validator addresses
Seal []byte // Proposer seal 65 bytes
CommittedSeal [][]byte // Committed seal, 65 * len(Validators) bytes
}
```
Please note: The `Seal`, and `CommittedSeal` is not considered in genesis block.
2017-09-14 19:26:45 -07:00
### Getting started
2017-06-23 02:21:11 -07:00
```
$ make istanbul
$ build/bin/istanbul
NAME:
istanbul - the istanbul-tools command line interface
2017-06-23 02:21:11 -07:00
USAGE:
istanbul [global options] command [command options] [arguments...]
COMMANDS:
2017-06-25 20:29:39 -07:00
decode To decode an Istanbul extraData
encode To encode an Istanbul extraData
2017-06-23 02:21:11 -07:00
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--help, -h show help
COPYRIGHT:
2017-06-25 20:29:39 -07:00
Copyright 2017 The Amis Authors
2017-06-23 02:21:11 -07:00
```
2017-09-14 19:26:45 -07:00
### Example
2017-06-23 02:21:11 -07:00
2017-09-14 19:26:45 -07:00
#### Encode command
2017-06-23 02:21:11 -07:00
Encode the given file to `Encoded Istanbul extra-data`
```
$ build/bin/istanbul encode --config ./cmd/istanbul/example/config.toml
OUTPUT:
Encoded Istanbul extra-data: 0x0000000000000000000000000000000000000000000000000000000000000000f89af85494475cc98b5521ab2a1335683e7567c8048bfe79ed9407d8299de61faed3686ba4c4e6c3b9083d7e2371944fe035ce99af680d89e2c4d73aca01dbfc1bd2fd94dc421209441a754f79c4a4ecd2b49c935aad0312b8410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0
```
2017-09-14 19:26:45 -07:00
#### Decode command
2017-06-23 02:21:11 -07:00
Decode extraData for the given input
```
$ build/bin/istanbul decode --extradata 0x0000000000000000000000000000000000000000000000000000000000000000f89af85494475cc98b5521ab2a1335683e7567c8048bfe79ed9407d8299de61faed3686ba4c4e6c3b9083d7e2371944fe035ce99af680d89e2c4d73aca01dbfc1bd2fd94dc421209441a754f79c4a4ecd2b49c935aad0312b8410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0
OUTPUT:
2017-06-26 00:24:42 -07:00
vanity: 0x0000000000000000000000000000000000000000000000000000000000000000
2017-06-23 02:21:11 -07:00
validator: 0x475cc98b5521ab2a1335683e7567c8048bfe79ed
validator: 0x07d8299de61faed3686ba4c4e6c3b9083d7e2371
validator: 0x4fe035ce99af680d89e2c4d73aca01dbfc1bd2fd
validator: 0xdc421209441a754f79c4a4ecd2b49c935aad0312
seal: 0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
2017-09-14 19:26:45 -07:00
```
Integration tests
---
### Istanbul BFT Geth Integration tests
[Test specification](https://github.com/getamis/istanbul-tools/wiki/Istanbul-BFT-Test-Specification)
[Source code](https://github.com/getamis/istanbul-tools/tree/develop/tests/functional)
### Istanbul BFT Quorum Integration tests
[Test specification](https://github.com/getamis/istanbul-tools/wiki/Istanbul-BFT-on-Quorum-Test-Specification)
[Source code](https://github.com/getamis/istanbul-tools/tree/develop/tests/quorum/functional)
Load tests
---
[Test specification](https://github.com/getamis/istanbul-tools/wiki/Istanbul-BFT-Benchmarking)