erigon-pulse/cmd/rpcdaemon
Thomas Jay Rush 7f1e7d5212
1073 eth get transaction by block number and index (#1083)
* Added missing README entry for getTransactionByHash

* Adding support for eth_getTransactioBy* RPC routines

* Added missing README entry for getTransactionByHash

* Adding support for eth_getTransactioBy* RPC routines

* Copying code from ./internal/ethapi/api.go with modifications
2020-09-08 20:39:31 +01:00
..
cli Websocket work over json rpc (#1030) 2020-09-02 06:56:48 +01:00
commands 1073 eth get transaction by block number and index (#1083) 2020-09-08 20:39:31 +01:00
service Rpcdaemon as lib (#940) 2020-08-19 12:46:20 +01:00
.gitignore Docker compose (#841) 2020-08-01 09:39:04 +02:00
main.go Fix for RPC daemon leak (#1059) 2020-09-05 21:58:51 +01:00
Readme.md Get logs (#1028) 2020-09-03 08:51:19 +01:00
test.http eth_syncing (#991) 2020-08-29 08:24:50 +01:00

In turbo-geth RPC calls are extracted out of the main binary into a separate daemon. This daemon can use both local or remote DBs. That means, that this RPC daemon doesn't have to be running on the same machine as the main turbo-geth binary or it can run from a snapshot of a database for read-only calls. Docs

Get started

For local DB

> make rpcdaemon
> ./build/bin/rpcdaemon --chaindata ~/Library/TurboGeth/tg/chaindata --http.api=eth,debug,net

For remote DB

Run turbo-geth in one terminal window

> ./build/bin/tg --private.api.addr=localhost:9090

Run RPC daemon

> ./build/bin/rpcdaemon --private.api.addr=localhost:9090

Test

Try eth_blockNumber call. In another console/tab, use curl to make RPC call:

curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_blockNumber", "params": [], "id":1}' localhost:8545

It should return something like this (depending on how far your turbo-geth node has synced):

{"jsonrpc":"2.0","id":1,"result":823909}

For Developers

Code generation: go.mod stores right version of generators, use mage grpc to install it and generate code.

protoc version not managed but recommended version is 3.*, install instruction