input-output-hk / jormungandr

privacy voting blockchain node
https://input-output-hk.github.io/jormungandr/
Apache License 2.0
364 stars 132 forks source link

New accounts created by jcli returning 404 Not Found #1501

Closed shawnrmoss closed 4 years ago

shawnrmoss commented 4 years ago

Describe the bug Unable to use jcli to lookup account information on my local node

Mandatory Information

  1. jcli 0.8.5 (8.5-3db06807, release, linux [aarch64]) - [rustc 1.40.0 (73528e339 2019-12-16)]
  2. jormungandr 0.8.5 (8.5-3db06807, release, linux [aarch64]) - [rustc 1.40.0 (73528e339 2019-12-16)]

Start the jormungandr node jormungandr --config ${BASE_FOLDER}config/node-config.yaml --genesis-block-hash $GEN_HASH >> ~/logs/node.out 2>&1 &

To Reproduce Method 1

  1. Create an account locally using the createAddress.sh script. I can see the account in the shelly testnet explorer but I cant get information about it from my local node.
  2. jcli rest v0 account get $ACCOUNT_ADDRESS -h $NODE_REST_URL Error node rejected request because of invalid parameters. Client Error: 404 Not Found

To Reproduce Method 2

  1. Create an account locally using the jcli. jcli key generate --type=Ed25519Extended > ~/files/receiver_secret.key cat ~/files/receiver_secret.key | jcli key to-public > ~/files/receiver_public.key jcli address account --testing --prefix addr $(cat ~/files/receiver_public.key) | tee ~/files/receiver_account.txt
  2. jcli rest v0 account get $ACCOUNT_ADDRESS -h $NODE_REST_URL Error node rejected request because of invalid parameters. Client Error: 404 Not Found

If I try to create a stake pool using the createStakePool.sh the script fails when trying to tally an account count again using the jcli to access to above created account.

Expected behavior When I create an account using the jcli I expect it to be available through my local node rest endpoint.

rinor commented 4 years ago

When I create an account using the jcli I expect it to be available through my local node rest endpoint.

@shawnrmoss your expectation is wrong. When you create and address for the first time using jcli, that address does not exist yet on the ledger. Hence the Client Error: 404 Not Found. You need to send some lovelace to that address and once the transaction is confirmed and included in a block, and your node is properly in sync (including the mentioned block), then you can query the data for that address.

Method 1 and 2 do the same thing, and don't think you can "see" the newly created account on shelley explorer (unless you send some lovelaces first)

As you already mentioned stake pool registration will fail, since that account in not available on the ledger.

shawnrmoss commented 4 years ago

@rinor thanks for the reply! I can send ADA to the created accounts via Daedalus ITN version. I can see those accounts in the Shelley test net explorer, the transactions send from Daedalus and the amount of ADA.

Still even then after Ive funded those newly created accounts with ADA I get the same 404 response.
I spent some time on the Cardano Shelley Testnet & StakePool Best Practice Workgroup telegram channel and other community members with fully functional nodes could retrieve information about the accounts I created without getting the 404s no problems.

Does this mean my node is not in sync?

Im connected to many peers in the network. If I check the stats of my node: jcli rest v0 node stats get -h http://127.0.0.1:${REST_PORT}/api the lastBlockTime and lastReceivedBlockTime are being updated consistently.

rinor commented 4 years ago

@shawnrmoss can you provide here one of the accounts address (public data only please) so we can check the ledger from our side? Thank you.

shawnrmoss commented 4 years ago

Account Address: addr1sh43w7e4grumtd9naq00f7e2jx6l8g00m5ssclgw5vxk6mrpalx6smv8yk7

rinor commented 4 years ago

@shawnrmoss I can see that account with balance 110_000_000 Lovelace (110 ADA). I see 2 transactions:

can you please check if you have those blocks in your node:

jcli rest v0 block eab340bd04359818f3b8567fa871b5151b28991c21ae52f135990bba423c5a50 get --host "http://127.0.0.1:${REST_PORT}/api"

jcli rest v0 block 0ea5b090e633a0940613aaef18933f2a2973a75d3e2af33087bae41e2dddc6f6 get --host "http://127.0.0.1:${REST_PORT}/api"

If not it means that the node you are querying the data from is in a pretty severe fork.


Question 1: Are you issuing jcli rest ... commands against jormungandr node of Deadalus ITN or against another separate jormungandr node.

Question 2: If using a separate jormungandr node, can you check if you are connecting to the correct ITN network. You probably know it, but just in case the genesis hash of itn is 8e4d2a343f3dcf9330ad9035b3e8d168e6728904262f2c434a4f8f934ec7b676.

Thank you.

shawnrmoss commented 4 years ago

Im issuing them to my local node.
http://127.0.0.1:3100/api

Yeah thats the same genesis hash Im using as well.

rinor commented 4 years ago

Do you have the mentioned blocks in your node?

jcli rest v0 block eab340bd04359818f3b8567fa871b5151b28991c21ae52f135990bba423c5a50 get --host "http://127.0.0.1:3100/api"

jcli rest v0 block 0ea5b090e633a0940613aaef18933f2a2973a75d3e2af33087bae41e2dddc6f6 get --host "http://127.0.0.1:3100/api"
shawnrmoss commented 4 years ago

Ive left my node running for a couple days. I was maxing out around 40 established connections with other nodes. Now Im connected to over 300.

When I run those commands from your last message I do have those blocks now in my node. And Im able to query that account successfully!

Im not sure why but am very happy ;)

I really appreciate you taking the time to respond. Im going to close this issue now.

Thanks again!