node

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package node provides the high-level interface for running a DAG-Time node

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidConfig = fmt.Errorf("invalid node configuration")

ErrInvalidConfig indicates the node configuration is invalid

Functions

func ValidateConfig

func ValidateConfig(cfg Config) error

ValidateConfig validates the node configuration

Types

type Config

type Config struct {
	// Network configuration
	Network network.Config

	// Beacon configuration
	BeaconURL       string
	BeaconInterval  time.Duration
	BeaconChainHash []byte
	BeaconPublicKey []byte

	// Pool configuration
	EventRate       int64
	AnchorInterval  int
	SubEventComplex float64
	VerifyInterval  int
	Verbose         bool
}

Config represents node configuration

type Node

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

Node represents a complete DAG-Time node

func New

func New(ctx context.Context, cfg Config) (*Node, error)

New creates a new DAG-Time node

func (*Node) AddEvent

func (n *Node) AddEvent(ctx context.Context, data []byte, parents []string) error

AddEvent adds a new event to the node's DAG

func (*Node) Close

func (n *Node) Close() error

Close shuts down the node and all its components

Jump to

Keyboard shortcuts

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