官网链接:
0.新建了一个目录:new_7_node_test
在该目录下进行了以下操作:
(共有三种启动运行方式,选择了第三种Running locally)
一、Running Locally
1.第一步:安装go(我的本地已经有了)
2.第二步:下载并构建quorum
git clone https://github.com/jpmorganchase/quorum
cd quorum
make
GETHDIR=`pwd`; export PATH=$GETHDIR/build/bin:$PATH
cd ..
3.第三步:下载并构建tessera
git clone https://github.com/jpmorganchase/tessera.git
cd tessera
mvn install
- 其中,使用mvn之前需要安装maven,通过sudo apt进行安装
- 卡在mvn install,花费时间太长(20201022)
4.第四步:下载quorum-examples
git clone https://github.com/jpmorganchase/quorum-examples
5.第五步:启动7nodes网络
5.1 stop20201025
Running locally这种方式有问题,换成docker-compose进行尝试。
二、Running with Docker
1.第一步 安装Docker,本地已有
2.第二步 下载并运行docker-compose
git clone https://github.com/jpmorganchase/quorum-examples
cd quorum-examples
docker-compose up -d
3.第三步 默认使用Tessera和IBFT
若要自定义,可以使用以下命令:
PRIVATE_CONFIG=ignore QUORUM_CONSENSUS=raft docker-compose up -d
4.第四步 运行docker ps
查看验证所有quorum-examples容器(7 nodes and 7 tx managers) 都是健健康康的。
5.第五步 查看日志
运行以下命令,用于查看特定容器的日志:
docker logs [container-name] -f
6.第六步 运行7nodes示例
打开geth的js控制台连接到特定节点,并发送一个私有交易
$ docker exec -it quorum-examples_node1_1 geth attach /qdata/dd/geth.ipc
Welcome to the Geth JavaScript console!
instance: Geth/node1-istanbul/v1.7.2-stable/linux-amd64/go1.9.7
coinbase: 0xd8dba507e85f116b1f7e231ca8525fc9008a6966
at block: 70 (Thu, 18 Oct 2018 14:49:47 UTC)
datadir: /qdata/dd
modules: admin:1.0 debug:1.0 eth:1.0 istanbul:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 txpool:1.0 web3:1.0
> loadScript('/examples/private-contract.js')
7.第七步 关闭Quorum网络
docker-compose down