eth-client icon indicating copy to clipboard operation
eth-client copied to clipboard

Are all the api methods implemented?

Open joesan opened this issue 7 years ago • 5 comments

I just checked out the latest code and I was having a look into the client.go source file and I could not find any implementation for some of the functions in the api.go?

For example., I could not find the implementation for BlockByHash method in the client.go? Any ideas?

joesan avatar Nov 08 '17 20:11 joesan

Hi joesan,

The reason you could not find any implementation is that client was inherited from ethclient.

So, BlockByHash can be found in here

Currently, client does not support all JSON-RPC methods. We will support all in the future.

Welcome to contribute.

bailantaotao avatar Nov 09 '17 03:11 bailantaotao

Ok so then what is the difference between ethClient (from go-ethereum) and the client that is part of this project? Could you please explain?

I'm definitely interested to do some contributions!

joesan avatar Nov 09 '17 04:11 joesan

The ethClient(go-ethereum) JSON-RPC methods are not enough to use. For example,

  • Some modules(admin, miner, ...etc) are not supported by ethClient, but supported in here.
  • If you do integration testing with go-ethereum, the ethClient JSON-RPC methods are not enough to use. Imagine that some feature can be tested after start mining, but start mining is not supported in ethClient.

This project provides a high-level interface, so we can use it directly in golang application or integration testing.

Some of complex feature are consider to support in the future, example of WaitForBlockHeight(num)

bailantaotao avatar Nov 09 '17 09:11 bailantaotao

Ok so the idea is to use this library from you with some other Go projects that would need to interface with an Ethereum node? Sounds interesting!

Have you got experience with go-ethereum itself? Actually I was asking for some help in the gitter channel of go for some help. I'm totally new to Blockchain and I want to get deeper in the fundamentals and one way for me to do that would be to understand the code base a bit better and since Go is also new to me, I was asking for some pair programming sort of help in the forum.

joesan avatar Nov 09 '17 10:11 joesan

Ok so the idea is to use this library from you with some other Go projects that would need to interface with an Ethereum node? Sounds interesting!

Yes, you got it.

In my experience, if you're a novice at golang, this guide gets you started programming.

If you want to understand any module of code base on go-ethereum, you can get start from testing file which are very useful. E.q. How to setup genesis by programming? Learned it from here.

bailantaotao avatar Nov 12 '17 05:11 bailantaotao