models

package
v0.0.0-...-92d349b Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BuildDirArg is the build directory for the devnet executable
	BuildDirArg = "./build/bin/devnet"
	// DataDirArg is the datadir flag
	DataDirArg = "--datadir"
	// ChainArg is the chain flag
	ChainArg = "--chain"
	// DevPeriodArg is the dev.period flag
	DevPeriodArg = "--dev.period"
	// ConsoleVerbosityArg is the log.console.verbosity flag
	ConsoleVerbosityArg = "--log.console.verbosity"
	// LogDirArg is the log.dir.path flag
	LogDirArg = "--log.dir.path"
	// TorrentPortArg is the --torrent.port flag argument
	TorrentPortArg = "--torrent.port"
	// Mine is the mine flag
	Mine = "--mine"
	// NoDiscover is the nodiscover flag
	NoDiscover = "--nodiscover"
	// PrivateApiAddrArg is the private.api.addr flag
	PrivateApiAddrArg = "--private.api.addr"
	// StaticPeersArg is the staticpeers flag
	StaticPeersArg = "--staticpeers"
	// HttpApiArg is the http.api flag
	HttpApiArg = "--http.api"
	// WSArg is the --ws flag for rpcdaemon
	WSArg = "--ws"

	// DataDirParam is the datadir parameter
	DataDirParam = "./dev"
	// ChainParam is the chain parameter
	ChainParam = "dev"
	// DevPeriodParam is the dev.period parameter
	DevPeriodParam = "30"
	// ConsoleVerbosityParam is the verbosity parameter for the console logs
	ConsoleVerbosityParam = "0"
	// LogDirParam is the log directory parameter for logging to disk
	LogDirParam = "./cmd/devnet/debug_logs"
	// TorrentPortParam is the port parameter for the second node
	TorrentPortParam = "42070"
	// PrivateApiParamMine is the private.api.addr parameter for the mining node
	PrivateApiParamMine = "localhost:9090"
	// PrivateApiParamNoMine is the private.api.addr parameter for the non-mining node
	PrivateApiParamNoMine = "localhost:9091"
	// HttpApiParam is the http.api default parameter for rpcdaemon
	HttpApiParam = "admin,eth,erigon,web3,net,debug,trace,txpool,parity,ots"

	// ErigonUrl is the default url for rpc connections
	ErigonUrl = "http://localhost:8545"
	// Localhost is the default localhost endpoint for web socket attachments
	Localhost = "127.0.0.1:8545"

	// ReqId is the request id for each request
	ReqId = 0
	// MaxNumberOfBlockChecks is the max number of blocks to look for a transaction in
	MaxNumberOfBlockChecks = 3

	// Latest is the parameter for the latest block
	Latest BlockNumber = "latest"
	// Earliest is the parameter for the earliest block
	Earliest BlockNumber = "earliest"
	// Pending is the parameter for the pending block
	Pending BlockNumber = "pending"

	// DevAddress is the developer address for sending
	DevAddress = "0x67b1d87101671b127f5f8714789C7192f7ad340e"

	// NonContractTx is the transaction type for sending ether
	NonContractTx TransactionType = "non-contract"
	// ContractTx is the transaction type for sending ether
	ContractTx TransactionType = "contract"
	// DynamicFee is the transaction type for dynamic fee
	DynamicFee TransactionType = "dynamic-fee"

	// SolContractMethodSignature is the function signature for the event in the solidity contract definition
	SolContractMethodSignature = "SubscriptionEvent()"

	// ETHGetTransactionCount represents the eth_getTransactionCount method
	ETHGetTransactionCount RPCMethod = "eth_getTransactionCount"
	// ETHGetBalance represents the eth_getBalance method
	ETHGetBalance RPCMethod = "eth_getBalance"
	// ETHSendRawTransaction represents the eth_sendRawTransaction method
	ETHSendRawTransaction RPCMethod = "eth_sendRawTransaction"
	// ETHGetBlockByNumber represents the eth_getBlockByNumber method
	ETHGetBlockByNumber RPCMethod = "eth_getBlockByNumber"
	// ETHGetBlock represents the eth_getBlock method
	ETHGetBlock RPCMethod = "eth_getBlock"
	// ETHGetLogs represents the eth_getLogs method
	ETHGetLogs RPCMethod = "eth_getLogs"
	// ETHBlockNumber represents the eth_blockNumber method
	ETHBlockNumber RPCMethod = "eth_blockNumber"
	// AdminNodeInfo represents the admin_nodeInfo method
	AdminNodeInfo RPCMethod = "admin_nodeInfo"
	// TxpoolContent represents the txpool_content method
	TxpoolContent RPCMethod = "txpool_content"

	// OTSGetBlockDetails represents the ots_getBlockDetails method
	OTSGetBlockDetails RPCMethod = "ots_getBlockDetails"

	// ETHNewHeads represents the eth_newHeads sub method
	ETHNewHeads SubMethod = "eth_newHeads"
)

Variables

View Source
var (
	// ErrInvalidArgument for invalid arguments
	ErrInvalidArgument = errors.New("invalid argument")
	// ErrBadRequest for http bad requests
	ErrBadRequest = errors.New("bad request")
	// ErrInvalidTransactionType for invalid transaction types
	ErrInvalidTransactionType = errors.New("invalid transaction type")
)
View Source
var (
	// DevSignedPrivateKey is the signed private key for signing transactions
	DevSignedPrivateKey, _ = crypto.HexToECDSA(hexPrivateKey)

	// ContractBackend is a simulated backend created using a simulated blockchain
	ContractBackend = backends.NewSimulatedBackendWithConfig(gspec.Alloc, gspec.Config, 1_000_000)

	// MethodSubscriptionMap is a container for all the subscription methods
	MethodSubscriptionMap *map[SubMethod]*MethodSubscription

	// NewHeadsChan is the block cache the eth_NewHeads
	NewHeadsChan chan interface{}

	//QuitNodeChan is the channel for receiving a quit signal on all nodes
	QuitNodeChan chan bool
)

Functions

func ParameterFromArgument

func ParameterFromArgument(arg, param string) (string, error)

ParameterFromArgument merges the argument and parameter and returns a flag input string

Types

type AdminNodeInfoResponse

type AdminNodeInfoResponse struct {
	rpctest.CommonResponse
	Result p2p.NodeInfo `json:"result"`
}

AdminNodeInfoResponse is the response for calls made to admin_nodeInfo

type Block

type Block struct {
	Number       *hexutil.Big
	Transactions []libcommon.Hash
	BlockHash    libcommon.Hash
}

Block represents a simple block for queries

type BlockNumber

type BlockNumber string

BlockNumber represents the block number type

type MethodSubscription

type MethodSubscription struct {
	Client    *rpc.Client
	ClientSub *rpc.ClientSubscription
	Name      SubMethod
	SubChan   chan interface{}
}

MethodSubscription houses the client subscription, name and channel for its delivery

func NewMethodSubscription

func NewMethodSubscription(name SubMethod) *MethodSubscription

NewMethodSubscription returns a new MethodSubscription instance

type RPCMethod

type RPCMethod string

RPCMethod is the type for rpc methods used

type SubMethod

type SubMethod string

SubMethod is the type for sub methods used in subscriptions

type TransactionType

type TransactionType string

TransactionType is the type of transaction attempted to be made, can be regular or contract

Jump to

Keyboard shortcuts

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