Go to file
Alan Chen d6ea5008a2 charts, client, common, container, genesis, k8s, log: logger refactoing for correct caller line number 2017-09-13 17:26:39 +08:00
benchmark/kubernetes benchmark/kubernetes: fix helm chart template error during installation 2017-09-11 17:29:59 +08:00
charts charts, client, common, container, genesis, k8s, log: logger refactoing for correct caller line number 2017-09-13 17:26:39 +08:00
client charts, client, common, container, genesis, k8s, log: logger refactoing for correct caller line number 2017-09-13 17:26:39 +08:00
cmd common, container, genesis: utilities refactoring 2017-09-07 18:22:07 +08:00
common charts, client, common, container, genesis, k8s, log: logger refactoing for correct caller line number 2017-09-13 17:26:39 +08:00
container charts, client, common, container, genesis, k8s, log: logger refactoing for correct caller line number 2017-09-13 17:26:39 +08:00
genesis charts, client, common, container, genesis, k8s, log: logger refactoing for correct caller line number 2017-09-13 17:26:39 +08:00
k8s charts, client, common, container, genesis, k8s, log: logger refactoing for correct caller line number 2017-09-13 17:26:39 +08:00
log charts, client, common, container, genesis, k8s, log: logger refactoing for correct caller line number 2017-09-13 17:26:39 +08:00
tests tests/quorum: add byzantine faulty behavior testing 2017-09-12 16:07:38 +08:00
vendor glide, vendor: add log15 2017-09-12 12:16:48 +08:00
.gitignore add gitignore file 2017-06-19 15:37:13 +08:00
.travis.yml travis: split tests 2017-09-07 16:32:53 +08:00
Makefile Makefile: add load testing make target 2017-09-07 18:22:07 +08:00
README.md rename Istanbul-tools to istanbul-tools 2017-06-26 15:24:54 +08:00
glide.lock glide, vendor: add log15 2017-09-12 12:16:48 +08:00
glide.yaml glide, vendor: add log15 2017-09-12 12:16:48 +08:00

README.md

istanbul-tools

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:

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.

Getting started

$ make istanbul
$ build/bin/istanbul

NAME:
   istanbul - the istanbul-tools command line interface

USAGE:
   istanbul [global options] command [command options] [arguments...]

COMMANDS:
     decode   To decode an Istanbul extraData
     encode   To encode an Istanbul extraData
     help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h  show help

COPYRIGHT:
   Copyright 2017 The Amis Authors

Example

Encode command

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

Decode command

Decode extraData for the given input

$ build/bin/istanbul decode --extradata 0x0000000000000000000000000000000000000000000000000000000000000000f89af85494475cc98b5521ab2a1335683e7567c8048bfe79ed9407d8299de61faed3686ba4c4e6c3b9083d7e2371944fe035ce99af680d89e2c4d73aca01dbfc1bd2fd94dc421209441a754f79c4a4ecd2b49c935aad0312b8410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0

OUTPUT:
vanity:  0x0000000000000000000000000000000000000000000000000000000000000000
validator:  0x475cc98b5521ab2a1335683e7567c8048bfe79ed
validator:  0x07d8299de61faed3686ba4c4e6c3b9083d7e2371
validator:  0x4fe035ce99af680d89e2c4d73aca01dbfc1bd2fd
validator:  0xdc421209441a754f79c4a4ecd2b49c935aad0312
seal: 0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000