I want to build a custom version of geth that provides a new JSON-RPC call to clients.

It looks like there are two pieces to make that happen: (1) a Go implementation in internal/ethapi/api.go, and (2) a Javascript endpoint in jsre/deps/web3.js.

Is that the right approach? What connects those pieces?

  • You need to modify both. If you want to change any json output format then client will get the data from Eth node, i.e web3js will read data from node. Commented Jun 13, 2018 at 4:50
  • Did you achieve this? Maybe you can let us know if you found the answer Commented Jul 19, 2019 at 20:55
  • I don't now recall the motivation for the new call, but in the end, I did not implement it. Commented Jul 21, 2019 at 0:42

1 Answer 1


If you wish to add a custom RPC method then yes you'd have to modify the go-ethereum library so that geth can process the new method, and in web3js so that the client knows how to construct and send the new RPC call.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.