Hyperledger Sawtooth 无法启动 devmode 共识引擎

Hyperledger Sawtooth cannot start devmode consensus engine

我正在尝试在 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 命令有什么问题?有人知道如何让共识引擎工作吗?谢谢。

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

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

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

那么为什么验证器服务没有在我的 Ubuntu 机器上侦听端口 5050?因为设置事务处理器从未在 Ubuntu 机器上 运行。我按照Ubuntu教程中的命令启动了这个处理器:

sudo -u sawtooth settings-tp -v

然后验证器开始监听 5050 端口。因此,共识引擎可以启动。