Documentation
¶
Overview ¶
Package config supports configuration of the Flow Rosetta server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chain ¶
type Chain struct {
BalanceValidationInterval time.Duration
Cache bool
ConstructionAccessNodes access.Pool
DataAccessNodes access.Pool
Contracts *Contracts
DataDir string
MaxBackoffInterval time.Duration
Mode string
Network string
Originators []string
Port uint16
PurgeProxyAccounts bool
ResyncFrom uint64
SkipBlocks map[flow.Identifier]struct{}
SporkSealTolerance uint64
Sporks []*Spork
UseConsensusFollower bool
Workers uint
}
Chain represents the definition of a Flow chain like mainnet and testnet.
func Init ¶
Init reads the given config file, decodes the JSON config, validates it, and returns the initialized config.
func (*Chain) FirstSpork ¶
FirstSpork returns the config for the first spork in the chain.
func (*Chain) IsProxyContractDeployed ¶
IsProxyContractDeployed returns whether a deployed Proxy contract has been configured.
func (*Chain) LatestSpork ¶
LatestSpork returns the config for the latest spork in the chain.
type Consensus ¶
type Consensus struct {
DisableSignatureCheck bool `json:"disable_signature_check"`
RootProtocolStateURL string `json:"root_protocol_state_url"`
RootProtocolStateSignatureURL string `json:"root_protocol_state_signature_url"`
SeedNodes []SeedNode `json:"seed_nodes"`
SigningKey string `json:"signing_key"`
}
Consensus defines the metadata needed to initialize a consensus follower for a live spork.
type Contracts ¶
type Contracts struct {
FlowFees string `json:"flow_fees"`
FlowToken string `json:"flow_token"`
FungibleToken string `json:"fungible_token"`
FlowColdStorageProxy string `json:"flow_cold_storage_proxy"`
}
Contracts defines the chain-specific addresses for various core contracts.
type SeedNode ¶
type SeedNode struct {
Host string `json:"host"`
Port uint16 `json:"port"`
PublicKey string `json:"public_key"`
}
SeedNode defines a seed node for the current spork.
type Spork ¶
type Spork struct {
AccessNodes access.Pool
Chain *Chain
Consensus *Consensus
ID uint
Next *Spork
Prev *Spork
RootBlock uint64
// Version is a Rosetta-internal version number that tracks Rosetta compatibility with Flow network versions.
// This version number is incremented each time there is a Flow network upgrades which includes a breaking change for Rosetta.
// Not all Flow network upgrades cause breaking changes for Rosetta, so this version number is not incremented for every network upgrade.
Version int
}
Spork provides the relevant metadata for a spork.