hyperledger-archives / iroha

Iroha - A simple, decentralized ledger
http://iroha.tech
Apache License 2.0
988 stars 297 forks source link

Getting started examples don't work #2019

Closed building39 closed 5 years ago

building39 commented 5 years ago

I have managed to successfully build (I think) the 1.0.0_beta_5 branch, but the examples in the Getting started doc don't seem to work. My config file looks like:

  "block_store_path" : "/tmp/block_store/",
  "torii_port" : 50051,
  "internal_port" : 10001,
  "pg_opt" : "host=localhost port=5432 user=postgres password=mysecretpassword",
  "max_proposal_size" : 10,
  "proposal_delay" : 5000,
  "vote_delay" : 5000,
  "mst_enable" : false
}```
and I'm running the daemon like this:
`irohad --config ../config.iroha3 --genesis_block ./genesis.block --keypair_name iroha3`
The key pair was previously created.

Following the example, I added a new asset `coolcoin`, added an asset quantity, and transferred some of that quantity to the `test@test` account. When I send the transaction to my peer, the peer logs this to the console:

```[2019-01-13 14:43:28.324584776][th:2885][info] IROHAD [Init] => storage
[2019-01-13 14:43:28.333929637][th:2885][info] StorageImpl drop wsv records from db tables
[2019-01-13 14:43:28.344206138][th:2885][info] StorageImpl drop blocks from disk
[2019-01-13 14:43:28.344773710][th:2885][info] StorageImpl create ordering service persistent state
[2019-01-13 14:43:28.344999269][th:2885][info] PostgresOrderingServicePersistentState Drop storage
[2019-01-13 14:43:28.381433999][th:2885][info] StorageImpl create ordering service persistent state
[2019-01-13 14:43:28.381636309][th:2885][info] PostgresOrderingServicePersistentState Drop storage
[2019-01-13 14:43:28.387742260][th:2885][info] MAIN Block is parsed
[2019-01-13 14:43:28.387945880][th:2885][info] StorageImpl create mutable storage
[2019-01-13 14:43:28.388100447][th:2885][info] FlatFile get(0) file not found
[2019-01-13 14:43:28.389050269][th:2885][info] MutableStorage Applying block: height 1, hash b328009b869a5c8809f2ffeeb362a34526b8c1fad626fedf156698b5554c1e75
[2019-01-13 14:43:28.399931370][th:2885][info] StorageImpl block inserted: true
[2019-01-13 14:43:28.403086287][th:2885][info] MAIN Genesis block inserted, number of transactions: 1
[2019-01-13 14:43:28.407444817][th:2885][info] StorageImpl drop wsv records from db tables
[2019-01-13 14:43:28.412211964][th:2885][info] StorageImpl drop blocks from disk
[2019-01-13 14:43:28.412548694][th:2885][info] StorageImpl create mutable storage
[2019-01-13 14:43:28.412691516][th:2885][info] FlatFile get(0) file not found
[2019-01-13 14:43:28.413435094][th:2885][info] MutableStorage Applying block: height 1, hash b328009b869a5c8809f2ffeeb362a34526b8c1fad626fedf156698b5554c1e75
[2019-01-13 14:43:28.424335911][th:2885][info] StorageImpl insert blocks finished
[2019-01-13 14:43:28.424568119][th:2885][info] IROHAD [Init] => crypto provider
[2019-01-13 14:43:28.424723665][th:2885][info] IROHAD [Init] => transaction batch parser
[2019-01-13 14:43:28.424991244][th:2885][info] IROHAD [Init] => validators
[2019-01-13 14:43:28.426332403][th:2885][info] IROHAD [Init] => factories
[2019-01-13 14:43:28.427652340][th:2885][info] OrderingInit Ordering gate is at 0.0.0.0:10001
[2019-01-13 14:43:28.429132273][th:2885][info] StorageImpl create ordering service persistent state
[2019-01-13 14:43:28.434028358][th:2885][info] OrderingInit Creating Ordering Gate with initial height 1
[2019-01-13 14:43:28.434209307][th:2885][info] AsyncGrpcClient Subscribe
[2019-01-13 14:43:28.434373034][th:2885][info] IROHAD [Init] => init ordering gate - [true]
[2019-01-13 14:43:28.434736095][th:2885][info] IROHAD [Init] => init simulator
[2019-01-13 14:43:28.434881029][th:2885][info] IROHAD [Init] => init consensus block cache
[2019-01-13 14:43:28.435112898][th:2885][info] IROHAD [Init] => block loader
[2019-01-13 14:43:28.436609120][th:2885][info] IROHAD [Init] => consensus gate
[2019-01-13 14:43:28.436988917][th:2885][info] IROHAD [Init] => synchronizer
[2019-01-13 14:43:28.437281114][th:2885][info] OrderingGate setPcs
[2019-01-13 14:43:28.438127170][th:2885][info] IROHAD [Init] => pcs
[2019-01-13 14:43:28.438435106][th:2885][info] IROHAD [Init] => Tx status bus
[2019-01-13 14:43:28.439005145][th:2885][info] IROHAD [Init] => MST processor
[2019-01-13 14:43:28.439332859][th:2885][info] IROHAD [Init] => pending transactions storage
[2019-01-13 14:43:28.441132844][th:2885][info] IROHAD [Init] => command service
[2019-01-13 14:43:28.441502249][th:2885][info] IROHAD [Init] => query service
[2019-01-13 14:43:28.441627348][th:2885][info] MAIN Running iroha
[2019-01-13 14:43:28.443200735][th:2885][info] IROHAD Torii server bound on port 50051
[2019-01-13 14:43:28.443666924][th:2885][info] IROHAD Internal server bound on port 10001
[2019-01-13 14:43:28.443872447][th:2885][info] IROHAD ===> iroha initialized
[2019-01-13 14:44:40.021147914][th:2903][info] TxProcessor handle batch
[2019-01-13 14:44:40.021329332][th:2903][info] TxProcessor propagating batch to PCS
[2019-01-13 14:44:40.023738985][th:2903][info] PCS propagate batch
[2019-01-13 14:44:40.023971133][th:2903][info] OrderingGate propagate batch, account_id: admin@test
[2019-01-13 14:44:40.024049416][th:2903][info] AsyncGrpcClient Propagate transaction batch (on transport)
[2019-01-13 14:44:40.027621490][th:2904][info] AsyncGrpcClient OrderingServiceTransportGrpc::onBatch
[2019-01-13 14:44:40.027988494][th:2904][info] OrderingServiceImpl Queue size is 1
[2019-01-13 14:44:43.428900242][th:2899][info] OrderingServiceImpl Start proposal generation
[2019-01-13 14:44:43.430907256][th:2899][info] StorageImpl create ordering service persistent state
[2019-01-13 14:44:43.431025087][th:2899][info] PostgresOrderingServicePersistentState Save proposal_height in ordering_service_state 3
[2019-01-13 14:44:43.435460655][th:2899][info] AsyncGrpcClient OrderingServiceTransportGrpc::publishProposal
[2019-01-13 14:44:43.438938825][th:2914][info] AsyncGrpcClient receive proposal
[2019-01-13 14:44:43.443213006][th:2914][info] AsyncGrpcClient transactions in proposal: 1
[2019-01-13 14:44:43.443383622][th:2914][info] OrderingGate Received new proposal, height: 2
[2019-01-13 14:44:43.443970814][th:2901][info] OrderingGate Pass the proposal to pipeline height 2
[2019-01-13 14:44:43.444098889][th:2901][info] Simulator process proposal
[2019-01-13 14:44:43.447402032][th:2901][info] SFV transactions in proposal: 1
[2019-01-13 14:44:43.458950009][th:2901][info] SFV transactions in verified proposal: 1
[2019-01-13 14:44:43.460308533][th:2901][info] Simulator process verified proposal
[2019-01-13 14:44:43.463720632][th:2901][info] YacGate vote for block (ff11d2d67d84a87d6f15f680155ec87c009bdfab6ae8230afab5cab1ba4ac33c, Hash: [ff11d2d67d84a87d6f15f680155ec87c009bdfab6ae8230afab5cab1ba4ac33c ])
[2019-01-13 14:44:43.466339880][th:2901][info] YAC Order for voting: {0.0.0.0:10001}
[2019-01-13 14:44:43.468509219][th:2901][info] YAC Vote for round (2, 1), hash (ff11d2d67d84a87d6f15f680155ec87c009bdfab6ae8230afab5cab1ba4ac33c, ff11d2d67d84a87d6f15f680155ec87c009bdfab6ae8230afab5cab1ba4ac33c)
[2019-01-13 14:44:43.469862453][th:2901][info] AsyncGrpcClient Send votes bundle[size=1] to 0.0.0.0:10001
[2019-01-13 14:44:43.470424481][th:2901][info] TxProcessor on stateful validation success: bbe7813426b90de17a8ca41946488af93616b62e9ecfdcdcda810fa17cc2ca80
[2019-01-13 14:44:43.470587943][th:2904][info] AsyncGrpcClient Receive votes[size=1] from ipv4:127.0.0.1:53106
[2019-01-13 14:44:43.471043722][th:2901][info] IROHAD ~~~~~~~~~| PROPOSAL ^_^ |~~~~~~~~~ 
[2019-01-13 14:44:43.471951688][th:2904][info] ProposalStorage Vote with round [2, 1] and hashes [ff11d2d67d84a87d6f15f680155ec87c009bdfab6ae8230afab5cab1ba4ac33c, ff11d2d67d84a87d6f15f680155ec87c009bdfab6ae8230afab5cab1ba4ac33c] looks valid
[2019-01-13 14:44:43.472074954][th:2904][info] YacBlockStorage Vote with rounds (2, 1) and hashes (ff11d2d67d84a87d6f15f680155ec87c009bdfab6ae8230afab5cab1ba4ac33c, ff11d2d67d84a87d6f15f680155ec87c009bdfab6ae8230afab5cab1ba4ac33c) inserted
[2019-01-13 14:44:43.472103930][th:2904][info] YacBlockStorage Votes in storage [1/1]
[2019-01-13 14:44:43.472152282][th:2904][info] YAC Propagate state (2, 1) to whole network
[2019-01-13 14:44:43.472527764][th:2904][info] AsyncGrpcClient Send votes bundle[size=1] to 0.0.0.0:10001
[2019-01-13 14:44:43.473574982][th:2914][info] AsyncGrpcClient Receive votes[size=1] from ipv4:127.0.0.1:53106
[2019-01-13 14:44:43.476719501][th:2914][info] YAC Pass outcome for (2, 1) to pipeline
[2019-01-13 14:44:43.477043695][th:2914][info] YacGate consensus: commit top block: height 2, hash ff11d2d67d84a87d6f15f680155ec87c009bdfab6ae8230afab5cab1ba4ac33c
[2019-01-13 14:44:43.477143311][th:2914][info] synchronizer processing commit
[2019-01-13 14:44:43.484578615][th:2914][info] ChainValidator validate chain...
[2019-01-13 14:44:43.485073421][th:2914][info] MutableStorage Applying block: height 2, hash ff11d2d67d84a87d6f15f680155ec87c009bdfab6ae8230afab5cab1ba4ac33c
[2019-01-13 14:44:43.485156227][th:2914][info] ChainValidator validate block: height 2, hash ff11d2d67d84a87d6f15f680155ec87c009bdfab6ae8230afab5cab1ba4ac33c
[2019-01-13 14:44:43.487247712][th:2914][info] ChainValidator Block does not contain signatures of supermajority of peers. Block signatures public keys: [28483d999f9c8539197d7f6fc5cde6db376f1e9e804039b1d0ab2fe235683140], ledger peers public keys: [bddd58404d1315e0eb27902c5d7c8eb0602c16238f005773df406bc191308929]
[2019-01-13 14:44:43.493443894][th:2914][error] BlockLoaderImpl Failed to find requested peer
[2019-01-13 14:44:43.493512197][th:2914][error] BlockLoaderImpl Cannot find peer
[2019-01-13 14:44:43.493581842][th:2914][info] synchronizer Downloaded an empty chain
[2019-01-13 14:44:43.496560833][th:2914][error] BlockLoaderImpl Failed to find requested peer
[2019-01-13 14:44:43.496620020][th:2914][error] BlockLoaderImpl Cannot find peer
[2019-01-13 14:44:43.496687180][th:2914][info] synchronizer Downloaded an empty chain
[2019-01-13 14:44:43.500273725][th:2914][error] BlockLoaderImpl Failed to find requested peer
[2019-01-13 14:44:43.500332329][th:2914][error] BlockLoaderImpl Cannot find peer
[2019-01-13 14:44:43.500394535][th:2914][info] synchronizer Downloaded an empty chain```

The peer appears to get into a failure loop, where the last three lines are continuously and rapidly repeated until I kill the peer.

If I then add a peer to the`peer` table in postgres:
`insert into peer (public_key, address) values('28483d999f9c8539197d7f6fc5cde6db376f1e9e804039b1d0ab2fe235683140', '10.138.77.23:10001');`
and recreate the transaction, sending it to `localhost:50051`, the peer logs this to the console:

[2019-01-13 14:50:27.337290874][th:2965][info] IROHAD [Init] => storage [2019-01-13 14:50:27.347855459][th:2965][info] StorageImpl drop wsv records from db tables [2019-01-13 14:50:27.367309330][th:2965][info] StorageImpl drop blocks from disk [2019-01-13 14:50:27.367753906][th:2965][info] StorageImpl create mutable storage [2019-01-13 14:50:27.367856657][th:2965][info] FlatFile get(0) file not found [2019-01-13 14:50:27.368764854][th:2965][info] MutableStorage Applying block: height 1, hash b328009b869a5c8809f2ffeeb362a34526b8c1fad626fedf156698b5554c1e75 [2019-01-13 14:50:27.382140435][th:2965][info] StorageImpl insert blocks finished [2019-01-13 14:50:27.382317167][th:2965][info] IROHAD [Init] => crypto provider [2019-01-13 14:50:27.382347611][th:2965][info] IROHAD [Init] => transaction batch parser [2019-01-13 14:50:27.382516114][th:2965][info] IROHAD [Init] => validators [2019-01-13 14:50:27.383731985][th:2965][info] IROHAD [Init] => factories [2019-01-13 14:50:27.385042751][th:2965][info] OrderingInit Ordering gate is at 0.0.0.0:10001 [2019-01-13 14:50:27.386499887][th:2965][info] StorageImpl create ordering service persistent state [2019-01-13 14:50:27.390678218][th:2965][info] OrderingInit Creating Ordering Gate with initial height 1 [2019-01-13 14:50:27.390868027][th:2965][info] AsyncGrpcClient Subscribe [2019-01-13 14:50:27.391022586][th:2965][info] IROHAD [Init] => init ordering gate - [true] [2019-01-13 14:50:27.391375498][th:2965][info] IROHAD [Init] => init simulator [2019-01-13 14:50:27.391503587][th:2965][info] IROHAD [Init] => init consensus block cache [2019-01-13 14:50:27.391718429][th:2965][info] IROHAD [Init] => block loader [2019-01-13 14:50:27.393107779][th:2965][info] IROHAD [Init] => consensus gate [2019-01-13 14:50:27.393470250][th:2965][info] IROHAD [Init] => synchronizer [2019-01-13 14:50:27.393792753][th:2965][info] OrderingGate setPcs [2019-01-13 14:50:27.394568533][th:2965][info] IROHAD [Init] => pcs [2019-01-13 14:50:27.394882208][th:2965][info] IROHAD [Init] => Tx status bus [2019-01-13 14:50:27.395377308][th:2965][info] IROHAD [Init] => MST processor [2019-01-13 14:50:27.395681019][th:2965][info] IROHAD [Init] => pending transactions storage [2019-01-13 14:50:27.396354222][th:2965][info] IROHAD [Init] => command service [2019-01-13 14:50:27.396716934][th:2965][info] IROHAD [Init] => query service [2019-01-13 14:50:27.396882438][th:2965][info] MAIN Running iroha [2019-01-13 14:50:27.398442313][th:2965][info] IROHAD Torii server bound on port 50051 [2019-01-13 14:50:27.398908860][th:2965][info] IROHAD Internal server bound on port 10001 [2019-01-13 14:50:27.399072925][th:2965][info] IROHAD ===> iroha initialized [2019-01-13 14:53:56.702340329][th:2992][info] TxProcessor handle batch [2019-01-13 14:53:56.702466508][th:2992][info] TxProcessor propagating batch to PCS [2019-01-13 14:53:56.702780017][th:2992][info] PCS propagate batch [2019-01-13 14:53:56.702826341][th:2992][info] OrderingGate propagate batch, account_id: admin@test [2019-01-13 14:53:56.702875588][th:2992][info] AsyncGrpcClient Propagate transaction batch (on transport) [2019-01-13 14:53:56.704800291][th:2984][info] AsyncGrpcClient OrderingServiceTransportGrpc::onBatch [2019-01-13 14:53:56.705043228][th:2984][info] OrderingServiceImpl Queue size is 1 [2019-01-13 14:53:57.386236623][th:2979][info] OrderingServiceImpl Start proposal generation [2019-01-13 14:53:57.388167786][th:2979][info] StorageImpl create ordering service persistent state [2019-01-13 14:53:57.388261442][th:2979][info] PostgresOrderingServicePersistentState Save proposal_height in ordering_service_state 4 [2019-01-13 14:53:57.392543019][th:2979][info] AsyncGrpcClient OrderingServiceTransportGrpc::publishProposal [2019-01-13 14:53:57.395254346][th:3006][info] AsyncGrpcClient receive proposal [2019-01-13 14:53:57.396786393][th:3006][info] AsyncGrpcClient transactions in proposal: 1 [2019-01-13 14:53:57.396824017][th:3006][info] OrderingGate Received new proposal, height: 3```

The failure loop noted above does not recur. However, entering the query as instructed in the Getting Started guide does not give the expected results:

Choose what to do:
1. New transaction (tx)
2. New query (qry)
3. New transaction status request (st)
> : 2
Choose query: 
1. Get all permissions related to role (get_role_perm)
2. Get Transactions by transactions' hashes (get_tx)
3. Get information about asset (get_ast_info)
4. Get Account's Transactions (get_acc_tx)
5. Get Account's Asset Transactions (get_acc_ast_tx)
6. Get all current roles in the system (get_roles)
7. Get Account's Signatories (get_acc_sign)
8. Get Account's Assets (get_acc_ast)
9. Get Account Information (get_acc)
0. Back (b)
> : 8
Requested account Id: test@test
Requested asset Id: coolcoin#test
Query is formed. Choose what to do:
1. Send to Iroha peer (send)
2. Save as json file (save)
0. Back (b)
> : 1
Peer address (0.0.0.0): localhost
Peer port (50051): 
[2019-01-13 14:57:28.718965306][th:3000][info] QueryResponseHandler [Account Assets]
--------------------
Choose what to do:
1. New transaction (tx)
2. New query (qry)
3. New transaction status request (st)
> :

What might I be doing wrong?

building39 commented 5 years ago

I might add that this peer is running on a virtual machine, not in a docker container.

luckychess commented 5 years ago

I would suggest you to update Iroha to rc2 first. Beta 5 is a pretty old now.

LiraLemur commented 5 years ago

We are moving issues to Jira at the moment. If Konstantin's solution does not work, please contact us in chat - we will find a way: https://chat.hyperledger.org/channel/iroha