cardano

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmbeddedConfigPreviewNetworkFS embed.FS

EmbeddedConfigPreviewNetworkFS contains the embedded Cardano configuration files for the preview network. This includes config.json and all genesis files required for preview network operation when no external config files are available.

Functions

This section is empty.

Types

type CardanoNodeConfig

type CardanoNodeConfig struct {
	AlonzoGenesisFile  string `yaml:"AlonzoGenesisFile"`
	AlonzoGenesisHash  string `yaml:"AlonzoGenesisHash"`
	ByronGenesisFile   string `yaml:"ByronGenesisFile"`
	ByronGenesisHash   string `yaml:"ByronGenesisHash"`
	ConwayGenesisFile  string `yaml:"ConwayGenesisFile"`
	ConwayGenesisHash  string `yaml:"ConwayGenesisHash"`
	ShelleyGenesisFile string `yaml:"ShelleyGenesisFile"`
	ShelleyGenesisHash string `yaml:"ShelleyGenesisHash"`
	// contains filtered or unexported fields
}

CardanoNodeConfig represents the config.json/yaml file used by cardano-node.

func LoadCardanoNodeConfigWithFallback added in v0.18.0

func LoadCardanoNodeConfigWithFallback(
	cfgPath, network string,
	embedFS embed.FS,
) (*CardanoNodeConfig, error)

LoadCardanoNodeConfigWithFallback tries to load config from file, then falls back to embed FS for preview network.

func NewCardanoNodeConfigFromEmbedFS added in v0.18.0

func NewCardanoNodeConfigFromEmbedFS(
	fs embed.FS,
	file string,
) (*CardanoNodeConfig, error)

NewCardanoNodeConfigFromEmbedFS creates a CardanoNodeConfig from an embedded filesystem. It loads the main config file and all referenced genesis files from the embedded FS. The file parameter should be a path relative to the root of the embedded filesystem.

func NewCardanoNodeConfigFromFile

func NewCardanoNodeConfigFromFile(file string) (*CardanoNodeConfig, error)

func NewCardanoNodeConfigFromReader

func NewCardanoNodeConfigFromReader(r io.Reader) (*CardanoNodeConfig, error)

func (*CardanoNodeConfig) AlonzoGenesis

func (c *CardanoNodeConfig) AlonzoGenesis() *alonzo.AlonzoGenesis

AlonzoGenesis returns the Alonzo genesis config specified in the cardano-node config

func (*CardanoNodeConfig) ByronGenesis

func (c *CardanoNodeConfig) ByronGenesis() *byron.ByronGenesis

ByronGenesis returns the Byron genesis config specified in the cardano-node config

func (*CardanoNodeConfig) ConwayGenesis

func (c *CardanoNodeConfig) ConwayGenesis() *conway.ConwayGenesis

ConwayGenesis returns the Conway genesis config specified in the cardano-node config

func (*CardanoNodeConfig) LoadAlonzoGenesisFromReader added in v0.6.0

func (c *CardanoNodeConfig) LoadAlonzoGenesisFromReader(r io.Reader) error

LoadAlonzoGenesisFromReader loads a Alonzo genesis config from an io.Reader This is useful mostly for tests

func (*CardanoNodeConfig) LoadByronGenesisFromReader added in v0.6.0

func (c *CardanoNodeConfig) LoadByronGenesisFromReader(r io.Reader) error

LoadByronGenesisFromReader loads a Byron genesis config from an io.Reader This is useful mostly for tests

func (*CardanoNodeConfig) LoadConwayGenesisFromReader added in v0.6.0

func (c *CardanoNodeConfig) LoadConwayGenesisFromReader(r io.Reader) error

LoadConwayGenesisFromReader loads a Conway genesis config from an io.Reader This is useful mostly for tests

func (*CardanoNodeConfig) LoadShelleyGenesisFromReader added in v0.6.0

func (c *CardanoNodeConfig) LoadShelleyGenesisFromReader(r io.Reader) error

LoadShelleyGenesisFromReader loads a Shelley genesis config from an io.Reader This is useful mostly for tests

func (*CardanoNodeConfig) ShelleyGenesis

func (c *CardanoNodeConfig) ShelleyGenesis() *shelley.ShelleyGenesis

ShelleyGenesis returns the Shelley genesis config specified in the cardano-node config

Jump to

Keyboard shortcuts

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