1

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

4

1 回答 1

3

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

[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。因此,可以启动共识引擎。

于 2019-03-08T13:57:00.803 回答