config

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScalaImageRepository = "wavesplatform/wavesnode"

	DefaultImageTag = "latest"
)
View Source
const (
	RESTAPIPort = "6869"
	GRPCAPIPort = "6870"
	BindPort    = "6868"
	DefaultIP   = "0.0.0.0"
	NetTCP      = "/tcp"
)

Variables

This section is empty.

Functions

func Platform added in v0.11.0

func Platform() string

Types

type AccountInfo

type AccountInfo struct {
	PublicKey    crypto.PublicKey
	SecretKey    crypto.SecretKey
	Amount       uint64
	Address      proto.WavesAddress
	Alias        proto.Alias
	BLSSecretKey bls.SecretKey
	BLSPublicKey bls.PublicKey
}

type BlockchainConfig added in v0.11.0

type BlockchainConfig struct {
	Settings        *settings.BlockchainSettings
	Features        []FeatureInfo
	RewardAddresses RewardAddresses
	// contains filtered or unexported fields
}

BlockchainConfig is a struct that contains settings for blockchain. This configuration is used both for building Scala and Go configuration files. Also, it's used to produce a Docker container run configurations for both nodes.

func NewBlockchainConfig

func NewBlockchainConfig(options ...BlockchainOption) (*BlockchainConfig, error)

func (*BlockchainConfig) DesiredBlockRewardString added in v0.11.0

func (c *BlockchainConfig) DesiredBlockRewardString() string

func (*BlockchainConfig) DisableGoMiningString added in v0.11.0

func (c *BlockchainConfig) DisableGoMiningString() string

func (*BlockchainConfig) EnableScalaMiningString added in v0.11.0

func (c *BlockchainConfig) EnableScalaMiningString() string

func (*BlockchainConfig) QuorumString added in v0.11.0

func (c *BlockchainConfig) QuorumString() string

func (*BlockchainConfig) SupportedFeaturesString added in v0.11.0

func (c *BlockchainConfig) SupportedFeaturesString() string

func (*BlockchainConfig) TestConfig added in v0.11.0

func (c *BlockchainConfig) TestConfig() TestConfig

func (*BlockchainConfig) UpdatePreactivatedFeatures added in v0.11.0

func (c *BlockchainConfig) UpdatePreactivatedFeatures(features []FeatureInfo) error

UpdatePreactivatedFeatures checks and inserts new preactivated features in BlockchainConfig.

type BlockchainOption added in v0.11.0

type BlockchainOption func(*BlockchainConfig) error

BlockchainOption is a function type that allows to set additional parameters to BlockchainConfig.

func WithAbsencePeriod added in v0.11.0

func WithAbsencePeriod(period uint64) BlockchainOption

WithAbsencePeriod sets the length of the period between the activation of LightNode and the height at which blocks without the new fields are considered invalid.

func WithFeatureSettingFromFile added in v0.11.0

func WithFeatureSettingFromFile(path ...string) BlockchainOption

WithFeatureSettingFromFile is a BlockchainOption that allows to set feature settings from configuration file. Feature settings configuration file is a JSON file with the structure of `featureSettings`.

func WithGenerationPeriod added in v0.11.0

func WithGenerationPeriod(generationPeriod uint64) BlockchainOption

func WithNoGoMining added in v0.11.0

func WithNoGoMining() BlockchainOption

WithNoGoMining disables mining on the Go node.

func WithNoScalaMining added in v0.11.0

func WithNoScalaMining() BlockchainOption

WithNoScalaMining disables mining on the Scala node.

func WithPaymentsSettingFromFile added in v0.11.0

func WithPaymentsSettingFromFile(path ...string) BlockchainOption

WithPaymentsSettingFromFile is a BlockchainOption that allows to set payment settings from configuration file. Payment settings configuration file is a JSON file with the structure of `paymentSettings`.

func WithPreactivatedFeatures added in v0.11.0

func WithPreactivatedFeatures(features []FeatureInfo) BlockchainOption

WithPreactivatedFeatures adds features to preactivated features.

func WithQuorum added in v0.11.0

func WithQuorum(quorum int) BlockchainOption

WithQuorum sets the quorum (number of connected peers) required to start block generation.

func WithRewardSettingFromFile added in v0.11.0

func WithRewardSettingFromFile(path ...string) BlockchainOption

WithRewardSettingFromFile is a BlockchainOption that allows to set reward settings from configuration file. Reward settings configuration file is a JSON file with the structure of `rewardSettings`.

type DistributionItem

type DistributionItem struct {
	SeedText string `json:"seed_text"`
	Amount   uint64 `json:"amount"`
	IsMiner  bool   `json:"is_miner"`
}

type DockerConfigurator added in v0.11.0

type DockerConfigurator interface {
	DockerRunOptions() *dockertest.RunOptions
	WithImageRepository(repository string) DockerConfigurator
	WithImageTag(tag string) DockerConfigurator
}

type FeatureInfo added in v0.10.2

type FeatureInfo struct {
	Feature int16  `json:"feature"`
	Height  uint64 `json:"height"`
}

type FeatureSettings added in v0.11.0

type FeatureSettings struct {
	PreactivatedFeatures []FeatureInfo `json:"preactivated_features"`
	SupportedFeatures    []int16       `json:"supported_features"`
}

FeatureSettings stores parts of genesis configuration related to features. It's used to modify the blockchain settings.

func NewFeatureSettingsFromFile added in v0.11.0

func NewFeatureSettingsFromFile(path ...string) (*FeatureSettings, error)

NewFeatureSettingsFromFile reads features settings from file. The `path` is a relative path to the configuration JSON file.

type GenesisConfig

type GenesisConfig struct {
	GenesisTimestamp  int64
	GenesisSignature  crypto.Signature
	GenesisBaseTarget types.BaseTarget
	AverageBlockDelay uint64
	Transaction       []genesis_generator.GenesisTransactionInfo
}

type GenesisSettings

type GenesisSettings struct {
	Scheme               proto.Scheme
	SchemeRaw            string             `json:"scheme"`
	AverageBlockDelay    uint64             `json:"average_block_delay"`
	MinBlockTime         float64            `json:"min_block_time"`
	DelayDelta           uint64             `json:"delay_delta"`
	Distributions        []DistributionItem `json:"distributions"`
	PreactivatedFeatures []FeatureInfo      `json:"preactivated_features"`
}

type GoConfigurator added in v0.11.0

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

func NewGoConfigurator added in v0.11.0

func NewGoConfigurator(suite string, cfg *BlockchainConfig) (*GoConfigurator, error)

func (*GoConfigurator) DockerRunOptions added in v0.11.0

func (c *GoConfigurator) DockerRunOptions() *dockertest.RunOptions

func (*GoConfigurator) WithImageRepository added in v0.11.0

func (c *GoConfigurator) WithImageRepository(_ string) DockerConfigurator

func (*GoConfigurator) WithImageTag added in v0.11.0

func (c *GoConfigurator) WithImageTag(_ string) DockerConfigurator

type PaymentSettings added in v0.11.0

type PaymentSettings struct {
	PaymentsFixAfterHeight                              uint64 `json:"payments_fix_after_height"`
	InternalInvokePaymentsValidationAfterHeight         uint64 `json:"internal_invoke_payments_validation_after_height"`
	InternalInvokeCorrectFailRejectBehaviourAfterHeight uint64 `json:"internal_invoke_correct_fail_reject_behaviour_after_height"` //nolint:lll
	InvokeNoZeroPaymentsAfterHeight                     uint64 `json:"invoke_no_zero_payments_after_height"`
}

PaymentSettings stores parts of genesis configuration related to payments. It's used to modify the blockchain settings.

func NewPaymentSettingsFromFile added in v0.11.0

func NewPaymentSettingsFromFile(path ...string) (*PaymentSettings, error)

NewPaymentSettingsFromFile reads payment settings from file. The `path` is a relative path to the configuration JSON file.

type RewardAddresses added in v0.11.0

type RewardAddresses struct {
	DAORewardAddress  *proto.WavesAddress
	XTNBuybackAddress *proto.WavesAddress
}

RewardAddresses contains information about DAO and XTNBuyback addresses. Methods of RewardAddresses allow to represent this information in a form suitable for Go node configuration.

func NewRewardAddresses added in v0.11.0

func NewRewardAddresses(daoAddress, xtnAddress string) (RewardAddresses, error)

NewRewardAddresses creates RewardAddresses from two string representations of DAO and XTNBuyback addresses.

func (*RewardAddresses) Addresses added in v0.11.0

func (ra *RewardAddresses) Addresses() []proto.WavesAddress

Addresses returns DAO and XTNBuyback addresses as a slice of Waves addresses.

func (*RewardAddresses) AddressesAfter21 added in v0.11.0

func (ra *RewardAddresses) AddressesAfter21() []proto.WavesAddress

AddressesAfter21 returns DAO address as a slice of Waves addresses that doesn't contain XTNBuyback address to represent the set of reward addresses after the activation of feature 21.

type RewardSettings added in v0.11.0

type RewardSettings struct {
	BlockRewardVotingPeriod uint64 `json:"voting_interval"`
	BlockRewardTerm         uint64 `json:"term"`
	BlockRewardTermAfter20  uint64 `json:"term_after_capped_reward_feature"`
	InitialBlockReward      uint64 `json:"initial_block_reward"`
	BlockRewardIncrement    uint64 `json:"block_reward_increment"`
	DesiredBlockReward      uint64 `json:"desired_reward"`
	DaoAddress              string `json:"dao_address"`
	XtnBuybackAddress       string `json:"xtn_buyback_address"`
	MinXTNBuyBackPeriod     uint64 `json:"min_xtn_buy_back_period"`
	BlockRewardBoostPeriod  uint64 `json:"block_reward_boost_period"`
}

RewardSettings stores parts of genesis configuration related to rewards. It's used to modify the blockchain settings in test on rewards.

func NewRewardSettingsFromFile added in v0.11.0

func NewRewardSettingsFromFile(path ...string) (*RewardSettings, error)

NewRewardSettingsFromFile reads reward settings from file. The `path` is a relative path to the configuration JSON file inside the project's "rewards_settings_testdata" folder.

type ScalaConfigurator added in v0.11.0

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

func NewScalaConfigurator added in v0.11.0

func NewScalaConfigurator(suite string, cfg *BlockchainConfig) (*ScalaConfigurator, error)

func (*ScalaConfigurator) DockerRunOptions added in v0.11.0

func (c *ScalaConfigurator) DockerRunOptions() *dockertest.RunOptions

func (*ScalaConfigurator) WithGoNode added in v0.11.0

func (c *ScalaConfigurator) WithGoNode(goNodeIP string) *ScalaConfigurator

func (*ScalaConfigurator) WithImageRepository added in v0.11.0

func (c *ScalaConfigurator) WithImageRepository(repository string) DockerConfigurator

func (*ScalaConfigurator) WithImageTag added in v0.11.0

func (c *ScalaConfigurator) WithImageTag(tag string) DockerConfigurator

type TestConfig

type TestConfig struct {
	Accounts           []AccountInfo
	BlockchainSettings *settings.BlockchainSettings
}

func (*TestConfig) GenesisSH added in v0.11.0

func (c *TestConfig) GenesisSH() crypto.Digest

func (*TestConfig) GetRichestAccount added in v0.11.0

func (c *TestConfig) GetRichestAccount() AccountInfo

type WaitOption added in v0.11.0

type WaitOption func(*WaitParams)

WaitOption is a functional option type that allows to set additional parameters of waiting operations.

func WaitWithContext added in v0.11.0

func WaitWithContext(ctx context.Context) WaitOption

WaitWithContext sets the context for waiting operations.

func WaitWithTimeout added in v0.11.0

func WaitWithTimeout(timeout time.Duration) WaitOption

WaitWithTimeout sets the timeout for waiting operations.

func WaitWithTimeoutInBlocks added in v0.11.0

func WaitWithTimeoutInBlocks(blocks uint64) WaitOption

WaitWithTimeoutInBlocks sets the timeout for waiting operations based on the number of blocks to wait for.

type WaitParams added in v0.11.0

type WaitParams struct {
	Ctx     context.Context
	Timeout time.Duration
}

func DefaultWaitParams added in v0.11.0

func DefaultWaitParams() *WaitParams

func NewWaitParams added in v0.11.0

func NewWaitParams(opts ...WaitOption) *WaitParams

Jump to

Keyboard shortcuts

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