我通过以下步骤在Ubuntu 16.04.4-VM上运行Hyperledger Burrow:
安装Go:
cd Downloads
wget https://dl.google.com/go/go1.10.3.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.10.3.linux-amd64.tar.gz
安装Burrow:
export PATH=$PATH:/usr/local/go/bin
export GOPATH=$HOME/go
go get github.com/hyperledger/burrow
cd $GOPATH/src/github.com/hyperledger/burrow
make build
安装Bosmarmot:
(export PATH=$PATH:/usr/local/go/bin)
(export GOPATH=$HOME/go)
go get github.com/monax/bosmarmot
cd $GOPATH/src/github.com/monax/bosmarmot
make build
安装Solc:
sudo add-apt-repository ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install solc
配置并启动挖洞:
cd $GOPATH/src/github.com/hyperledger/burrow/bin
./burrow spec --participant-accounts=1 --full-accounts=1 > genesis-spec.json
./burrow configure --genesis-spec=genesis-spec.json > burrow.toml
./burrow start --validator-index=0 2>burrow.log &
绑定合同:
[copy validator-address from burrow.toml]
cd [your contract folder here]
$GOPATH/src/github.com/monax/bosmarmot/bin/bos --keys="localhost:10997" --chain-url="tcp://localhost:46657" --address=[insert copied address here]
到目前为止运行良好。现在,我正在尝试在同一虚拟机上运行的Docker容器中执行相同的操作。
Dockerfile:
FROM golang
RUN apt-get update && \
apt-get -y install sudo
RUN apt-get -y install software-properties-common
EXPOSE 46657
EXPOSE 10997
COPY init.sh /init.sh
COPY start.sh /start.sh
COPY contract /contract
RUN /init.sh
CMD /start.sh
init.sh:
#!/bin/bash
go get github.com/hyperledger/burrow
cd $GOPATH/src/github.com/hyperledger/burrow
make build
go get github.com/monax/bosmarmot
cd $GOPATH/src/github.com/monax/bosmarmot
make build
start.sh:
#!/bin/bash
cd $GOPATH/src/github.com/hyperledger/burrow/bin
./burrow spec --participant-accounts=1 --full-accounts=1 > genesis-spec.json
./burrow configure --genesis-spec=genesis-spec.json > burrow.toml
./burrow start --validator-index=0 2>burrow.log &
cd $GOPATH/src/github.com/hyperledger/burrow/bin
ValIdWhole=$(awk NR==31 burrow.toml)
ValId=${ValIdWhole:15:40}
cd /contract
$GOPATH/src/github.com/monax/bosmarmot/bin/bos --keys="localhost:10997" --chain-url="tcp://localhost:46657" --address=$ValId
结果是此错误,尝试绑定合同时发生:
root@d11d1125ff0a:/contract# $GOPATH/src/github.com/monax/bosmarmot/bin/bos --keys="localhost:10997" --chain-url="tcp://localhost:46657" --address=$ValId
*****Executing Job*****
Job Name => defaultAddr
defAddr => EF624B8C6B430837D2D5EF1E6B16F1CD67B0FBD5
There has been an error talking to your burrow keys service.
keys instance did not become responsive after 5s: rpc error: code = Unimplemented desc = unknown service pbkeys.Keys
Debugging this error is tricky, but don't worry the marmot recovery checklist is...
* is your EF624B8C6B430837D2D5EF1E6B16F1CD67B0FBD5 account right?
* is the key for EF624B8C6B430837D2D5EF1E6B16F1CD67B0FBD5 in your keys service: burrow keys list ?
帐户地址正确,并且也已在密钥列表中注册。谁能告诉我为什么它在docker中不起作用?