replayer

package
v0.0.0-...-985d544 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2022 License: CC0-1.0 Imports: 30 Imported by: 0

Documentation

Overview

Package replayer implements an Ethereum transaction replayer.

Index

Constants

View Source
const TLAMinLength = 32

TLAMinLength defines the minimum length for top-level accounts.

Variables

This section is empty.

Functions

func CalcStats

func CalcStats(
	dataDir, testnet string,
	blockHeight uint64,
	blockHash string,
	defrost bool,
	dump bool,
) error

CalcStats calculates some statistics for the given testnet and prints them to stdout.

func ProcGenesisBlock

func ProcGenesisBlock(testnet string) error

ProcGenesisBlock processes the genesis block for the given testnet.

func ReplayTx

func ReplayTx(
	breakpointDir string,
	build bool,
	contract string,
	release bool,
	gas uint64,
) error

ReplayTx replays transaction from breakpointDir.

Types

type AccountBalance

type AccountBalance struct {
	Account RawAddress
	Balance RawU256
}

AccountBalance encodes (genesis) account balances used by the 'begin_chain' function.

type AddrSlice

type AddrSlice []common.Address

AddrSlice is an array of addresses.

func (AddrSlice) Len

func (s AddrSlice) Len() int

func (AddrSlice) Less

func (s AddrSlice) Less(i, j int) bool

func (AddrSlice) Swap

func (s AddrSlice) Swap(i, j int)

type BeginBlockArgs

type BeginBlockArgs struct {
	Hash       RawU256
	Coinbase   RawAddress
	Timestamp  RawU256
	Number     RawU256
	Difficulty RawU256
	Gaslimit   RawU256
}

BeginBlockArgs encodes the arguments for 'begin_block'.

type BeginChainArgs

type BeginChainArgs struct {
	ChainID      RawU256
	GenesisAlloc []AccountBalance
}

BeginChainArgs encodes the arguments for 'begin_chain'.

type Breakpoint

type Breakpoint struct {
	ChainID          uint8  `json:"chain-id"`
	AccountID        string `json:"account-id"`
	NearcoreHead     string `json:"nearcore"`
	AuroraEngineHead string `json:"aurora-engine"`
	Transaction      string `json:"transaction"`
	// contains filtered or unexported fields
}

Breakpoint defines a break point.

type CreateAccount

type CreateAccount struct {
	Config         *near.Config
	InitialBalance string
	MasterAccount  string
}

CreateAccount allow to create accounts.

func (*CreateAccount) Create

func (ca *CreateAccount) Create(accountID string) error

Create account with accountID.

type RawAddress

type RawAddress [20]uint8

RawAddress type for Aurora Engine.

type RawU256

type RawU256 [32]uint8

RawU256 type for Aurora Engine (big-endian large integer type).

type Replayer

type Replayer struct {
	Config         *near.Config
	Timeout        time.Duration
	ChainID        uint8
	Gas            uint64
	DataDir        string
	Testnet        string
	Defrost        bool
	Skip           bool   // skip empty blocks
	Batch          bool   // batch transactions
	BatchSize      int    // batch size when batching transactions
	StartBlock     int    // start replaying at this block height
	StartTx        int    // start replaying at this transaction (in block given by StartBlock)
	Autobreak      bool   // automatically repeat with break point after error
	BreakBlock     int    // break replaying at this block height
	BreakTx        int    // break replaying at this transaction (in block given by BreakBlock)
	Release        bool   // run release version of neard
	Setup          bool   // setup and run neard before replaying
	NeardPath      string // path to neard binary
	NeardHead      string // git hash of neard
	InitialBalance string
	Contract       string
	Breakpoint     Breakpoint
}

A Replayer replays transactions.

func (*Replayer) Replay

func (r *Replayer) Replay(evmContract string) error

Replay transactions with evmContract.

type Tx

type Tx struct {
	BlockNum   int             // block number (-1 if undefined)
	TxNum      int             // transaction number
	Comment    string          // comment for the transaction
	MethodName string          // the Aurora Engine method name to call
	Args       []byte          // the argument to call the method with
	EthTx      *db.Transaction // pointer to original Ethereum transaction (for 'submit')
	Error      error           // error during transaction construction
}

Tx defines a replayer transaction.

Directories

Path Synopsis
Package neard implements NEAR daemon related functionality.
Package neard implements NEAR daemon related functionality.

Jump to

Keyboard shortcuts

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