Documentation ¶
Index ¶
- func ExtractNodeRef(rawJSON []byte) (string, error)
- func ExtractRegisterNodeResponse(data []byte) ([]byte, error)
- func RandomUint64() uint64
- type NetworkCoordinator
- func (nc *NetworkCoordinator) Authorize(ctx context.Context, nodeRef core.RecordRef, seed []byte, signatureRaw []byte) (string, []core.NodeRole, error)
- func (nc *NetworkCoordinator) RegisterNode(ctx context.Context, publicKey string, numberOfBootstrapNodes int, ...) ([]byte, error)
- func (nc *NetworkCoordinator) Start(ctx context.Context, c core.Components) error
- func (nc *NetworkCoordinator) Stop(ctx context.Context) error
- func (nc *NetworkCoordinator) WriteActiveNodes(ctx context.Context, number core.PulseNumber, activeNodes []*core.Node) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractNodeRef ¶ added in v0.6.1
ExtractNodeRef extract reference from json response
func ExtractRegisterNodeResponse ¶ added in v0.6.1
ExtractRegisterNodeResponse extracts response of RegisterNode
Types ¶
type NetworkCoordinator ¶
type NetworkCoordinator struct {
// contains filtered or unexported fields
}
NetworkCoordinator encapsulates logic of network configuration
func (*NetworkCoordinator) Authorize ¶
func (nc *NetworkCoordinator) Authorize(ctx context.Context, nodeRef core.RecordRef, seed []byte, signatureRaw []byte) (string, []core.NodeRole, error)
Authorize authorizes node by verifying it's signature
func (*NetworkCoordinator) RegisterNode ¶
func (nc *NetworkCoordinator) RegisterNode(ctx context.Context, publicKey string, numberOfBootstrapNodes int, majorityRule int, roles []string, ip string) ([]byte, error)
RegisterNode registers node in nodedomain
func (*NetworkCoordinator) Start ¶
func (nc *NetworkCoordinator) Start(ctx context.Context, c core.Components) error
Start implements interface of Component
func (*NetworkCoordinator) Stop ¶
func (nc *NetworkCoordinator) Stop(ctx context.Context) error
Stop implements interface of Component
func (*NetworkCoordinator) WriteActiveNodes ¶
func (nc *NetworkCoordinator) WriteActiveNodes(ctx context.Context, number core.PulseNumber, activeNodes []*core.Node) error
WriteActiveNodes writes active nodes to ledger
Click to show internal directories.
Click to hide internal directories.