| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| "github.com/ethereum/go-ethereum/portalnetwork/history" | ||
| ) | ||
|
|
||
| func rpcMarshalBlock(block *types.Block, fullTx bool, chainId *big.Int) (map[string]interface{}, error) { |
There was a problem hiding this comment.
Can we reuse the function here https://github.com/optimism-java/shisui/blob/portal/internal/ethapi/api.go#L1277, and passed mainnet config https://github.com/optimism-java/shisui/blob/portal/params/config.go#L41. It seems we don't need copy these functions.
Sorry, something went wrong.
There was a problem hiding this comment.
Indeed we don't need copy these functions, thanks, done, also fixed lint.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This PR proposes the implementation of a minimal eth namespace and two methods: eth_chainId and eth_gtBlockByHash.
The RPC specification follows the [Execution APIs specification] (https://ethereum.github.io/execution-apis/api-documentation/). This design of offering APIs for external interaction is described in the documentation although there are other approaches such as embedding a Portal Network client in a lightweight wallet, for example.
This PR is inspired by the code from geth and fluffy
The following code, in JS using ethers, may be used to test the integration:
Alternatively, rpc endpoints can be called with curl:
curl 127.0.0.1:8545/ -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getBlockByHash","params":["0xb81fcfee29cea2922aa9f553644463bee1c49895e56bc87f4417834e681ad305",true],"id":1}'curl 127.0.0.1:8545/ -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}'