编译配置Nervos Cita

2018-09-11  本文已影响51人  已不再更新

CITA是什么

CITA(Cryptape Inter-enterprise Trust Automation)是秘猿科技自主研发的区块链底层技术平台,用切实可行的方案解决了区块链底层扩展性问题,并于 2017 年 7 月开源 0.8 版本。CITA 是世界上第一个成功引入并实现微服务与逻辑节点的区块链底层内核,共识协议使用了自主开发的 CITA-BFT,具有高性能、高扩展性和可定制性等特点。

安装 rust

curl https://sh.rustup.rs -sSf | sh

下载源码

git clone https://github.com/cryptape/cita.git

编译

rust最多使用cargo编译, Car-go 是rust的包管理工具, 集成了 下载依赖/管理依赖/测试/编译等功能.

cd cita
git checkout v0.18 # 切换到 0.18版本
git submodule init
git submodule update

执行 makefile中的命令

make release

 cargo build --all  --release

 Updating git repository `https://github.com/cryptape/cita-common.git`
 Updating registry `https://github.com/rust-lang/crates.io-index`

 Downloading lru v0.1.7
 Downloading rayon v1.0.2
 Downloading cpuprofiler v0.0.3
 Downloading serde_derive v1.0.71
 Downloading serde v1.0.71
 Downloading error-chain v0.10.0
 Downloading derive-error-chain v0.10.1
 Downloading libc v0.2.43
 Downloading syn v0.11.11
 ......

 Compiling serde v1.0.71
 Compiling proc-macro2 v0.4.12
 Compiling byteorder v1.2.4
 Compiling ethcore-bloom-journal v0.1.0 (https://github.com/cryptape/cita-common.git?branch=develop#67c715f8)
 Compiling protobuf v2.0.4
 Compiling tokio-timer v0.1.2
 Compiling ryu v0.2.3
 Compiling lazycell v0.6.0
 Compiling futures v0.1.23
 Compiling matches v0.1.7
 Compiling itoa v0.4.2
 ......

提示 ld: library not found for -lprofiler, 不能加载类库profiler
安装 gperftools brew install gperftools

再次执行 make release

编译成功

target/install/bin 有很多执行文件

chain-executor-mock
cita
cita-auth
cita-bft
cita-chain
cita-executor
cita-forever
cita-jsonrpc
cita-network
cita-relayer-parser
consensus-mock
create_key_addr
snapshot_tool

安装 python类库

pip3 install pysodium toml jsonschema secp256k1 protobuf requests ecdsa \
  jsonrpcclient[requests]==2.4.2 \
  py_solc==3.0.0 \
  simplejson==3.11.1 \
  pathlib==1.0.1 \
  pysha3>=1.0.2 \
  bitcoin==1.1.42 \
  && pip3 install git+https://github.com/ethereum/pyethereum.git@3d5ec14032cc471f4dcfc7cc5c947294daf85fe0 


参考:

https://github.com/cryptape/cita/issues/162

https://docs.nervos.org/nervos-appchain-docs/#/quick-start/deploy-appchain

https://docs.nervos.org/cita/#/chain/getting_started
dockerfile https://hub.docker.com/r/cita/cita-build/~/dockerfile/

上一篇下一篇

猜你喜欢

热点阅读