Documentation ¶
Overview ¶
Package isaacnetwork provides network.
Index ¶
- Variables
- func ClientWrite(w io.Writer, prefix string, enchint hint.Hint, header []byte, body io.Reader) error
- func HandlerReadHead(ctx context.Context, encs *encoder.Encoders, r io.Reader) (encoder.Encoder, []byte, error)
- func QuicstreamErrorHandler(enc encoder.Encoder) quicstream.ErrorHandler
- func QuicstreamHandlerBlockMap(encs *encoder.Encoders, idleTimeout time.Duration, ...) quicstream.Handler
- func QuicstreamHandlerBlockMapItem(encs *encoder.Encoders, idleTimeout, writeTimeout time.Duration, ...) quicstream.Handler
- func QuicstreamHandlerCallbackMessage(encs *encoder.Encoders, idleTimeout time.Duration, cb *CallbackBroadcaster) quicstream.Handler
- func QuicstreamHandlerExistsInStateOperation(encs *encoder.Encoders, idleTimeout time.Duration, ...) quicstream.Handler
- func QuicstreamHandlerLastBlockMap(encs *encoder.Encoders, idleTimeout time.Duration, ...) quicstream.Handler
- func QuicstreamHandlerLastSuffrageProof(encs *encoder.Encoders, idleTimeout time.Duration, ...) quicstream.Handler
- func QuicstreamHandlerNodeChallenge(encs *encoder.Encoders, idleTimeout time.Duration, local base.LocalNode, ...) quicstream.Handler
- func QuicstreamHandlerNodeInfo(encs *encoder.Encoders, idleTimeout time.Duration, ...) quicstream.Handler
- func QuicstreamHandlerOperation(encs *encoder.Encoders, idleTimeout time.Duration, ...) quicstream.Handler
- func QuicstreamHandlerProposal(encs *encoder.Encoders, idleTimeout time.Duration, pool isaac.ProposalPool) quicstream.Handler
- func QuicstreamHandlerRequestProposal(encs *encoder.Encoders, idleTimeout time.Duration, local base.LocalNode, ...) quicstream.Handler
- func QuicstreamHandlerSendBallots(encs *encoder.Encoders, idleTimeout time.Duration, params *isaac.LocalParams, ...) quicstream.Handler
- func QuicstreamHandlerSendOperation(encs *encoder.Encoders, idleTimeout time.Duration, params *isaac.LocalParams, ...) quicstream.Handler
- func QuicstreamHandlerState(encs *encoder.Encoders, idleTimeout time.Duration, ...) quicstream.Handler
- func QuicstreamHandlerSuffrageNodeConnInfo(encs *encoder.Encoders, idleTimeout time.Duration, ...) quicstream.Handler
- func QuicstreamHandlerSuffrageProof(encs *encoder.Encoders, idleTimeout time.Duration, ...) quicstream.Handler
- func QuicstreamHandlerSyncSourceConnInfo(encs *encoder.Encoders, idleTimeout time.Duration, ...) quicstream.Handler
- func ReadEncoder(ctx context.Context, encs *encoder.Encoders, r io.Reader) (encoder.Encoder, error)
- func WriteResponse(w io.Writer, header isaac.NetworkHeader, body interface{}, enc encoder.Encoder) error
- func WriteResponseBytes(w io.Writer, header isaac.NetworkHeader, body []byte, enc encoder.Encoder) error
- type BaseHeader
- type BaseNetworkClient
- func (c *BaseNetworkClient) BlockMap(ctx context.Context, ci quicstream.UDPConnInfo, height base.Height) (base.BlockMap, bool, error)
- func (c *BaseNetworkClient) BlockMapItem(ctx context.Context, ci quicstream.UDPConnInfo, height base.Height, ...) (_ io.ReadCloser, cancel func() error, found bool, _ error)
- func (c *BaseNetworkClient) ExistsInStateOperation(ctx context.Context, ci quicstream.UDPConnInfo, facthash util.Hash) (bool, error)
- func (c *BaseNetworkClient) LastBlockMap(ctx context.Context, ci quicstream.UDPConnInfo, manifest util.Hash) (base.BlockMap, bool, error)
- func (c *BaseNetworkClient) LastSuffrageProof(ctx context.Context, ci quicstream.UDPConnInfo, state util.Hash) (base.Height, base.SuffrageProof, bool, error)
- func (c *BaseNetworkClient) NewClient() *BaseNetworkClient
- func (c *BaseNetworkClient) NodeChallenge(ctx context.Context, ci quicstream.UDPConnInfo, networkID base.NetworkID, ...) (base.Signature, error)
- func (c *BaseNetworkClient) Operation(ctx context.Context, ci quicstream.UDPConnInfo, operationhash util.Hash) (base.Operation, bool, error)
- func (c *BaseNetworkClient) Proposal(ctx context.Context, ci quicstream.UDPConnInfo, pr util.Hash) (base.ProposalSignFact, bool, error)
- func (c *BaseNetworkClient) Request(ctx context.Context, ci quicstream.UDPConnInfo, header isaac.NetworkHeader, ...) (_ isaac.NetworkResponseHeader, _ interface{}, cancel func() error, _ error)
- func (c *BaseNetworkClient) RequestProposal(ctx context.Context, ci quicstream.UDPConnInfo, point base.Point, ...) (base.ProposalSignFact, bool, error)
- func (c *BaseNetworkClient) SendBallots(ctx context.Context, ci quicstream.UDPConnInfo, ballots []base.BallotSignFact) error
- func (c *BaseNetworkClient) SendOperation(ctx context.Context, ci quicstream.UDPConnInfo, op base.Operation) (bool, error)
- func (c *BaseNetworkClient) State(ctx context.Context, ci quicstream.UDPConnInfo, key string, h util.Hash) (base.State, bool, error)
- func (c *BaseNetworkClient) SuffrageNodeConnInfo(ctx context.Context, ci quicstream.UDPConnInfo) ([]isaac.NodeConnInfo, error)
- func (c *BaseNetworkClient) SuffrageProof(ctx context.Context, ci quicstream.UDPConnInfo, suffrageheight base.Height) (base.SuffrageProof, bool, error)
- func (c *BaseNetworkClient) SyncSourceConnInfo(ctx context.Context, ci quicstream.UDPConnInfo) ([]isaac.NodeConnInfo, error)
- type BaseNetworkClientWriteFunc
- type BlockMapItemRequestHeader
- func (h BlockMapItemRequestHeader) Height() base.Height
- func (h BlockMapItemRequestHeader) IsValid([]byte) error
- func (h BlockMapItemRequestHeader) Item() base.BlockMapItemType
- func (h BlockMapItemRequestHeader) MarshalJSON() ([]byte, error)
- func (h *BlockMapItemRequestHeader) UnmarshalJSON(b []byte) error
- type BlockMapItemRequestHeaderJSONMarshaler
- type BlockMapItemRequestHeaderJSONUnmarshaler
- type BlockMapRequestHeader
- type BlockMapRequestHeaderJSONMarshaler
- type BlockMapRequestHeaderJSONUnmarshaler
- type CallbackBroadcastMessage
- type CallbackBroadcaster
- type CallbackMessageHeader
- type ExistsInStateOperationRequestHeader
- type LastBlockMapRequestHeader
- type LastSuffrageProofRequestHeader
- type NodeChallengeRequestHeader
- type NodeChallengeRequestHeaderJSONMarshaler
- type NodeConnInfo
- type NodeInfo
- func (info NodeInfo) Address() base.Address
- func (info NodeInfo) ConnInfo() string
- func (info NodeInfo) ConsensusNodes() []base.Node
- func (info NodeInfo) ConsensusState() string
- func (info *NodeInfo) DecodeJSON(b []byte, enc *jsonenc.Encoder) error
- func (info NodeInfo) IsValid(networkID base.NetworkID) error
- func (info NodeInfo) JSONMarshaler() NodeInfoJSONMarshaler
- func (info NodeInfo) LastManifest() base.Manifest
- func (info NodeInfo) LocalParams() *isaac.LocalParams
- func (info NodeInfo) MarshalJSON() ([]byte, error)
- func (info NodeInfo) NetworkPolicy() base.NetworkPolicy
- func (info NodeInfo) Publickey() base.Publickey
- func (info NodeInfo) SuffrageHeight() base.Height
- func (info NodeInfo) Version() util.Version
- type NodeInfoConsensusJSONMarshaler
- type NodeInfoJSONMarshaler
- type NodeInfoLocalJSONMarshaler
- type NodeInfoRequestHeader
- type NodeInfoSuffrageJSONMarshaler
- type NodeInfoUpdater
- func (info *NodeInfoUpdater) ID() string
- func (info *NodeInfoUpdater) NodeInfo() NodeInfo
- func (info *NodeInfoUpdater) SetConnInfo(c string) bool
- func (info *NodeInfoUpdater) SetConsensusNodes(nodes []base.Node) bool
- func (info *NodeInfoUpdater) SetConsensusState(s isaacstates.StateType) bool
- func (info *NodeInfoUpdater) SetLastManifest(m base.Manifest) bool
- func (info *NodeInfoUpdater) SetLocalParams(p *isaac.LocalParams) bool
- func (info *NodeInfoUpdater) SetNetworkPolicy(p base.NetworkPolicy) bool
- func (info *NodeInfoUpdater) SetSuffrageHeight(h base.Height) bool
- func (info *NodeInfoUpdater) StartedAt() time.Time
- type NodeSignBroadcast
- type OperationRequestHeader
- type ProposalRequestHeader
- type QuicstreamClient
- type RequestProposalRequestHeader
- func (h *RequestProposalRequestHeader) DecodeJSON(b []byte, enc *jsonenc.Encoder) error
- func (h RequestProposalRequestHeader) IsValid([]byte) error
- func (h RequestProposalRequestHeader) MarshalJSON() ([]byte, error)
- func (h RequestProposalRequestHeader) Point() base.Point
- func (h RequestProposalRequestHeader) Proposer() base.Address
- type ResponseHeader
- type ResponseHeaderJSONMarshaler
- type SendBallotsHeader
- type SendOperationRequestHeader
- type StateRequestHeader
- type SuffrageNodeConnInfoRequestHeader
- type SuffrageProofRequestHeader
- type SyncSource
- type SyncSourceChecker
- type SyncSourceConnInfoRequestHeader
- type SyncSourceType
Constants ¶
This section is empty.
Variables ¶
View Source
var ( HandlerPrefixRequestProposal = "request_proposal" HandlerPrefixProposal = "proposal" HandlerPrefixLastSuffrageProof = "last_suffrage_proof" HandlerPrefixSuffrageProof = "suffrage_proof" HandlerPrefixLastBlockMap = "last_blockmap" HandlerPrefixBlockMap = "blockmap" HandlerPrefixBlockMapItem = "blockmap_item" HandlerPrefixMemberlist = "memberlist" HandlerPrefixNodeChallenge = "node_challenge" HandlerPrefixSuffrageNodeConnInfo = "suffrage_node_conninfo" HandlerPrefixSyncSourceConnInfo = "sync_source_conninfo" HandlerPrefixOperation = "operation" HandlerPrefixSendOperation = "send_operation" HandlerPrefixState = "state" HandlerPrefixExistsInStateOperation = "exists_instate_operation" HandlerPrefixNodeInfo = "node_info" HandlerPrefixCallbackMessage = "callback_message" HandlerPrefixSendBallots = "send_ballots" )
View Source
var ( OperationRequestHeaderHint = hint.MustNewHint("operation-header-v0.0.1") SendOperationRequestHeaderHint = hint.MustNewHint("send-operation-header-v0.0.1") RequestProposalRequestHeaderHint = hint.MustNewHint("request-proposal-header-v0.0.1") ProposalRequestHeaderHint = hint.MustNewHint("proposal-header-v0.0.1") LastSuffrageProofRequestHeaderHint = hint.MustNewHint("last-suffrage-proof-header-v0.0.1") SuffrageProofRequestHeaderHint = hint.MustNewHint("suffrage-proof-header-v0.0.1") LastBlockMapRequestHeaderHint = hint.MustNewHint("last-blockmap-header-v0.0.1") BlockMapRequestHeaderHint = hint.MustNewHint("blockmap-header-v0.0.1") BlockMapItemRequestHeaderHint = hint.MustNewHint("blockmap-item-header-v0.0.1") NodeChallengeRequestHeaderHint = hint.MustNewHint("node-challenge-header-v0.0.1") SuffrageNodeConnInfoRequestHeaderHint = hint.MustNewHint("suffrage-node-conninfo-header-v0.0.1") SyncSourceConnInfoRequestHeaderHint = hint.MustNewHint("sync-source-conninfo-header-v0.0.1") StateRequestHeaderHint = hint.MustNewHint("state-header-v0.0.1") ExistsInStateOperationRequestHeaderHint = hint.MustNewHint("exists-instate-operation-header-v0.0.1") NodeInfoRequestHeaderHint = hint.MustNewHint("node-info-header-v0.0.1") CallbackMessageHeaderHint = hint.MustNewHint("callback-message-header-v0.0.1") SendBallotsHeaderHint = hint.MustNewHint("send-ballots-header-v0.0.1") )
View Source
var CallbackBroadcastMessageHint = hint.MustNewHint("callback-broadcast-message-v0.0.1")
View Source
var NodeConnInfoHint = hint.MustNewHint("node-conninfo-v0.0.1")
View Source
var NodeInfoHint = hint.MustNewHint("node-info-v0.0.1")
View Source
var ResponseHeaderHint = hint.MustNewHint("response-header-v0.0.1")
Functions ¶
func ClientWrite ¶
func HandlerReadHead ¶
func QuicstreamErrorHandler ¶
func QuicstreamErrorHandler(enc encoder.Encoder) quicstream.ErrorHandler
func QuicstreamHandlerBlockMapItem ¶
func QuicstreamHandlerBlockMapItem( encs *encoder.Encoders, idleTimeout, writeTimeout time.Duration, blockMapItemf func(base.Height, base.BlockMapItemType) (io.ReadCloser, bool, error), ) quicstream.Handler
func QuicstreamHandlerCallbackMessage ¶
func QuicstreamHandlerCallbackMessage( encs *encoder.Encoders, idleTimeout time.Duration, cb *CallbackBroadcaster, ) quicstream.Handler
func QuicstreamHandlerLastBlockMap ¶
func QuicstreamHandlerLastBlockMap( encs *encoder.Encoders, idleTimeout time.Duration, lastBlockMapf func(util.Hash) (hint.Hint, []byte, []byte, bool, error), ) quicstream.Handler
LastBlockMap responds the last BlockMap to client; if there is no BlockMap, it returns nil BlockMap and not updated without error.
func QuicstreamHandlerNodeChallenge ¶
func QuicstreamHandlerNodeChallenge( encs *encoder.Encoders, idleTimeout time.Duration, local base.LocalNode, params base.LocalParams, ) quicstream.Handler
func QuicstreamHandlerOperation ¶
func QuicstreamHandlerOperation( encs *encoder.Encoders, idleTimeout time.Duration, oppool isaac.NewOperationPool, ) quicstream.Handler
func QuicstreamHandlerProposal ¶
func QuicstreamHandlerProposal( encs *encoder.Encoders, idleTimeout time.Duration, pool isaac.ProposalPool, ) quicstream.Handler
func QuicstreamHandlerSendBallots ¶
func QuicstreamHandlerSendBallots( encs *encoder.Encoders, idleTimeout time.Duration, params *isaac.LocalParams, votef func(base.BallotSignFact) error, ) quicstream.Handler
func QuicstreamHandlerSendOperation ¶
func QuicstreamHandlerSendOperation( encs *encoder.Encoders, idleTimeout time.Duration, params *isaac.LocalParams, oppool isaac.NewOperationPool, existsInStateOperationf func(util.Hash) (bool, error), filterSendOperationf func(base.Operation) (bool, error), svvote isaac.SuffrageVoteFunc, broadcast func(string, []byte) error, ) quicstream.Handler
func QuicstreamHandlerState ¶
func QuicstreamHandlerSuffrageNodeConnInfo ¶
func QuicstreamHandlerSuffrageNodeConnInfo( encs *encoder.Encoders, idleTimeout time.Duration, suffrageNodeConnInfof func() ([]isaac.NodeConnInfo, error), ) quicstream.Handler
func QuicstreamHandlerSyncSourceConnInfo ¶
func QuicstreamHandlerSyncSourceConnInfo( encs *encoder.Encoders, idleTimeout time.Duration, syncSourceConnInfof func() ([]isaac.NodeConnInfo, error), ) quicstream.Handler
func ReadEncoder ¶
func WriteResponse ¶
func WriteResponseBytes ¶
Types ¶
type BaseHeader ¶
type BaseHeader struct { hint.BaseHinter // contains filtered or unexported fields }
func NewBaseHeader ¶
func NewBaseHeader(ht hint.Hint) BaseHeader
func (BaseHeader) HandlerPrefix ¶
func (h BaseHeader) HandlerPrefix() string
type BaseNetworkClient ¶
type BaseNetworkClient struct {
// contains filtered or unexported fields
}
func NewBaseNetworkClient ¶
func NewBaseNetworkClient( encs *encoder.Encoders, enc encoder.Encoder, idleTimeout time.Duration, writef BaseNetworkClientWriteFunc, ) *BaseNetworkClient
func (*BaseNetworkClient) BlockMap ¶
func (c *BaseNetworkClient) BlockMap( ctx context.Context, ci quicstream.UDPConnInfo, height base.Height, ) (base.BlockMap, bool, error)
func (*BaseNetworkClient) BlockMapItem ¶
func (c *BaseNetworkClient) BlockMapItem( ctx context.Context, ci quicstream.UDPConnInfo, height base.Height, item base.BlockMapItemType, ) (_ io.ReadCloser, cancel func() error, found bool, _ error)
func (*BaseNetworkClient) ExistsInStateOperation ¶
func (c *BaseNetworkClient) ExistsInStateOperation( ctx context.Context, ci quicstream.UDPConnInfo, facthash util.Hash, ) (bool, error)
func (*BaseNetworkClient) LastBlockMap ¶
func (c *BaseNetworkClient) LastBlockMap( ctx context.Context, ci quicstream.UDPConnInfo, manifest util.Hash, ) (base.BlockMap, bool, error)
func (*BaseNetworkClient) LastSuffrageProof ¶
func (c *BaseNetworkClient) LastSuffrageProof( ctx context.Context, ci quicstream.UDPConnInfo, state util.Hash, ) (base.Height, base.SuffrageProof, bool, error)
func (*BaseNetworkClient) NewClient ¶
func (c *BaseNetworkClient) NewClient() *BaseNetworkClient
func (*BaseNetworkClient) NodeChallenge ¶
func (c *BaseNetworkClient) NodeChallenge( ctx context.Context, ci quicstream.UDPConnInfo, networkID base.NetworkID, node base.Address, pub base.Publickey, input []byte, ) (base.Signature, error)
func (*BaseNetworkClient) Operation ¶
func (c *BaseNetworkClient) Operation( ctx context.Context, ci quicstream.UDPConnInfo, operationhash util.Hash, ) (base.Operation, bool, error)
func (*BaseNetworkClient) Proposal ¶
func (c *BaseNetworkClient) Proposal( ctx context.Context, ci quicstream.UDPConnInfo, pr util.Hash, ) (base.ProposalSignFact, bool, error)
func (*BaseNetworkClient) Request ¶
func (c *BaseNetworkClient) Request( ctx context.Context, ci quicstream.UDPConnInfo, header isaac.NetworkHeader, body io.Reader, ) ( _ isaac.NetworkResponseHeader, _ interface{}, cancel func() error, _ error, )
func (*BaseNetworkClient) RequestProposal ¶
func (c *BaseNetworkClient) RequestProposal( ctx context.Context, ci quicstream.UDPConnInfo, point base.Point, proposer base.Address, ) (base.ProposalSignFact, bool, error)
func (*BaseNetworkClient) SendBallots ¶
func (c *BaseNetworkClient) SendBallots( ctx context.Context, ci quicstream.UDPConnInfo, ballots []base.BallotSignFact, ) error
func (*BaseNetworkClient) SendOperation ¶
func (c *BaseNetworkClient) SendOperation( ctx context.Context, ci quicstream.UDPConnInfo, op base.Operation, ) (bool, error)
func (*BaseNetworkClient) State ¶
func (c *BaseNetworkClient) State( ctx context.Context, ci quicstream.UDPConnInfo, key string, h util.Hash, ) (base.State, bool, error)
func (*BaseNetworkClient) SuffrageNodeConnInfo ¶
func (c *BaseNetworkClient) SuffrageNodeConnInfo( ctx context.Context, ci quicstream.UDPConnInfo, ) ([]isaac.NodeConnInfo, error)
func (*BaseNetworkClient) SuffrageProof ¶
func (c *BaseNetworkClient) SuffrageProof( ctx context.Context, ci quicstream.UDPConnInfo, suffrageheight base.Height, ) (base.SuffrageProof, bool, error)
func (*BaseNetworkClient) SyncSourceConnInfo ¶
func (c *BaseNetworkClient) SyncSourceConnInfo( ctx context.Context, ci quicstream.UDPConnInfo, ) ([]isaac.NodeConnInfo, error)
type BaseNetworkClientWriteFunc ¶
type BaseNetworkClientWriteFunc func( ctx context.Context, conninfo quicstream.UDPConnInfo, writef quicstream.ClientWriteFunc, ) (_ io.ReadCloser, cancel func() error, _ error)
type BlockMapItemRequestHeader ¶
type BlockMapItemRequestHeader struct { BaseHeader // contains filtered or unexported fields }
func NewBlockMapItemRequestHeader ¶
func NewBlockMapItemRequestHeader(height base.Height, item base.BlockMapItemType) BlockMapItemRequestHeader
func (BlockMapItemRequestHeader) Height ¶
func (h BlockMapItemRequestHeader) Height() base.Height
func (BlockMapItemRequestHeader) IsValid ¶
func (h BlockMapItemRequestHeader) IsValid([]byte) error
func (BlockMapItemRequestHeader) Item ¶
func (h BlockMapItemRequestHeader) Item() base.BlockMapItemType
func (BlockMapItemRequestHeader) MarshalJSON ¶
func (h BlockMapItemRequestHeader) MarshalJSON() ([]byte, error)
func (*BlockMapItemRequestHeader) UnmarshalJSON ¶
func (h *BlockMapItemRequestHeader) UnmarshalJSON(b []byte) error
type BlockMapItemRequestHeaderJSONMarshaler ¶
type BlockMapItemRequestHeaderJSONMarshaler struct { Item base.BlockMapItemType `json:"item"` Height base.Height `json:"height"` }
type BlockMapItemRequestHeaderJSONUnmarshaler ¶
type BlockMapItemRequestHeaderJSONUnmarshaler struct { Item base.BlockMapItemType `json:"item"` Height base.Height `json:"height"` }
type BlockMapRequestHeader ¶
type BlockMapRequestHeader struct { BaseHeader // contains filtered or unexported fields }
func NewBlockMapRequestHeader ¶
func NewBlockMapRequestHeader(height base.Height) BlockMapRequestHeader
func (BlockMapRequestHeader) Height ¶
func (h BlockMapRequestHeader) Height() base.Height
func (BlockMapRequestHeader) IsValid ¶
func (h BlockMapRequestHeader) IsValid([]byte) error
func (BlockMapRequestHeader) MarshalJSON ¶
func (h BlockMapRequestHeader) MarshalJSON() ([]byte, error)
func (*BlockMapRequestHeader) UnmarshalJSON ¶
func (h *BlockMapRequestHeader) UnmarshalJSON(b []byte) error
type CallbackBroadcastMessage ¶
type CallbackBroadcastMessage struct { hint.BaseHinter // contains filtered or unexported fields }
func NewCallbackBroadcastMessage ¶
func NewCallbackBroadcastMessage(id string, ci quicstream.UDPConnInfo) CallbackBroadcastMessage
func (CallbackBroadcastMessage) ConnInfo ¶
func (m CallbackBroadcastMessage) ConnInfo() quicstream.UDPConnInfo
func (CallbackBroadcastMessage) ID ¶
func (m CallbackBroadcastMessage) ID() string
func (CallbackBroadcastMessage) IsValid ¶
func (m CallbackBroadcastMessage) IsValid([]byte) error
func (CallbackBroadcastMessage) MarshalJSON ¶
func (m CallbackBroadcastMessage) MarshalJSON() ([]byte, error)
func (*CallbackBroadcastMessage) UnmarshalJSON ¶
func (m *CallbackBroadcastMessage) UnmarshalJSON(b []byte) error
type CallbackBroadcaster ¶
type CallbackBroadcaster struct {
// contains filtered or unexported fields
}
func NewCallbackBroadcaster ¶
func NewCallbackBroadcaster( localci quicstream.UDPConnInfo, enc encoder.Encoder, m *quicmemberlist.Memberlist, ) *CallbackBroadcaster
func (*CallbackBroadcaster) Broadcast ¶
func (c *CallbackBroadcaster) Broadcast(id string, b []byte, notifych chan struct{}) error
func (*CallbackBroadcaster) RawMessage ¶
func (c *CallbackBroadcaster) RawMessage(id string) ([]byte, bool)
type CallbackMessageHeader ¶
type CallbackMessageHeader struct { BaseHeader // contains filtered or unexported fields }
func NewCallbackMessageHeader ¶
func NewCallbackMessageHeader(id string) CallbackMessageHeader
func (*CallbackMessageHeader) DecodeJSON ¶
func (h *CallbackMessageHeader) DecodeJSON(b []byte, _ *jsonenc.Encoder) error
func (CallbackMessageHeader) ID ¶
func (h CallbackMessageHeader) ID() string
func (CallbackMessageHeader) IsValid ¶
func (h CallbackMessageHeader) IsValid([]byte) error
func (CallbackMessageHeader) MarshalJSON ¶
func (h CallbackMessageHeader) MarshalJSON() ([]byte, error)
type ExistsInStateOperationRequestHeader ¶
type ExistsInStateOperationRequestHeader struct { BaseHeader // contains filtered or unexported fields }
func NewExistsInStateOperationRequestHeader ¶
func NewExistsInStateOperationRequestHeader(facthash util.Hash) ExistsInStateOperationRequestHeader
func (ExistsInStateOperationRequestHeader) FactHash ¶
func (h ExistsInStateOperationRequestHeader) FactHash() util.Hash
func (ExistsInStateOperationRequestHeader) IsValid ¶
func (h ExistsInStateOperationRequestHeader) IsValid([]byte) error
func (ExistsInStateOperationRequestHeader) MarshalJSON ¶
func (h ExistsInStateOperationRequestHeader) MarshalJSON() ([]byte, error)
func (*ExistsInStateOperationRequestHeader) UnmarshalJSON ¶
func (h *ExistsInStateOperationRequestHeader) UnmarshalJSON(b []byte) error
type LastBlockMapRequestHeader ¶
type LastBlockMapRequestHeader struct { BaseHeader // contains filtered or unexported fields }
func NewLastBlockMapRequestHeader ¶
func NewLastBlockMapRequestHeader(manifest util.Hash) LastBlockMapRequestHeader
func (LastBlockMapRequestHeader) IsValid ¶
func (h LastBlockMapRequestHeader) IsValid([]byte) error
func (LastBlockMapRequestHeader) Manifest ¶
func (h LastBlockMapRequestHeader) Manifest() util.Hash
func (LastBlockMapRequestHeader) MarshalJSON ¶
func (h LastBlockMapRequestHeader) MarshalJSON() ([]byte, error)
func (*LastBlockMapRequestHeader) UnmarshalJSON ¶
func (h *LastBlockMapRequestHeader) UnmarshalJSON(b []byte) error
type LastSuffrageProofRequestHeader ¶
type LastSuffrageProofRequestHeader struct { BaseHeader // contains filtered or unexported fields }
func NewLastSuffrageProofRequestHeader ¶
func NewLastSuffrageProofRequestHeader(state util.Hash) LastSuffrageProofRequestHeader
func (LastSuffrageProofRequestHeader) IsValid ¶
func (h LastSuffrageProofRequestHeader) IsValid([]byte) error
func (LastSuffrageProofRequestHeader) MarshalJSON ¶
func (h LastSuffrageProofRequestHeader) MarshalJSON() ([]byte, error)
func (LastSuffrageProofRequestHeader) State ¶
func (h LastSuffrageProofRequestHeader) State() util.Hash
func (*LastSuffrageProofRequestHeader) UnmarshalJSON ¶
func (h *LastSuffrageProofRequestHeader) UnmarshalJSON(b []byte) error
type NodeChallengeRequestHeader ¶
type NodeChallengeRequestHeader struct { BaseHeader // contains filtered or unexported fields }
func NewNodeChallengeRequestHeader ¶
func NewNodeChallengeRequestHeader(input []byte) NodeChallengeRequestHeader
func (NodeChallengeRequestHeader) Input ¶
func (h NodeChallengeRequestHeader) Input() []byte
func (NodeChallengeRequestHeader) IsValid ¶
func (h NodeChallengeRequestHeader) IsValid([]byte) error
func (NodeChallengeRequestHeader) MarshalJSON ¶
func (h NodeChallengeRequestHeader) MarshalJSON() ([]byte, error)
func (*NodeChallengeRequestHeader) UnmarshalJSON ¶
func (h *NodeChallengeRequestHeader) UnmarshalJSON(b []byte) error
type NodeChallengeRequestHeaderJSONMarshaler ¶
type NodeChallengeRequestHeaderJSONMarshaler struct {
Input []byte `json:"input"`
}
type NodeConnInfo ¶
type NodeConnInfo struct { quicmemberlist.NamedConnInfo base.BaseNode }
func NewNodeConnInfo ¶
func NewNodeConnInfo(node base.BaseNode, addr string, tlsinsecure bool) NodeConnInfo
func NewNodeConnInfoFromMemberlistNode ¶
func NewNodeConnInfoFromMemberlistNode(node quicmemberlist.Node) NodeConnInfo
func (*NodeConnInfo) DecodeJSON ¶
func (n *NodeConnInfo) DecodeJSON(b []byte, enc *jsonenc.Encoder) error
func (NodeConnInfo) IsValid ¶
func (n NodeConnInfo) IsValid([]byte) error
func (NodeConnInfo) MarshalJSON ¶
func (n NodeConnInfo) MarshalJSON() ([]byte, error)
type NodeInfo ¶
type NodeInfo struct { hint.BaseHinter // contains filtered or unexported fields }
func (NodeInfo) ConsensusNodes ¶
func (NodeInfo) ConsensusState ¶
func (*NodeInfo) DecodeJSON ¶
func (NodeInfo) JSONMarshaler ¶
func (info NodeInfo) JSONMarshaler() NodeInfoJSONMarshaler
func (NodeInfo) LastManifest ¶
func (NodeInfo) LocalParams ¶
func (info NodeInfo) LocalParams() *isaac.LocalParams
func (NodeInfo) MarshalJSON ¶
func (NodeInfo) NetworkPolicy ¶
func (info NodeInfo) NetworkPolicy() base.NetworkPolicy
func (NodeInfo) SuffrageHeight ¶
type NodeInfoConsensusJSONMarshaler ¶
type NodeInfoConsensusJSONMarshaler struct { State isaacstates.StateType `json:"state"` Suffrage NodeInfoSuffrageJSONMarshaler `json:"suffrage"` }
type NodeInfoJSONMarshaler ¶
type NodeInfoJSONMarshaler struct { NetworkID base.NetworkID `json:"network_id"` LastManifest base.Manifest `json:"last_manifest"` NetworkPolicy base.NetworkPolicy `json:"network_policy"` Local NodeInfoLocalJSONMarshaler `json:"local"` Consensus NodeInfoConsensusJSONMarshaler `json:"consensus"` hint.BaseHinter }
type NodeInfoLocalJSONMarshaler ¶
type NodeInfoLocalJSONMarshaler struct { Address base.Address `json:"address"` Publickey base.Publickey `json:"publickey"` LocalParams *isaac.LocalParams `json:"parameters"` //nolint:tagliatelle //... ConnInfo string `json:"conn_info"` Uptime string `json:"uptime"` Version util.Version `json:"version"` }
type NodeInfoRequestHeader ¶
type NodeInfoRequestHeader struct {
BaseHeader
}
func NewNodeInfoRequestHeader ¶
func NewNodeInfoRequestHeader() NodeInfoRequestHeader
func (NodeInfoRequestHeader) IsValid ¶
func (h NodeInfoRequestHeader) IsValid([]byte) error
func (*NodeInfoRequestHeader) UnmarshalJSON ¶
func (h *NodeInfoRequestHeader) UnmarshalJSON(b []byte) error
type NodeInfoUpdater ¶
func NewNodeInfoUpdater ¶
func (*NodeInfoUpdater) ID ¶
func (info *NodeInfoUpdater) ID() string
func (*NodeInfoUpdater) NodeInfo ¶
func (info *NodeInfoUpdater) NodeInfo() NodeInfo
func (*NodeInfoUpdater) SetConnInfo ¶
func (info *NodeInfoUpdater) SetConnInfo(c string) bool
func (*NodeInfoUpdater) SetConsensusNodes ¶
func (info *NodeInfoUpdater) SetConsensusNodes(nodes []base.Node) bool
func (*NodeInfoUpdater) SetConsensusState ¶
func (info *NodeInfoUpdater) SetConsensusState(s isaacstates.StateType) bool
func (*NodeInfoUpdater) SetLastManifest ¶
func (info *NodeInfoUpdater) SetLastManifest(m base.Manifest) bool
func (*NodeInfoUpdater) SetLocalParams ¶
func (info *NodeInfoUpdater) SetLocalParams(p *isaac.LocalParams) bool
func (*NodeInfoUpdater) SetNetworkPolicy ¶
func (info *NodeInfoUpdater) SetNetworkPolicy(p base.NetworkPolicy) bool
func (*NodeInfoUpdater) SetSuffrageHeight ¶
func (info *NodeInfoUpdater) SetSuffrageHeight(h base.Height) bool
func (*NodeInfoUpdater) StartedAt ¶
func (info *NodeInfoUpdater) StartedAt() time.Time
type NodeSignBroadcast ¶
type NodeSignBroadcast struct { base.BaseNodeSign // contains filtered or unexported fields }
func NewNodeSignBroadcast ¶
func NewNodeSignBroadcast(b []byte) NodeSignBroadcast
func (NodeSignBroadcast) Body ¶
func (m NodeSignBroadcast) Body() []byte
func (*NodeSignBroadcast) NodeSign ¶
func (m *NodeSignBroadcast) NodeSign(priv base.Privatekey, networkID base.NetworkID, node base.Address) error
type OperationRequestHeader ¶
type OperationRequestHeader struct { BaseHeader // contains filtered or unexported fields }
func NewOperationRequestHeader ¶
func NewOperationRequestHeader(operationhash util.Hash) OperationRequestHeader
func (*OperationRequestHeader) DecodeJSON ¶
func (h *OperationRequestHeader) DecodeJSON(b []byte, _ *jsonenc.Encoder) error
func (OperationRequestHeader) IsValid ¶
func (h OperationRequestHeader) IsValid([]byte) error
func (OperationRequestHeader) MarshalJSON ¶
func (h OperationRequestHeader) MarshalJSON() ([]byte, error)
func (OperationRequestHeader) Operation ¶
func (h OperationRequestHeader) Operation() util.Hash
type ProposalRequestHeader ¶
type ProposalRequestHeader struct { BaseHeader // contains filtered or unexported fields }
func NewProposalRequestHeader ¶
func NewProposalRequestHeader(proposal util.Hash) ProposalRequestHeader
func (ProposalRequestHeader) IsValid ¶
func (h ProposalRequestHeader) IsValid([]byte) error
func (ProposalRequestHeader) MarshalJSON ¶
func (h ProposalRequestHeader) MarshalJSON() ([]byte, error)
func (ProposalRequestHeader) Proposal ¶
func (h ProposalRequestHeader) Proposal() util.Hash
func (*ProposalRequestHeader) UnmarshalJSON ¶
func (h *ProposalRequestHeader) UnmarshalJSON(b []byte) error
type QuicstreamClient ¶
type QuicstreamClient struct { *BaseNetworkClient // contains filtered or unexported fields }
func NewQuicstreamClient ¶
func (*QuicstreamClient) Clone ¶
func (c *QuicstreamClient) Clone() *QuicstreamClient
func (*QuicstreamClient) Close ¶
func (c *QuicstreamClient) Close() error
func (*QuicstreamClient) NewQuicstreamClient ¶
func (c *QuicstreamClient) NewQuicstreamClient( ci quicstream.UDPConnInfo, ) func(*net.UDPAddr) *quicstream.Client
type RequestProposalRequestHeader ¶
type RequestProposalRequestHeader struct { BaseHeader // contains filtered or unexported fields }
func NewRequestProposalRequestHeader ¶
func NewRequestProposalRequestHeader(point base.Point, proposer base.Address) RequestProposalRequestHeader
func (*RequestProposalRequestHeader) DecodeJSON ¶
func (h *RequestProposalRequestHeader) DecodeJSON(b []byte, enc *jsonenc.Encoder) error
func (RequestProposalRequestHeader) IsValid ¶
func (h RequestProposalRequestHeader) IsValid([]byte) error
func (RequestProposalRequestHeader) MarshalJSON ¶
func (h RequestProposalRequestHeader) MarshalJSON() ([]byte, error)
func (RequestProposalRequestHeader) Point ¶
func (h RequestProposalRequestHeader) Point() base.Point
func (RequestProposalRequestHeader) Proposer ¶
func (h RequestProposalRequestHeader) Proposer() base.Address
type ResponseHeader ¶
type ResponseHeader struct { BaseHeader // contains filtered or unexported fields }
func NewResponseHeader ¶
func NewResponseHeader(ok bool, err error) ResponseHeader
func NewResponseHeaderWithType ¶
func NewResponseHeaderWithType(ok bool, err error, ctype isaac.NetworkResponseContentType) ResponseHeader
func (ResponseHeader) Err ¶
func (r ResponseHeader) Err() error
func (ResponseHeader) MarshalJSON ¶
func (r ResponseHeader) MarshalJSON() ([]byte, error)
func (ResponseHeader) OK ¶
func (r ResponseHeader) OK() bool
func (ResponseHeader) Type ¶
func (r ResponseHeader) Type() isaac.NetworkResponseContentType
func (*ResponseHeader) UnmarshalJSON ¶
func (r *ResponseHeader) UnmarshalJSON(b []byte) error
type ResponseHeaderJSONMarshaler ¶
type ResponseHeaderJSONMarshaler struct { Type isaac.NetworkResponseContentType `json:"type,omitempty"` Error string `json:"error,omitempty"` OK bool `json:"ok,omitempty"` }
type SendBallotsHeader ¶
type SendBallotsHeader struct {
BaseHeader
}
func NewSendBallotsHeader ¶
func NewSendBallotsHeader() SendBallotsHeader
func (SendBallotsHeader) IsValid ¶
func (h SendBallotsHeader) IsValid([]byte) error
type SendOperationRequestHeader ¶
type SendOperationRequestHeader struct {
BaseHeader
}
func NewSendOperationRequestHeader ¶
func NewSendOperationRequestHeader() SendOperationRequestHeader
func (SendOperationRequestHeader) IsValid ¶
func (h SendOperationRequestHeader) IsValid([]byte) error
func (*SendOperationRequestHeader) UnmarshalJSON ¶
func (h *SendOperationRequestHeader) UnmarshalJSON(b []byte) error
type StateRequestHeader ¶
type StateRequestHeader struct { BaseHeader // contains filtered or unexported fields }
func NewStateRequestHeader ¶
func NewStateRequestHeader(key string, h util.Hash) StateRequestHeader
func (StateRequestHeader) Hash ¶
func (h StateRequestHeader) Hash() util.Hash
func (StateRequestHeader) IsValid ¶
func (h StateRequestHeader) IsValid([]byte) error
func (StateRequestHeader) Key ¶
func (h StateRequestHeader) Key() string
func (StateRequestHeader) MarshalJSON ¶
func (h StateRequestHeader) MarshalJSON() ([]byte, error)
func (*StateRequestHeader) UnmarshalJSON ¶
func (h *StateRequestHeader) UnmarshalJSON(b []byte) error
type SuffrageNodeConnInfoRequestHeader ¶
type SuffrageNodeConnInfoRequestHeader struct {
BaseHeader
}
func NewSuffrageNodeConnInfoRequestHeader ¶
func NewSuffrageNodeConnInfoRequestHeader() SuffrageNodeConnInfoRequestHeader
func (SuffrageNodeConnInfoRequestHeader) IsValid ¶
func (h SuffrageNodeConnInfoRequestHeader) IsValid([]byte) error
func (*SuffrageNodeConnInfoRequestHeader) UnmarshalJSON ¶
func (h *SuffrageNodeConnInfoRequestHeader) UnmarshalJSON(b []byte) error
type SuffrageProofRequestHeader ¶
type SuffrageProofRequestHeader struct { BaseHeader // contains filtered or unexported fields }
func NewSuffrageProofRequestHeader ¶
func NewSuffrageProofRequestHeader(suffrageheight base.Height) SuffrageProofRequestHeader
func (SuffrageProofRequestHeader) Height ¶
func (h SuffrageProofRequestHeader) Height() base.Height
func (SuffrageProofRequestHeader) IsValid ¶
func (h SuffrageProofRequestHeader) IsValid([]byte) error
func (SuffrageProofRequestHeader) MarshalJSON ¶
func (h SuffrageProofRequestHeader) MarshalJSON() ([]byte, error)
func (*SuffrageProofRequestHeader) UnmarshalJSON ¶
func (h *SuffrageProofRequestHeader) UnmarshalJSON(b []byte) error
type SyncSource ¶
type SyncSource struct { Source interface{} Type SyncSourceType }
func (*SyncSource) DecodeYAML ¶
func (d *SyncSource) DecodeYAML(b []byte, enc *jsonenc.Encoder) error
func (SyncSource) IsValid ¶
func (s SyncSource) IsValid([]byte) error
type SyncSourceChecker ¶
type SyncSourceChecker struct { *logging.Logging *util.ContextDaemon // contains filtered or unexported fields }
func NewSyncSourceChecker ¶
func NewSyncSourceChecker( local base.Node, networkID base.NetworkID, client isaac.NetworkClient, interval time.Duration, enc encoder.Encoder, sources []SyncSource, callback func(called int64, _ []isaac.NodeConnInfo, _ error), ) *SyncSourceChecker
func (*SyncSourceChecker) Sources ¶
func (c *SyncSourceChecker) Sources() []SyncSource
func (*SyncSourceChecker) UpdateSources ¶
func (c *SyncSourceChecker) UpdateSources(cis []SyncSource)
type SyncSourceConnInfoRequestHeader ¶
type SyncSourceConnInfoRequestHeader struct {
BaseHeader
}
func NewSyncSourceConnInfoRequestHeader ¶
func NewSyncSourceConnInfoRequestHeader() SyncSourceConnInfoRequestHeader
func (SyncSourceConnInfoRequestHeader) IsValid ¶
func (h SyncSourceConnInfoRequestHeader) IsValid([]byte) error
func (*SyncSourceConnInfoRequestHeader) UnmarshalJSON ¶
func (h *SyncSourceConnInfoRequestHeader) UnmarshalJSON(b []byte) error
type SyncSourceType ¶
type SyncSourceType string
var ( SyncSourceTypeNode SyncSourceType = "sync-source-node" SyncSourceTypeSuffrageNodes SyncSourceType = "sync-source-suffrage-nodes" SyncSourceTypeSyncSources SyncSourceType = "sync-source-sync-sources" SyncSourceTypeURL SyncSourceType = "sync-source-url" )
Click to show internal directories.
Click to hide internal directories.