【区块链】Tendermint——多节点Docker Compose部署

多节点Docker Compose部署

本地集群

部署一个4个node的Tendermint区块链网路。

获取Tendermint源码

可以使用git活go get,这里略。

编译

$ make build-linux
$ make build-docker-localnode

启动

$ make localnet-start
docker-compose down
Removing network tendermint_localnet
WARNING: Network tendermint_localnet not found.
make[1]: Entering directory '/home/frank/project/go/tendermint/src/github.com/tendermint/tendermint/networks/local'
docker build --tag tendermint/localnode localnode
Sending build context to Docker daemon  4.608kB
Step 1/11 : FROM alpine:3.7
 ---> 6d1ef012b567
Step 2/11 : MAINTAINER Greg Szabo <greg@tendermint.com>
 ---> Using cache
 ---> 56dc57e31027
Step 3/11 : RUN apk update &&     apk upgrade &&     apk --no-cache add curl jq file
 ---> Using cache
 ---> e76f72fbd3bd
Step 4/11 : VOLUME [ /tendermint ]
 ---> Using cache
 ---> 2db2bc1737b1
Step 5/11 : WORKDIR /tendermint
 ---> Using cache
 ---> 68e161d1c688
Step 6/11 : EXPOSE 26656 26657
 ---> Using cache
 ---> 82f1bd12e713
Step 7/11 : ENTRYPOINT ["/usr/bin/wrapper.sh"]
 ---> Using cache
 ---> 9cea399ec367
Step 8/11 : CMD ["node", "--proxy_app", "kvstore"]
 ---> Using cache
 ---> 36510b247587
Step 9/11 : STOPSIGNAL SIGTERM
 ---> Using cache
 ---> 77d014c73f91
Step 10/11 : COPY wrapper.sh /usr/bin/wrapper.sh
 ---> Using cache
 ---> 12f76b156566
Step 11/11 : COPY config-template.toml /etc/tendermint/config-template.toml
 ---> Using cache
 ---> 5bd6dc502548
Successfully built 5bd6dc502548
Successfully tagged tendermint/localnode:latest
make[1]: Leaving directory '/home/frank/project/go/tendermint/src/github.com/tendermint/tendermint/networks/local'
docker-compose up
Creating network "tendermint_localnet" with driver "bridge"
Creating node2 ... done
Creating node0 ... done
Creating node1 ... done
Creating node3 ... done
Attaching to node2, node0, node3, node1
node0    | I[2020-02-25|12:13:01.616] Version info                                 module=main software=0.33.1 block=10 p2p=7
node2    | I[2020-02-25|12:13:00.739] Version info                                 module=main software=0.33.1 block=10 p2p=7

容器

$ sudo docker ps -a
CONTAINER ID        IMAGE                  COMMAND                  CREATED             STATUS                            PORTS               NAMES
09946ef320dd        tendermint/localnode   "/usr/bin/wrapper.sh…"   2 minutes ago       Exited (137) About a minute ago                       node1
1b1b752e86e1        tendermint/localnode   "/usr/bin/wrapper.sh…"   2 minutes ago       Exited (137) About a minute ago                       node3
2661a76dcd5e        tendermint/localnode   "/usr/bin/wrapper.sh…"   2 minutes ago       Exited (137) About a minute ago                       node0
77e667017254        tendermint/localnode   "/usr/bin/wrapper.sh…"   2 minutes ago       Exited (137) About a minute ago                       node2

镜像

$ sudo docker images | grep tendermint
tendermint/localnode            latest              5bd6dc502548        4 weeks ago         13.7MB
tendermint/tendermint           latest              d0f9c639fc2d        5 weeks ago         39.6MB

停止

$ make localnet-stop
docker-compose down
Removing node1 ... done
Removing node3 ... done
Removing node0 ... done
Removing node2 ... done
Removing network tendermint_localnet
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

夏 克

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值