erigon-pulse/cmd/rpcdaemon
Alex Sharov c5ffc971c5
[WIP] Badger v2 (#378)
* badger v2 investigation

* buf pool - use native New method and avoid double checks

* db.Open prototype

* db.Tx/Bucket/Cursor prototypes

* Chained config

* Item concept added

* save changes to test on master

* make hack resumable

* Design document v0

* Cursor concept

* less brackets syntax of cursor builder

* benchmarks

* cleanup fs

* test for context cancelations

* test for context cancelations

* test for cursor.Prefix option

* add ForEachKey method

* add ForEachKey method

* add naming explanation

* experiment of non-pointers cursor/bucket

* .Bucket() and .Cursor() doesn't returns error

* .Bucket() and .Cursor() doesn't returns error

* .Bucket() and .Cursor() doesn't returns error

* remove CursorOpts concept

* more test-cases

* simplify open api

* Tx, Bucket, Cursor - now are interfaces

* Tx, Bucket, Cursor - now are interfaces

* switch to interfaces

* rebase master

Co-authored-by: alex.sharov <alex.sharov@lazada.com>
2020-03-11 11:02:37 +00:00
..
commands [WIP] Badger v2 (#378) 2020-03-11 11:02:37 +00:00
.gitignore ignore *.http files - I using them to store http requests 2019-12-03 09:07:33 +07:00
main.go Use local db in analytics (#308) 2020-01-15 19:47:13 +07:00
Readme.md Readme.md 2019-12-03 09:07:33 +07:00

Getting Started

In order to build and run turbo-geth node together with RPC daemon, you need to do the following:

  1. Clone turbo-geth repo
  2. Build it by running make
  3. Start it (it will start syncing to the mainnet) like this:
./build/bin/geth --remote-db-listen-addr localhost:9999
  1. Look out for this in the console/log file:
INFO [11-30|18:34:12.687] Remote DB interface listening on         address=localhost:9999
  1. In another terminal/tab, build RPC daemon:
make rpcdaemon
  1. Run it:
./build/bin/rpcdaemon --rpcapi eth

By default, it will connect to the turbo-geth node on the localhost:9999, but this can be changed via command line parameters. Note that it does not matter in which order you start these two processes, RPC daemon will only try to connect to turbo-geth node when serving its first RPC request, and then it will reconnect if connection is lost (for example, if you restart turbo-geth) 7. 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:854
  1. It should return something like this (depending on how far your turbo-geth node has synced):
{"jsonrpc":"2.0","id":1,"result":823909}