knode

package
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2023 License: MIT, MIT Imports: 19 Imported by: 0

README

kroma-node

This is the reference implementation of the rollup-node spec.

Compiling

Compile a binary:

> cd kroma-node
> go build -o bin/kroma-node ./cmd

Testing

Run kroma-node unit tests:

> cd kroma-node
> go test ./...

Run end-to-end tests:

> cd e2e
> go test ./...

Running

Options can be reviewed with:

> ./bin/kroma-node --help

To start syncing the rollup:

Connect to at least one L1 RPC and L2 execution engine:

  • L1: use any L1 node / RPC (websocket connection path may differ)
  • L2: run the Kroma fork of geth: kroma-geth
# websockets or IPC preferred for event notifications to improve sync, http RPC works with adaptive polling.
> ./bin/kroma-node \
  --l1=ws://localhost:8546 --l2=ws//localhost:9001 \
  --rollup.config=./path-to-network-config/rollup.json \
  --rpc.addr=127.0.0.1 \
  --rpc.port=7000

Devnet Genesis Generation

The kroma-node can generate geth compatible genesis.json files. These files can be used with geth init to initialize the StateDB with accounts, storage, code and balances. The L2 state must be initialized with predeploy contracts that exist in the state and act as system level contracts. The kroma-node can generate a genesis file with these predeploys configured correctly given hardhat compilation artifacts, hardhat deployment artifacts, a L1 RPC URL and a deployment config.

The hardhat compilation artifacts are produced by hardhat compile. The native hardhat compiler toolchain produces them by default and the @foundry-rs/hardhat plugin can also produce them when using the foundry compiler toolchain. They can usually be found in an artifacts directory.

The hardhat deployment artifacts are produced by running hardhat deploy. These exist to make it easy to track deployments of smart contract systems over time. They can usually be found in a deployments directory.

The deployment config contains all of the information required to deploy the system. It can be found in packages/contracts/deploy-config. Each deploy config file can be JSON or TypeScript, although only JSON files are supported by the kroma-node. The network name must match the name of the file in the deploy config directory.

Example usage:

> ./bin/kroma-node genesis devnet-l2 \
   --artifacts $CONTRACTS/artifacts \
   --network $NETWORK \
   --deployments $CONTRACTS/deployments \
   --deploy-config $CONTRACTS/deploy-config \
   --rpc-url http://localhost:8545

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConfig

func NewConfig(ctx *cli.Context, log log.Logger) (*node.Config, error)

NewConfig creates a Config from the provided flags or environment variables.

func NewDriverConfig

func NewDriverConfig(ctx *cli.Context) *driver.Config

func NewL1EndpointConfig

func NewL1EndpointConfig(ctx *cli.Context) *node.L1EndpointConfig

func NewL2EndpointConfig

func NewL2EndpointConfig(ctx *cli.Context, log log.Logger) (*node.L2EndpointConfig, error)

func NewL2SyncEndpointConfig

func NewL2SyncEndpointConfig(ctx *cli.Context) *node.L2SyncEndpointConfig

NewL2SyncEndpointConfig returns a pointer to a L2SyncEndpointConfig if the flag is set, otherwise nil.

func NewRollupConfig

func NewRollupConfig(ctx *cli.Context) (*rollup.Config, error)

func NewSnapshotLogger

func NewSnapshotLogger(ctx *cli.Context) (log.Logger, error)

func NewSyncConfig added in v1.0.2

func NewSyncConfig(ctx *cli.Context) *sync.Config

Types

This section is empty.

Directories

Path Synopsis
cmd
doc
p2p
Package heartbeat provides a service for sending heartbeats to a server.
Package heartbeat provides a service for sending heartbeats to a server.
Package metrics provides a set of metrics for the kroma-node.
Package metrics provides a set of metrics for the kroma-node.
p2p
cli
derive
Package derive provides the data transformation functions that take L1 data and turn it into L2 blocks and results.
Package derive provides the data transformation functions that take L1 data and turn it into L2 blocks and results.
sync
Package sync is responsible for reconciling L1 and L2.
Package sync is responsible for reconciling L1 and L2.
Package sources exports a number of clients used to access ethereum chain data.
Package sources exports a number of clients used to access ethereum chain data.
Package testlog provides a log handler for unit tests.
Package testlog provides a log handler for unit tests.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL