aurora-is-near / aurora-relayer

[DEPRECATED] Web3-compatible relayer server for Aurora.
https://aurora-is-near.github.io/aurora-relayer/
Creative Commons Zero v1.0 Universal
26 stars 13 forks source link

[BUG] JSON-RPC result error #325

Closed jiOnederfull closed 2 years ago

jiOnederfull commented 2 years ago

Describe the bug Please provide a short description of the bug.

When I request a call for RPC node, it prints out result+%. Please refer to the screenshot attached.

To Reproduce Steps to reproduce the behavior, e.g.:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Request the call for RPC node Please refer to the screenshot attached.

Expected behavior A clear and concise description of what you expected to happen. No %

Screenshots If applicable, add screenshots to help explain your problem. image

Technical Details (please complete relevant fields):

Additional context Add any other context about the problem here.

pustovalov commented 2 years ago

Hi @jiOnederfull,

This is a zsh feature that prints a percent-and-newline after a command completes if that command does not already include a newline at the end of its output. If zsh did not do this, you would either not ever notice the fact that the command didn't print a newline - or you'd see zsh's command prompt not start on the margin and think it was a bug in zsh. https://stackoverflow.com/questions/29497038/why-does-a-curl-request-return-a-percent-sign-with-every-request-in-zsh

you can try to add -w '\n'

$ curl "https://mainnet.aurora.dev" -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' -w '\n'

{"jsonrpc":"2.0","id":1,"result":"0x420a3f2"}

or try to use for example httpie:

http post https://mainnet.aurora.dev jsonrpc=2.0 id=20 method=eth_blockNumber params:='[]'

{
    "id": "20",
    "jsonrpc": "2.0",
    "result": "0x420a44f"
}
jiOnederfull commented 2 years ago

ty