pax_global_header 0000666 0000000 0000000 00000000064 13447176222 0014522 g ustar 00root root 0000000 0000000 52 comment=0db1dbd5ecde648d0220b58497c43d1b39926bdf
parity-bitcoin-ci-docker/ 0000775 0000000 0000000 00000000000 13447176222 0015661 5 ustar 00root root 0000000 0000000 parity-bitcoin-ci-docker/.dockerignore 0000664 0000000 0000000 00000000361 13447176222 0020335 0 ustar 00root root 0000000 0000000 # Generated by Cargo
# will have compiled files and executables
target
*.swp
*.swo
*.swn
*.DS_Store
# Visual Studio Code stuff
.vscode
# GitEye stuff
.project
# idea ide
.idea
# git stuff
.git
# ignore compare tools
tools/compare-tool
parity-bitcoin-ci-docker/.editorconfig 0000664 0000000 0000000 00000000361 13447176222 0020336 0 ustar 00root root 0000000 0000000 root = true
[*]
indent_style=tab
indent_size=tab
tab_width=4
end_of_line=lf
charset=utf-8
trim_trailing_whitespace=true
max_line_length=120
insert_final_newline=true
[.travis.yml]
indent_style=space
indent_size=2
tab_width=8
end_of_line=lf
parity-bitcoin-ci-docker/.gitignore 0000664 0000000 0000000 00000000270 13447176222 0017650 0 ustar 00root root 0000000 0000000 # Generated by Cargo
# will have compiled files and executables
/target/
*.swp
*.swo
*.swn
*.DS_Store
# Visual Studio Code stuff
/.vscode
# GitEye stuff
/.project
# idea ide
.idea
parity-bitcoin-ci-docker/.gitlab-ci.yml 0000664 0000000 0000000 00000006763 13447176222 0020331 0 ustar 00root root 0000000 0000000 stages:
- test
- build
- publish
image: parity/rust:gitlab-ci
variables:
GIT_DEPTH: "3"
SIMPLECOV: "true"
RUST_BACKTRACE: "1"
RUSTFLAGS: " -C link-arg=-s"
CARGOFLAGS: ""
GIT_STRATEGY: pull
GIT_SUBMODULE_STRATEGY: recursive
CARGO_TARGET: x86_64-unknown-linux-gnu
cache:
key: "$CI_BUILD_STAGE-$CI_BUILD_REF_NAME"
untracked: true
.test_tags: &test_tags #branches and tags for test stage
stage: test
tags:
- linux-docker
.no_git: &no_git # disable git strategy
variables:
GIT_STRATEGY: none
GIT_SUBMODULE_STRATEGY: none
.releaseable_branches: # list of git refs for building GitLab artifacts (think "pre-release binaries")
only: &releaseable_branches
- stable
- beta
- tags
- schedules
- master
.collect_artifacts: &collect_artifacts
artifacts:
name: "${CI_JOB_NAME}_${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}}"
when: on_success
expire_in: 12 mos
paths:
- artifacts/
linux-stable-test:
<<: *test_tags
script:
- rustup default stable
- echo 'Running tests' && echo -en 'gitlab_fold:start:tests'
- time cargo test --all
- echo -en 'gitlab_fold:end:tests'
linux-beta-test:
<<: *test_tags
script:
- rustup default beta
- echo 'Running check'
- time cargo check
- echo 'End check'
allow_failure: true
linux-nightly-test:
<<: *test_tags
script:
- rustup default nightly
- echo 'Running check'
- time cargo check
- echo 'End check'
allow_failure: true
build-linux:
stage: build
only: *releaseable_branches
script:
- git submodule update --init
- echo 'Building in release mode' && echo -en 'gitlab_fold:start:build.release'
- rustup default stable
- time cargo build --target $CARGO_TARGET -p pbtc --release
- md5sum target/$CARGO_TARGET/release/pbtc > pbtc.md5
- echo -en 'gitlab_fold:end:build.release'
- echo 'Running regtests from ./tools/regtests.sh' && echo -en 'gitlab_fold:start:regtests'
- ./tools/regtests.sh
- echo -en 'gitlab_fold:end:regtests'
- echo 'Running bench from ./tools/bench.sh' && echo -en 'gitlab_fold:start:bench'
- ./tools/bench.sh
- echo -en 'gitlab_fold:end:bench'
- sh tools/deb_build.sh amd64
- cp target/$CARGO_TARGET/release/pbtc deb/usr/bin/pbtc
- export VER=$(grep -m 1 version Cargo.toml | awk '{print $3}' | tr -d '"' | tr -d "\n")
- dpkg-deb -b deb "pbtc_"$VER"_amd64.deb"
- md5sum "pbtc_"$VER"_amd64.deb" > "pbtc_"$VER"_amd64.deb.md5"
- echo "_____ Post-processing binaries _____"
- rm -rf artifacts/*
- mkdir -p artifacts/$CARGO_TARGET
- cd artifacts/$CARGO_TARGET
- cp -v ../../target/$CARGO_TARGET/release/pbtc pbtc
- cp -v ../../pbtc_"$VER"_amd64.deb pbtc_"$VER"_amd64.deb
- cp -v ../../pbtc.md5 pbtc.md5
- cp -v ../../pbtc_"$VER"_amd64.deb.md5 pbtc_"$VER"_amd64.deb.md5
tags:
- linux-docker
<<: *collect_artifacts
publish-docker: &publish_release
stage: publish
only: *releaseable_branches
<<: *no_git
cache: {}
dependencies:
- build-linux
script:
- tools/docker_build.sh
tags:
- shell
parity-bitcoin-ci-docker/.gitmodules 0000664 0000000 0000000 00000000165 13447176222 0020040 0 ustar 00root root 0000000 0000000 [submodule "tools/compare-tool"]
path = tools/compare-tool
url = https://github.com/theuni/bitcoind-comparisontool
parity-bitcoin-ci-docker/.travis.yml 0000664 0000000 0000000 00000004174 13447176222 0020000 0 ustar 00root root 0000000 0000000 sudo: required
dist: trusty
language: rust
branches:
only:
- master
matrix:
fast_finish: false
include:
- rust: stable
cache:
apt: true
directories:
- $TRAVIS_BUILD_DIR/target
- $HOME/.cargo
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- libcurl4-openssl-dev
- libelf-dev
- libdw-dev
- gcc-4.8
- g++-4.8
- oracle-java8-set-default
script:
- echo 'Running tests' && echo -en 'travis_fold:start:tests'
- cargo test --all
- echo -en 'travis_fold:end:tests'
- echo 'Building in release mode' && echo -en 'travis_fold:start:build.release'
- cargo build --release
- echo -en 'travis_fold:end:build.release'
- echo 'Running regtests from ./tools/regtests.sh' && echo -en 'travis_fold:start:regtests'
- ./tools/regtests.sh
- echo -en 'travis_fold:end:regtests'
- echo 'Running bench from ./tools/bench.sh' && echo -en 'travis_fold:start:bench'
- ./tools/bench.sh
- echo -en 'travis_fold:end:bench'
after_success: |
[ true ] &&
[ $TRAVIS_BRANCH = master ] &&
[ $TRAVIS_PULL_REQUEST = false ] &&
[ $TRAVIS_RUST_VERSION = stable ] &&
./tools/doc.sh &&
echo '' > target/doc/index.html &&
pip install --user ghp-import &&
/home/travis/.local/bin/ghp-import -n target/doc &&
git push -fq https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages
env:
global:
- CXX="g++-4.8"
- CC="gcc-4.8"
- secure: RPpiXGV2RgRNv/S5XICdym33pauO5PNQu06+0kIuap6acsT6rjWZDeKU0kXIkCyv7XGu6TAE3m1/N6DSFvoeObdoodzakpUnzI9ysC9UbGbX3KgFAILrsuD+Th0HR1yZ2+boXEnetl7lp87X6m3HL4dz7ccuRJOGQFCdzo4iQd4RXMJXq1nS8pXYOnOiGtWy/K6SBqHus42End303vR6ptd71iuEYmX2qL5LUpXRQ5JuvE78JL4v5e1jrLwwrIG5hr3ej+EICiEKjAtZcv3C/CYq2+V7T8mI8FQFBsVG56FxP1Qq0G1jnv6r8i/pLb342DiQapeQZ+CZ1vHv3Ruzxm4+T9VLkwIcI5kOZmbOjt/BnO1yHFMr6uslxYuyEvSLZXsvnB7Qi2cB/nFWxi8nk19CzuYy2hjrnDA/bfeii65oQ4hyqAuF6QvHgZtMmSONbea679b1mbl9K67EWt04J4k67Hfuj6HvmIOT3KF0TPXO6K4b6a4OJ43PinNSWtIOlCb4658HrfUBTUEe1XN14uC/F8dyFw8PTrw/VQKkmNEDRvI0AuWF1s+qN1u1mm+CpyJaqxcPloUR+RgVBk3KrRd/Gm6neunx07G6STv/S2mGCZ2ZRIUpbSqha7XTmHltoWZRYFeM3dhVMXe3hgEYuJfm4n7HxGvp4b1s1ckenPI=
- RUST_BACKTRACE=1
parity-bitcoin-ci-docker/Cargo.lock 0000664 0000000 0000000 00000213371 13447176222 0017575 0 ustar 00root root 0000000 0000000 [[package]]
name = "abstract-ns"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
"quick-error 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "aho-corasick"
version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"memchr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "ansi_term"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "app_dirs"
version = "1.2.1"
source = "git+https://github.com/paritytech/app-dirs-rs#0b37f9481ce29e9d5174ad185bca695b206368eb"
dependencies = [
"ole32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"shell32-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"xdg 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "arrayvec"
version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "atty"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "base58"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "base64"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "bencher"
version = "0.1.0"
dependencies = [
"byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"chain 0.1.0",
"db 0.1.0",
"network 0.1.0",
"primitives 0.1.0",
"storage 0.1.0",
"test-data 0.1.0",
"time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)",
"verification 0.1.0",
]
[[package]]
name = "bigint"
version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc_version 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "bit-vec"
version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "bitcrypto"
version = "0.1.0"
dependencies = [
"primitives 0.1.0",
"rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)",
"siphasher 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "bitflags"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "bitflags"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "bitflags"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "byteorder"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "bytes"
version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"iovec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "cc"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "cfg-if"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "chain"
version = "0.1.0"
dependencies = [
"bitcrypto 0.1.0",
"heapsize 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"primitives 0.1.0",
"rustc-hex 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serialization 0.1.0",
"serialization_derive 0.1.0",
]
[[package]]
name = "chrono"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "clap"
version = "2.27.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"atty 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
"strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"textwrap 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"vec_map 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"yaml-rust 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "crossbeam-deque"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"crossbeam-epoch 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "crossbeam-epoch"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"arrayvec 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
"scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "crossbeam-utils"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "csv"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"csv-core 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.21 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "csv-core"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "db"
version = "0.1.0"
dependencies = [
"bit-vec 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
"chain 0.1.0",
"elastic-array 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"lru-cache 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"primitives 0.1.0",
"rocksdb 0.4.5 (git+https://github.com/ethcore/rust-rocksdb)",
"serialization 0.1.0",
"storage 0.1.0",
"tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"test-data 0.1.0",
]
[[package]]
name = "display_derive"
version = "0.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)",
"synstructure 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "domain"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-core 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "dtoa"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "either"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "elastic-array"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"heapsize 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "env_logger"
version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"atty 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"termcolor 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "eth-secp256k1"
version = "0.5.7"
source = "git+https://github.com/ethcore/rust-secp256k1#6370d63adf4e8c91e2eae9225eef4b4e0294c5d0"
dependencies = [
"arrayvec 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"cc 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "fnv"
version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "fuchsia-zircon"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"fuchsia-zircon-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "fuchsia-zircon"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "fuchsia-zircon-sys"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "fuchsia-zircon-sys"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "futures"
version = "0.1.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "futures-cpupool"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "gcc"
version = "0.3.54"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rayon 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "getopts"
version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "globset"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"memchr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "heapsize"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "heapsize"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "httparse"
version = "1.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "hyper"
version = "0.11.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bytes 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
"futures-cpupool 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"httparse 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"mime 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"relay 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-core 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-proto 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"unicase 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "import"
version = "0.1.0"
dependencies = [
"chain 0.1.0",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"primitives 0.1.0",
"serialization 0.1.0",
]
[[package]]
name = "iovec"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "itoa"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "jsonrpc-core"
version = "8.0.0"
source = "git+https://github.com/ethcore/jsonrpc.git#0eba7e745b0895b4234cd8d89b28e10e2c3c34a4"
dependencies = [
"futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.21 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.21 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "jsonrpc-http-server"
version = "8.0.0"
source = "git+https://github.com/ethcore/jsonrpc.git#0eba7e745b0895b4234cd8d89b28e10e2c3c34a4"
dependencies = [
"hyper 0.11.7 (registry+https://github.com/rust-lang/crates.io-index)",
"jsonrpc-core 8.0.0 (git+https://github.com/ethcore/jsonrpc.git)",
"jsonrpc-server-utils 8.0.0 (git+https://github.com/ethcore/jsonrpc.git)",
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"net2 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)",
"unicase 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "jsonrpc-macros"
version = "8.0.0"
source = "git+https://github.com/ethcore/jsonrpc.git#0eba7e745b0895b4234cd8d89b28e10e2c3c34a4"
dependencies = [
"jsonrpc-core 8.0.0 (git+https://github.com/ethcore/jsonrpc.git)",
"jsonrpc-pubsub 8.0.0 (git+https://github.com/ethcore/jsonrpc.git)",
"serde 1.0.21 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "jsonrpc-pubsub"
version = "8.0.0"
source = "git+https://github.com/ethcore/jsonrpc.git#0eba7e745b0895b4234cd8d89b28e10e2c3c34a4"
dependencies = [
"jsonrpc-core 8.0.0 (git+https://github.com/ethcore/jsonrpc.git)",
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "jsonrpc-server-utils"
version = "8.0.0"
source = "git+https://github.com/ethcore/jsonrpc.git#0eba7e745b0895b4234cd8d89b28e10e2c3c34a4"
dependencies = [
"bytes 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
"globset 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"jsonrpc-core 8.0.0 (git+https://github.com/ethcore/jsonrpc.git)",
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-core 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "kernel32-sys"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "keys"
version = "0.1.0"
dependencies = [
"base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bitcrypto 0.1.0",
"eth-secp256k1 0.5.7 (git+https://github.com/ethcore/rust-secp256k1)",
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"primitives 0.1.0",
"rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-hex 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "language-tags"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "lazy_static"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "lazycell"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "libc"
version = "0.2.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "linked-hash-map"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "linked-hash-map"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "local-encoding"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"skeptic 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "log"
version = "0.3.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "log"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "logs"
version = "0.1.0"
dependencies = [
"ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "lru-cache"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"linked-hash-map 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "memchr"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "memchr"
version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "memoffset"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "message"
version = "0.1.0"
dependencies = [
"bitcrypto 0.1.0",
"byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"chain 0.1.0",
"network 0.1.0",
"primitives 0.1.0",
"serialization 0.1.0",
"serialization_derive 0.1.0",
]
[[package]]
name = "mime"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"unicase 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "miner"
version = "0.1.0"
dependencies = [
"bitcrypto 0.1.0",
"byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"chain 0.1.0",
"db 0.1.0",
"heapsize 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"keys 0.1.0",
"network 0.1.0",
"primitives 0.1.0",
"script 0.1.0",
"serialization 0.1.0",
"storage 0.1.0",
"test-data 0.1.0",
"verification 0.1.0",
]
[[package]]
name = "mio"
version = "0.6.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"fuchsia-zircon 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"fuchsia-zircon-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"iovec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"lazycell 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"net2 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)",
"slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "miow"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"net2 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "murmur3"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "net2"
version = "0.2.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "network"
version = "0.1.0"
dependencies = [
"chain 0.1.0",
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"primitives 0.1.0",
]
[[package]]
name = "nodrop"
version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "ns-dns-tokio"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"abstract-ns 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
"domain 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-core 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "num"
version = "0.1.42"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"num-integer 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)",
"num-iter 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "num-integer"
version = "0.1.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"num-traits 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "num-iter"
version = "0.1.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"num-integer 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "num-traits"
version = "0.1.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "num-traits"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "num_cpus"
version = "1.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "ole32-sys"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "owning_ref"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"stable_deref_trait 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "p2p"
version = "0.1.0"
dependencies = [
"abstract-ns 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
"bitcrypto 0.1.0",
"csv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
"futures-cpupool 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"message 0.1.0",
"network 0.1.0",
"ns-dns-tokio 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"primitives 0.1.0",
"rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"serialization 0.1.0",
"time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-core 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "parking_lot"
version = "0.4.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot_core 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "parking_lot_core"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "pbtc"
version = "0.1.0"
dependencies = [
"app_dirs 1.2.1 (git+https://github.com/paritytech/app-dirs-rs)",
"chain 0.1.0",
"clap 2.27.1 (registry+https://github.com/rust-lang/crates.io-index)",
"db 0.1.0",
"env_logger 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
"import 0.1.0",
"keys 0.1.0",
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"logs 0.1.0",
"message 0.1.0",
"miner 0.1.0",
"network 0.1.0",
"p2p 0.1.0",
"primitives 0.1.0",
"rpc 0.1.0",
"script 0.1.0",
"storage 0.1.0",
"sync 0.1.0",
"verification 0.1.0",
]
[[package]]
name = "percent-encoding"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "primitives"
version = "0.1.0"
dependencies = [
"bigint 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-hex 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "pulldown-cmark"
version = "0.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"getopts 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "quick-error"
version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "quote"
version = "0.3.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "rand"
version = "0.3.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rand"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rayon"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rayon-core 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rayon"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"either 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rayon-core 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rayon-core"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "redox_syscall"
version = "0.1.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "redox_termios"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"redox_syscall 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "regex"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
"memchr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "regex-syntax"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "relay"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rocksdb"
version = "0.4.5"
source = "git+https://github.com/ethcore/rust-rocksdb#4364caec4dd5da1a1d78c39276774ee65bf55c7d"
dependencies = [
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"local-encoding 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rocksdb-sys 0.3.0 (git+https://github.com/ethcore/rust-rocksdb)",
]
[[package]]
name = "rocksdb-sys"
version = "0.3.0"
source = "git+https://github.com/ethcore/rust-rocksdb#4364caec4dd5da1a1d78c39276774ee65bf55c7d"
dependencies = [
"gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rpc"
version = "0.1.0"
dependencies = [
"chain 0.1.0",
"db 0.1.0",
"jsonrpc-core 8.0.0 (git+https://github.com/ethcore/jsonrpc.git)",
"jsonrpc-http-server 8.0.0 (git+https://github.com/ethcore/jsonrpc.git)",
"jsonrpc-macros 8.0.0 (git+https://github.com/ethcore/jsonrpc.git)",
"keys 0.1.0",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"miner 0.1.0",
"network 0.1.0",
"p2p 0.1.0",
"primitives 0.1.0",
"rustc-hex 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"script 0.1.0",
"serde 1.0.21 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.21 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
"serialization 0.1.0",
"storage 0.1.0",
"sync 0.1.0",
"test-data 0.1.0",
"tokio-core 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
"verification 0.1.0",
]
[[package]]
name = "rust-crypto"
version = "0.2.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rustc-hex"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "rustc-serialize"
version = "0.3.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "rustc_version"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "safemem"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "scoped-tls"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "scopeguard"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "script"
version = "0.1.0"
dependencies = [
"bitcrypto 0.1.0",
"chain 0.1.0",
"keys 0.1.0",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"primitives 0.1.0",
"serialization 0.1.0",
]
[[package]]
name = "semver"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "semver-parser"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "serde"
version = "1.0.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "serde_derive"
version = "1.0.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive_internals 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "serde_derive_internals"
version = "0.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)",
"synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "serde_json"
version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"itoa 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.21 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "serialization"
version = "0.1.0"
dependencies = [
"byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"primitives 0.1.0",
]
[[package]]
name = "serialization_derive"
version = "0.1.0"
dependencies = [
"quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
"serialization 0.1.0",
"syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "shell32-sys"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "siphasher"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "skeptic"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"pulldown-cmark 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "slab"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "slab"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "smallvec"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "smallvec"
version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "stable_deref_trait"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "storage"
version = "0.1.0"
dependencies = [
"bit-vec 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
"chain 0.1.0",
"display_derive 0.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"elastic-array 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lru-cache 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"network 0.1.0",
"parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"primitives 0.1.0",
"serialization 0.1.0",
]
[[package]]
name = "strsim"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "syn"
version = "0.11.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
"synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "sync"
version = "0.1.0"
dependencies = [
"bit-vec 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
"bitcrypto 0.1.0",
"byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"chain 0.1.0",
"db 0.1.0",
"futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
"linked-hash-map 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"message 0.1.0",
"miner 0.1.0",
"murmur3 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"network 0.1.0",
"p2p 0.1.0",
"parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"primitives 0.1.0",
"rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"script 0.1.0",
"serialization 0.1.0",
"storage 0.1.0",
"test-data 0.1.0",
"time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)",
"verification 0.1.0",
]
[[package]]
name = "synom"
version = "0.11.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "synstructure"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "take"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "tempdir"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "termcolor"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"wincolor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "termion"
version = "1.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_syscall 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "test-data"
version = "0.1.0"
dependencies = [
"chain 0.1.0",
"primitives 0.1.0",
"script 0.1.0",
"serialization 0.1.0",
"time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "textwrap"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "thread_local"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "time"
version = "0.1.38"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_syscall 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "tokio-core"
version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bytes 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
"iovec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"mio 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)",
"scoped-tls 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"slab 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "tokio-io"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bytes 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "tokio-proto"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"net2 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)",
"slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"take 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-core 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "tokio-service"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "unicase"
version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"version_check 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "unicode-width"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "unicode-xid"
version = "0.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "unreachable"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "utf8-ranges"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "vec_map"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "verification"
version = "0.1.0"
dependencies = [
"bitcrypto 0.1.0",
"chain 0.1.0",
"db 0.1.0",
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"network 0.1.0",
"parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"primitives 0.1.0",
"rayon 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"script 0.1.0",
"serialization 0.1.0",
"storage 0.1.0",
"test-data 0.1.0",
"time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "version_check"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "void"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "winapi"
version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "winapi"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "winapi-build"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "winapi-i686-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "winapi-x86_64-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "wincolor"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "ws2_32-sys"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "xdg"
version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "yaml-rust"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
[metadata]
"checksum abstract-ns 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "2f451afbdf8ed8c8f8a98433055bb9a6b7a72aef4baff16227d2a43dd547f43b"
"checksum aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "500909c4f87a9e52355b26626d890833e9e1d53ac566db76c36faa984b889699"
"checksum ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "23ac7c30002a5accbf7e8987d0632fa6de155b7c3d39d0067317a391e00a2ef6"
"checksum app_dirs 1.2.1 (git+https://github.com/paritytech/app-dirs-rs)" = ""
"checksum arrayvec 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2f0ef4a9820019a0c91d918918c93dc71d469f581a49b47ddc1d285d4270bbe2"
"checksum atty 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "21e50800ec991574876040fff8ee46b136a53e985286fbe6a3bdfe6421b78860"
"checksum base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5024ee8015f02155eee35c711107ddd9a9bf3cb689cf2a9089c97e79b6e1ae83"
"checksum base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "96434f987501f0ed4eb336a411e0631ecd1afa11574fe148587adc4ff96143c9"
"checksum bigint 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "5d1b3ef6756498df0e2c6bb67c065f4154d0ecd721eb5b3c3f865c8012b9fd74"
"checksum bit-vec 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "02b4ff8b16e6076c3e14220b39fbc1fabb6737522281a388998046859400895f"
"checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d"
"checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5"
"checksum bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b3c30d3802dfb7281680d6285f2ccdaa8c2d8fee41f93805dba5c4cf50dc23cf"
"checksum byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff81738b726f5d099632ceaffe7fb65b90212e8dce59d518729e7e8634032d3d"
"checksum bytes 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d828f97b58cc5de3e40c421d0cf2132d6b2da4ee0e11b8632fa838f0f9333ad6"
"checksum cc 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a9b13a57efd6b30ecd6598ebdb302cca617930b5470647570468a65d12ef9719"
"checksum cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de"
"checksum chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7c20ebe0b2b08b0aeddba49c609fe7957ba2e33449882cb186a180bc60682fa9"
"checksum clap 2.27.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1b8c532887f1a292d17de05ae858a8fe50a301e196f9ef0ddb7ccd0d1d00f180"
"checksum crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f739f8c5363aca78cfb059edf753d8f0d36908c348f3d8d1503f03d8b75d9cf3"
"checksum crossbeam-epoch 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "927121f5407de9956180ff5e936fe3cf4324279280001cd56b669d28ee7e9150"
"checksum crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2760899e32a1d58d5abb31129f8fae5de75220bc2176e77ff7c627ae45c918d9"
"checksum csv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "71903184af9960c555e7f3b32ff17390d20ecaaf17d4f18c4a0993f2df8a49e3"
"checksum csv-core 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4dd8e6d86f7ba48b4276ef1317edc8cc36167546d8972feb4a2b5fec0b374105"
"checksum display_derive 0.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4bba5dcd6d2855639fcf65a9af7bbad0bfb6dbf6fe68fba70bab39a6eb973ef4"
"checksum domain 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c1850bf2c3c3349e1dba2aa214d86cf9edaa057a09ce46b1a02d5c07d5da5e65"
"checksum dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "09c3753c3db574d215cba4ea76018483895d7bff25a31b49ba45db21c48e50ab"
"checksum either 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "740178ddf48b1a9e878e6d6509a1442a2d42fd2928aae8e7a6f8a36fb01981b3"
"checksum elastic-array 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "058dc1040bbf28853bc48ec5f59190bac41b246c43c30064f0d318e6d1362fd6"
"checksum env_logger 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f15f0b172cb4f52ed5dbf47f774a387cd2315d1bf7894ab5af9b083ae27efa5a"
"checksum eth-secp256k1 0.5.7 (git+https://github.com/ethcore/rust-secp256k1)" = ""
"checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3"
"checksum fuchsia-zircon 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f6c0581a4e363262e52b87f59ee2afe3415361c6ec35e665924eb08afe8ff159"
"checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82"
"checksum fuchsia-zircon-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "43f3795b4bae048dc6123a6b972cadde2e676f9ded08aef6bb77f5f157684a82"
"checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"
"checksum futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "118b49cac82e04121117cbd3121ede3147e885627d82c4546b87c702debb90c1"
"checksum futures-cpupool 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "e86f49cc0d92fe1b97a5980ec32d56208272cbb00f15044ea9e2799dde766fdf"
"checksum gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)" = "5e33ec290da0d127825013597dbdfc28bee4964690c7ce1166cbc2a7bd08b1bb"
"checksum getopts 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)" = "65922871abd2f101a2eb0eaebadc66668e54a87ad9c3dd82520b5f86ede5eff9"
"checksum globset 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "90d069fe6beb9be359ef505650b3f73228c5591a3c4b1f32be2f4f44459ffa3a"
"checksum heapsize 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "556cd479866cf85c3f671209c85e8a6990211c916d1002c2fcb2e9b7cf60bc36"
"checksum heapsize 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "54fab2624374e5137ae4df13bf32b0b269cb804df42d13a51221bbd431d1a237"
"checksum httparse 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "af2f2dd97457e8fb1ae7c5a420db346af389926e36f43768b96f101546b04a07"
"checksum hyper 0.11.7 (registry+https://github.com/rust-lang/crates.io-index)" = "4959ca95f55df4265bff2ad63066147255e6fa733682cf6d1cb5eaff6e53324b"
"checksum iovec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b6e8b9c2247fcf6c6a1151f1156932be5606c9fd6f55a2d7f9fc1cb29386b2f7"
"checksum itoa 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8324a32baf01e2ae060e9de58ed0bc2320c9a2833491ee36cd3b4c414de4db8c"
"checksum jsonrpc-core 8.0.0 (git+https://github.com/ethcore/jsonrpc.git)" = ""
"checksum jsonrpc-http-server 8.0.0 (git+https://github.com/ethcore/jsonrpc.git)" = ""
"checksum jsonrpc-macros 8.0.0 (git+https://github.com/ethcore/jsonrpc.git)" = ""
"checksum jsonrpc-pubsub 8.0.0 (git+https://github.com/ethcore/jsonrpc.git)" = ""
"checksum jsonrpc-server-utils 8.0.0 (git+https://github.com/ethcore/jsonrpc.git)" = ""
"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
"checksum language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a"
"checksum lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c8f31047daa365f19be14b47c29df4f7c3b581832407daabe6ae77397619237d"
"checksum lazycell 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3b585b7a6811fb03aa10e74b278a0f00f8dd9b45dc681f148bb29fa5cb61859b"
"checksum libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "5ba3df4dcb460b9dfbd070d41c94c19209620c191b0340b929ce748a2bcd42d2"
"checksum linked-hash-map 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6d262045c5b87c0861b3f004610afd0e2c851e2908d08b6c870cbb9d5f494ecd"
"checksum linked-hash-map 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7860ec297f7008ff7a1e3382d7f7e1dcd69efc94751a2284bafc3d013c2aa939"
"checksum local-encoding 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e1ceb20f39ff7ae42f3ff9795f3986b1daad821caaa1e1732a0944103a5a1a66"
"checksum log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "880f77541efa6e5cc74e76910c9884d9859683118839d6a1dc3b11e63512565b"
"checksum log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "89f010e843f2b1a31dbd316b3b8d443758bc634bed37aabade59c686d644e0a2"
"checksum lru-cache 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4d06ff7ff06f729ce5f4e227876cb88d10bc59cd4ae1e09fbb2bde15c850dc21"
"checksum memchr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "148fab2e51b4f1cfc66da2a7c32981d1d3c083a803978268bb11fe4b86925e7a"
"checksum memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "796fba70e76612589ed2ce7f45282f5af869e0fdd7cc6199fa1aa1f1d591ba9d"
"checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3"
"checksum mime 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e2e00e17be181010a91dbfefb01660b17311059dc8c7f48b9017677721e732bd"
"checksum mio 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)" = "0e8411968194c7b139e9105bc4ae7db0bae232af087147e72f0616ebf5fdb9cb"
"checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919"
"checksum murmur3 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a9fbfc749b3a5d9c313c5e0cd61788f1f219ebd2f22de25996df0481c08949e4"
"checksum net2 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)" = "3a80f842784ef6c9a958b68b7516bc7e35883c614004dd94959a4dca1b716c09"
"checksum nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "9a2228dca57108069a5262f2ed8bd2e82496d2e074a06d1ccc7ce1687b6ae0a2"
"checksum ns-dns-tokio 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d13b872a5a65428c1d4628fa04391f5c05ba8a23d5ee3094e22284fdddebed86"
"checksum num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "4703ad64153382334aa8db57c637364c322d3372e097840c72000dabdcf6156e"
"checksum num-integer 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)" = "f8d26da319fb45674985c78f1d1caf99aa4941f785d384a2ae36d0740bc3e2fe"
"checksum num-iter 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "4b226df12c5a59b63569dd57fafb926d91b385dfce33d8074a412411b689d593"
"checksum num-traits 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "99843c856d68d8b4313b03a17e33c4bb42ae8f6610ea81b28abe076ac721b9b0"
"checksum num-traits 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e7de20f146db9d920c45ee8ed8f71681fd9ade71909b48c3acbd766aa504cf10"
"checksum num_cpus 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "514f0d73e64be53ff320680ca671b64fe3fb91da01e1ae2ddc99eb51d453b20d"
"checksum ole32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5d2c49021782e5233cd243168edfa8037574afed4eba4bbaf538b3d8d1789d8c"
"checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37"
"checksum parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "149d8f5b97f3c1133e3cfcd8886449959e856b557ff281e292b733d7c69e005e"
"checksum parking_lot_core 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "4f610cb9664da38e417ea3225f23051f589851999535290e077939838ab7a595"
"checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831"
"checksum pulldown-cmark 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8361e81576d2e02643b04950e487ec172b687180da65c731c03cf336784e6c07"
"checksum quick-error 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eda5fe9b71976e62bc81b781206aaa076401769b2143379d3eb2118388babac4"
"checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a"
"checksum rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)" = "15a732abf9d20f0ad8eeb6f909bf6868722d9a06e1e50802b6a70351f40b4eb1"
"checksum rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "eba5f8cb59cc50ed56be8880a5c7b496bfd9bd26394e176bc67884094145c2c5"
"checksum rayon 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b614fe08b6665cb9a231d07ac1364b0ef3cb3698f1239ee0c4c3a88a524f54c8"
"checksum rayon 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "80e811e76f1dbf68abf87a759083d34600017fc4e10b6bd5ad84a700f9dba4b1"
"checksum rayon-core 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9d24ad214285a7729b174ed6d3bcfcb80177807f959d95fafd5bfc5c4f201ac8"
"checksum redox_syscall 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)" = "8dde11f18c108289bef24469638a04dce49da56084f2d50618b226e47eb04509"
"checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76"
"checksum regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1731164734096285ec2a5ec7fea5248ae2f5485b3feeb0115af4fda2183b2d1b"
"checksum regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ad890a5eef7953f55427c50575c680c42841653abd2b028b68cd223d157f62db"
"checksum relay 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f301bafeb60867c85170031bdb2fcf24c8041f33aee09e7b116a58d4e9f781c5"
"checksum rocksdb 0.4.5 (git+https://github.com/ethcore/rust-rocksdb)" = ""
"checksum rocksdb-sys 0.3.0 (git+https://github.com/ethcore/rust-rocksdb)" = ""
"checksum rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)" = "f76d05d3993fd5f4af9434e8e436db163a12a9d40e1a58a726f27a01dfd12a2a"
"checksum rustc-hex 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d2b03280c2813907a030785570c577fb27d3deec8da4c18566751ade94de0ace"
"checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda"
"checksum rustc_version 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b9743a7670d88d5d52950408ecdb7c71d8986251ab604d4689dd2ca25c9bca69"
"checksum safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e27a8b19b835f7aea908818e871f5cc3a5a186550c30773be987e155e8163d8f"
"checksum scoped-tls 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f417c22df063e9450888a7561788e9bd46d3bb3c1466435b4eccb903807f147d"
"checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27"
"checksum semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a3186ec9e65071a2095434b1f5bb24838d4e8e130f584c790f6033c79943537"
"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
"checksum serde 1.0.21 (registry+https://github.com/rust-lang/crates.io-index)" = "6eda663e865517ee783b0891a3f6eb3a253e0b0dabb46418969ee9635beadd9e"
"checksum serde_derive 1.0.21 (registry+https://github.com/rust-lang/crates.io-index)" = "652bc323d694dc925829725ec6c890156d8e70ae5202919869cb00fe2eff3788"
"checksum serde_derive_internals 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "32f1926285523b2db55df263d2aa4eb69ddcfa7a7eade6430323637866b513ab"
"checksum serde_json 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "e4586746d1974a030c48919731ecffd0ed28d0c40749d0d18d43b3a7d6c9b20e"
"checksum shell32-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "72f20b8f3c060374edb8046591ba28f62448c369ccbdc7b02075103fb3a9e38d"
"checksum siphasher 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "833011ca526bd88f16778d32c699d325a9ad302fa06381cd66f7be63351d3f6d"
"checksum skeptic 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "24ebf8a06f5f8bae61ae5bbc7af7aac4ef6907ae975130faba1199e5fe82256a"
"checksum slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17b4fcaed89ab08ef143da37bc52adbcc04d4a69014f4c1208d6b51f0c47bc23"
"checksum slab 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fdeff4cd9ecff59ec7e3744cbca73dfe5ac35c2aedb2cfba8a1c715a18912e9d"
"checksum smallvec 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4c8cbcd6df1e117c2210e13ab5109635ad68a929fcbb8964dc965b76cb5ee013"
"checksum smallvec 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f90c5e5fe535e48807ab94fc611d323935f39d4660c52b26b96446a7b33aef10"
"checksum stable_deref_trait 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "15132e0e364248108c5e2c02e3ab539be8d6f5d52a01ca9bbf27ed657316f02b"
"checksum strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b4d15c810519a91cf877e7e36e63fe068815c678181439f2f29e2562147c3694"
"checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad"
"checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6"
"checksum synstructure 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3a761d12e6d8dcb4dcf952a7a89b475e3a9d69e4a69307e01a470977642914bd"
"checksum take 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b157868d8ac1f56b64604539990685fa7611d8fa9e5476cf0c02cf34d32917c5"
"checksum tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "87974a6f5c1dfb344d733055601650059a3363de2a6104819293baff662132d6"
"checksum termcolor 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9065bced9c3e43453aa3d56f1e98590b8455b341d2fa191a1090c0dd0b242c75"
"checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096"
"checksum textwrap 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c0b59b6b4b44d867f1370ef1bd91bfb262bf07bf0ae65c202ea2fbc16153b693"
"checksum thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "279ef31c19ededf577bfd12dfae728040a21f635b06a24cd670ff510edd38963"
"checksum time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)" = "d5d788d3aa77bc0ef3e9621256885555368b47bd495c13dd2e7413c89f845520"
"checksum tokio-core 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "c843a027f7c1df5f81e7734a0df3f67bf329411781ebf36393ce67beef6071e3"
"checksum tokio-io 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "514aae203178929dbf03318ad7c683126672d4d96eccb77b29603d33c9e25743"
"checksum tokio-proto 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8fbb47ae81353c63c487030659494b295f6cb6576242f907f203473b191b0389"
"checksum tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "24da22d077e0f15f55162bdbdc661228c1581892f52074fb242678d015b45162"
"checksum unicase 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "284b6d3db520d67fbe88fd778c21510d1b0ba4a551e5d0fbb023d33405f6de8a"
"checksum unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "bf3a113775714a22dcb774d8ea3655c53a32debae63a063acc00a91cc586245f"
"checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc"
"checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56"
"checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122"
"checksum vec_map 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "887b5b631c2ad01628bbbaa7dd4c869f80d3186688f8d0b6f58774fbe324988c"
"checksum version_check 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6b772017e347561807c1aa192438c5fd74242a670a6cffacc40f2defd1dc069d"
"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
"checksum winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "04e3bd221fcbe8a271359c04f21a76db7d0c6028862d1bb5512d85e1e2eb5bb3"
"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
"checksum wincolor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0878187fa88838d2006c0a76f30d64797098426245b375383f60acb6aed8a203"
"checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e"
"checksum xdg 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a66b7c2281ebde13cf4391d70d4c7e5946c3c25e72a7b859ca8f677dcd0b0c61"
"checksum yaml-rust 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e66366e18dc58b46801afbf2ca7661a9f59cc8c5962c29892b6039b4f86fa992"
parity-bitcoin-ci-docker/Cargo.toml 0000664 0000000 0000000 00000001666 13447176222 0017622 0 ustar 00root root 0000000 0000000 [package]
name = "pbtc"
version = "0.1.0"
license = "GPL-3.0"
authors = ["Parity Technologies "]
description = "Parity bitcoin client."
[dependencies]
log = "0.4"
env_logger = "0.5"
app_dirs = { git = "https://github.com/paritytech/app-dirs-rs" }
libc = "0.2"
clap = { version = "2", features = ["yaml"] }
chain = { path = "chain" }
keys = { path = "keys" }
message = { path = "message" }
network = { path = "network" }
miner = { path = "miner" }
p2p = { path = "p2p" }
script = { path = "script" }
storage = { path = "storage" }
db = { path = "db" }
verification = { path = "verification" }
sync = { path = "sync" }
import = { path = "import" }
logs = { path = "logs" }
rpc = { path = "rpc" }
primitives = { path = "primitives" }
[profile.dev]
debug = true
panic = 'abort'
[profile.release]
debug = true
panic = 'abort'
[profile.test]
debug = true
[[bin]]
path = "pbtc/main.rs"
name = "pbtc"
[workspace]
members = ["bencher"]
parity-bitcoin-ci-docker/LICENSE 0000664 0000000 0000000 00000104505 13447176222 0016673 0 ustar 00root root 0000000 0000000 GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{one line to give the program's name and a brief idea of what it does.}
Copyright (C) {year} {name of author}
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
{project} Copyright (C) {year} {fullname}
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
.
parity-bitcoin-ci-docker/README.md 0000664 0000000 0000000 00000031370 13447176222 0017144 0 ustar 00root root 0000000 0000000 # The Parity Bitcoin client.
[![Build Status][travis-image]][travis-url] [![Snap Status](https://build.snapcraft.io/badge/paritytech/parity-bitcoin.svg)](https://build.snapcraft.io/user/paritytech/parity-bitcoin)
Gitter [![Gitter https://gitter.im/paritytech/parity-bitcoin](https://badges.gitter.im/paritytech/parity-bitcoin.svg)](https://gitter.im/paritytech/parity-bitcoin)
- [Installing from source](#installing-from-source)
- [Installing the snap](#installing-the-snap)
- [Running tests](#running-tests)
- [Going online](#going-online)
- [Importing bitcoind database](#importing-bitcoind-database)
- [Command line interface](#command-line-interface)
- [JSON-RPC](#json-rpc)
- [Logging](#logging)
- [Internal Documentation](#internal-documentation)
- [Project Graph][graph]
[graph]: ./tools/graph.svg
[travis-image]: https://travis-ci.com/paritytech/parity-bitcoin.svg?token=DMFvZu71iaTbUYx9UypX&branch=master
[travis-url]: https://travis-ci.com/paritytech/parity-bitcoin
[doc-url]: https://paritytech.github.io/parity-bitcoin/pbtc/index.html
## Installing from source
Installing `pbtc` from source requires `rustc` and `cargo`.
Minimal supported version is `rustc 1.23.0 (766bd11c8 2018-01-01)`
#### Install rustc and cargo
Both `rustc` and `cargo` are a part of rust tool-chain.
An easy way to install the stable binaries for Linux and Mac is to run this in your shell:
```
curl -sSf https://static.rust-lang.org/rustup.sh | sh
```
Windows binaries can be downloaded from [rust-lang website](https://www.rust-lang.org/en-US/downloads.html).
#### Install C and C++ compilers
You will need the cc and gcc compilers to build some of the dependencies.
```
sudo apt-get update
sudo apt-get install build-essential
```
#### Clone and build pbtc
Now let's clone `pbtc` and enter it's directory:
```
git clone https://github.com/paritytech/parity-bitcoin
cd parity-bitcoin
```
`pbtc` can be build in two modes. `--debug` and `--release`. Debug is the default.
```
# builds pbtc in debug mode
cargo build -p pbtc
```
```
# builds pbtc in release mode
cargo build -p pbtc --release
```
`pbtc` is now available at either `./target/debug/pbtc` or `./target/release/pbtc`.
## Installing the snap
In any of the [supported Linux distros](https://snapcraft.io/docs/core/install):
```
sudo snap install parity-bitcoin --edge
```
## Running tests
`pbtc` has internal unit tests and it conforms to external integration tests.
#### Running unit tests
Assuming that repository is already cloned, we can run unit tests with this command:
```
cargo test --all
```
#### Running external integration tests
Running integration tests is automated, as the regtests repository is one of the submodules. Let's download it first:
```
git submodule update --init
```
Now we can run them:
```
./tools/regtests.sh
```
It's also possible to run regtests manually:
```
# let's start pbtc in regtest compatible mode
./target/release/pbtc --btc --regtest
# now in second shell window
cd $HOME
git clone https://github.com/TheBlueMatt/test-scripts
cd test-scripts
java -jar pull-tests-f56eec3.jar
```
## Going online
By default parity connects to bitcoind-seednodes. Full list is [here](./pbtc/seednodes.rs).
Before starting synchronization, you must decide - which fork to follow - Bitcoin Core (`--btc` flag) or Bitcoin Cash (`--bch` flag). On next start, passing the same flag is optional, as the database is already bound to selected fork and won't be synchronized using other verification rules.
To start syncing the main network, just start the client, passing selected fork flag. For example:
```
./target/release/pbtc --btc
```
To start syncing the testnet:
```
./target/release/pbtc --btc --testnet
```
To not print any syncing progress add `--quiet` flag:
```
./target/release/pbtc --btc --quiet
```
## Importing bitcoind database
It it is possible to import existing `bitcoind` database:
```
# where $BITCOIND_DB is path to your bitcoind database, e.g., "/Users/user/Library/Application Support"
./target/release/pbtc import "$BITCOIND_DB/Bitcoin/blocks"
```
By default import verifies imported the blocks. You can disable this, by adding `--verification-level==none` flag.
```
./target/release/pbtc import "#BITCOIND_DB/Bitcoin/blocks" --btc --skip-verification
```
## Command line interface
Full list of CLI options, which is available under `pbtc --help`:
```
pbtc 0.1.0
Parity Technologies
Parity Bitcoin client
USAGE:
pbtc [FLAGS] [OPTIONS] [SUBCOMMAND]
FLAGS:
--bch Use Bitcoin Cash verification rules (BCH).
--btc Use Bitcoin Core verification rules (BTC).
-h, --help Prints help information
--no-jsonrpc Disable the JSON-RPC API server.
-q, --quiet Do not show any synchronization information in the console.
--regtest Use a private network for regression tests.
--testnet Use the test network (Testnet3).
-V, --version Prints version information
OPTIONS:
--blocknotify Execute COMMAND when the best block changes (%s in COMMAND is replaced by the block hash).
-c, --connect Connect only to the specified node.
-d, --data-dir Specify the database and configuration directory PATH.
--db-cache Sets the database cache size.
--jsonrpc-apis Specify the APIs available through the JSONRPC interface. APIS is a comma-delimited list of API names.
--jsonrpc-cors Specify CORS header for JSON-RPC API responses.
--jsonrpc-hosts List of allowed Host header values.
--jsonrpc-interface The hostname portion of the JSONRPC API server.
--jsonrpc-port Specify the PORT for the JSONRPC API server.
--only-net Only connect to nodes in network version (ipv4 or ipv6).
--port Listen for connections on PORT.
-s, --seednode Connect to a seed-node to retrieve peer addresses, and disconnect.
--verification-edge Non-default verification-level is applied until a block with given hash is met.
--verification-level Sets the Blocks verification level to full (default), header (scripts are not verified), or none (no verification at all).
SUBCOMMANDS:
help Prints this message or the help of the given subcommand(s)
import Import blocks from a Bitcoin Core database.
rollback Rollback the database to given canonical-chain block.
```
## JSON-RPC
The JSON-RPC interface is served on port :8332 for mainnet and :18332 for testnet unless you specified otherwise. So if you are using testnet, you will need to change the port in the sample curl requests shown below.
#### Network
The Parity-bitcoin `network` interface.
##### addnode
Add the node.
curl -H 'content-type: application/json' --data-binary '{"jsonrpc": "2.0", "method": "addnode", "params": ["127.0.0.1:8888", "add"], "id":1 }' localhost:8332
Remove the node.
curl -H 'content-type: application/json' --data-binary '{"jsonrpc": "2.0", "method": "addnode", "params": ["127.0.0.1:8888", "remove"], "id":1 }' localhost:8332
Connect to the node.
curl -H 'content-type: application/json' --data-binary '{"jsonrpc": "2.0", "method": "addnode", "params": ["127.0.0.1:8888", "onetry"], "id":1 }' localhost:8332
##### getaddednodeinfo
Query info for all added nodes.
curl -H 'content-type: application/json' --data-binary '{"jsonrpc": "2.0", "id":"1", "method": "getaddednodeinfo", "params": [true] }' localhost:8332
Query info for the specified node.
curl -H 'content-type: application/json' --data-binary '{"jsonrpc": "2.0", "id":"1", "method": "getaddednodeinfo", "params": [true, "192.168.0.201"] }' localhost:8332
##### getconnectioncount
Get the peer count.
curl -H 'content-type: application/json' --data-binary '{"jsonrpc": "2.0", "id":"1", "method": "getconnectioncount", "params": [] }' localhost:8332
#### Blockchain
The Parity-bitcoin `blockchain` data interface.
##### getbestblockhash
Get hash of best block.
curl -H 'content-type: application/json' --data-binary '{"jsonrpc": "2.0", "method": "getbestblockhash", "params": [], "id":1 }' localhost:8332
##### getblockcount
Get height of best block.
curl -H 'content-type: application/json' --data-binary '{"jsonrpc": "2.0", "method": "getblockcount", "params": [], "id":1 }' localhost:8332
##### getblockhash
Get hash of block at given height.
curl -H 'content-type: application/json' --data-binary '{"jsonrpc": "2.0", "method": "getblockhash", "params": [0], "id":1 }' localhost:8332
##### getdifficulty
Get proof-of-work difficulty as a multiple of the minimum difficulty
curl -H 'content-type: application/json' --data-binary '{"jsonrpc": "2.0", "method": "getdifficulty", "params": [], "id":1 }' localhost:8332
##### getblock
Get information on given block.
curl -H 'content-type: application/json' --data-binary '{"jsonrpc": "2.0", "method": "getblock", "params": ["000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f"], "id":1 }' localhost:8332
##### gettxout
Get details about an unspent transaction output.
curl -H 'content-type: application/json' --data-binary '{"jsonrpc": "2.0", "method": "gettxout", "params": ["4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b", 0], "id":1 }' localhost:8332
##### gettxoutsetinfo
Get statistics about the unspent transaction output set.
curl -H 'content-type: application/json' --data-binary '{"jsonrpc": "2.0", "method": "gettxoutsetinfo", "params": [], "id":1 }' localhost:8332
#### Miner
The Parity-bitcoin `miner` data interface.
##### getblocktemplate
Get block template for mining.
curl -H 'content-type: application/json' --data-binary '{"jsonrpc": "2.0", "method": "getblocktemplate", "params": [{"capabilities": ["coinbasetxn", "workid", "coinbase/append"]}], "id":1 }' localhost:8332
#### Raw
The Parity-bitcoin `raw` data interface.
##### getrawtransaction
Return the raw transaction data.
curl -H 'content-type: application/json' --data-binary '{"jsonrpc": "2.0", "method": "getrawtransaction", "params": ["4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"], "id":1 }' localhost:8332
##### decoderawtransaction
Return an object representing the serialized, hex-encoded transaction.
curl -H 'content-type: application/json' --data-binary '{"jsonrpc": "2.0", "method": "decoderawtransaction", "params": ["01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000"], "id":1 }' localhost:8332
##### createrawtransaction
Create a transaction spending the given inputs and creating new outputs.
curl -H 'content-type: application/json' --data-binary '{"jsonrpc": "2.0", "method": "createrawtransaction", "params": [[{"txid":"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b","vout":0}],{"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa":0.01}], "id":1 }' localhost:8332
##### sendrawtransaction
Adds transaction to the memory pool && relays it to the peers.
curl -H 'content-type: application/json' --data-binary '{"jsonrpc": "2.0", "method": "sendrawtransaction", "params": ["01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000"], "id":1 }' localhost:8332
## Logging
This is a section only for developers and power users.
You can enable detailed client logging by setting the environment variable `RUST_LOG`, e.g.,
```
RUST_LOG=verification=info ./target/release/pbtc --btc
```
`pbtc` started with this environment variable will print all logs coming from `verification` module with verbosity `info` or higher. Available log levels are:
- `error`
- `warn`
- `info`
- `debug`
- `trace`
It's also possible to start logging from multiple modules in the same time:
```
RUST_LOG=sync=trace,p2p=trace,verification=trace,db=trace ./target/release/pbtc --btc
```
## Internal documentation
Once released, `pbtc` documentation will be available [here][doc-url]. Meanwhile it's only possible to build it locally:
```
cd parity-bitcoin
./tools/doc.sh
open target/doc/pbtc/index.html
```
parity-bitcoin-ci-docker/bencher/ 0000775 0000000 0000000 00000000000 13447176222 0017267 5 ustar 00root root 0000000 0000000 parity-bitcoin-ci-docker/bencher/Cargo.toml 0000664 0000000 0000000 00000000741 13447176222 0021221 0 ustar 00root root 0000000 0000000 [package]
name = "bencher"
version = "0.1.0"
license = "GPL-3.0"
authors = ["Ethcore "]
description = "Parity bitcoin client."
[dependencies]
storage = { path = "../storage" }
db = { path = "../db" }
verification = { path = "../verification" }
network = { path = "../network" }
chain = { path = "../chain" }
primitives = { path = "../primitives" }
test-data = { path = "../test-data" }
time = "*"
byteorder = "1.0"
[[bin]]
path = "src/main.rs"
name = "bencher"
parity-bitcoin-ci-docker/bencher/src/ 0000775 0000000 0000000 00000000000 13447176222 0020056 5 ustar 00root root 0000000 0000000 parity-bitcoin-ci-docker/bencher/src/database.rs 0000664 0000000 0000000 00000015201 13447176222 0022167 0 ustar 00root root 0000000 0000000 use chain::IndexedBlock;
use storage::{BlockProvider, BlockRef, BlockOrigin, ForkChain};
use db::BlockChainDatabase;
use test_data;
use super::Benchmark;
pub fn fetch(benchmark: &mut Benchmark) {
// params
const BLOCKS: usize = 1000;
benchmark.samples(BLOCKS);
// test setup
let genesis: IndexedBlock = test_data::genesis().into();
let store = BlockChainDatabase::init_test_chain(vec![genesis.clone()]);
let mut rolling_hash = genesis.hash().clone();
let mut blocks = Vec::new();
let mut hashes = Vec::new();
for x in 0..BLOCKS {
let next_block = test_data::block_builder()
.transaction()
.coinbase()
.lock_time(x as u32)
.output().value(5000000000).build()
.build()
.merkled_header().parent(rolling_hash.clone()).nonce(x as u32).build()
.build();
rolling_hash = next_block.hash();
blocks.push(next_block);
hashes.push(rolling_hash.clone());
}
for block in blocks.into_iter() {
let block: IndexedBlock = block.into();
let hash = block.hash().clone();
store.insert(block).unwrap();
store.canonize(&hash).unwrap();
}
// bench
benchmark.start();
for _ in 0..BLOCKS {
let block = store.block(BlockRef::Hash(hashes[0].clone())).unwrap();
assert_eq!(&block.hash(), &hashes[0]);
}
benchmark.stop();
}
pub fn write(benchmark: &mut Benchmark) {
// params
const BLOCKS: usize = 1000;
benchmark.samples(BLOCKS);
// setup
let genesis: IndexedBlock = test_data::genesis().into();
let store = BlockChainDatabase::init_test_chain(vec![genesis.clone()]);
let mut rolling_hash = genesis.hash().clone();
let mut blocks: Vec = Vec::new();
for x in 0..BLOCKS {
let next_block = test_data::block_builder()
.transaction()
.coinbase()
.lock_time(x as u32)
.output().value(5000000000).build()
.build()
.merkled_header().parent(rolling_hash.clone()).nonce(x as u32).build()
.build();
rolling_hash = next_block.hash();
blocks.push(next_block.into());
}
// bench
benchmark.start();
for block in blocks {
let hash = block.hash().clone();
store.insert(block).unwrap();
store.canonize(&hash).unwrap();
}
benchmark.stop();
}
pub fn reorg_short(benchmark: &mut Benchmark) {
// params
const BLOCKS: usize = 1000;
benchmark.samples(BLOCKS);
// setup
let genesis: IndexedBlock = test_data::genesis().into();
let store = BlockChainDatabase::init_test_chain(vec![genesis.clone()]);
let mut rolling_hash = genesis.hash().clone();
let mut blocks = Vec::new();
for x in 0..BLOCKS {
let base = rolling_hash.clone();
let next_block = test_data::block_builder()
.transaction()
.coinbase()
.lock_time(x as u32)
.output().value(5000000000).build()
.build()
.merkled_header().parent(rolling_hash.clone()).nonce(x as u32 * 4).build()
.build();
rolling_hash = next_block.hash();
blocks.push(next_block);
let next_block_side = test_data::block_builder()
.transaction()
.coinbase()
.lock_time(x as u32)
.output().value(5000000000).build()
.build()
.merkled_header().parent(base).nonce(x as u32 * 4 + 2).build()
.build();
let next_base = next_block_side.hash();
blocks.push(next_block_side);
let next_block_side_continue = test_data::block_builder()
.transaction()
.coinbase()
.lock_time(x as u32)
.output().value(5000000000).build()
.build()
.merkled_header().parent(next_base).nonce(x as u32 * 4 + 3).build()
.build();
blocks.push(next_block_side_continue);
let next_block_continue = test_data::block_builder()
.transaction()
.coinbase()
.lock_time(x as u32)
.output().value(5000000000).build()
.build()
.merkled_header().parent(rolling_hash.clone()).nonce(x as u32 * 4 + 1).build()
.build();
rolling_hash = next_block_continue.hash();
blocks.push(next_block_continue);
}
let mut total: usize = 0;
let mut reorgs: usize = 0;
// bench
benchmark.start();
for idx in 0..BLOCKS {
total += 1;
let block: IndexedBlock = blocks[idx].clone().into();
let hash = block.hash().clone();
match store.block_origin(&block.header).unwrap() {
BlockOrigin::KnownBlock => {
unreachable!();
},
BlockOrigin::CanonChain { .. } => {
store.insert(block).unwrap();
store.canonize(&hash).unwrap();
},
BlockOrigin::SideChain(_origin) => {
store.insert(block).unwrap();
},
BlockOrigin::SideChainBecomingCanonChain(origin) => {
reorgs += 1;
let fork = store.fork(origin).unwrap();
fork.store().insert(block).unwrap();
fork.store().canonize(&hash).unwrap();
store.switch_to_fork(fork).unwrap();
},
}
}
benchmark.stop();
// reorgs occur twice per iteration except last one where there only one, blocks are inserted with rate 4/iteration
// so reorgs = total/2 - 1
assert_eq!(1000, total);
assert_eq!(499, reorgs);
}
// 1. write 12000 blocks
// 2. write 100 blocks that has 100 transaction each spending outputs from first 1000 blocks
pub fn write_heavy(benchmark: &mut Benchmark) {
// params
const BLOCKS_INITIAL: usize = 12000;
const BLOCKS: usize = 100;
const TRANSACTIONS: usize = 100;
benchmark.samples(BLOCKS);
// test setup
let genesis: IndexedBlock = test_data::genesis().into();
let store = BlockChainDatabase::init_test_chain(vec![genesis.clone()]);
let mut rolling_hash = genesis.hash().clone();
let mut blocks = Vec::new();
let mut hashes = Vec::new();
for x in 0..BLOCKS_INITIAL {
let next_block = test_data::block_builder()
.transaction()
.coinbase()
.lock_time(x as u32)
.output().value(5000000000).build()
.build()
.merkled_header().parent(rolling_hash.clone()).nonce(x as u32).build()
.build();
rolling_hash = next_block.hash();
blocks.push(next_block);
hashes.push(rolling_hash.clone());
}
for b in 0..BLOCKS {
let mut builder = test_data::block_builder()
.transaction().coinbase().build();
for t in 0..TRANSACTIONS {
builder = builder.transaction()
.input().hash(blocks[b*TRANSACTIONS+t].transactions()[0].hash()).build() // default index is 0 which is ok
.output().value(1000).build()
.build();
}
let next_block = builder.merkled_header().parent(rolling_hash).build().build();
rolling_hash = next_block.hash();
blocks.push(next_block);
hashes.push(rolling_hash.clone());
}
for block in blocks[..BLOCKS_INITIAL].iter() {
let block: IndexedBlock = block.clone().into();
let hash = block.hash().clone();
store.insert(block).expect("cannot insert initial block");
store.canonize(&hash).unwrap();
}
// bench
benchmark.start();
for block in blocks[BLOCKS_INITIAL..].iter() {
let block: IndexedBlock = block.clone().into();
let hash = block.hash().clone();
store.insert(block).expect("cannot insert bench block");
store.canonize(&hash).unwrap();
}
benchmark.stop();
}
parity-bitcoin-ci-docker/bencher/src/main.rs 0000664 0000000 0000000 00000003477 13447176222 0021363 0 ustar 00root root 0000000 0000000 extern crate storage;
extern crate db;
extern crate chain;
extern crate test_data;
extern crate time;
extern crate verification;
extern crate network;
extern crate byteorder;
extern crate primitives;
mod database;
mod verifier;
use time::{PreciseTime, Duration};
use std::io::Write;
use std::str;
#[derive(Default)]
pub struct Benchmark {
start: Option,
end: Option,
samples: Option,
}
impl Benchmark {
pub fn start(&mut self) {
self.start = Some(PreciseTime::now());
}
pub fn stop(&mut self) {
self.end = Some(PreciseTime::now());
}
pub fn evaluate(&self) -> Duration {
self.start.expect("benchmarch never ended").to(self.end.expect("benchmark never started"))
}
pub fn samples(&mut self, samples: usize) {
self.samples = Some(samples);
}
}
fn decimal_mark(s: String) -> String {
let bytes: Vec<_> = s.bytes().rev().collect();
let chunks: Vec<_> = bytes.chunks(3).map(|chunk| str::from_utf8(chunk).unwrap()).collect();
let result: Vec<_> = chunks.join(",").bytes().rev().collect();
String::from_utf8(result).unwrap()
}
fn run_benchmark(name: &str, f: F) where F: FnOnce(&mut Benchmark) {
print!("{}: ", name);
::std::io::stdout().flush().unwrap();
let mut benchmark = Benchmark::default();
f(&mut benchmark);
if let Some(samples) = benchmark.samples {
println!("{} ns/sample",
decimal_mark(format!("{}", benchmark.evaluate().num_nanoseconds().unwrap() / samples as i64)),
);
}
else {
println!("{} ns", decimal_mark(format!("{}", benchmark.evaluate().num_nanoseconds().unwrap())));
}
}
macro_rules! benchmark {
($t:expr) => {
run_benchmark(stringify!($t), $t);
};
}
fn main() {
benchmark!(database::fetch);
benchmark!(database::write);
benchmark!(database::reorg_short);
benchmark!(database::write_heavy);
benchmark!(verifier::main);
}
parity-bitcoin-ci-docker/bencher/src/verifier.rs 0000664 0000000 0000000 00000006013 13447176222 0022237 0 ustar 00root root 0000000 0000000 use std::sync::Arc;
use db::BlockChainDatabase;
use chain::IndexedBlock;
use verification::{BackwardsCompatibleChainVerifier as ChainVerifier, Verify, VerificationLevel};
use network::{Network, ConsensusParams, ConsensusFork};
use test_data;
use byteorder::{LittleEndian, ByteOrder};
use super::Benchmark;
// 1. write BLOCKS_INITIAL blocks with 1 transaction each
// 2. verify blocks that has transaction each with output each,
// spending outputs from last blocks
pub fn main(benchmark: &mut Benchmark) {
// params
const BLOCKS_INITIAL: usize = 200200;
const BLOCKS: usize = 10;
const TRANSACTIONS: usize = 2000;
const OUTPUTS: usize = 10;
benchmark.samples(BLOCKS);
assert!(BLOCKS_INITIAL - 100 > BLOCKS * OUTPUTS * TRANSACTIONS,
"There will be not enough initial blocks to continue this bench");
// test setup
let genesis = test_data::genesis();
let mut rolling_hash = genesis.hash();
let mut blocks: Vec = Vec::new();
for x in 0..BLOCKS_INITIAL {
let mut coinbase_nonce = [0u8;8];
LittleEndian::write_u64(&mut coinbase_nonce[..], x as u64);
let next_block = test_data::block_builder()
.transaction()
.lock_time(x as u32)
.input()
.coinbase()
.signature_bytes(coinbase_nonce.to_vec().into())
.build()
.output().value(5000000000).build()
.build()
.merkled_header()
.parent(rolling_hash.clone())
.nonce(x as u32)
.build()
.build();
rolling_hash = next_block.hash();
blocks.push(next_block.into());
}
let store = Arc::new(BlockChainDatabase::init_test_chain(vec![genesis.clone().into()]));
for block in blocks.iter() {
let hash = block.hash().clone();
store.insert(block.clone()).unwrap();
store.canonize(&hash).unwrap();
}
let mut verification_blocks: Vec = Vec::new();
for b in 0..BLOCKS {
let mut coinbase_nonce = [0u8;8];
LittleEndian::write_u64(&mut coinbase_nonce[..], (b + BLOCKS_INITIAL) as u64);
let mut builder = test_data::block_builder()
.transaction()
.lock_time(b as u32)
.input().coinbase().signature_bytes(coinbase_nonce.to_vec().into()).build()
.output().value(5000000000).build()
.build();
for t in 0..TRANSACTIONS {
let mut tx_builder = builder.transaction();
for o in 0..OUTPUTS {
let parent_hash = blocks[(b*TRANSACTIONS*OUTPUTS + t * OUTPUTS + o)].transactions[0].hash.clone();
tx_builder = tx_builder
.input()
.hash(parent_hash)
.index(0)
.build()
}
builder = tx_builder.output().value(0).build().build()
}
verification_blocks.push(
builder
.merkled_header()
.parent(rolling_hash.clone())
.build()
.build()
.into());
}
assert_eq!(store.best_block().hash, rolling_hash);
let chain_verifier = ChainVerifier::new(store.clone(), ConsensusParams::new(Network::Unitest, ConsensusFork::BitcoinCore));
// bench
benchmark.start();
for block in verification_blocks.iter() {
chain_verifier.verify(VerificationLevel::Full, block).unwrap();
}
benchmark.stop();
}
parity-bitcoin-ci-docker/chain/ 0000775 0000000 0000000 00000000000 13447176222 0016743 5 ustar 00root root 0000000 0000000 parity-bitcoin-ci-docker/chain/Cargo.toml 0000664 0000000 0000000 00000000502 13447176222 0020670 0 ustar 00root root 0000000 0000000 [package]
name = "chain"
version = "0.1.0"
authors = ["debris "]
[dependencies]
rustc-hex = "2"
heapsize = "0.4"
bitcrypto = { path = "../crypto" }
primitives = { path = "../primitives" }
serialization = { path = "../serialization" }
serialization_derive = { path = "../serialization_derive" }
parity-bitcoin-ci-docker/chain/README.md 0000664 0000000 0000000 00000040635 13447176222 0020232 0 ustar 00root root 0000000 0000000 # Chain
In this crate, you will find the structures and functions that make up the blockchain, Bitcoin's core data structure.
## Conceptual Overview
Here we will dive deep into how the blockchain is created, organized, etc. as a preface for understanding the code in this crate.
We will cover the following concepts:
* Blockchain
* Block
* Block Header
* Merkle Tree
* Transaction
* Witnesses and SegWit
* Coinbase
### Blockchain
So what is a blockchain? A blockchain is a *chain* of *blocks*...
![mind blown gif](https://media.giphy.com/media/OK27wINdQS5YQ/giphy.gif)
Yep, actually.
### Block
The real question is, what is a [block](https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch09.asciidoc#structure-of-a-block)?
A block is a data structure with two fields:
* **Block header:** a data structure containing the block's metadata
* **Transactions:** an array ([vector](https://doc.rust-lang.org/book/second-edition/ch08-01-vectors.html) in rust) of transactions
![Blockchain diagram](https://raw.githubusercontent.com/pluralsight/guides/master/images/8cd8b94f-d05f-41e8-a0f1-70853f390094.png)
### Block Header
So what is a [block header](https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch09.asciidoc#block-header)?
A block header is a data structure with the following fields:
* **Version:** indicates which set of block validation rules to follow
* **Previous Header Hash:** a reference to the parent/previous block in the blockchain
* **Merkle Root Hash:** a hash (root hash) of the merkle tree data structure containing a block's transactions
* **Time:** a timestamp (seconds from Unix Epoch)
* **Bits:** aka the difficulty target for this block
* **Nonce:** value used in proof-of-work
![Block header diagram](https://i.stack.imgur.com/BiaJK.png)
*How are blocks chained together?* They are chained together via the backwards reference (previous header hash) present in the block header. Each block points backwards to its parent, all the way back to the [genesis block](https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch09.asciidoc#the-genesis-block) (the first block in the Bitcoin blockchain that is hard coded into all clients).
### Merkle Root
*What is a Merkle Root?* A merkle root is the root of a merkle tree. As best stated in *Mastering Bitcoin*:
> A _merkle tree_, also known as a _binary hash tree_, is a data
> structure used for efficiently summarizing and verifying the integrity of large sets of data.
In a merkle tree, all the data, in this case transactions, are leaves in the tree. Each of these is hashed and concatenated with its sibling... all the way up the tree until you are left with a single *root* hash (the merkle root hash).
![Merkle tree](https://upload.wikimedia.org/wikipedia/commons/9/95/Hash_Tree.svg)
### Transaction
According to [Mastering Bitcoin](https://github.com/bitcoinbook/bitcoinbook/) :
> Transactions are the most important part of the bitcoin system. Everything else in bitcoin is designed to ensure that transactions can created, propagated on the network, validated, and finally added to the global ledger of transactions (the blockchain).
At its most basic level, a transaction is an encoded data structure that facilitates the transfer of value between two public key addresses on the Bitcoin blockchain.
The most fundamental building block of a transaction is a `transaction output` -- the bitcoin you own in your "wallet" is in fact a subset of `unspent transaction outputs` or `UTXO's` of the global `UTXO set`. `UTXOs` are indivisible, discrete units of value which can only be consumed in their entirety. Thus, if I want to send you 1 BTC and I only own one `UTXO` worth 2 BTC, I would construct a transaction that spends my `UTXO` and sends 1 BTC to you and 1 BTC back to me (just like receiving change).
**Transaction Output:** transaction outputs have two fields:
* *value*: the value of a transaction
* *scriptPubKey (aka locking script or witness script)*: conditions required to unlock (spend) a transaction value
**Transaction Input:** transaction inputs have four fields:
* *previous output*: the previous output transaction reference, as an OutPoint structure (see below)
* *scriptSig*: a script satisfying the conditions set on the UTXO ([BIP16](https://github.com/bitcoin/bips/blob/master/bip-0016.mediawiki))
* *scriptWitness*: a script satisfying the conditions set on the UTXO ([BIP141](https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki))
* *sequence number*: transaction version as defined by the sender. Intended for "replacement" of transactions when information is updated before inclusion into a block.
**Outpoint**:
* *hash*: references the transaction that contains the UTXO being spent
* *index*: identifies which UTXO from that transaction is referenced
**Transaction Version:** the version of the data formatting
**Transaction Locktime:** this specifies either a block number or a unix time at which this transaction is valid
**Transaction Fee:** A transaction's input value must equal the transaction's output value or else the transaction is invalid. The difference between these two values is the transaction fee, a fee paid to the miner who includes this transaction in his/her block.
### Witnesses and SegWit
**Preface**: here I will try to give the minimal context surrounding segwit as is necessary to understand why witnesses exist in terms of blocks, block headers, and transactions.
SegWit is defined in [BIP141](https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki).
A witness is defined as:
> The witness is a serialization of all witness data of the transaction.
Most importantly:
> Witness data is NOT script.
Thus:
> A non-witness program (defined hereinafter) txin MUST be associated with an empty witness field, represented by a 0x00. If all txins are not witness program, a transaction's wtxid is equal to its txid.
*Regular Transaction Id vs. Witness Transaction Id*
* Regular transaction id:
```[nVersion][txins][txouts][nLockTime]```
* Witness transaction id:
```[nVersion][marker][flag][txins][txouts][witness][nLockTime]```
A `witness root hash` is calculated with all those `wtxid` as leaves, in a way similar to the `hashMerkleRoot` in the block header.
In the transaction, there are two different script fields:
* **script_sig**: original/old signature script ([BIP16](https://github.com/bitcoin/bips/blob/master/bip-0016.mediawiki)/P2SH)
* **script_witness**: witness script
Depending on the content of these two fields and the scriptPubKey, witness validation logic may be triggered. Here are the two cases (note these definitions are straight from the BIP so may be quite dense):
1. **Native witness program**: *a scriptPubKey that is exactly a push of a version byte, plus a push of a witness program. The scriptSig must be exactly empty or validation fails.*
2. **P2SH witness program**: *a scriptPubKey is a P2SH script, and the BIP16 redeemScript pushed in the scriptSig is exactly a push of a version byte plus a push of a witness program. The scriptSig must be exactly a push of the BIP16 redeemScript or validation fails.*
[Here](https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#witness-program) are the nitty gritty details of how witnesses and scripts work together -- this goes into the fine details of how the above situations are implemented.
Here are a couple StackOverflow Questions/Answers that help clarify some of the above information:
* [What's the purpose of ScriptSig in a SegWit transaction?](https://bitcoin.stackexchange.com/questions/49372/whats-the-purpose-of-scriptsig-in-a-segwit-transaction)
* [Can old wallets redeem segwit outputs it receives? If so how?](https://bitcoin.stackexchange.com/questions/50254/can-old-wallets-redeem-segwit-outputs-it-receives-if-so-how?rq=1)
### Coinbase
Whenever a miner mines a block, it includes a special transaction called a coinbase transaction. This transaction has no inputs and creates X bitcoins equal to the current block reward (at this time 12.5) which are awarded to the miner of the block. Read more about the coinbase transaction [here](https://github.com/bitcoinbook/bitcoinbook/blob/f8b883dcd4e3d1b9adf40fed59b7e898fbd9241f/ch10.asciidoc#the-coinbase-transaction).
**Need a more visual demonstration of the above information? Check out [this awesome website](https://anders.com/blockchain/).**
## Crate Dependencies
#### 1. [rustc-hex](https://crates.io/crates/rustc-hex):
*Serialization and deserialization support from hexadecimal strings.*
**One thing to note**: *This crate is deprecated in favor of [`serde`](https://serde.rs/). No new feature development will happen in this crate, although bug fixes proposed through PRs will still be merged. It is very highly recommended by the Rust Library Team that you use [`serde`](https://serde.rs/), not this crate.*
#### 2. [heapsize](https://crates.io/crates/heapsize):
*infrastructure for measuring the total runtime size of an object on the heap*
#### 3. Crates from within the Parity Bitcoin Repo:
* bitcrypto (crypto)
* primitives
* serialization
* serialization_derive
## Crate Content
### Block (block.rs)
A relatively straight forward implementation of the data structure described above. A `block` is a rust `struct`. It implements the following traits:
* ```From<&'static str>```: this trait takes in a string and outputs a `block`. It is implemented via the `from` function which deserializes the received string into a `block` data structure. Read more about serialization [here](https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch06.asciidoc#transaction-serializationoutputs) (in the context of transactions).
* ```RepresentH256```: this trait takes a `block` data structure and hashes it, returning the hash.
The `block` has a few methods of its own. The entirety of these are simple getter methods.
### Block Header (block_header.rs)
A relatively straight forward implementation of the data structure described above. A `block header` is a rust `struct`. It implements the following traits:
* ```From<&'static str>```: this trait takes in a string and outputs a `block`. It is implemented via the `from` function which deserializes the received string into a `block` data structure. Read more about serialization [here](https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch06.asciidoc#transaction-serializationoutputs) (in the context of transactions).
* `fmt::Debug`: this trait formats the `block header` struct for pretty printing the debug context -- ie it allows the programmer to print out the context of the struct in a way that makes it easier to debug. Once this trait is implemented, you can do:
```rust
println!("{:?}", some_block_header);
```
Which will print out:
```
Block Header {
version: VERSION_VALUE,
previous_header_hash: PREVIOUS_HASH_HEADER_VALUE,
merkle_root_hash: MERKLE_ROOT_HASH_VALUE,
time: TIME_VALUE,
bits: BITS_VALUE,
nonce: NONCE_VALUE,
}
```
The `block header` only has a single method of its own, the `hash` method that returns a hash of itself.
### Constants (constants.rs)
There are a few constants included in this crate. Since these are nicely documented, documenting them here would be redundant. [Here](https://doc.rust-lang.org/rust-by-example/custom_types/constants.html) you can read more about constants in rust.
### Read and Hash (read_and_hash.rs)
This is a small file that deals with the reading and hashing of serialized data, utilizing a few nifty rust features.
First, a `HashedData` struct is defined over a generic T. Generics in rust work in a similar way to generics in other languages. If you need to brush up on generics, [read here](https://doc.rust-lang.org/1.8.0/book/generics.html). This data structure stores the data for a hashed value along with the size (length of the hash in bytes) and the original hash.
Next the `ReadAndHash` trait is defined. Traits in rust define abstract behaviors that can be shared between many different types. For example, let's say I am writing some code about food. To do this, I might want to create an `Eatable` trait that has a method `eat` describing how to eat this food (borrowing an example from the [New Rustacean podcast](https://newrustacean.com/)). To do this, I would define the trait as follows:
```rust
pub trait Eatable {
fn eat(&self) -> String;
}
```
Here I have defined a trait along with a method signature that must be implemented by any type that implements this trait. For example, let's say I define a candy type that is eatable:
```rust
struct Candy {
flavor: String,
}
impl Eatable for Candy {
fn eat(&self) -> String {
format!("Unwrap candy and munch on that {} goodness.", &self.flavor)
}
}
// Create candy and eat it
let candy = Candy { flavor: chocolate };
prinln!("{}", candy.eat()); // "Unwrap candy and munch on that chocolate goodness."
```
Now let's take this one step further. Let's say we want to recreate Eatable so that the eat function returns a `Compost` type with generic T where presumably T is some type that is `Compostable` (another trait). Now here, it is important that we only return `Compostable` types because only `Compostable` foods can be made into Compost. Thus, we can recreate the `Eatable` trait, this time limiting what types can implement it to those that also implement the `Compostable` trait using the where keyword (note this is called a bounded trait):
```rust
pub trait Eatable {
fn eat(&self) -> Compost where T: Compostable;
}
pub trait Compostable {} // Here Compostable is a marker trait
struct Compost {
compostable_food: T,
}
impl Compost {
fn celebrate() {
println!("Thank you for saving the earth!");
}
}
```
So, let's now redefine `Candy`:
```rust
struct Candy {
flavor: String,
}
impl Compostable for Candy {}
impl Eatable for Candy {
fn eat(&self) -> Compost where T: Compostable{
Compost { compostable_food: format("A {} candy", &self.flavor) }
}
}
// Create candy and eat it
let candy = Candy { flavor: chocolate };
let compost = candy.eat();
compost.celebrate(); // "Thank you for saving the earth!"
```
If this example doesn't quite make sense, I recommend checking out the [traits chapter](https://doc.rust-lang.org/book/second-edition/ch10-02-traits.html) in the Rust Book.
Now that you understand traits, generics, and bounded traits, let's get back to `ReadAndHash`. This is a trait that implements a `read_and_hash` method where T is `Deserializable`, hence it can be deserialized (which as you might guess is important since the input here is a serialized string). The output of this method is a Result (unfamiliar with Results in rust... [read more here](https://doc.rust-lang.org/std/result/)) returning the `HashedData` type described above.
Finally, the `ReadAndHash` trait is implemented for the `Reader` type. You can read more about the `Reader` type in the serialization crate.
### Transaction (transaction.rs)
As described above, there are four structs related to transactions defined in this file:
* OutPoint
* TransactionInput
* TransactionOutput
* Transaction
The implementations of these are pretty straight forward -- a majority of the defined methods are getters and each of these structs implements the `Serializable` and `Deserializable` traits.
A few things to note:
* The `HeapSizeOf` trait is implemented for `TransactionInput`, `TransactionOutput`, and `Transaction`. It has the method `heap_size_of_children` which calculates and returns the heap sizes of various struct fields.
* The `total_spends` method on `Transaction` calculates the sum of all the outputs in a transaction.
### Merkle Root (merkle_root.rs)
The main function in this file is the function that calculates the merkle root (a filed on the block header struct). This function has two helper functions:
* **concat**: takes two values and returns the concatenation of the two hashed values (512 bit)
* **merkle_root_hash**: hashes the 512 bit hash of two concatenated values
Using these two functions, the merkle root function takes a vector of values and calculates the merkle root row-by-row (a row being the level of a binary tree). Note, if there is an uneven number of values in the vector, the last value will be duplicated to create a full tree.
### Indexed
There are indexed equivalents of `block`, `block header`, and `transaction`:
* indexed_block.rs
* indexed_header.rs
* indexed_transaction.rs
These are essentially wrappers around the "raw" data structures with the following:
* methods to convert to and from the raw data structures (i.e. block <-> indexed_block)
* an equivalence method to compare equality against other indexed structures (specifically the PartialEq trait)
* a deserialize method
parity-bitcoin-ci-docker/chain/src/ 0000775 0000000 0000000 00000000000 13447176222 0017532 5 ustar 00root root 0000000 0000000 parity-bitcoin-ci-docker/chain/src/block.rs 0000664 0000000 0000000 00000005412 13447176222 0021174 0 ustar 00root root 0000000 0000000 use hex::FromHex;
use hash::H256;
use ser::{deserialize};
use merkle_root::merkle_root;
use {BlockHeader, Transaction};
use super::RepresentH256;
#[derive(Debug, PartialEq, Clone, Serializable, Deserializable)]
pub struct Block {
pub block_header: BlockHeader,
pub transactions: Vec,
}
impl From<&'static str> for Block {
fn from(s: &'static str) -> Self {
deserialize(&s.from_hex::>().unwrap() as &[u8]).unwrap()
}
}
impl RepresentH256 for Block {
fn h256(&self) -> H256 { self.hash() }
}
impl Block {
pub fn new(header: BlockHeader, transactions: Vec) -> Self {
Block { block_header: header, transactions: transactions }
}
/// Returns block's merkle root.
pub fn merkle_root(&self) -> H256 {
let hashes = self.transactions.iter().map(Transaction::hash).collect::>();
merkle_root(&hashes)
}
/// Returns block's witness merkle root.
pub fn witness_merkle_root(&self) -> H256 {
let hashes = match self.transactions.split_first() {
None => vec![],
Some((_, rest)) => {
let mut hashes = vec![H256::from(0)];
hashes.extend(rest.iter().map(Transaction::witness_hash));
hashes
},
};
merkle_root(&hashes)
}
pub fn transactions(&self) -> &[Transaction] {
&self.transactions
}
pub fn header(&self) -> &BlockHeader {
&self.block_header
}
pub fn hash(&self) -> H256 {
self.block_header.hash()
}
}
#[cfg(test)]
mod tests {
use hash::H256;
use super::Block;
// Block 80000
// https://blockchain.info/rawblock/000000000043a8c0fd1d6f726790caa2a406010d19efd2780db27bdbbd93baf6
// https://blockchain.info/rawblock/000000000043a8c0fd1d6f726790caa2a406010d19efd2780db27bdbbd93baf6?format=hex
#[test]
fn test_block_merkle_root_and_hash() {
let block: Block = "01000000ba8b9cda965dd8e536670f9ddec10e53aab14b20bacad27b9137190000000000190760b278fe7b8565fda3b968b918d5fd997f993b23674c0af3b6fde300b38f33a5914ce6ed5b1b01e32f570201000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0704e6ed5b1b014effffffff0100f2052a01000000434104b68a50eaa0287eff855189f949c1c6e5f58b37c88231373d8a59809cbae83059cc6469d65c665ccfd1cfeb75c6e8e19413bba7fbff9bc762419a76d87b16086eac000000000100000001a6b97044d03da79c005b20ea9c0e1a6d9dc12d9f7b91a5911c9030a439eed8f5000000004948304502206e21798a42fae0e854281abd38bacd1aeed3ee3738d9e1446618c4571d1090db022100e2ac980643b0b82c0e88ffdfec6b64e3e6ba35e7ba5fdd7d5d6cc8d25c6b241501ffffffff0100f2052a010000001976a914404371705fa9bd789a2fcd52d2c580b65d35549d88ac00000000".into();
let merkle_root = H256::from_reversed_str("8fb300e3fdb6f30a4c67233b997f99fdd518b968b9a3fd65857bfe78b2600719");
let hash = H256::from_reversed_str("000000000043a8c0fd1d6f726790caa2a406010d19efd2780db27bdbbd93baf6");
assert_eq!(block.merkle_root(), merkle_root);
assert_eq!(block.hash(), hash);
}
}
parity-bitcoin-ci-docker/chain/src/block_header.rs 0000664 0000000 0000000 00000004537 13447176222 0022513 0 ustar 00root root 0000000 0000000 use std::fmt;
use hex::FromHex;
use ser::{deserialize, serialize};
use crypto::dhash256;
use compact::Compact;
use hash::H256;
#[derive(PartialEq, Clone, Serializable, Deserializable)]
pub struct BlockHeader {
pub version: u32,
pub previous_header_hash: H256,
pub merkle_root_hash: H256,
pub time: u32,
pub bits: Compact,
pub nonce: u32,
}
impl BlockHeader {
pub fn hash(&self) -> H256 {
dhash256(&serialize(self))
}
}
impl fmt::Debug for BlockHeader {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("BlockHeader")
.field("version", &self.version)
.field("previous_header_hash", &self.previous_header_hash.reversed())
.field("merkle_root_hash", &self.merkle_root_hash.reversed())
.field("time", &self.time)
.field("bits", &self.bits)
.field("nonce", &self.nonce)
.finish()
}
}
impl From<&'static str> for BlockHeader {
fn from(s: &'static str) -> Self {
deserialize(&s.from_hex::>().unwrap() as &[u8]).unwrap()
}
}
#[cfg(test)]
mod tests {
use ser::{Reader, Error as ReaderError, Stream};
use super::BlockHeader;
#[test]
fn test_block_header_stream() {
let block_header = BlockHeader {
version: 1,
previous_header_hash: [2; 32].into(),
merkle_root_hash: [3; 32].into(),
time: 4,
bits: 5.into(),
nonce: 6,
};
let mut stream = Stream::default();
stream.append(&block_header);
let expected = vec![
1, 0, 0, 0,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
4, 0, 0, 0,
5, 0, 0, 0,
6, 0, 0, 0,
].into();
assert_eq!(stream.out(), expected);
}
#[test]
fn test_block_header_reader() {
let buffer = vec![
1, 0, 0, 0,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
4, 0, 0, 0,
5, 0, 0, 0,
6, 0, 0, 0,
];
let mut reader = Reader::new(&buffer);
let expected = BlockHeader {
version: 1,
previous_header_hash: [2; 32].into(),
merkle_root_hash: [3; 32].into(),
time: 4,
bits: 5.into(),
nonce: 6,
};
assert_eq!(expected, reader.read().unwrap());
assert_eq!(ReaderError::UnexpectedEnd, reader.read::().unwrap_err());
}
}
parity-bitcoin-ci-docker/chain/src/constants.rs 0000664 0000000 0000000 00000002010 13447176222 0022105 0 ustar 00root root 0000000 0000000
// Below flags apply in the context of BIP 68
// If this flag set, CTxIn::nSequence is NOT interpreted as a
// relative lock-time.
pub const SEQUENCE_LOCKTIME_DISABLE_FLAG: u32 = 1u32 << 31;
// Setting nSequence to this value for every input in a transaction
// disables nLockTime.
pub const SEQUENCE_FINAL: u32 = 0xffffffff;
// If CTxIn::nSequence encodes a relative lock-time and this flag
// is set, the relative lock-time has units of 512 seconds,
// otherwise it specifies blocks with a granularity of 1.
pub const SEQUENCE_LOCKTIME_TYPE_FLAG: u32 = (1 << 22);
// If CTxIn::nSequence encodes a relative lock-time, this mask is
// applied to extract that lock-time from the sequence field.
pub const SEQUENCE_LOCKTIME_MASK: u32 = 0x0000ffff;
/// Threshold for `nLockTime`: below this value it is interpreted as block number,
/// otherwise as UNIX timestamp.
pub const LOCKTIME_THRESHOLD: u32 = 500000000; // Tue Nov 5 00:53:20 1985 UTC
/// Number of Satoshis in single coin
pub const SATOSHIS_IN_COIN: u64 = 100_000_000;
parity-bitcoin-ci-docker/chain/src/indexed_block.rs 0000664 0000000 0000000 00000006662 13447176222 0022704 0 ustar 00root root 0000000 0000000 use std::cmp;
use hash::H256;
use hex::FromHex;
use ser::{Serializable, serialized_list_size, serialized_list_size_with_flags, deserialize, SERIALIZE_TRANSACTION_WITNESS};
use block::Block;
use transaction::Transaction;
use merkle_root::merkle_root;
use indexed_header::IndexedBlockHeader;
use indexed_transaction::IndexedTransaction;
#[derive(Debug, Clone, Deserializable)]
pub struct IndexedBlock {
pub header: IndexedBlockHeader,
pub transactions: Vec,
}
impl From for IndexedBlock {
fn from(block: Block) -> Self {
let Block { block_header, transactions } = block;
IndexedBlock {
header: block_header.into(),
transactions: transactions.into_iter().map(Into::into).collect(),
}
}
}
impl cmp::PartialEq for IndexedBlock {
fn eq(&self, other: &Self) -> bool {
self.header.hash == other.header.hash
}
}
impl IndexedBlock {
pub fn new(header: IndexedBlockHeader, transactions: Vec) -> Self {
IndexedBlock {
header: header,
transactions: transactions,
}
}
pub fn hash(&self) -> &H256 {
&self.header.hash
}
pub fn to_raw_block(self) -> Block {
Block::new(self.header.raw, self.transactions.into_iter().map(|tx| tx.raw).collect())
}
pub fn size(&self) -> usize {
let header_size = self.header.raw.serialized_size();
let transactions = self.transactions.iter().map(|tx| &tx.raw).collect::>();
let txs_size = serialized_list_size::(&transactions);
header_size + txs_size
}
pub fn size_with_witness(&self) -> usize {
let header_size = self.header.raw.serialized_size();
let transactions = self.transactions.iter().map(|tx| &tx.raw).collect::>();
let txs_size = serialized_list_size_with_flags::(&transactions, SERIALIZE_TRANSACTION_WITNESS);
header_size + txs_size
}
pub fn merkle_root(&self) -> H256 {
merkle_root(&self.transactions.iter().map(|tx| &tx.hash).collect::>())
}
pub fn witness_merkle_root(&self) -> H256 {
let hashes = match self.transactions.split_first() {
None => vec![],
Some((_, rest)) => {
let mut hashes = vec![H256::from(0)];
hashes.extend(rest.iter().map(|tx| tx.raw.witness_hash()));
hashes
},
};
merkle_root(&hashes)
}
pub fn is_final(&self, height: u32) -> bool {
self.transactions.iter().all(|tx| tx.raw.is_final_in_block(height, self.header.raw.time))
}
}
impl From<&'static str> for IndexedBlock {
fn from(s: &'static str) -> Self {
deserialize(&s.from_hex::>().unwrap() as &[u8]).unwrap()
}
}
#[cfg(test)]
mod tests {
use super::IndexedBlock;
#[test]
fn size_with_witness_not_equal_to_size() {
let block_without_witness: IndexedBlock = "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000".into();
assert_eq!(block_without_witness.size(), block_without_witness.size_with_witness());
// bip143 block
let block_with_witness: IndexedBlock = "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000010100000000000000000000000000000000000000000000000000000000000000000000000000000000000001010000000000".into();
assert!(block_with_witness.size() != block_with_witness.size_with_witness());
}
}
parity-bitcoin-ci-docker/chain/src/indexed_header.rs 0000664 0000000 0000000 00000002274 13447176222 0023035 0 ustar 00root root 0000000 0000000 use std::{io, cmp, fmt};
use hash::H256;
use ser::{Deserializable, Reader, Error as ReaderError};
use block_header::BlockHeader;
use read_and_hash::ReadAndHash;
#[derive(Clone)]
pub struct IndexedBlockHeader {
pub hash: H256,
pub raw: BlockHeader,
}
impl fmt::Debug for IndexedBlockHeader {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("IndexedBlockHeader")
.field("hash", &self.hash.reversed())
.field("raw", &self.raw)
.finish()
}
}
impl From for IndexedBlockHeader {
fn from(header: BlockHeader) -> Self {
IndexedBlockHeader {
hash: header.hash(),
raw: header,
}
}
}
impl IndexedBlockHeader {
pub fn new(hash: H256, header: BlockHeader) -> Self {
IndexedBlockHeader {
hash: hash,
raw: header,
}
}
}
impl cmp::PartialEq for IndexedBlockHeader {
fn eq(&self, other: &Self) -> bool {
self.hash == other.hash
}
}
impl Deserializable for IndexedBlockHeader {
fn deserialize(reader: &mut Reader) -> Result where T: io::Read {
let data = try!(reader.read_and_hash::());
// TODO: use len
let header = IndexedBlockHeader {
raw: data.data,
hash: data.hash,
};
Ok(header)
}
}
parity-bitcoin-ci-docker/chain/src/indexed_transaction.rs 0000664 0000000 0000000 00000002354 13447176222 0024131 0 ustar 00root root 0000000 0000000 use std::{cmp, io, fmt};
use hash::H256;
use ser::{Deserializable, Reader, Error as ReaderError};
use transaction::Transaction;
use read_and_hash::ReadAndHash;
#[derive(Default, Clone)]
pub struct IndexedTransaction {
pub hash: H256,
pub raw: Transaction,
}
impl fmt::Debug for IndexedTransaction {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("IndexedTransaction")
.field("hash", &self.hash.reversed())
.field("raw", &self.raw)
.finish()
}
}
impl From for IndexedTransaction where Transaction: From {
fn from(other: T) -> Self {
let tx = Transaction::from(other);
IndexedTransaction {
hash: tx.hash(),
raw: tx,
}
}
}
impl IndexedTransaction {
pub fn new(hash: H256, transaction: Transaction) -> Self {
IndexedTransaction {
hash: hash,
raw: transaction,
}
}
}
impl cmp::PartialEq for IndexedTransaction {
fn eq(&self, other: &Self) -> bool {
self.hash == other.hash
}
}
impl Deserializable for IndexedTransaction {
fn deserialize(reader: &mut Reader) -> Result where T: io::Read {
let data = try!(reader.read_and_hash::());
// TODO: use len
let tx = IndexedTransaction {
raw: data.data,
hash: data.hash,
};
Ok(tx)
}
}
parity-bitcoin-ci-docker/chain/src/lib.rs 0000664 0000000 0000000 00000001634 13447176222 0020652 0 ustar 00root root 0000000 0000000 extern crate rustc_hex as hex;
extern crate heapsize;
extern crate primitives;
extern crate bitcrypto as crypto;
extern crate serialization as ser;
#[macro_use]
extern crate serialization_derive;
pub mod constants;
mod block;
mod block_header;
mod merkle_root;
mod transaction;
/// `IndexedBlock` extension
mod read_and_hash;
mod indexed_block;
mod indexed_header;
mod indexed_transaction;
pub trait RepresentH256 {
fn h256(&self) -> hash::H256;
}
pub use primitives::{hash, bytes, bigint, compact};
pub use block::Block;
pub use block_header::BlockHeader;
pub use merkle_root::{merkle_root, merkle_node_hash};
pub use transaction::{Transaction, TransactionInput, TransactionOutput, OutPoint};
pub use read_and_hash::{ReadAndHash, HashedData};
pub use indexed_block::IndexedBlock;
pub use indexed_header::IndexedBlockHeader;
pub use indexed_transaction::IndexedTransaction;
pub type ShortTransactionID = hash::H48;
parity-bitcoin-ci-docker/chain/src/merkle_root.rs 0000664 0000000 0000000 00000003255 13447176222 0022427 0 ustar 00root root 0000000 0000000 use crypto::dhash256;
use hash::{H256, H512};
#[inline]
fn concat(a: T, b: T) -> H512 where T: AsRef {
let mut result = H512::default();
result[0..32].copy_from_slice(&**a.as_ref());
result[32..64].copy_from_slice(&**b.as_ref());
result
}
/// Calculates the root of the merkle tree
/// https://en.bitcoin.it/wiki/Protocol_documentation#Merkle_Trees
pub fn merkle_root(hashes: &[T]) -> H256 where T: AsRef {
if hashes.len() == 1 {
return hashes[0].as_ref().clone();
}
let mut row = Vec::with_capacity(hashes.len() / 2);
let mut i = 0;
while i + 1 < hashes.len() {
row.push(merkle_node_hash(&hashes[i], &hashes[i + 1]));
i += 2
}
// duplicate the last element if len is not even
if hashes.len() % 2 == 1 {
let last = &hashes[hashes.len() - 1];
row.push(merkle_node_hash(last, last));
}
merkle_root(&row)
}
/// Calculate merkle tree node hash
pub fn merkle_node_hash(left: T, right: T) -> H256 where T: AsRef {
dhash256(&*concat(left, right))
}
#[cfg(test)]
mod tests {
use hash::H256;
use super::merkle_root;
// block 80_000
// https://blockchain.info/block/000000000043a8c0fd1d6f726790caa2a406010d19efd2780db27bdbbd93baf6
#[test]
fn test_merkle_root_with_2_hashes() {
let tx1 = H256::from_reversed_str("c06fbab289f723c6261d3030ddb6be121f7d2508d77862bb1e484f5cd7f92b25");
let tx2 = H256::from_reversed_str("5a4ebf66822b0b2d56bd9dc64ece0bc38ee7844a23ff1d7320a88c5fdb2ad3e2");
let expected = H256::from_reversed_str("8fb300e3fdb6f30a4c67233b997f99fdd518b968b9a3fd65857bfe78b2600719");
let result = merkle_root(&[&tx1, &tx2]);
let result2 = merkle_root(&[tx1, tx2]);
assert_eq!(result, expected);
assert_eq!(result2, expected);
}
}
parity-bitcoin-ci-docker/chain/src/read_and_hash.rs 0000664 0000000 0000000 00000001343 13447176222 0022641 0 ustar 00root root 0000000 0000000 use std::io;
use hash::H256;
use crypto::{DHash256, Digest};
use ser::{Reader, Error as ReaderError, Deserializable};
pub struct HashedData {
pub size: usize,
pub hash: H256,
pub data: T,
}
pub trait ReadAndHash {
fn read_and_hash(&mut self) -> Result, ReaderError> where T: Deserializable;
}
impl ReadAndHash for Reader where R: io::Read {
fn read_and_hash(&mut self) -> Result, ReaderError> where T: Deserializable {
let mut size = 0usize;
let mut hasher = DHash256::new();
let data = self.read_with_proxy(|bytes| {
size += bytes.len();
hasher.input(bytes);
})?;
let result = HashedData {
hash: hasher.finish(),
data: data,
size: size,
};
Ok(result)
}
}
parity-bitcoin-ci-docker/chain/src/transaction.rs 0000664 0000000 0000000 00000027262 13447176222 0022436 0 ustar 00root root 0000000 0000000 //! Bitcoin trainsaction.
//! https://en.bitcoin.it/wiki/Protocol_documentation#tx
use std::io;
use heapsize::HeapSizeOf;
use hex::FromHex;
use bytes::Bytes;
use ser::{deserialize, serialize, serialize_with_flags, SERIALIZE_TRANSACTION_WITNESS};
use crypto::dhash256;
use hash::H256;
use constants::{SEQUENCE_FINAL, LOCKTIME_THRESHOLD};
use ser::{Error, Serializable, Deserializable, Stream, Reader};
/// Must be zero.
const WITNESS_MARKER: u8 = 0;
/// Must be nonzero.
const WITNESS_FLAG: u8 = 1;
#[derive(Debug, PartialEq, Eq, Clone, Default, Serializable, Deserializable)]
pub struct OutPoint {
pub hash: H256,
pub index: u32,
}
impl OutPoint {
pub fn null() -> Self {
OutPoint {
hash: H256::default(),
index: u32::max_value(),
}
}
pub fn is_null(&self) -> bool {
self.hash.is_zero() && self.index == u32::max_value()
}
}
#[derive(Debug, PartialEq, Default, Clone)]
pub struct TransactionInput {
pub previous_output: OutPoint,
pub script_sig: Bytes,
pub sequence: u32,
pub script_witness: Vec,
}
impl TransactionInput {
pub fn coinbase(script_sig: Bytes) -> Self {
TransactionInput {
previous_output: OutPoint::null(),
script_sig: script_sig,
sequence: SEQUENCE_FINAL,
script_witness: vec![],
}
}
pub fn is_final(&self) -> bool {
self.sequence == SEQUENCE_FINAL
}
pub fn has_witness(&self) -> bool {
!self.script_witness.is_empty()
}
}
impl HeapSizeOf for TransactionInput {
fn heap_size_of_children(&self) -> usize {
self.script_sig.heap_size_of_children() +
self.script_witness.heap_size_of_children()
}
}
#[derive(Debug, PartialEq, Clone, Serializable, Deserializable)]
pub struct TransactionOutput {
pub value: u64,
pub script_pubkey: Bytes,
}
impl Default for TransactionOutput {
fn default() -> Self {
TransactionOutput {
value: 0xffffffffffffffffu64,
script_pubkey: Bytes::default(),
}
}
}
impl HeapSizeOf for TransactionOutput {
fn heap_size_of_children(&self) -> usize {
self.script_pubkey.heap_size_of_children()
}
}
#[derive(Debug, PartialEq, Default, Clone)]
pub struct Transaction {
pub version: i32,
pub inputs: Vec,
pub outputs: Vec,
pub lock_time: u32,
}
impl From<&'static str> for Transaction {
fn from(s: &'static str) -> Self {
deserialize(&s.from_hex::>().unwrap() as &[u8]).unwrap()
}
}
impl HeapSizeOf for Transaction {
fn heap_size_of_children(&self) -> usize {
self.inputs.heap_size_of_children() + self.outputs.heap_size_of_children()
}
}
impl Transaction {
pub fn hash(&self) -> H256 {
dhash256(&serialize(self))
}
pub fn witness_hash(&self) -> H256 {
dhash256(&serialize_with_flags(self, SERIALIZE_TRANSACTION_WITNESS))
}
pub fn inputs(&self) -> &[TransactionInput] {
&self.inputs
}
pub fn outputs(&self) -> &[TransactionOutput] {
&self.outputs
}
pub fn is_empty(&self) -> bool {
self.inputs.is_empty() || self.outputs.is_empty()
}
pub fn is_null(&self) -> bool {
self.inputs.iter().any(|input| input.previous_output.is_null())
}
pub fn is_coinbase(&self) -> bool {
self.inputs.len() == 1 && self.inputs[0].previous_output.is_null()
}
pub fn is_final(&self) -> bool {
// if lock_time is 0, transaction is final
if self.lock_time == 0 {
return true;
}
// setting all sequence numbers to 0xffffffff disables the time lock, so if you want to use locktime,
// at least one input must have a sequence number below the maximum.
self.inputs.iter().all(TransactionInput::is_final)
}
pub fn is_final_in_block(&self, block_height: u32, block_time: u32) -> bool {
if self.lock_time == 0 {
return true;
}
let max_lock_time = if self.lock_time < LOCKTIME_THRESHOLD {
block_height
} else {
block_time
};
if self.lock_time < max_lock_time {
return true;
}
self.inputs.iter().all(TransactionInput::is_final)
}
pub fn has_witness(&self) -> bool {
self.inputs.iter().any(TransactionInput::has_witness)
}
pub fn total_spends(&self) -> u64 {
let mut result = 0u64;
for output in self.outputs.iter() {
if u64::max_value() - result < output.value {
return u64::max_value();
}
result += output.value;
}
result
}
}
impl Serializable for TransactionInput {
fn serialize(&self, stream: &mut Stream) {
stream
.append(&self.previous_output)
.append(&self.script_sig)
.append(&self.sequence);
}
}
impl Deserializable for TransactionInput {
fn deserialize(reader: &mut Reader) -> Result where Self: Sized, T: io::Read {
Ok(TransactionInput {
previous_output: reader.read()?,
script_sig: reader.read()?,
sequence: reader.read()?,
script_witness: vec![],
})
}
}
impl Serializable for Transaction {
fn serialize(&self, stream: &mut Stream) {
let include_transaction_witness = stream.include_transaction_witness() && self.has_witness();
match include_transaction_witness {
false => stream
.append(&self.version)
.append_list(&self.inputs)
.append_list(&self.outputs)
.append(&self.lock_time),
true => {
stream
.append(&self.version)
.append(&WITNESS_MARKER)
.append(&WITNESS_FLAG)
.append_list(&self.inputs)
.append_list(&self.outputs);
for input in &self.inputs {
stream.append_list(&input.script_witness);
}
stream.append(&self.lock_time)
}
};
}
}
impl Deserializable for Transaction {
fn deserialize(reader: &mut Reader) -> Result where Self: Sized, T: io::Read {
let version = reader.read()?;
let mut inputs: Vec = reader.read_list()?;
let read_witness = if inputs.is_empty() {
let witness_flag: u8 = reader.read()?;
if witness_flag != WITNESS_FLAG {
return Err(Error::MalformedData);
}
inputs = reader.read_list()?;
true
} else {
false
};
let outputs = reader.read_list()?;
if read_witness {
for input in inputs.iter_mut() {
input.script_witness = reader.read_list()?;
}
}
Ok(Transaction {
version: version,
inputs: inputs,
outputs: outputs,
lock_time: reader.read()?,
})
}
}
#[cfg(test)]
mod tests {
use hash::H256;
use ser::{Serializable, serialize_with_flags, SERIALIZE_TRANSACTION_WITNESS};
use super::{Transaction, TransactionInput, OutPoint, TransactionOutput};
// real transaction from block 80000
// https://blockchain.info/rawtx/5a4ebf66822b0b2d56bd9dc64ece0bc38ee7844a23ff1d7320a88c5fdb2ad3e2
// https://blockchain.info/rawtx/5a4ebf66822b0b2d56bd9dc64ece0bc38ee7844a23ff1d7320a88c5fdb2ad3e2?format=hex
#[test]
fn test_transaction_reader() {
let t: Transaction = "0100000001a6b97044d03da79c005b20ea9c0e1a6d9dc12d9f7b91a5911c9030a439eed8f5000000004948304502206e21798a42fae0e854281abd38bacd1aeed3ee3738d9e1446618c4571d1090db022100e2ac980643b0b82c0e88ffdfec6b64e3e6ba35e7ba5fdd7d5d6cc8d25c6b241501ffffffff0100f2052a010000001976a914404371705fa9bd789a2fcd52d2c580b65d35549d88ac00000000".into();
assert_eq!(t.version, 1);
assert_eq!(t.lock_time, 0);
assert_eq!(t.inputs.len(), 1);
assert_eq!(t.outputs.len(), 1);
let tx_input = &t.inputs[0];
assert_eq!(tx_input.sequence, 4294967295);
assert_eq!(tx_input.script_sig, "48304502206e21798a42fae0e854281abd38bacd1aeed3ee3738d9e1446618c4571d1090db022100e2ac980643b0b82c0e88ffdfec6b64e3e6ba35e7ba5fdd7d5d6cc8d25c6b241501".into());
let tx_output = &t.outputs[0];
assert_eq!(tx_output.value, 5000000000);
assert_eq!(tx_output.script_pubkey, "76a914404371705fa9bd789a2fcd52d2c580b65d35549d88ac".into());
assert!(!t.has_witness());
}
#[test]
fn test_transaction_hash() {
let t: Transaction = "0100000001a6b97044d03da79c005b20ea9c0e1a6d9dc12d9f7b91a5911c9030a439eed8f5000000004948304502206e21798a42fae0e854281abd38bacd1aeed3ee3738d9e1446618c4571d1090db022100e2ac980643b0b82c0e88ffdfec6b64e3e6ba35e7ba5fdd7d5d6cc8d25c6b241501ffffffff0100f2052a010000001976a914404371705fa9bd789a2fcd52d2c580b65d35549d88ac00000000".into();
let hash = H256::from_reversed_str("5a4ebf66822b0b2d56bd9dc64ece0bc38ee7844a23ff1d7320a88c5fdb2ad3e2");
assert_eq!(t.hash(), hash);
}
#[test]
fn test_transaction_serialized_len() {
let raw_tx: &'static str = "0100000001a6b97044d03da79c005b20ea9c0e1a6d9dc12d9f7b91a5911c9030a439eed8f5000000004948304502206e21798a42fae0e854281abd38bacd1aeed3ee3738d9e1446618c4571d1090db022100e2ac980643b0b82c0e88ffdfec6b64e3e6ba35e7ba5fdd7d5d6cc8d25c6b241501ffffffff0100f2052a010000001976a914404371705fa9bd789a2fcd52d2c580b65d35549d88ac00000000";
let tx: Transaction = raw_tx.into();
assert_eq!(tx.serialized_size(), raw_tx.len() / 2);
}
#[test]
fn test_transaction_reader_with_witness() {
// test case from https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki
let actual: Transaction = "01000000000102fff7f7881a8099afa6940d42d1e7f6362bec38171ea3edf433541db4e4ad969f00000000494830450221008b9d1dc26ba6a9cb62127b02742fa9d754cd3bebf337f7a55d114c8e5cdd30be022040529b194ba3f9281a99f2b1c0a19c0489bc22ede944ccf4ecbab4cc618ef3ed01eeffffffef51e1b804cc89d182d279655c3aa89e815b1b309fe287d9b2b55d57b90ec68a0100000000ffffffff02202cb206000000001976a9148280b37df378db99f66f85c95a783a76ac7a6d5988ac9093510d000000001976a9143bde42dbee7e4dbe6a21b2d50ce2f0167faa815988ac000247304402203609e17b84f6a7d30c80bfa610b5b4542f32a8a0d5447a12fb1366d7f01cc44a0220573a954c4518331561406f90300e8f3358f51928d43c212a8caed02de67eebee0121025476c2e83188368da1ff3e292e7acafcdb3566bb0ad253f62fc70f07aeee635711000000".into();
let expected = Transaction {
version: 1,
inputs: vec![TransactionInput {
previous_output: OutPoint {
hash: "fff7f7881a8099afa6940d42d1e7f6362bec38171ea3edf433541db4e4ad969f".into(),
index: 0,
},
script_sig: "4830450221008b9d1dc26ba6a9cb62127b02742fa9d754cd3bebf337f7a55d114c8e5cdd30be022040529b194ba3f9281a99f2b1c0a19c0489bc22ede944ccf4ecbab4cc618ef3ed01".into(),
sequence: 0xffffffee,
script_witness: vec![],
}, TransactionInput {
previous_output: OutPoint {
hash: "ef51e1b804cc89d182d279655c3aa89e815b1b309fe287d9b2b55d57b90ec68a".into(),
index: 1,
},
script_sig: "".into(),
sequence: 0xffffffff,
script_witness: vec![
"304402203609e17b84f6a7d30c80bfa610b5b4542f32a8a0d5447a12fb1366d7f01cc44a0220573a954c4518331561406f90300e8f3358f51928d43c212a8caed02de67eebee01".into(),
"025476c2e83188368da1ff3e292e7acafcdb3566bb0ad253f62fc70f07aeee6357".into(),
],
}],
outputs: vec![TransactionOutput {
value: 0x0000000006b22c20,
script_pubkey: "76a9148280b37df378db99f66f85c95a783a76ac7a6d5988ac".into(),
}, TransactionOutput {
value: 0x000000000d519390,
script_pubkey: "76a9143bde42dbee7e4dbe6a21b2d50ce2f0167faa815988ac".into(),
}],
lock_time: 0x00000011,
};
assert_eq!(actual, expected);
}
#[test]
fn test_serialization_with_flags() {
let transaction_without_witness: Transaction = "000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000".into();
assert_eq!(serialize_with_flags(&transaction_without_witness, 0), serialize_with_flags(&transaction_without_witness, SERIALIZE_TRANSACTION_WITNESS));
let transaction_with_witness: Transaction = "0000000000010100000000000000000000000000000000000000000000000000000000000000000000000000000000000001010000000000".into();
assert!(serialize_with_flags(&transaction_with_witness, 0) != serialize_with_flags(&transaction_with_witness, SERIALIZE_TRANSACTION_WITNESS));
}
#[test]
fn test_witness_hash_differs() {
let transaction_without_witness: Transaction = "000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000".into();
assert_eq!(transaction_without_witness.hash(), transaction_without_witness.witness_hash());
let transaction_with_witness: Transaction = "0000000000010100000000000000000000000000000000000000000000000000000000000000000000000000000000000001010000000000".into();
assert!(transaction_with_witness.hash() != transaction_with_witness.witness_hash());
}
}
parity-bitcoin-ci-docker/crypto/ 0000775 0000000 0000000 00000000000 13447176222 0017201 5 ustar 00root root 0000000 0000000 parity-bitcoin-ci-docker/crypto/Cargo.toml 0000664 0000000 0000000 00000000302 13447176222 0021124 0 ustar 00root root 0000000 0000000 [package]
name = "bitcrypto"
version = "0.1.0"
authors = ["debris "]
[dependencies]
rust-crypto = "0.2.36"
siphasher = "0.1.1"
primitives = { path = "../primitives" }
parity-bitcoin-ci-docker/crypto/src/ 0000775 0000000 0000000 00000000000 13447176222 0017770 5 ustar 00root root 0000000 0000000 parity-bitcoin-ci-docker/crypto/src/lib.rs 0000664 0000000 0000000 00000010714 13447176222 0021107 0 ustar 00root root 0000000 0000000 extern crate crypto as rcrypto;
extern crate primitives;
extern crate siphasher;
pub use rcrypto::digest::Digest;
use std::hash::Hasher;
use rcrypto::sha1::Sha1;
use rcrypto::sha2::Sha256;
use rcrypto::ripemd160::Ripemd160;
use siphasher::sip::SipHasher24;
use primitives::hash::{H32, H160, H256};
pub struct DHash160 {
sha256: Sha256,
ripemd: Ripemd160,
}
impl Default for DHash160 {
fn default() -> Self {
DHash160 {
sha256: Sha256::new(),
ripemd: Ripemd160::new(),
}
}
}
impl DHash160 {
pub fn new() -> Self {
DHash160::default()
}
}
impl Digest for DHash160 {
fn input(&mut self, d: &[u8]) {
self.sha256.input(d)
}
fn result(&mut self, out: &mut [u8]) {
let mut tmp = [0u8; 32];
self.sha256.result(&mut tmp);
self.ripemd.input(&tmp);
self.ripemd.result(out);
self.ripemd.reset();
}
fn reset(&mut self) {
self.sha256.reset();
}
fn output_bits(&self) -> usize {
160
}
fn block_size(&self) -> usize {
64
}
}
pub struct DHash256 {
hasher: Sha256,
}
impl Default for DHash256 {
fn default() -> Self {
DHash256 {
hasher: Sha256::new(),
}
}
}
impl DHash256 {
pub fn new() -> Self {
DHash256::default()
}
pub fn finish(mut self) -> H256 {
let mut result = H256::default();
self.result(&mut *result);
result
}
}
impl Digest for DHash256 {
fn input(&mut self, d: &[u8]) {
self.hasher.input(d)
}
fn result(&mut self, out: &mut [u8]) {
self.hasher.result(out);
self.hasher.reset();
self.hasher.input(out);
self.hasher.result(out);
}
fn reset(&mut self) {
self.hasher.reset();
}
fn output_bits(&self) -> usize {
256
}
fn block_size(&self) -> usize {
64
}
}
/// RIPEMD160
#[inline]
pub fn ripemd160(input: &[u8]) -> H160 {
let mut result = H160::default();
let mut hasher = Ripemd160::new();
hasher.input(input);
hasher.result(&mut *result);
result
}
/// SHA-1
#[inline]
pub fn sha1(input: &[u8]) -> H160 {
let mut result = H160::default();
let mut hasher = Sha1::new();
hasher.input(input);
hasher.result(&mut *result);
result
}
/// SHA-256
#[inline]
pub fn sha256(input: &[u8]) -> H256 {
let mut result = H256::default();
let mut hasher = Sha256::new();
hasher.input(input);
hasher.result(&mut *result);
result
}
/// SHA-256 and RIPEMD160
#[inline]
pub fn dhash160(input: &[u8]) -> H160 {
let mut result = H160::default();
let mut hasher = DHash160::new();
hasher.input(input);
hasher.result(&mut *result);
result
}
/// Double SHA-256
#[inline]
pub fn dhash256(input: &[u8]) -> H256 {
let mut result = H256::default();
let mut hasher = DHash256::new();
hasher.input(input);
hasher.result(&mut *result);
result
}
/// SipHash-2-4
#[inline]
pub fn siphash24(key0: u64, key1: u64, input: &[u8]) -> u64 {
let mut hasher = SipHasher24::new_with_keys(key0, key1);
hasher.write(input);
hasher.finish()
}
/// Data checksum
#[inline]
pub fn checksum(data: &[u8]) -> H32 {
let mut result = H32::default();
result.copy_from_slice(&dhash256(data)[0..4]);
result
}
#[cfg(test)]
mod tests {
use primitives::bytes::Bytes;
use super::{ripemd160, sha1, sha256, dhash160, dhash256, siphash24, checksum};
#[test]
fn test_ripemd160() {
let expected = "108f07b8382412612c048d07d13f814118445acd".into();
let result = ripemd160(b"hello");
assert_eq!(result, expected);
}
#[test]
fn test_sha1() {
let expected = "aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d".into();
let result = sha1(b"hello");
assert_eq!(result, expected);
}
#[test]
fn test_sha256() {
let expected = "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824".into();
let result = sha256(b"hello");
assert_eq!(result, expected);
}
#[test]
fn test_dhash160() {
let expected = "b6a9c8c230722b7c748331a8b450f05566dc7d0f".into();
let result = dhash160(b"hello");
assert_eq!(result, expected);
let expected = "865c71bfc7e314709207ab9e7e205c6f8e453d08".into();
let bytes: Bytes = "210292be03ed9475445cc24a34a115c641a67e4ff234ccb08cb4c5cea45caa526cb26ead6ead6ead6ead6eadac".into();
let result = dhash160(&bytes);
assert_eq!(result, expected);
}
#[test]
fn test_dhash256() {
let expected = "9595c9df90075148eb06860365df33584b75bff782a510c6cd4883a419833d50".into();
let result = dhash256(b"hello");
assert_eq!(result, expected);
}
#[test]
fn test_siphash24() {
let expected = 0x74f839c593dc67fd_u64;
let result = siphash24(0x0706050403020100_u64, 0x0F0E0D0C0B0A0908_u64, &[0; 1]);
assert_eq!(result, expected);
}
#[test]
fn test_checksum() {
assert_eq!(checksum(b"hello"), "9595c9df".into());
}
}
parity-bitcoin-ci-docker/db/ 0000775 0000000 0000000 00000000000 13447176222 0016246 5 ustar 00root root 0000000 0000000 parity-bitcoin-ci-docker/db/Cargo.toml 0000664 0000000 0000000 00000000742 13447176222 0020201 0 ustar 00root root 0000000 0000000 [package]
name = "db"
version = "0.1.0"
authors = ["Parity Technologies "]
[dependencies]
rocksdb = { git = "https://github.com/ethcore/rust-rocksdb" }
elastic-array = "0.6"
parking_lot = "0.4"
log = "0.4"
bit-vec = "0.4"
lru-cache = "0.1"
primitives = { path = "../primitives" }
serialization = { path = "../serialization" }
chain = { path = "../chain" }
storage = { path = "../storage" }
[dev-dependencies]
tempdir = "0.3"
test-data = { path = "../test-data" }
parity-bitcoin-ci-docker/db/src/ 0000775 0000000 0000000 00000000000 13447176222 0017035 5 ustar 00root root 0000000 0000000 parity-bitcoin-ci-docker/db/src/block_chain_db.rs 0000664 0000000 0000000 00000045472 13447176222 0022320 0 ustar 00root root 0000000 0000000 use std::collections::HashMap;
use std::fs;
use std::path::Path;
use parking_lot::RwLock;
use hash::H256;
use bytes::Bytes;
use chain::{
IndexedBlock, IndexedBlockHeader, IndexedTransaction, BlockHeader, Block, Transaction,
OutPoint, TransactionOutput
};
use ser::{
deserialize, serialize, List
};
use kv::{
KeyValueDatabase, OverlayDatabase, Transaction as DBTransaction, Value, DiskDatabase,
DatabaseConfig, MemoryDatabase, AutoFlushingOverlayDatabase, KeyValue, Key, KeyState, CacheDatabase
};
use kv::{
COL_COUNT, COL_BLOCK_HASHES, COL_BLOCK_HEADERS, COL_BLOCK_TRANSACTIONS, COL_TRANSACTIONS,
COL_TRANSACTIONS_META, COL_BLOCK_NUMBERS
};
use storage::{
BlockRef, Error, BlockHeaderProvider, BlockProvider, BlockOrigin, TransactionMeta, IndexedBlockProvider,
TransactionMetaProvider, TransactionProvider, TransactionOutputProvider, BlockChain, Store,
SideChainOrigin, ForkChain, Forkable, CanonStore, ConfigStore, BestBlock
};
const KEY_BEST_BLOCK_NUMBER: &'static str = "best_block_number";
const KEY_BEST_BLOCK_HASH: &'static str = "best_block_hash";
const MAX_FORK_ROUTE_PRESET: usize = 2048;
pub struct BlockChainDatabase where T: KeyValueDatabase {
best_block: RwLock,
db: T,
}
pub struct ForkChainDatabase<'a, T> where T: 'a + KeyValueDatabase {
blockchain: BlockChainDatabase>,
}
impl<'a, T> ForkChain for ForkChainDatabase<'a, T> where T: KeyValueDatabase {
fn store(&self) -> &Store {
&self.blockchain
}
fn flush(&self) -> Result<(), Error> {
self.blockchain.db.flush().map_err(Error::DatabaseError)
}
}
impl BlockChainDatabase>> {
pub fn open_at_path
(path: P, total_cache: usize) -> Result where P: AsRef {
fs::create_dir_all(path.as_ref()).map_err(|err| Error::DatabaseError(err.to_string()))?;
let mut cfg = DatabaseConfig::with_columns(Some(COL_COUNT));
cfg.set_cache(Some(COL_TRANSACTIONS), total_cache / 4);
cfg.set_cache(Some(COL_TRANSACTIONS_META), total_cache / 4);
cfg.set_cache(Some(COL_BLOCK_HEADERS), total_cache / 4);
cfg.set_cache(Some(COL_BLOCK_HASHES), total_cache / 12);
cfg.set_cache(Some(COL_BLOCK_TRANSACTIONS), total_cache / 12);
cfg.set_cache(Some(COL_BLOCK_NUMBERS), total_cache / 12);
cfg.bloom_filters.insert(Some(COL_TRANSACTIONS_META), 32);
match DiskDatabase::open(cfg, path) {
Ok(db) => Ok(Self::open_with_cache(db)),
Err(err) => Err(Error::DatabaseError(err))
}
}
}
impl BlockChainDatabase {
pub fn init_test_chain(blocks: Vec) -> Self {
let store = BlockChainDatabase::open(MemoryDatabase::default());
for block in blocks {
let hash = block.hash().clone();
store.insert(block).unwrap();
store.canonize(&hash).unwrap();
}
store
}
}
impl BlockChainDatabase>> where T: KeyValueDatabase {
pub fn open_with_cache(db: T) -> Self {
let db = CacheDatabase::new(AutoFlushingOverlayDatabase::new(db, 50));
let best_block = Self::read_best_block(&db).unwrap_or_default();
BlockChainDatabase {
best_block: RwLock::new(best_block),
db: db,
}
}
}
impl BlockChainDatabase where T: KeyValueDatabase {
fn read_best_block(db: &T) -> Option {
let best_number = db.get(&Key::Meta(KEY_BEST_BLOCK_NUMBER)).map(KeyState::into_option).map(|x| x.and_then(Value::as_meta));
let best_hash = db.get(&Key::Meta(KEY_BEST_BLOCK_HASH)).map(KeyState::into_option).map(|x| x.and_then(Value::as_meta));
match (best_number, best_hash) {
(Ok(None), Ok(None)) => None,
(Ok(Some(number)), Ok(Some(hash))) => Some(BestBlock {
number: deserialize(&**number).expect("Inconsistent DB. Invalid best block number."),
hash: deserialize(&**hash).expect("Inconsistent DB. Invalid best block hash."),
}),
_ => panic!("Inconsistent DB"),
}
}
pub fn open(db: T) -> Self {
let best_block = Self::read_best_block(&db).unwrap_or_default();
BlockChainDatabase {
best_block: RwLock::new(best_block),
db: db,
}
}
pub fn best_block(&self) -> BestBlock {
self.best_block.read().clone()
}
pub fn fork(&self, side_chain: SideChainOrigin) -> Result, Error> {
let overlay = BlockChainDatabase::open(OverlayDatabase::new(&self.db));
for hash in side_chain.decanonized_route.into_iter().rev() {
let decanonized_hash = overlay.decanonize()?;
assert_eq!(hash, decanonized_hash);
}
for block_hash in &side_chain.canonized_route {
overlay.canonize(block_hash)?;
}
let fork = ForkChainDatabase {
blockchain: overlay,
};
Ok(fork)
}
pub fn switch_to_fork(&self, fork: ForkChainDatabase) -> Result<(), Error> {
let mut best_block = self.best_block.write();
*best_block = fork.blockchain.best_block.read().clone();
fork.blockchain.db.flush().map_err(Error::DatabaseError)
}
pub fn block_origin(&self, header: &IndexedBlockHeader) -> Result {
let best_block = self.best_block.read();
assert_eq!(Some(best_block.hash.clone()), self.block_hash(best_block.number));
if self.contains_block(header.hash.clone().into()) {
// it does not matter if it's canon chain or side chain block
return Ok(BlockOrigin::KnownBlock)
}
if best_block.hash == header.raw.previous_header_hash {
return Ok(BlockOrigin::CanonChain {
block_number: best_block.number + 1
})
}
if !self.contains_block(header.raw.previous_header_hash.clone().into()) {
return Err(Error::UnknownParent)
}
let mut sidechain_route = Vec::new();
let mut next_hash = header.raw.previous_header_hash.clone();
for fork_len in 0..MAX_FORK_ROUTE_PRESET {
match self.block_number(&next_hash) {
Some(number) => {
let block_number = number + fork_len as u32 + 1;
let origin = SideChainOrigin {
ancestor: number,
canonized_route: sidechain_route.into_iter().rev().collect(),
decanonized_route: (number + 1..best_block.number + 1).into_iter()
.filter_map(|decanonized_bn| self.block_hash(decanonized_bn))
.collect(),
block_number: block_number,
};
if block_number > best_block.number {
return Ok(BlockOrigin::SideChainBecomingCanonChain(origin))
} else {
return Ok(BlockOrigin::SideChain(origin))
}
},
None => {
sidechain_route.push(next_hash.clone());
next_hash = self.block_header(next_hash.into())
.expect("not to find orphaned side chain in database; qed")
.previous_header_hash;
}
}
}
Err(Error::AncientFork)
}
pub fn insert(&self, block: IndexedBlock) -> Result<(), Error> {
if self.contains_block(block.hash().clone().into()) {
return Ok(())
}
let parent_hash = block.header.raw.previous_header_hash.clone();
if !self.contains_block(parent_hash.clone().into()) && !parent_hash.is_zero() {
return Err(Error::UnknownParent);
}
let mut update = DBTransaction::new();
update.insert(KeyValue::BlockHeader(block.hash().clone(), block.header.raw));
let tx_hashes = block.transactions.iter().map(|tx| tx.hash.clone()).collect::>();
update.insert(KeyValue::BlockTransactions(block.header.hash.clone(), List::from(tx_hashes)));
for tx in block.transactions.into_iter() {
update.insert(KeyValue::Transaction(tx.hash, tx.raw));
}
self.db.write(update).map_err(Error::DatabaseError)
}
/// Rollbacks single best block
fn rollback_best(&self) -> Result {
let decanonized = match self.block(self.best_block.read().hash.clone().into()) {
Some(block) => block,
None => return Ok(H256::default()),
};
let decanonized_hash = self.decanonize()?;
debug_assert_eq!(decanonized.hash(), decanonized_hash);
// and now remove decanonized block from database
// all code currently works in assumption that origin of all blocks is one of:
// {CanonChain, SideChain, SideChainBecomingCanonChain}
let mut update = DBTransaction::new();
update.delete(Key::BlockHeader(decanonized_hash.clone()));
update.delete(Key::BlockTransactions(decanonized_hash.clone()));
for tx in decanonized.transactions.into_iter() {
update.delete(Key::Transaction(tx.hash()));
}
self.db.write(update).map_err(Error::DatabaseError)?;
Ok(self.best_block().hash)
}
/// Marks block as a new best block.
/// Block must be already inserted into db, and it's parent must be current best block.
/// Updates meta data.
pub fn canonize(&self, hash: &H256) -> Result<(), Error> {
let mut best_block = self.best_block.write();
let block = match self.indexed_block(hash.clone().into()) {
Some(block) => block,
None => return Err(Error::CannotCanonize),
};
if best_block.hash != block.header.raw.previous_header_hash {
return Err(Error::CannotCanonize);
}
let new_best_block = BestBlock {
hash: hash.clone(),
number: if block.header.raw.previous_header_hash.is_zero() {
assert_eq!(best_block.number, 0);
0
} else {
best_block.number + 1
}
};
trace!(target: "db", "canonize {:?}", new_best_block);
let mut update = DBTransaction::new();
update.insert(KeyValue::BlockHash(new_best_block.number, new_best_block.hash.clone()));
update.insert(KeyValue::BlockNumber(new_best_block.hash.clone(), new_best_block.number));
update.insert(KeyValue::Meta(KEY_BEST_BLOCK_HASH, serialize(&new_best_block.hash)));
update.insert(KeyValue::Meta(KEY_BEST_BLOCK_NUMBER, serialize(&new_best_block.number)));
let mut modified_meta: HashMap = HashMap::new();
if let Some(tx) = block.transactions.first() {
let meta = TransactionMeta::new_coinbase(new_best_block.number, tx.raw.outputs.len());
modified_meta.insert(tx.hash.clone(), meta);
}
for tx in block.transactions.iter().skip(1) {
modified_meta.insert(tx.hash.clone(), TransactionMeta::new(new_best_block.number, tx.raw.outputs.len()));
for input in &tx.raw.inputs {
use std::collections::hash_map::Entry;
match modified_meta.entry(input.previous_output.hash.clone()) {
Entry::Occupied(mut entry) => {
let meta = entry.get_mut();
meta.denote_used(input.previous_output.index as usize);
},
Entry::Vacant(entry) => {
let mut meta = self.transaction_meta(&input.previous_output.hash)
.ok_or(Error::CannotCanonize)?;
meta.denote_used(input.previous_output.index as usize);
entry.insert(meta);
}
}
}
}
for (hash, meta) in modified_meta.into_iter() {
update.insert(KeyValue::TransactionMeta(hash, meta));
}
self.db.write(update).map_err(Error::DatabaseError)?;
*best_block = new_best_block;
Ok(())
}
pub fn decanonize(&self) -> Result {
let mut best_block = self.best_block.write();
let block = match self.indexed_block(best_block.hash.clone().into()) {
Some(block) => block,
None => return Err(Error::CannotCanonize),
};
let block_number = best_block.number;
let block_hash = best_block.hash.clone();
let new_best_block = BestBlock {
hash: block.header.raw.previous_header_hash.clone(),
number: if best_block.number > 0 {
best_block.number - 1
} else {
assert!(block.header.raw.previous_header_hash.is_zero());
0
}
};
trace!(target: "db", "decanonize, new best: {:?}", new_best_block);
let mut update = DBTransaction::new();
update.delete(Key::BlockHash(block_number));
update.delete(Key::BlockNumber(block_hash.clone()));
update.insert(KeyValue::Meta(KEY_BEST_BLOCK_HASH, serialize(&new_best_block.hash)));
update.insert(KeyValue::Meta(KEY_BEST_BLOCK_NUMBER, serialize(&new_best_block.number)));
let mut modified_meta: HashMap = HashMap::new();
for tx in block.transactions.iter().skip(1) {
for input in &tx.raw.inputs {
use std::collections::hash_map::Entry;
match modified_meta.entry(input.previous_output.hash.clone()) {
Entry::Occupied(mut entry) => {
let meta = entry.get_mut();
meta.denote_unused(input.previous_output.index as usize);
},
Entry::Vacant(entry) => {
let mut meta = self.transaction_meta(&input.previous_output.hash)
.ok_or(Error::CannotCanonize)?;
meta.denote_unused(input.previous_output.index as usize);
entry.insert(meta);
}
}
}
}
for (hash, meta) in modified_meta {
update.insert(KeyValue::TransactionMeta(hash, meta));
}
for tx in block.transactions {
update.delete(Key::TransactionMeta(tx.hash));
}
self.db.write(update).map_err(Error::DatabaseError)?;
*best_block = new_best_block;
Ok(block_hash)
}
fn get(&self, key: Key) -> Option {
self.db.get(&key).expect("db value to be fine").into_option()
}
fn resolve_hash(&self, block_ref: BlockRef) -> Option {
match block_ref {
BlockRef::Number(n) => self.block_hash(n),
BlockRef::Hash(h) => Some(h),
}
}
}
impl BlockHeaderProvider for BlockChainDatabase where T: KeyValueDatabase {
fn block_header_bytes(&self, block_ref: BlockRef) -> Option {
self.block_header(block_ref).map(|header| serialize(&header))
}
fn block_header(&self, block_ref: BlockRef) -> Option {
self.resolve_hash(block_ref)
.and_then(|hash| self.get(Key::BlockHeader(hash)))
.and_then(Value::as_block_header)
}
}
impl BlockProvider for BlockChainDatabase where T: KeyValueDatabase {
fn block_number(&self, hash: &H256) -> Option {
self.get(Key::BlockNumber(hash.clone()))
.and_then(Value::as_block_number)
}
fn block_hash(&self, number: u32) -> Option {
self.get(Key::BlockHash(number))
.and_then(Value::as_block_hash)
}
fn block(&self, block_ref: BlockRef) -> Option {
self.resolve_hash(block_ref)
.and_then(|block_hash| {
self.block_header(block_hash.clone().into())
.map(|header| {
let transactions = self.block_transactions(block_hash.into());
Block::new(header, transactions)
})
})
}
fn contains_block(&self, block_ref: BlockRef) -> bool {
self.resolve_hash(block_ref)
.and_then(|hash| self.get(Key::BlockHeader(hash)))
.is_some()
}
fn block_transaction_hashes(&self, block_ref: BlockRef) -> Vec {
self.resolve_hash(block_ref)
.and_then(|hash| self.get(Key::BlockTransactions(hash)))
.and_then(Value::as_block_transactions)
.map(List::into)
.unwrap_or_default()
}
fn block_transactions(&self, block_ref: BlockRef) -> Vec {
self.block_transaction_hashes(block_ref)
.into_iter()
.filter_map(|hash| self.get(Key::Transaction(hash)))
.filter_map(Value::as_transaction)
.collect()
}
}
impl IndexedBlockProvider for BlockChainDatabase where T: KeyValueDatabase {
fn indexed_block_header(&self, block_ref: BlockRef) -> Option {
self.resolve_hash(block_ref)
.and_then(|block_hash| {
self.get(Key::BlockHeader(block_hash.clone()))
.and_then(Value::as_block_header)
.map(|header| IndexedBlockHeader::new(block_hash, header))
})
}
fn indexed_block(&self, block_ref: BlockRef) -> Option {
self.resolve_hash(block_ref)
.and_then(|block_hash| {
self.indexed_block_header(block_hash.clone().into())
.map(|header| {
let transactions = self.indexed_block_transactions(block_hash.into());
IndexedBlock::new(header, transactions)
})
})
}
fn indexed_block_transactions(&self, block_ref: BlockRef) -> Vec {
self.block_transaction_hashes(block_ref)
.into_iter()
.filter_map(|hash| {
self.get(Key::Transaction(hash.clone()))
.and_then(Value::as_transaction)
.map(|tx| IndexedTransaction::new(hash, tx))
})
.collect()
}
}
impl TransactionMetaProvider for BlockChainDatabase where T: KeyValueDatabase {
fn transaction_meta(&self, hash: &H256) -> Option {
self.get(Key::TransactionMeta(hash.clone()))
.and_then(Value::as_transaction_meta)
}
}
impl TransactionProvider for BlockChainDatabase where T: KeyValueDatabase {
fn transaction_bytes(&self, hash: &H256) -> Option {
self.transaction(hash).map(|tx| serialize(&tx))
}
fn transaction(&self, hash: &H256) -> Option {
self.get(Key::Transaction(hash.clone()))
.and_then(Value::as_transaction)
}
}
impl TransactionOutputProvider for BlockChainDatabase where T: KeyValueDatabase {
fn transaction_output(&self, prevout: &OutPoint, _transaction_index: usize) -> Option {
// return previous transaction outputs only for canon chain transactions
self.transaction_meta(&prevout.hash)
.and_then(|_| self.transaction(&prevout.hash))
.and_then(|tx| tx.outputs.into_iter().nth(prevout.index as usize))
}
fn is_spent(&self, prevout: &OutPoint) -> bool {
self.transaction_meta(&prevout.hash)
.and_then(|meta| meta.is_spent(prevout.index as usize))
.unwrap_or(false)
}
}
impl BlockChain for BlockChainDatabase where T: KeyValueDatabase {
fn insert(&self, block: IndexedBlock) -> Result<(), Error> {
BlockChainDatabase::insert(self, block)
}
fn rollback_best(&self) -> Result {
BlockChainDatabase::rollback_best(self)
}
fn canonize(&self, block_hash: &H256) -> Result<(), Error> {
BlockChainDatabase::canonize(self, block_hash)
}
fn decanonize(&self) -> Result {
BlockChainDatabase::decanonize(self)
}
fn block_origin(&self, header: &IndexedBlockHeader) -> Result {
BlockChainDatabase::block_origin(self, header)
}
}
impl Forkable for BlockChainDatabase where T: KeyValueDatabase {
fn fork<'a>(&'a self, side_chain: SideChainOrigin) -> Result, Error> {
BlockChainDatabase::fork(self, side_chain)
.map(|fork_chain| {
let boxed: Box = Box::new(fork_chain);
boxed
})
}
fn switch_to_fork<'a>(&self, fork: Box) -> Result<(), Error> {
let mut best_block = self.best_block.write();
*best_block = fork.store().best_block();
fork.flush()
}
}
impl CanonStore for BlockChainDatabase where T: KeyValueDatabase {
fn as_store(&self) -> &Store {
&*self
}
}
impl Store for BlockChainDatabase where T: KeyValueDatabase {
fn best_block(&self) -> BestBlock {
BlockChainDatabase::best_block(self)
}
/// get best header
fn best_header(&self) -> BlockHeader {
self.block_header(self.best_block().hash.into()).expect("best block header should be in db; qed")
}
/// get blockchain difficulty
fn difficulty(&self) -> f64 {
self.best_header().bits.to_f64()
}
}
impl ConfigStore for BlockChainDatabase where T: KeyValueDatabase {
fn consensus_fork(&self) -> Result