truechain / truechain-consensus-core

TrueChain Consensus Protocol: Minerva
Apache License 2.0
161 stars 70 forks source link

Logging for TrueChain #28

Open arcolife opened 6 years ago

arcolife commented 6 years ago

enhance logging for truechain, just like in https://github.com/truechain/py-trueconsensus (truechain's py based alt-ego)

for orchestrator, referred to as minverva.py:

py-trueconsensus  ./minerva.py 
loaded local_config.py from /etc/truechain
Storing engine logs to file: /var/log/truechain/engine.log
Storing client logs to file: /var/log/truechain/client.log
Start time:  2018-07-07 17:17:01.603656
Threading enabled:  True
run started
run started
run started
run started
Node: [3], Msg: [Firing up gRPC channel], Address: [127.0.0.1:49503]
Node: [0], Msg: [Firing up gRPC channel], Address: [127.0.0.1:49500]
Node: [2], Msg: [Firing up gRPC channel], Address: [127.0.0.1:49502]
Node: [1], Msg: [Firing up gRPC channel], Address: [127.0.0.1:49501]
Node: [3], Msg: [INIT SERVER LOOP]
Node: [1], Msg: [INIT SERVER LOOP]
Node: [0], Msg: [INIT SERVER LOOP]
Node: [2], Msg: [INIT SERVER LOOP]

for client:

py-trueconsensus  tail -f /var/log/truechain/client.log 
...
[2018-07-03 02:57:28,891] [DEBUG ] [bank.py:118:open_db_conn()] - Msg: [Opened Database connection..], ForNode: [None]
[2018-07-03 02:57:28,891] [DEBUG ] [bank.py:140:gen_accounts()] - Generating 4 accounts
[2018-07-03 02:57:28,897] [ERROR ] [client.py:99:send_requests()] - Msg: [failed to send], Target: [127.0.0.1:49500], Error => {Value out of range: 77600048550433786810477053529344464877384026879796736630228681607545426539267}

for server:

py-trueconsensus  tail -f /var/log/truechain/engine.log
...
[2018-07-07 17:17:01,612] [DEBUG ] [engine.py:171:init_grpc_server()] - Node: [3], Msg: [Firing up gRPC channel], Address: [127.0.0.1:49503]
[2018-07-07 17:17:01,614] [DEBUG ] [engine.py:171:init_grpc_server()] - Node: [0], Msg: [Firing up gRPC channel], Address: [127.0.0.1:49500]
[2018-07-07 17:17:01,614] [DEBUG ] [engine.py:171:init_grpc_server()] - Node: [2], Msg: [Firing up gRPC channel], Address: [127.0.0.1:49502]
[2018-07-07 17:17:01,616] [DEBUG ] [engine.py:171:init_grpc_server()] - Node: [1], Msg: [Firing up gRPC channel], Address: [127.0.0.1:49501]
[2018-07-07 17:17:01,810] [INFO ] [node.py:934:parse_request()] - Node: [0], Phase: [PARSE REQUEST], RequestInnerID: [2]
[2018-07-07 17:17:01,830] [INFO ] [node.py:61:record_pbft()] - Node: [0], Req Type: [INIT], Seq: [0], Received From: [2], In View: [0]
[2018-07-07 17:17:01,937] [INFO ] [node.py:934:parse_request()] - Node: [0], Phase: [PARSE REQUEST], RequestInnerID: [3]
[2018-07-07 17:17:01,937] [INFO ] [node.py:61:record_pbft()] - Node: [0], Req Type: [INIT], Seq: [0], Received From: [3], In View: [0]
...
[2018-07-07 17:17:03,281] [INFO ] [node.py:211:unicast_message()] - Node [2], Msg: [FastChainStub.Send()], Status: [200], Target Replica: [3]
[2018-07-07 17:17:03,281] [INFO ] [engine.py:224:run()] - Node: [2], Current Primary: [0]
...
[2018-07-07 17:17:22,128] [DEBUG ] [engine.py:131:NewTxnRequest()] - Node: [0], Msg: [Received Client Request for Acc Nonce 254 for Recipient b'0xa593094cebb06bf34df7311845c2a34996b52324']
[2018-07-07 17:17:23,081] [DEBUG ] [engine.py:274:run()] - Node: [3], Waiting for next batch..
[2018-07-07 17:17:23,198] [DEBUG ] [engine.py:274:run()] - Node: [1], Waiting for next batch..