node

package
v0.15.16 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2025 License: Apache-2.0 Imports: 55 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewReadinessHandlers added in v0.12.1

func NewReadinessHandlers(bcReader blockchain.Reader, syncReader sync.Reader, readinessBlockTolerance uint) *readinessHandlers

Types

type Config

type Config struct {
	LogLevel                 string        `mapstructure:"log-level"`
	HTTP                     bool          `mapstructure:"http"`
	HTTPHost                 string        `mapstructure:"http-host"`
	HTTPPort                 uint16        `mapstructure:"http-port"`
	RPCCorsEnable            bool          `mapstructure:"rpc-cors-enable"`
	Websocket                bool          `mapstructure:"ws"`
	WebsocketHost            string        `mapstructure:"ws-host"`
	WebsocketPort            uint16        `mapstructure:"ws-port"`
	GRPC                     bool          `mapstructure:"grpc"`
	GRPCHost                 string        `mapstructure:"grpc-host"`
	GRPCPort                 uint16        `mapstructure:"grpc-port"`
	DatabasePath             string        `mapstructure:"db-path"`
	Network                  utils.Network `mapstructure:"network"`
	EthNode                  string        `mapstructure:"eth-node"`
	DisableL1Verification    bool          `mapstructure:"disable-l1-verification"`
	Pprof                    bool          `mapstructure:"pprof"`
	PprofHost                string        `mapstructure:"pprof-host"`
	PprofPort                uint16        `mapstructure:"pprof-port"`
	Colour                   bool          `mapstructure:"colour"`
	PendingPollInterval      time.Duration `mapstructure:"pending-poll-interval"`
	PreConfirmedPollInterval time.Duration `mapstructure:"preconfirmed-poll-interval"`
	RemoteDB                 string        `mapstructure:"remote-db"`
	VersionedConstantsFile   string        `mapstructure:"versioned-constants-file"`

	Sequencer      bool   `mapstructure:"seq-enable"`
	SeqBlockTime   uint   `mapstructure:"seq-block-time"`
	SeqGenesisFile string `mapstructure:"seq-genesis-file"`
	SeqDisableFees bool   `mapstructure:"seq-disable-fees"`

	Metrics     bool   `mapstructure:"metrics"`
	MetricsHost string `mapstructure:"metrics-host"`
	MetricsPort uint16 `mapstructure:"metrics-port"`

	P2P           bool   `mapstructure:"p2p"`
	P2PAddr       string `mapstructure:"p2p-addr"`
	P2PPublicAddr string `mapstructure:"p2p-public-addr"`
	P2PPeers      string `mapstructure:"p2p-peers"`
	P2PFeederNode bool   `mapstructure:"p2p-feeder-node"`
	P2PPrivateKey string `mapstructure:"p2p-private-key"`

	MaxVMs                  uint   `mapstructure:"max-vms"`
	MaxVMQueue              uint   `mapstructure:"max-vm-queue"`
	RPCMaxBlockScan         uint   `mapstructure:"rpc-max-block-scan"`
	RPCCallMaxSteps         uint64 `mapstructure:"rpc-call-max-steps"`
	RPCCallMaxGas           uint64 `mapstructure:"rpc-call-max-gas"`
	ReadinessBlockTolerance uint   `mapstructure:"readiness-block-tolerance"`

	SubmittedTransactionsCacheSize     uint          `mapstructure:"submitted-transactions-cache-size"`
	SubmittedTransactionsCacheEntryTTL time.Duration `mapstructure:"submitted-transactions-cache-entry-ttl"`

	DBCacheSize  uint `mapstructure:"db-cache-size"`
	DBMaxHandles int  `mapstructure:"db-max-handles"`

	GatewayAPIKey   string `mapstructure:"gw-api-key"`
	GatewayTimeouts string `mapstructure:"gw-timeouts"`

	PluginPath string `mapstructure:"plugin-path"`

	HTTPUpdateHost string `mapstructure:"http-update-host"`
	HTTPUpdatePort uint16 `mapstructure:"http-update-port"`

	ForbidRPCBatchRequests bool `mapstructure:"disable-rpc-batch-requests"`
}

Config is the top-level juno configuration.

type Node

type Node struct {
	// contains filtered or unexported fields
}

func New

func New(cfg *Config, version string, logLevel *utils.LogLevel) (*Node, error)

New sets the config and logger to the StarknetNode. Any errors while parsing the config on creating logger will be returned. Todo: (immediate follow-up PR) tidy this function up.

func (*Node) Config

func (n *Node) Config() Config

func (*Node) Run

func (n *Node) Run(ctx context.Context)

Run starts Juno node by opening the DB, initialising services. All the services blocking and any errors returned by service run function is logged. Run will wait for all services to return before exiting.

func (*Node) StartService added in v0.13.0

func (n *Node) StartService(wg *conc.WaitGroup, ctx context.Context, cancel context.CancelFunc, s service.Service)

type ThrottledVM added in v0.7.4

type ThrottledVM struct {
	*utils.Throttler[vm.VM]
}

func NewThrottledVM added in v0.7.4

func NewThrottledVM(res vm.VM, concurrenyBudget uint, maxQueueLen int32) *ThrottledVM

func (*ThrottledVM) Call added in v0.7.4

func (tvm *ThrottledVM) Call(
	callInfo *vm.CallInfo,
	blockInfo *vm.BlockInfo,
	state core.StateReader,
	maxSteps uint64,
	maxGas uint64,
	errStack, returnStateDiff bool,
) (vm.CallResult, error)

func (*ThrottledVM) Execute added in v0.7.4

func (tvm *ThrottledVM) Execute(
	txns []core.Transaction,
	declaredClasses []core.ClassDefinition,
	paidFeesOnL1 []*felt.Felt,
	blockInfo *vm.BlockInfo,
	state core.StateReader,
	skipChargeFee,
	skipValidate,
	errOnRevert,
	errStack,
	allowBinarySearch bool,
	isEstimateFee bool,
) (vm.ExecutionResults, error)

Jump to

Keyboard shortcuts

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