Documentation
¶
Index ¶
- func NewAwaiter(vdrs validators.Set, reqWeight uint64, connected func()) network.Handler
- type ChainParameters
- type Manager
- type MockManager
- func (mm MockManager) AddRegistrant(Registrant)
- func (mm MockManager) Alias(ids.ID, string) error
- func (mm MockManager) Aliases(ids.ID) []string
- func (mm MockManager) CreateChain(ChainParameters)
- func (mm MockManager) ForceCreateChain(ChainParameters)
- func (mm MockManager) IsBootstrapped(ids.ID) bool
- func (mm MockManager) Lookup(s string) (ids.ID, error)
- func (mm MockManager) LookupVM(s string) (ids.ID, error)
- func (mm MockManager) Router() router.Router
- func (mm MockManager) Shutdown()
- func (mm MockManager) SubnetID(ids.ID) (ids.ID, error)
- type Registrant
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAwaiter ¶ added in v0.6.1
func NewAwaiter(vdrs validators.Set, reqWeight uint64, connected func()) network.Handler
NewAwaiter returns a new handler that will await for a sufficient number of validators to be connected.
Types ¶
type ChainParameters ¶
type ChainParameters struct {
ID ids.ID // The ID of the chain being created
SubnetID ids.ID // ID of the subnet that validates this chain
GenesisData []byte // The genesis data of this chain's ledger
VMAlias string // The ID of the vm this chain is running
FxAliases []string // The IDs of the feature extensions this chain is running
CustomBeacons validators.Set // Should only be set if the default beacons can't be used.
}
ChainParameters defines the chain being created
type Manager ¶
type Manager interface {
// Return the router this Manager is using to route consensus messages to chains
Router() router.Router
// Create a chain in the future
CreateChain(ChainParameters)
// Create a chain now
ForceCreateChain(ChainParameters)
// Add a registrant [r]. Every time a chain is
// created, [r].RegisterChain([new chain]) is called
AddRegistrant(Registrant)
// Given an alias, return the ID of the chain associated with that alias
Lookup(string) (ids.ID, error)
// Given an alias, return the ID of the VM associated with that alias
LookupVM(string) (ids.ID, error)
// Return the aliases associated with a chain
Aliases(ids.ID) []string
// Add an alias to a chain
Alias(ids.ID, string) error
// Returns the ID of the subnet that is validating the provided chain
SubnetID(chainID ids.ID) (ids.ID, error)
// Returns true iff the chain with the given ID exists and is finished bootstrapping
IsBootstrapped(ids.ID) bool
Shutdown()
}
Manager manages the chains running on this node. It can:
- Create a chain
- Add a registrant. When a chain is created, each registrant calls RegisterChain with the new chain as the argument.
- Get the aliases associated with a given chain.
- Get the ID of the chain associated with a given alias.
func New ¶
func New( stakingEnabled bool, stakerMsgPortion, stakerCPUPortion float64, log logging.Logger, logFactory logging.Factory, vmManager vms.Manager, decisionEvents *triggers.EventDispatcher, consensusEvents *triggers.EventDispatcher, db database.Database, rtr router.Router, net network.Network, consensusParams avcon.Parameters, validators validators.Manager, nodeID ids.ShortID, networkID uint32, server *api.Server, keystore *keystore.Keystore, atomicMemory *atomic.Memory, avaxAssetID ids.ID, xChainID ids.ID, criticalChains ids.Set, ) (Manager, error)
New returns a new Manager where:
<db> is this node's database <sender> sends messages to other validators <validators> validate this chain
TODO: Make this function take less arguments
type MockManager ¶
type MockManager struct{}
MockManager implements Manager but does nothing. Always returns nil error. To be used only in tests
func (MockManager) AddRegistrant ¶
func (mm MockManager) AddRegistrant(Registrant)
AddRegistrant ...
func (MockManager) ForceCreateChain ¶
func (mm MockManager) ForceCreateChain(ChainParameters)
ForceCreateChain ...
func (MockManager) IsBootstrapped ¶ added in v0.6.1
func (mm MockManager) IsBootstrapped(ids.ID) bool
IsBootstrapped ...
type Registrant ¶
Registrant can register the existence of a chain
Click to show internal directories.
Click to hide internal directories.