Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Latest commit

 

History

History
116 lines (82 loc) · 1.9 KB

README.md

File metadata and controls

116 lines (82 loc) · 1.9 KB

Neptune Server

Quickstart

  • first-time setup: make setup
  • build: make build
  • run: ./build/neptune-<version>-<architecture/os>

Routes

/forks

GET

Get a list of all forks.

Reponse:

{
  "forks": {
    "<fork_id>": {
      "id": "<fork_id>",
      "name": "<fork_name>",
      "config": {
        ...
      }
    }
  }
}

POST

Create a new fork

Request Body:

{
  "name": "the-fork-name",
  "config": {} // see ForkConfig object
}

Response:

{
  "fork_id": "<string>"
}

ForkConfig object

Neptune allows creating blank forks and forks of mainnet - base forks, and forks of forks - child forks. These are configured using the following variants of the ForkConfig object:

BaseConfig:

{
  "eth_rpc_url": "string, optional", // optionally specify a mainnet RPC provider
  "fork_block_number": number, optional, // defaults to the current block number
  "prefund_anvil_accounts": bool // generate a list of pre-funded accounts using anvil's default seed phrase
}

ChildConfig:

{
  "parent_fork_id": "string" // the ID of the parent fork (must be a valid uuid string)
  "fork_block_number": number?, // defaults to the current block number
  "prefund_anvil_accounts": bool // generate a list of pre-funded accounts using anvil's default seed phrase
}

/forks/{fork_id}

POST

Send an eth or anvil rpc request

Request:

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "eth_blockNumber",
  "params": [...]
}

Response:

{
  "id": 1,
  "result": "0xasedfasdf"
}

DELETE

Delete a fork - fails if a fork is referenced by another fork.

GET

Returns a serialized version of the fork if it exists.

/reset

DELETE

clears all forks from memory