mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 03:30:37 +00:00
df0699a12b
This adds a simulator object with implements the SentryServer api but takes objects from a pre-existing snapshot file. If the snapshot is not available locally it will download and index the .seg file for the header range being asked for. It is created as follows: ```go sim, err := simulator.NewSentry(ctx, "mumbai", dataDir, 1, logger) ``` Where the arguments are: * ctx - a callable context where cancel will close the simulator torrent and file connections (it also has a Close method) * chain - the name of the chain to take the snapshots from * datadir - a directory potentially containing snapshot .seg files. If not files exist in this directory they will be downloaded * num peers - the number of peers the simulator should create * logger - the loger to log actions to It can be attached to a client as follows: ```go simClient := direct.NewSentryClientDirect(66, sim) ``` At the moment only very basic functionality is implemented: * get headers will return headers by range or hash (hash assumes a pre-downloaded .seg as it needs an index * the header replay semantics need to be confirmed * eth 65 and 66(+) messaging is supported * For details see: `simulator_test.go More advanced peer behavior (e.g. header rewriting) can be added Bodies/Transactions handling can be added |
||
---|---|---|
.. | ||
adapter | ||
app | ||
backup | ||
builder | ||
cli | ||
cmdtest | ||
debug | ||
engineapi | ||
execution/eth1 | ||
jsonrpc | ||
logging | ||
mock | ||
node | ||
rlphacks | ||
rpchelper | ||
services | ||
shards | ||
silkworm | ||
snapshotsync | ||
stages | ||
testlog | ||
transactions | ||
trie | ||
README.md |
Erigon-API
Erigon-API is a set of tools for building applications containing Erigon node.
Our own binary erigon
is built using it.
Modules
-
cli
- erigon-cli, methods & helpers to run a CLI app with Erigon node. -
node
- represents an Ethereum node, running devp2p and sync and writing state to the database. -
stagedsync
- staged sync algorithm.
Examples
-
erigon
- our binary is using erigon-api with all defaults -
erigoncustom
- a very simple example of adding a custom stage, a custom bucket and a custom command-line parameter -
erigon-examples - a series of examples for Erigon api