goclient

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: GPL-3.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DataVersionNil is just a placeholder for a nil data version.
	// Don't check for it, check for errors or nil data instead.
	DataVersionNil spec.DataVersion = math.MaxUint64

	// Client timeouts.
	DefaultCommonTimeout = time.Second * 5  // For dialing and most requests.
	DefaultLongTimeout   = time.Second * 10 // For long requests.
)

Variables

View Source
var (
	SyncCommitteeSize                    uint64       = 512
	SyncCommitteeSubnetCount             uint64       = 4
	TargetAggregatorsPerSyncSubcommittee uint64       = 16
	EpochsPerSyncCommitteePeriod         uint64       = 256
	TargetAggregatorsPerCommittee        uint64       = 16
	FarFutureEpoch                       phase0.Epoch = 1<<64 - 1
	IntervalsPerSlot                     uint64       = 3
)

Functions

func ComputeForkDigest added in v0.4.0

func ComputeForkDigest(version phase0.Version, genesisValidatorsRoot phase0.Root) ([4]byte, error)

ComputeForkDigest returns the fork for the current version and genesis validator root

Spec pseudocode definition:

	def compute_fork_digest(current_version: Version, genesis_validators_root: Root) -> ForkDigest:
   """
   Return the 4-byte fork digest for the ``current_version`` and ``genesis_validators_root``.
   This is a digest primarily used for domain separation on the p2p layer.
   4-bytes suffices for practical separation of forks/chains.
   """
   return ForkDigest(compute_fork_data_root(current_version, genesis_validators_root)[:4])

func Hash added in v0.4.0

func Hash(data []byte) [32]byte

Hash defines a function that returns the sha256 checksum of the data passed in. https://github.com/ethereum/consensus-specs/blob/v0.9.3/specs/core/0_beacon-chain.md#hash

func New

func New(
	logger *zap.Logger,
	opt beaconprotocol.Options,
	operatorDataStore operatordatastore.OperatorDataStore,
	slotTickerProvider slotticker.Provider,
) (beaconprotocol.BeaconNode, error)

New init new client and go-client instance

func ToBytes4 added in v0.4.0

func ToBytes4(x []byte) [4]byte

ToBytes4 is a convenience method for converting a byte slice to a fix sized 4 byte array. This method will truncate the input if it is larger than 4 bytes.

Types

type NodeClient added in v1.1.0

type NodeClient string

NodeClient is the type of the Beacon node.

const (
	NodeLighthouse NodeClient = "lighthouse"
	NodePrysm      NodeClient = "prysm"
	NodeNimbus     NodeClient = "nimbus"
	NodeUnknown    NodeClient = "unknown"
)

func ParseNodeClient added in v1.1.0

func ParseNodeClient(version string) NodeClient

ParseNodeClient derives the client from node's version string.

type NodeClientProvider added in v1.1.0

type NodeClientProvider interface {
	NodeClient() NodeClient
}

Jump to

Keyboard shortcuts

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