parameter

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: MIT Imports: 13 Imported by: 0

README

Parameter

This directory contains the parameters affecting the behavior of the Node.

The parameters must NOT be changed manually.

Documentation

Index

Constants

View Source
const NumberOfMonthsToCover = 4

NumberOfMonthsToCover the number of months that a Node should cover data for

Variables

View Source
var CurrentNetworkCoreWorkerDiskSpacePerMonth = NetworkCoreWorkerDiskSpacePerMonth{}

CurrentNetworkCoreWorkerDiskSpacePerMonth the disk space required for the network's core worker to store a month worth of data The data is calculated based on the average disk space usage during 2024 Q1. Actually usage may vary depending on the network's activity.

View Source
var CurrentNetworkStartBlock = NetworkStartBlock{}

CurrentNetworkStartBlock should be updated each epoch from vsl

View Source
var CurrentNetworkTolerance = NetworkTolerance{}

CurrentNetworkTolerance should be updated each epoch from vsl

Functions

func CheckParamsTask added in v0.5.25

func CheckParamsTask(ctx context.Context, redisClient rueidis.Client, networkParamsCaller *vsl.NetworkParamsCaller) error

func GetCurrentEpoch added in v0.5.25

func GetCurrentEpoch(ctx context.Context, redisClient rueidis.Client) (int64, error)

GetCurrentEpoch Get the current epoch from redis cache

func GetCurrentEpochFromVSL added in v0.5.25

func GetCurrentEpochFromVSL(settlement *vsl.SettlementCaller) (int64, error)

GetCurrentEpochFromVSL Get the current epoch from VSL blockchain

func GetNetworkBlockStart added in v0.5.25

func GetNetworkBlockStart(ctx context.Context, redisClient rueidis.Client, network string) (uint64, error)

GetNetworkBlockStart Get the current network block start from redis cache

func InitVSLClient added in v0.5.25

func InitVSLClient() (ethereum.Client, error)

InitVSLClient initializes the VSL client

func PullNetworkParamsFromVSL added in v0.5.25

func PullNetworkParamsFromVSL(networkParams *vsl.NetworkParamsCaller, epoch uint64) (string, error)

PullNetworkParamsFromVSL pulls the network parameters from the VSL

func UpdateBlockStart added in v0.5.25

func UpdateBlockStart(ctx context.Context, redisClient rueidis.Client, network string, blockStart int64) error

UpdateBlockStart updates the current start block in redis cache

func UpdateCurrentEpoch added in v0.5.25

func UpdateCurrentEpoch(ctx context.Context, redisClient rueidis.Client, epoch int64) error

UpdateCurrentEpoch updates the current epoch in redis cache

Types

type NetworkCoreWorkerDiskSpacePerMonth added in v0.4.42

type NetworkCoreWorkerDiskSpacePerMonth map[network.Network]uint

type NetworkParamsData added in v0.5.25

type NetworkParamsData struct {
	NetworkTolerance                   NetworkTolerance                   `json:"network_tolerance"`
	NetworkStartBlock                  NetworkStartBlock                  `json:"network_start_block"`
	NetworkCoreWorkerDiskSpacePerMonth NetworkCoreWorkerDiskSpacePerMonth `json:"network_core_worker_disk_space_per_month"`
}

NetworkParamsData contains the network parameters

func (*NetworkParamsData) UnmarshalJSON added in v0.5.25

func (npd *NetworkParamsData) UnmarshalJSON(data []byte) error

UnmarshalJSON defines a custom UnmarshalJSON method for NetworkParamsData

type NetworkStartBlock

type NetworkStartBlock map[network.Network]*big.Int

type NetworkTolerance

type NetworkTolerance map[network.Network]uint64

Jump to

Keyboard shortcuts

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