1

I have access to a private chain Ethereum node that is accessible via http https://sustainability-chain.info (e.g. i can access it with metamask using special RPC and networkid 20030117

Based on https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_blocknumber I would like to change

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' sustainability-chain.info 

which actually works better using:

curl -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' sustainability-chain.info

into something like:

https://sustainability-chain.info/?method=eth_blockNumber&params=[]&id=1

but that does not work

Any idea what I am doing wrong?

Mikhail Vladimirov
  • 7,313
  • 1
  • 23
  • 38
Hans-Ueli M.
  • 63
  • 1
  • 7
  • 1
    You need a server that accepts input in your desired syntax and make a translation to the RPC syntax accepted by geth, and to return the result. I don't know a product that does that automatically. – Ismael Apr 22 '19 at 17:37
  • thank you. I installed web3 and access the information with java-scripts now – Hans-Ueli M. Apr 22 '19 at 20:48

1 Answers1

3

This worked for me:

curl -X POST -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","method":"eth_blockNumber","id":1}' https://sustainability-chain.info
Thomas
  • 526
  • 2
  • 6
  • the curl works fine, but i wonder if I can translate that into a http://sustainability-chain.info/application/json?method=eth_blocknumber&id=1 or similar address in a browser and if I can how do i need to to do this. – Hans-Ueli M. Apr 22 '19 at 13:56