network

package
v0.0.0-...-5a6e01e Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: GPL-3.0 Imports: 37 Imported by: 0

Documentation

Overview

Package network is the basic libraries for network layer.

Index

Constants

View Source
const (
	ProblemMimetype    = "application/problem+json; charset=utf-8"
	ProblemNamespace   = "https://github.com/spikeekips/mitum/problems"
	DefaultProblemType = "others"
)

Variables

View Source
var (
	NilConnInfoType    = hint.Type("nil-conninfo")
	NilConnInfoHint    = hint.NewHint(NilConnInfoType, "v0.0.1")
	NilConnInfoHinter  = NilConnInfo{BaseHinter: hint.NewBaseHinter(NilConnInfoHint)}
	HTTPConnInfoType   = hint.Type("http-conninfo")
	HTTPConnInfoHint   = hint.NewHint(HTTPConnInfoType, "v0.0.1")
	HTTPConnInfoHinter = HTTPConnInfo{BaseHinter: hint.NewBaseHinter(HTTPConnInfoHint)}
)
View Source
var (
	NetworkError          = util.NewError("network error")
	HandoverRejectedError = util.NewError("handover failed")
)
View Source
var (
	StartHandoverSealV0Type   = hint.Type("start-handover-seal")
	StartHandoverSealV0Hint   = hint.NewHint(StartHandoverSealV0Type, "v0.0.1")
	StartHandoverSealV0Hinter = HandoverSealV0{BaseSeal: seal.NewBaseSealWithHint(StartHandoverSealV0Hint)}
	PingHandoverSealV0Type    = hint.Type("ping-handover-seal")
	PingHandoverSealV0Hint    = hint.NewHint(PingHandoverSealV0Type, "v0.0.1")
	PingHandoverSealV0Hinter  = HandoverSealV0{BaseSeal: seal.NewBaseSealWithHint(PingHandoverSealV0Hint)}
	EndHandoverSealV0Type     = hint.Type("end-handover-seal")
	EndHandoverSealV0Hint     = hint.NewHint(EndHandoverSealV0Type, "v0.0.1")
	EndHandoverSealV0Hinter   = HandoverSealV0{BaseSeal: seal.NewBaseSealWithHint(EndHandoverSealV0Hint)}
)
View Source
var (
	ChannelTimeoutSeal         = time.Second * 2
	ChannelTimeoutOperation    = time.Second * 2
	ChannelTimeoutSendSeal     = time.Second * 2
	ChannelTimeoutNodeInfo     = time.Second * 2
	ChannelTimeoutBlockdataMap = time.Second * 2
	ChannelTimeoutBlockdata    = time.Second * 30
	ChannelTimeoutHandover     = time.Second * 2
)
View Source
var (
	NodeInfoType     = hint.Type("node-info")
	NodeInfoV0Hint   = hint.NewHint(NodeInfoType, "v0.0.1")
	NodeInfoV0Hinter = NodeInfoV0{BaseHinter: hint.NewBaseHinter(NodeInfoV0Hint)}
)
View Source
var (
	ProblemType   = hint.Type("mitum-problem")
	ProblemHint   = hint.NewHint(ProblemType, "v0.0.1")
	ProblemHinter = Problem{BaseHinter: hint.NewBaseHinter(ProblemHint)}
)
View Source
var (
	UnknownProblem = NewProblem(DefaultProblemType, "unknown problem occurred")
)

Functions

func CheckBindIsOpen

func CheckBindIsOpen(network, bind string, timeout time.Duration) error

func FetchBlockdataFromHTTP

func FetchBlockdataFromHTTP(ctx context.Context, item block.BlockdataMapItem) (io.ReadCloser, error)

func FetchBlockdataFromRemote

func FetchBlockdataFromRemote(ctx context.Context, item block.BlockdataMapItem) (io.ReadCloser, error)

func FetchBlockdataThruChannel

func FetchBlockdataThruChannel(handler BlockdataHandler, item block.BlockdataMapItem) (io.ReadCloser, error)

func HTTPError

func HTTPError(w http.ResponseWriter, statusCode int)

func HTTPLogHandler

func HTTPLogHandler(handler http.Handler, logger *zerolog.Logger) http.Handler

func IsProblemFromResponse

func IsProblemFromResponse(res *http.Response) bool

func IsValidHandoverSeal

func IsValidHandoverSeal(local node.Local, sl HandoverSeal, networkID base.NetworkID) error

func IsValidURL

func IsValidURL(u *url.URL) error

func MergeError

func MergeError(err error) error

func NormalizeURL

func NormalizeURL(u *url.URL) *url.URL

func NormalizeURLString

func NormalizeURLString(s string) (*url.URL, error)

func ParseCombinedNodeURL

func ParseCombinedNodeURL(u *url.URL) (*url.URL, bool, error)

ParseCombinedNodeURL parses the combined url of node; it contains, - node publish url - tls insecure: "#insecure" "insecure" fragment will be removed.

func ParseURL

func ParseURL(s string, allowEmpty bool) (*url.URL, error)

func WritePoblem

func WritePoblem(w http.ResponseWriter, status int, pr Problem)

func WriteProblemWithError

func WriteProblemWithError(w http.ResponseWriter, status int, err error)

Types

type BlockdataHandler

type BlockdataHandler func(string) (io.Reader, func() error, error)

type BlockdataMapsHandler

type BlockdataMapsHandler func([]base.Height) ([]block.BlockdataMap, error)

type ConnInfo

type ConnInfo interface {
	hint.Hinter
	isvalid.IsValider
	fmt.Stringer
	util.Byter
	URL() *url.URL
	Insecure() bool
	Equal(ConnInfo) bool
}

type DummyChannel

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

func NewDummyChannel

func NewDummyChannel(connInfo ConnInfo) *DummyChannel

func (*DummyChannel) Blockdata

func (*DummyChannel) BlockdataMaps

func (ch *DummyChannel) BlockdataMaps(_ context.Context, heights []base.Height) ([]block.BlockdataMap, error)

func (*DummyChannel) ConnInfo

func (ch *DummyChannel) ConnInfo() ConnInfo

func (*DummyChannel) EndHandover

func (ch *DummyChannel) EndHandover(_ context.Context, sl EndHandoverSeal) (bool, error)

func (*DummyChannel) Initialize

func (*DummyChannel) Initialize() error

func (*DummyChannel) NodeInfo

func (ch *DummyChannel) NodeInfo(_ context.Context) (NodeInfo, error)

func (*DummyChannel) PingHandover

func (ch *DummyChannel) PingHandover(_ context.Context, sl PingHandoverSeal) (bool, error)

func (*DummyChannel) Proposal

func (ch *DummyChannel) Proposal(_ context.Context, h valuehash.Hash) (base.Proposal, error)

func (*DummyChannel) SendSeal

func (ch *DummyChannel) SendSeal(_ context.Context, _ ConnInfo, sl seal.Seal) error

func (*DummyChannel) SetBlockdataHandler

func (ch *DummyChannel) SetBlockdataHandler(f BlockdataHandler)

func (*DummyChannel) SetBlockdataMapsHandler

func (ch *DummyChannel) SetBlockdataMapsHandler(f BlockdataMapsHandler)

func (*DummyChannel) SetEndHandover

func (ch *DummyChannel) SetEndHandover(f EndHandoverHandler)

func (*DummyChannel) SetGetStagedOperationsHandler

func (ch *DummyChannel) SetGetStagedOperationsHandler(f GetStagedOperationsHandler)

func (*DummyChannel) SetGetStateHandler

func (ch *DummyChannel) SetGetStateHandler(f GetStateHandler)

func (*DummyChannel) SetNewSealHandler

func (ch *DummyChannel) SetNewSealHandler(f NewSealHandler)

func (*DummyChannel) SetNodeInfoHandler

func (ch *DummyChannel) SetNodeInfoHandler(f NodeInfoHandler)

func (*DummyChannel) SetPingHandover

func (ch *DummyChannel) SetPingHandover(f PingHandoverHandler)

func (*DummyChannel) SetStartHandover

func (ch *DummyChannel) SetStartHandover(f StartHandoverHandler)

func (*DummyChannel) StagedOperations

func (ch *DummyChannel) StagedOperations(_ context.Context, h []valuehash.Hash) ([]operation.Operation, error)

func (*DummyChannel) StartHandover

func (ch *DummyChannel) StartHandover(_ context.Context, sl StartHandoverSeal) (bool, error)

func (*DummyChannel) State

func (ch *DummyChannel) State(_ context.Context, key string) (state.State, bool, error)

type EndHandoverHandler

type EndHandoverHandler func(EndHandoverSeal) (bool, error)

type EndHandoverSeal

type EndHandoverSeal interface {
	HandoverSeal
}

type GetProposalHandler

type GetProposalHandler func(valuehash.Hash) (base.Proposal, error)

type GetStagedOperationsHandler

type GetStagedOperationsHandler func([]valuehash.Hash) ([]operation.Operation, error)

type GetStateHandler

type GetStateHandler func(string) (state.State, bool, error)

type HTTPConnInfo

type HTTPConnInfo struct {
	hint.BaseHinter
	// contains filtered or unexported fields
}

func NewHTTPConnInfo

func NewHTTPConnInfo(u *url.URL, insecure bool) HTTPConnInfo

func NewHTTPConnInfoFromString

func NewHTTPConnInfoFromString(s string, insecure bool) (HTTPConnInfo, error)

func (HTTPConnInfo) Bytes

func (conn HTTPConnInfo) Bytes() []byte

func (HTTPConnInfo) Equal

func (conn HTTPConnInfo) Equal(b ConnInfo) bool

func (HTTPConnInfo) Insecure

func (conn HTTPConnInfo) Insecure() bool

func (HTTPConnInfo) IsValid

func (conn HTTPConnInfo) IsValid([]byte) error

func (HTTPConnInfo) MarshalBSON

func (conn HTTPConnInfo) MarshalBSON() ([]byte, error)

func (HTTPConnInfo) MarshalJSON

func (conn HTTPConnInfo) MarshalJSON() ([]byte, error)

func (HTTPConnInfo) SetInsecure

func (conn HTTPConnInfo) SetInsecure(i bool) HTTPConnInfo

func (HTTPConnInfo) String

func (conn HTTPConnInfo) String() string

func (HTTPConnInfo) URL

func (conn HTTPConnInfo) URL() *url.URL

func (*HTTPConnInfo) UnmarshalBSON

func (conn *HTTPConnInfo) UnmarshalBSON(b []byte) error

func (*HTTPConnInfo) UnmarshalJSON

func (conn *HTTPConnInfo) UnmarshalJSON(b []byte) error

type HTTPConnInfoPackerJSON

type HTTPConnInfoPackerJSON struct {
	jsonenc.HintedHead
	U string `json:"url"`
	I bool   `json:"insecure"`
}

type HTTPConnInfoUnpackerBSON

type HTTPConnInfoUnpackerBSON struct {
	HT hint.Hint `bson:"_hint"`
	U  string    `bson:"url"`
	I  bool      `bson:"insecure"`
}

type HTTPConnInfoUnpackerJSON

type HTTPConnInfoUnpackerJSON struct {
	U string `json:"url"`
	I bool   `json:"insecure"`
}

type HTTPHandlerFunc

type HTTPHandlerFunc func(http.ResponseWriter, *http.Request)

type HandoverSeal

type HandoverSeal interface {
	seal.Seal
	Address() base.Address
	ConnInfo() ConnInfo
}

type HandoverSealV0

type HandoverSealV0 struct {
	seal.BaseSeal
	// contains filtered or unexported fields
}

func NewHandoverSealV0

func NewHandoverSealV0(
	ht hint.Hint,
	pk key.Privatekey,
	ad base.Address,
	ci ConnInfo,
	networkID []byte,
) (HandoverSealV0, error)

func (HandoverSealV0) Address

func (sl HandoverSealV0) Address() base.Address

func (HandoverSealV0) BodyBytes

func (sl HandoverSealV0) BodyBytes() []byte

func (HandoverSealV0) ConnInfo

func (sl HandoverSealV0) ConnInfo() ConnInfo

func (HandoverSealV0) IsValid

func (sl HandoverSealV0) IsValid(networkID []byte) error

func (HandoverSealV0) MarshalBSON

func (sl HandoverSealV0) MarshalBSON() ([]byte, error)

func (HandoverSealV0) MarshalJSON

func (sl HandoverSealV0) MarshalJSON() ([]byte, error)

func (*HandoverSealV0) UnpackBSON

func (sl *HandoverSealV0) UnpackBSON(b []byte, enc *bsonenc.Encoder) error

func (*HandoverSealV0) UnpackJSON

func (sl *HandoverSealV0) UnpackJSON(b []byte, enc *jsonenc.Encoder) error

type HandoverSealV0BSONUnpack

type HandoverSealV0BSONUnpack struct {
	AD base.AddressDecoder `bson:"address"`
	CI bson.Raw            `bson:"conninfo"`
}

type HandoverSealV0JSONPack

type HandoverSealV0JSONPack struct {
	*seal.BaseSealJSONPack
	AD base.Address `json:"address"`
	CI ConnInfo     `json:"conninfo"`
}

type HandoverSealV0JSONUnpack

type HandoverSealV0JSONUnpack struct {
	AD base.AddressDecoder `json:"address"`
	CI json.RawMessage     `json:"conninfo"`
}

type NewSealHandler

type NewSealHandler func(seal.Seal) error

type NilConnInfo

type NilConnInfo struct {
	hint.BaseHinter
	// contains filtered or unexported fields
}

func NewNilConnInfo

func NewNilConnInfo(name string) NilConnInfo

func (NilConnInfo) Bytes

func (NilConnInfo) Bytes() []byte

func (NilConnInfo) Equal

func (conn NilConnInfo) Equal(b ConnInfo) bool

func (NilConnInfo) Insecure

func (NilConnInfo) Insecure() bool

func (NilConnInfo) IsValid

func (conn NilConnInfo) IsValid([]byte) error

func (NilConnInfo) MarshalBSON

func (conn NilConnInfo) MarshalBSON() ([]byte, error)

func (NilConnInfo) MarshalJSON

func (conn NilConnInfo) MarshalJSON() ([]byte, error)

func (NilConnInfo) String

func (conn NilConnInfo) String() string

func (NilConnInfo) URL

func (NilConnInfo) URL() *url.URL

func (*NilConnInfo) UnmarshalBSON

func (conn *NilConnInfo) UnmarshalBSON(b []byte) error

func (*NilConnInfo) UnmarshalJSON

func (conn *NilConnInfo) UnmarshalJSON(b []byte) error

type NilConnInfoPackerJSON

type NilConnInfoPackerJSON struct {
	jsonenc.HintedHead
	S string `json:"name"`
}

type NilConnInfoUnpackerBSON

type NilConnInfoUnpackerBSON struct {
	HT hint.Hint `bson:"_hint"`
	S  string    `bson:"name"`
}

type NilConnInfoUnpackerJSON

type NilConnInfoUnpackerJSON struct {
	S string `json:"name"`
}

type NodeInfo

type NodeInfo interface {
	isvalid.IsValider
	hint.Hinter
	base.Node
	NetworkID() base.NetworkID
	State() base.State
	LastBlock() block.Manifest
	Version() util.Version
	ConnInfo() ConnInfo
	Policy() map[string]interface{}
	Nodes() []RemoteNode // Only contains suffrage nodes
}

type NodeInfoChecker

type NodeInfoChecker struct {
	sync.RWMutex
	*logging.Logging
	*util.ContextDaemon
	// contains filtered or unexported fields
}

func NewNodeInfoChecker

func NewNodeInfoChecker(
	networkID base.NetworkID,
	nodepool *Nodepool,
	interval time.Duration,
	whenNewHeight func(base.Height) error,
) *NodeInfoChecker

func (*NodeInfoChecker) SetLogging

func (nc *NodeInfoChecker) SetLogging(l *logging.Logging) *logging.Logging

type NodeInfoHandler

type NodeInfoHandler func() (NodeInfo, error)

type NodeInfoV0

type NodeInfoV0 struct {
	hint.BaseHinter
	// contains filtered or unexported fields
}

func NewNodeInfoV0

func NewNodeInfoV0(
	node base.Node,
	networkID base.NetworkID,
	state base.State,
	lastBlock block.Manifest,
	version util.Version,
	policy map[string]interface{},
	nodes []RemoteNode,
	suffrage base.Suffrage,
	ci ConnInfo,
) NodeInfoV0

func (NodeInfoV0) Address

func (ni NodeInfoV0) Address() base.Address

func (NodeInfoV0) Bytes

func (NodeInfoV0) Bytes() []byte

func (NodeInfoV0) ConnInfo

func (ni NodeInfoV0) ConnInfo() ConnInfo

func (NodeInfoV0) IsValid

func (ni NodeInfoV0) IsValid([]byte) error

func (NodeInfoV0) JSONPacker

func (ni NodeInfoV0) JSONPacker() NodeInfoV0PackerJSON

func (NodeInfoV0) LastBlock

func (ni NodeInfoV0) LastBlock() block.Manifest

func (NodeInfoV0) MarshalBSON

func (ni NodeInfoV0) MarshalBSON() ([]byte, error)

func (NodeInfoV0) MarshalJSON

func (ni NodeInfoV0) MarshalJSON() ([]byte, error)

func (NodeInfoV0) NetworkID

func (ni NodeInfoV0) NetworkID() base.NetworkID

func (NodeInfoV0) Nodes

func (ni NodeInfoV0) Nodes() []RemoteNode

func (NodeInfoV0) Policy

func (ni NodeInfoV0) Policy() map[string]interface{}

func (NodeInfoV0) Publickey

func (ni NodeInfoV0) Publickey() key.Publickey

func (NodeInfoV0) State

func (ni NodeInfoV0) State() base.State

func (NodeInfoV0) String

func (ni NodeInfoV0) String() string

func (*NodeInfoV0) UnpackBSON

func (ni *NodeInfoV0) UnpackBSON(b []byte, enc *bsonenc.Encoder) error

func (*NodeInfoV0) UnpackJSON

func (ni *NodeInfoV0) UnpackJSON(b []byte, enc *jsonenc.Encoder) error

func (NodeInfoV0) Version

func (ni NodeInfoV0) Version() util.Version

type NodeInfoV0PackerJSON

type NodeInfoV0PackerJSON struct {
	jsonenc.HintedHead
	ND  base.Node              `json:"node"`
	NID base.NetworkID         `json:"network_id"`
	ST  base.State             `json:"state"`
	LB  block.Manifest         `json:"last_block"`
	VS  util.Version           `json:"version"`
	PO  map[string]interface{} `json:"policy"`
	SF  []RemoteNode           `json:"suffrage"`
	CI  ConnInfo               `json:"conninfo"`
}

type NodeInfoV0UnpackerBSON

type NodeInfoV0UnpackerBSON struct {
	ND  bson.Raw               `bson:"node"`
	NID base.NetworkID         `bson:"network_id"`
	ST  base.State             `bson:"state"`
	LB  bson.Raw               `bson:"last_block"`
	VS  util.Version           `bson:"version"`
	PO  map[string]interface{} `bson:"policy"`
	SF  []bson.Raw             `bson:"suffrage"`
	CI  bson.Raw               `bson:"conninfo"`
}

type NodeInfoV0UnpackerJSON

type NodeInfoV0UnpackerJSON struct {
	ND  json.RawMessage        `json:"node"`
	NID base.NetworkID         `json:"network_id"`
	ST  base.State             `json:"state"`
	LB  json.RawMessage        `json:"last_block"`
	VS  util.Version           `json:"version"`
	PO  map[string]interface{} `json:"policy"`
	SF  []json.RawMessage      `json:"suffrage"`
	CI  json.RawMessage        `json:"conninfo"`
}

type Nodepool

type Nodepool struct {
	*logging.Logging
	sync.RWMutex
	// contains filtered or unexported fields
}

Nodepool contains all the known nodes including local node.

func NewNodepool

func NewNodepool(local node.Local, ch Channel) *Nodepool

func (*Nodepool) Add

func (np *Nodepool) Add(no base.Node, ch Channel) error

func (*Nodepool) Broadcast

func (np *Nodepool) Broadcast(
	ctx context.Context,
	sl seal.Seal,
	filter func(base.Node) bool,
) ([]error, error)

func (*Nodepool) Channel

func (np *Nodepool) Channel(addr base.Address) (Channel, bool)

func (*Nodepool) Exists

func (np *Nodepool) Exists(address base.Address) bool

func (*Nodepool) ExistsPassthrough

func (np *Nodepool) ExistsPassthrough(ci ConnInfo) bool

func (*Nodepool) Len

func (np *Nodepool) Len() int

func (*Nodepool) LenRemoteAlives

func (np *Nodepool) LenRemoteAlives() int

func (*Nodepool) LocalChannel

func (np *Nodepool) LocalChannel() Channel

func (*Nodepool) LocalNode

func (np *Nodepool) LocalNode() node.Local

func (*Nodepool) Node

func (np *Nodepool) Node(address base.Address) (base.Node, Channel, bool)

func (*Nodepool) Passthroughs

func (np *Nodepool) Passthroughs(ctx context.Context, sl PassthroughedSeal, callback func(seal.Seal, Channel)) error

func (*Nodepool) Remove

func (np *Nodepool) Remove(addrs ...base.Address) error

func (*Nodepool) RemovePassthrough

func (np *Nodepool) RemovePassthrough(s string) error

func (*Nodepool) SetChannel

func (np *Nodepool) SetChannel(addr base.Address, ch Channel) error

func (*Nodepool) SetPassthrough

func (np *Nodepool) SetPassthrough(ch Channel, filter func(PassthroughedSeal) bool, expire time.Duration) error

func (*Nodepool) Traverse

func (np *Nodepool) Traverse(callback func(base.Node, Channel) bool)

func (*Nodepool) TraverseAliveRemotes

func (np *Nodepool) TraverseAliveRemotes(callback func(base.Node, Channel) bool)

func (*Nodepool) TraverseRemotes

func (np *Nodepool) TraverseRemotes(callback func(base.Node, Channel) bool)

type PassthroughedSeal

type PassthroughedSeal struct {
	seal.Seal
	// contains filtered or unexported fields
}

func NewPassthroughedSeal

func NewPassthroughedSeal(sl seal.Seal, ci string) PassthroughedSeal

func NewPassthroughedSealFromConnInfo

func NewPassthroughedSealFromConnInfo(sl seal.Seal, ci ConnInfo) PassthroughedSeal

func (PassthroughedSeal) FromConnInfo

func (sl PassthroughedSeal) FromConnInfo() string

type PingHandoverHandler

type PingHandoverHandler func(PingHandoverSeal) (bool, error)

type PingHandoverSeal

type PingHandoverSeal interface {
	HandoverSeal
}

type Problem

type Problem struct {
	hint.BaseHinter
	// contains filtered or unexported fields
}

Problem implements "Problem Details for HTTP APIs"<https://tools.ietf.org/html/rfc7807>.

func LoadProblemFromResponse

func LoadProblemFromResponse(res *http.Response) (Problem, error)

func NewProblem

func NewProblem(t, title string) Problem

func NewProblemFromError

func NewProblemFromError(err error) Problem

func (Problem) AddExtra

func (pr Problem) AddExtra(k string, v interface{}) Problem

func (Problem) Detail

func (pr Problem) Detail() string

func (Problem) Error

func (pr Problem) Error() string

func (Problem) Extra

func (pr Problem) Extra() map[string]interface{}

func (Problem) MarshalJSON

func (pr Problem) MarshalJSON() ([]byte, error)

func (Problem) SetDetail

func (pr Problem) SetDetail(detail string) Problem

func (Problem) Title

func (pr Problem) Title() string

func (Problem) Type

func (pr Problem) Type() string

func (*Problem) UnmarshalJSON

func (pr *Problem) UnmarshalJSON(b []byte) error

type ProblemJSONPacker

type ProblemJSONPacker struct {
	jsonenc.HintedHead
	T  string                 `json:"type"`
	TI string                 `json:"title"`
	DE string                 `json:"detail,omitempty"`
	EX map[string]interface{} `json:"extra,omitempty"`
}

type RemoteNode

type RemoteNode struct {
	Address   base.Address
	Publickey key.Publickey
	// contains filtered or unexported fields
}

func NewRemoteNode

func NewRemoteNode(no base.Node, connInfo ConnInfo) RemoteNode

func NewRemoteNodeFromNodeInfo

func NewRemoteNodeFromNodeInfo(ni NodeInfo) RemoteNode

func (RemoteNode) ConnInfo

func (no RemoteNode) ConnInfo() ConnInfo

func (RemoteNode) MarshalBSON

func (no RemoteNode) MarshalBSON() ([]byte, error)

func (RemoteNode) MarshalJSON

func (no RemoteNode) MarshalJSON() ([]byte, error)

type RemoteNodeUnpackBSON

type RemoteNodeUnpackBSON struct {
	A  base.AddressDecoder  `bson:"address"`
	P  key.PublickeyDecoder `bson:"publickey"`
	CI bson.Raw             `bson:"conninfo"`
}

type RemoteNodeUnpackJSON

type RemoteNodeUnpackJSON struct {
	A  base.AddressDecoder  `json:"address"`
	P  key.PublickeyDecoder `json:"publickey"`
	CI json.RawMessage      `json:"conninfo"`
}

type Response

type Response interface {
	util.Byter
	OK() bool
}

type Server

type Server interface {
	util.Daemon
	util.Initializer
	SetNewSealHandler(NewSealHandler)
	SetGetStagedOperationsHandler(GetStagedOperationsHandler)
	SetGetProposalHandler(GetProposalHandler)
	NodeInfoHandler() NodeInfoHandler
	SetNodeInfoHandler(NodeInfoHandler)
	SetBlockdataMapsHandler(BlockdataMapsHandler)
	SetBlockdataHandler(BlockdataHandler)
	SetStartHandoverHandler(StartHandoverHandler)
	SetPingHandoverHandler(PingHandoverHandler)
	SetEndHandoverHandler(EndHandoverHandler)
}

type StartHandoverHandler

type StartHandoverHandler func(StartHandoverSeal) (bool, error)

type StartHandoverSeal

type StartHandoverSeal interface {
	HandoverSeal
}

Directories

Path Synopsis
Package discovery supports suffrage nodes network.
Package discovery supports suffrage nodes network.
memberlist
Package memberlist provides node discovery and failed nodes detection by hashicorp/memberlist.
Package memberlist provides node discovery and failed nodes detection by hashicorp/memberlist.
Package channetwork provides the golang channel based network.
Package channetwork provides the golang channel based network.
Package quicnetwork provides the quic based network.
Package quicnetwork provides the quic based network.

Jump to

Keyboard shortcuts

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