Hyperledger Sawtooth无法启动devmode共识引擎

时间:2019-03-07 16:41:52

标签: blockchain hyperledger-sawtooth

我正在尝试在Ubuntu 16.04上启动Hyperledger Sawtooth网络。我正在按照https://sawtooth.hyperledger.org/docs/core/releases/latest/app_developers_guide/ubuntu.html的说明进行操作。

启动验证服务可以正常运行,但是无法启动devmode共识引擎。发生了以下情况:

mdi@boromir:~$ sudo -u sawtooth devmode-engine-rust -vv --connect tcp://localhost:5050
ERROR | devmode_engine_rust: | ReceiveError: TimeoutError
DEBUG | sawtooth_sdk::messag | Disconnected outbound channel
DEBUG | sawtooth_sdk::messag | Exited stream
DEBUG | zmq:547              | socket dropped
DEBUG | zmq:547              | socket dropped
DEBUG | zmq:454              | context dropped
mdi@boromir:~$

验证服务正在运行,如下所示:

mdi@boromir:~$ sudo -u sawtooth sawtooth-validator -vv
[sudo] password for mdi: 
[2019-03-07 16:40:15.601 WARNING  (unknown file)] [src/pylogger.rs: 40] Started logger at level DEBUG
[2019-03-07 16:40:15.919 DEBUG    ffi] loading library libsawtooth_validator.so
[2019-03-07 16:40:15.926 DEBUG    ffi] loading library libsawtooth_validator.so
[2019-03-07 16:40:16.299 INFO     path] Skipping path loading from non-existent config file: /etc/sawtooth/path.toml
[2019-03-07 16:40:16.299 INFO     validator] Skipping validator config loading from non-existent config file: /etc/sawtooth/validator.toml
[2019-03-07 16:40:16.300 INFO     keys] Loading signing key: /etc/sawtooth/keys/validator.priv
[2019-03-07 16:40:16.306 INFO     cli] sawtooth-validator (Hyperledger Sawtooth) version 1.1.4
[2019-03-07 16:40:16.307 INFO     cli] config [path]: config_dir = "/etc/sawtooth"; config [path]: key_dir = "/etc/sawtooth/keys"; config [path]: data_dir = "/var/lib/sawtooth"; config [path]: log_dir = "/var/log/sawtooth"; config [path]: policy_dir = "/etc/sawtooth/policy"
[2019-03-07 16:40:16.307 WARNING  cli] Network key pair is not configured, Network communications between validators will not be authenticated or encrypted.
[2019-03-07 16:40:16.333 DEBUG    state_verifier] verifying state in /var/lib/sawtooth/merkle-00.lmdb
[2019-03-07 16:40:16.337 DEBUG    state_verifier] block store file is /var/lib/sawtooth/block-00.lmdb
[2019-03-07 16:40:16.338 INFO     state_verifier] Skipping state verification: chain head's state root is present
[2019-03-07 16:40:16.339 INFO     cli] Starting validator with serial scheduler
[2019-03-07 16:40:16.339 DEBUG    core] global state database file is /var/lib/sawtooth/merkle-00.lmdb
[2019-03-07 16:40:16.340 DEBUG    core] txn receipt store file is /var/lib/sawtooth/txn_receipts-00.lmdb
[2019-03-07 16:40:16.341 DEBUG    core] block store file is /var/lib/sawtooth/block-00.lmdb
[2019-03-07 16:40:16.342 DEBUG    threadpool] Creating thread pool executor Component
[2019-03-07 16:40:16.343 DEBUG    threadpool] Creating thread pool executor Network
[2019-03-07 16:40:16.343 DEBUG    threadpool] Creating thread pool executor Client
[2019-03-07 16:40:16.343 DEBUG    threadpool] Creating thread pool executor Signature
[2019-03-07 16:40:16.345 DEBUG    threadpool] Creating thread pool executor FutureCallback
[2019-03-07 16:40:16.346 DEBUG    threadpool] Creating thread pool executor FutureCallback
[2019-03-07 16:40:16.352 DEBUG    threadpool] Creating thread pool executor Executing
[2019-03-07 16:40:16.353 DEBUG    threadpool] Creating thread pool executor Consensus
[2019-03-07 16:40:16.353 DEBUG    threadpool] Creating thread pool executor FutureCallback
[2019-03-07 16:40:16.358 DEBUG    threadpool] Creating thread pool executor Instrumented
[2019-03-07 16:40:16.368 DEBUG    selector_events] Using selector: ZMQSelector
[2019-03-07 16:40:16.376 INFO     interconnect] Listening on tcp://127.0.0.1:4004
[2019-03-07 16:40:16.377 DEBUG    dispatch] Added send_message function for connection ServerThread
[2019-03-07 16:40:16.377 DEBUG    dispatch] Added send_last_message function for connection ServerThread
[2019-03-07 16:40:16.382 DEBUG    genesis] genesis_batch_file: /var/lib/sawtooth/genesis.batch
[2019-03-07 16:40:16.384 DEBUG    genesis] block_chain_id: not yet specified
[2019-03-07 16:40:16.384 INFO     genesis] Producing genesis block from /var/lib/sawtooth/genesis.batch
[2019-03-07 16:40:16.385 DEBUG    genesis] Adding 1 batches

此输出的时间是17:29,因此几乎一个小时都没有附加输出。

我试图查看锯齿设置:

mdi@boromir:~$ sawtooth settings list
Error: Unable to connect to "http://localhost:8008": make sure URL is correct
mdi@boromir:~$

然后我检查了哪些进程正在侦听哪些端口:

mdi@boromir:~$ netstat -plnt
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:4004          0.0.0.0:*               LISTEN      -               
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -               
tcp6       0      0 :::22                   :::*                    LISTEN      -               
mdi@boromir:~$

有人知道验证程序服务是发起连接还是共识引擎?我的sawtooth settings list命令出了什么问题?有人知道如何使共识引擎正常工作吗?谢谢。

1 个答案:

答案 0 :(得分:1)

我自己找到了答案。我有一台安装了Hyperledger Sawtooth的docker的机器。在该服务器上,验证程序日志的行为:

[2019-03-08 14:39:02.478 INFO     interconnect] Listening on tcp://127.0.0.1:5050

https://sawtooth.hyperledger.org/docs/core/releases/latest/app_developers_guide/ubuntu.html中所述,端口5050用于共识引擎。这清楚表明共识引擎会启动与验证程序服务的连接。

那么,为什么验证程序服务没有监听Ubuntu计算机上的端口5050?因为设置事务处理器从未在Ubuntu计算机上运行。我根据Ubuntu教程中的命令启动了该处理器:

sudo -u sawtooth settings-tp -v

然后,验证程序继续运行并开始侦听端口5050。因此,可以启动共识引擎。