erigon-pulse/cmd/restapi
Alex Sharov daa359c363
Mgr schedule iterator (#566)
* db based version of PrefixByCumulativeWitnessSize

* db based version of PrefixByCumulativeWitnessSize

* retain all in Trie by default

* fix WitnessLen logic in calcTrie roots

* Rename IntermediateTrieWitnessLenBucket to IntermediateWitnessLenBucket

* handle corner cases in WL

* Use correct incarnation for IH bucket

* use name WitnessSize

* save progress towards db-only witness estimation

* results from trie and from db are still different

* less recursion

* correct incarnation in CumulativeSearch

* reuse results from previous Tick, separate concepts of parent and startKey

* experiment: if not including trie structure to WitnessSize will reduce cumulative error

* tool to generate all IH and tool to calculate assessment of cumulative error

* tool to generate all IH

* Calculate totalWitnessSize based on DB data - then schedule will not overrun state during MGR cycle

* better stats

* Calculate totalWitnessSize based on DB data - then schedule will not overrun state during MGR cycle

* Calculate totalWitnessSize based on DB data - then schedule will not overrun state during MGR cycle

* calculate ticks size distribution

* estimate cumulative error

* fix linter

* resetIH from scratch if needed

* cleanup

* fix test

* fix test
2020-05-28 12:33:05 +01:00
..
apis Mgr schedule iterator (#566) 2020-05-28 12:33:05 +01:00
commands Fix RestAPI for tx_retrace and make it work for local boltdb (#584) 2020-05-27 17:24:34 +01:00
rest Fix RestAPI for tx_retrace and make it work for local boltdb (#584) 2020-05-27 17:24:34 +01:00
Dockerfile Add support of geth on hostmachine (#437) 2020-04-11 08:22:23 +01:00
main.go Debug Web UI prototype (#362) 2020-02-09 13:31:52 +03:00
README.md Tx retrace extension for Rest API (#436) 2020-04-10 19:47:45 +01:00

Turbo-Geth Rest API

Build

make restapi

Running

  • Running node with --remote-db-listen-addr (e.g ./build/bin/geth --remote-db-listen-addr localhost:9999).
  • Running Restapi: ./build/bin/restapi (Default Port: 8080)

API

  • /api/v1/remote-db/: gives remote-db url
  • /api/v1/accounts/:accountID: gives account data
    • accountID is account address
    • Reponse:
{

    "balance":"BALANCE",
    "code_hash":"HASH",
    "implementation":
        {
            "incarnation":NUMBER
        },
        "nonce":NUMBER,
        "root_hash":"HASH"      
}
  • /api/v1/storage/
    • gives the storage
    • Response:
[
    {"prefix": "Storage Prefix","value": "Value"},
    ...
]
  • /api/v1/retrace/:chain/:number
    • chain is the name of the chain(mainnet, testnet, goerli and rinkeby)
    • number is block number (e.g 98345)
    • extract changeSets and readSets for each block
    • Response:
[
    {
        "storage": {
            "reads": [READ, ...],
            "writes": [WRITE, ...]
        },
        "accounts": {
            "reads": [READ, ...],
            "writes": [WRITE, ...]
        }
    }
]
  • /api/v1/intermediate-hash/
    • extract intermediate hashes
    • Response:
[
    {"prefix": "Prefix","value": "Value"},
    ...
]