JSON-RPC is a remote procedure call protocol encoded in JSON. You can use this API to access data from the Harmony nodes. The JSON-RPC API server runs on:
Web sockets can also be used
All requests follow the standard JSON-RPC format and include 4 variables in the data object:
Request Data Object
Specifies version number
Method to be called server-side
Parameters for method call
The prefix of RPC calls is different - 'hmy' is used instead of 'eth'.
Address format, SDK uses two, the default use checksum, it is recommended to use Bech32. has been defined in the SDK.
Transaction uses RLP, but adds two fields, one is shardID and the other is toShardID.
There are some RPC Ethereum, there is no Harmony, we will discuss it in detail during the process.
So for the JS project, you can directly modify the existing Ethereum library, or you can use the SDK package to see your engineering needs.
The best practice is to extend the SDK's Transaction class and then add customization.
The biggest difference is that Harmony does not use
eth_sendTransaction and uses
eth_sendRawTransaction to send the signed bytes, this is called