Every Transaction Is Pending & User accounts not recognized


#1

I have Blockapps running locally using the --stable command. I am experience two issues.

  1. I have to click “Faucet” for every user I create before any APIs will recognize the account. I set up all my user accounts through the management dashboard.

  2. Every transaction I try to Send or execute via a Function call is stuck in Pending and never gets executed. Transactions work fine via the management dashboard, but not the API.

The API call looks like the following sent with the correct headers:

POST http://192.168.0.5/bloc/v2.2/users/volunteer2/e7118c4204e1314a009ebe97dd23558ae71367a4/send
{
  "toAddress": "00dc6915a34ac70b1930672e96f71b2abbcffc4e",
  "value": 1,
  "password": "volunteer2"
}

The API response looks like the following:

{
    "status": "Pending",
    "hash": "53ba1047e8fb1ee70eb710fd2ef1e4332e9d29b79503c72b3b2361ec049a7cdc",
    "txResult": null,
    "data": null
}

I have tried wiping the system and rebooting, but I cannot seem to get past these two issues. Could you please help?

Best,
Aaron


#2

Just wanted to confirm that I get a similar error. I am guessing there an API change which made it to the dashboard but not the Swagger docs.

  • Kieren

#3

The API will always return pending state for the transactions unless the URL is appended with ?resolve. This is because the send endpoint doesnt block on a transaction confirmation.

If you want to get a response then use POST http://192.168.0.5/bloc/v2.2/users/volunteer2/e7118c4204e1314a009ebe97dd23558ae71367a4/send?resolve. This will tell the API to wait for a result.

When not using ?resolve, you can check the the result of the tx using the hash returned by the pending response. The request for this is GET http://<server-dns-or-ip>/strato-api/eth/v1.2/transactionResult/:txHash