区块链 | Distributed Ledger Technology区块链技术探索

Quorum-example搭建

2018-10-17  本文已影响19人  hasika

example实例分析

example提供了两种私密交易管理,两种共识机制,两两可以互相结合使用。

私密交易管理
共识机制

constellation+raft 环境搭建

安装依赖库
apt-get install libdb-dev libleveldb-dev libsodium-dev zlib1g-dev libtinfo-dev
下载quorum
git clone  https://github.com/jpmorganchase/quorum.git
git checkout v2.1.0
cd quorum
make all

编译完成后,会在quorum/build/bin目录下生成一些可执行命令,类似:

abigen  bootnode  evm  examples  faucet  geth  p2psim  puppeth  rlpdump  swarm  wnode
下载costellation-node
//下载
wget https://github.com/jpmorganchase/constellation/releases/download/v0.3.2/constellation-0.3.2-ubuntu1604.tar.xz
//解压
xz -d constellation-0.3.2-ubuntu1604.tar.xz
//打开
tar -xvf constellation-0.3.2-ubuntu1604.tar

执行完后会在~/constellation-0.3.2-ubuntu1604目录下发现constellation-node可执行文件。

将constellation-node配置在环境变量中

下载quorum-examples

git clone https://github.com/jpmorganchase/quorum-examples.git

初始化7个节点

cd /quorum-examples/examples/7nodes
sudo ./raft-init.sh
启动constellation
sudo ./constellation-start.sh

可以通过以下命令查看启动的进程

ps -ef | grep constellation-node

杀掉所有constellation-node进程

sudo killall constellation-node
启动geth节点和constellation节点
./raft-start.sh
验证节点是否成功启动
geth attach qdata/dd1/geth.ipc
>Welcome to the Geth JavaScript console!
私密交易失败

https://github.com/jpmorganchase/quorum-examples

github上直接说明了,在本地环境搭建的quorum不支持Constellation

Rejected peer before protocol handshake id=ac6b1096ca56b9f6 addr=127.0.0.1:21000 conn=staticdial err="connected to self"

tessera+raft 环境搭建

安装依赖
下载安装tessera
git clone https://github.com/jpmorganchase/tessera.git
maven install

安装完成后,需要将/tessera/tessera-app/target目录下的tessera-app-0.7-SNAPSHOT-app.jar配置到

tessera-start.sh文件中。

下载quorum
git clone  https://github.com/jpmorganchase/quorum.git
git checkout v2.1.0
cd quorum
make all

编译完成后,会在quorum/build/bin目录下生成一些可执行命令,类似:

abigen  bootnode  evm  examples  faucet  geth  p2psim  puppeth  rlpdump  swarm  wnode
下载quorum-examples

git clone https://github.com/jpmorganchase/quorum-examples.git

初始化7个节点

cd /quorum-examples/examples/7nodes
sudo ./raft-init.sh
启动geth节点和constellation节点
./raft-start.sh
验证节点是否成功启动
geth attach qdata/dd1/geth.ipc
>Welcome to the Geth JavaScript console!

https://t.zsxq.com/iiMvfea

我的星球.jpg
上一篇下一篇

猜你喜欢

热点阅读