CITA环境搭建与运行

CITA环境配置与部署(Ubuntu18.04)

1.安装Rust
sudo apt-get install curl
curl https://sh.rustup.rs -sSf | sh
sudo apt-get install rustc
检查rustc安装是否成功
rustc --version
2.下载CITA源码
git clone -b v0.25.2 https://github.com/citahub/cita
cd cita
git submodule init

遇到Submodule ‘cita-bft’(…)registered for path 'cita-bft’报错时:
git submodule sync
git submodule update --init --recursive

git submodule update
3.编译
调试模式编译./env.sh make debug

遇到docker find no command报错
sudo apt install docker.io
再次编译遇到get permission denied报错
sudo groupadd docker #添加docker用户组
sudo gpasswd -a 用户名 docker#用户名为当前用户用户名
newgrp docker
docker ps

发行模式编译./env.sh make release #未测试

4.配置CITA
cita-cli key create 返回address,private,public

若cita-cli命令不存在,下载cita-cli安装包
https://docs.citahub.com/zh-CN/cita/getting-started/setup 下载在cita文件夹中

进入编译好的结果目录cita/target/install,初始化链
bin/cita create --super_admin "0x37d1c7449bfe76fe9c445e626da06265e9377601" --nodes "127.0.0.1:4000,127.0.0.1:4001,127.0.0.1:4002,127.0.0.1:4003" --chain_name "test-chain01" #super_admin地址用上面返回的address

5.启动CITA
第一次启动 CITA 时需要使用 setup 命令初始化每个节点,之后重新启动不需要再次操作。(也在install下操作)
bin/cita setup test-chain01/0 #test-chain01/节点编号
bin/cita start test-chain01/0
启动0-3四个节点后,检查节点是否运行正常
bin/cita top test-chain01/0 #test-chain01/节点编号
通过端口localhost:15672访问rabbitmq通信可视化

CITA在vscode中运行问题

cargo build error:failed to run custom build command for 'openssl-sys v0.9.39’
sudo apt install libssl-dev安装最新的libssl包
sudo rm -rf Cargo.lock target/清除之前build failed的文件

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值