Documentation
¶
Index ¶
- Variables
- func Retry(tries int, durationBetweenAttempts time.Duration, fn func() error) (err error)
- type FullNode
- func (n *FullNode) GetGenesis() genesispkg.Genesis
- func (n *FullNode) GetGenesisChunks() ([]string, error)
- func (n *FullNode) GetLogger() logging.EventLogger
- func (n *FullNode) IsRunning() bool
- func (n *FullNode) Run(parentCtx context.Context) error
- func (n *FullNode) SetLogger(logger logging.EventLogger)
- type LightNode
- type MetricsProvider
- type MockTester
- type Node
- type Source
Constants ¶
This section is empty.
Variables ¶
var RollkitPrefix = "0"
prefixes used in KV store to separate rollkit data from execution environment data (if the same data base is reused)
Functions ¶
func Retry ¶
Retry attempts to execute the provided function up to the specified number of tries, with a delay between attempts. It returns nil if the function succeeds, or the last error encountered if all attempts fail.
Parameters:
- tries: The maximum number of attempts to make
- durationBetweenAttempts: The duration to wait between attempts
- fn: The function to retry, which returns an error on failure
Returns:
- error: nil if the function succeeds, or the last error encountered
Types ¶
type FullNode ¶
type FullNode struct {
service.BaseService
Store store.Store
// contains filtered or unexported fields
}
FullNode represents a client node in Rollkit network. It connects all the components and orchestrates their work.
func (*FullNode) GetGenesis ¶
func (n *FullNode) GetGenesis() genesispkg.Genesis
GetGenesis returns entire genesis doc.
func (*FullNode) GetGenesisChunks ¶
GetGenesisChunks returns chunked version of genesis.
func (*FullNode) GetLogger ¶
func (n *FullNode) GetLogger() logging.EventLogger
GetLogger returns logger.
func (*FullNode) Run ¶
Run implements the Service interface. It starts all subservices and manages the node's lifecycle.
func (*FullNode) SetLogger ¶
func (n *FullNode) SetLogger(logger logging.EventLogger)
SetLogger sets the logger used by node.
type LightNode ¶
type LightNode struct {
service.BaseService
P2P *p2p.Client
Store store.Store
// contains filtered or unexported fields
}
LightNode is a chain node that only needs the header service
type MetricsProvider ¶ added in v0.11.19
MetricsProvider returns a consensus, p2p and mempool Metrics.
func DefaultMetricsProvider ¶ added in v0.11.19
func DefaultMetricsProvider(config *config.InstrumentationConfig) MetricsProvider
DefaultMetricsProvider returns Metrics build using Prometheus client library if Prometheus is enabled. Otherwise, it returns no-op Metrics.
type MockTester ¶ added in v0.9.0
type MockTester struct {
}
MockTester is a mock testing.T
func (MockTester) Errorf ¶ added in v0.9.0
func (m MockTester) Errorf(format string, args ...any)
Errorf is used to log an error to the test logger
func (MockTester) FailNow ¶ added in v0.9.0
func (m MockTester) FailNow()
FailNow is used to fail the test immediately
func (MockTester) Logf ¶ added in v0.9.0
func (m MockTester) Logf(format string, args ...any)
Logf is used to log a message to the test logger
type Node ¶
Node is the interface for an application node
func NewNode ¶
func NewNode( ctx context.Context, conf config.Config, exec coreexecutor.Executor, sequencer coresequencer.Sequencer, da coreda.DA, signer signer.Signer, p2pClient *p2p.Client, genesis genesis.Genesis, database ds.Batching, metricsProvider MetricsProvider, logger logging.EventLogger, signaturePayloadProvider types.SignaturePayloadProvider, ) (Node, error)
NewNode returns a new Full or Light Node based on the config This is the entry point for composing a node, when compiling a node, you need to provide an executor Example executors can be found in apps/