Documentation ¶
Index ¶
- Variables
- type Cache
- func (cache *Cache) Backend() Reader
- func (cache *Cache) Flush(output Writer, backend Reader) error
- func (cache *Cache) GetNodeByID(id crypto.Address) (*NodeIdentity, error)
- func (cache *Cache) GetNodeIDsByAddress(net string) ([]crypto.Address, error)
- func (cache *Cache) GetNumPeers() int
- func (cache *Cache) RemoveNode(id crypto.Address) error
- func (cache *Cache) Reset(backend Reader)
- func (cache *Cache) Sync(state Writer) error
- func (cache *Cache) UpdateNode(id crypto.Address, node *NodeIdentity) error
- type Iterable
- type IterableReader
- type IterableReaderWriter
- type NodeFilter
- type NodeIdentity
- func (*NodeIdentity) Descriptor() ([]byte, []int)
- func (m *NodeIdentity) GetMoniker() string
- func (m *NodeIdentity) GetNetworkAddress() string
- func (m *NodeIdentity) Marshal() (dAtA []byte, err error)
- func (m *NodeIdentity) MarshalTo(dAtA []byte) (int, error)
- func (m *NodeIdentity) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*NodeIdentity) ProtoMessage()
- func (m *NodeIdentity) Reset()
- func (m *NodeIdentity) Size() (n int)
- func (rn *NodeIdentity) String() string
- func (m *NodeIdentity) Unmarshal(dAtA []byte) error
- func (m *NodeIdentity) XXX_DiscardUnknown()
- func (m *NodeIdentity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *NodeIdentity) XXX_Merge(src proto.Message)
- func (*NodeIdentity) XXX_MessageName() string
- func (m *NodeIdentity) XXX_Size() int
- func (m *NodeIdentity) XXX_Unmarshal(b []byte) error
- type NodeStats
- type Reader
- type ReaderWriter
- type Writer
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Cache ¶
Cache helps prevent unnecessary IAVLTree updates and garbage generation.
func NewCache ¶
NewCache returns a Cache which can write to an output Writer via Sync. Not goroutine safe, use syncStateCache if you need concurrent access
func (*Cache) GetNodeByID ¶
func (cache *Cache) GetNodeByID(id crypto.Address) (*NodeIdentity, error)
func (*Cache) GetNodeIDsByAddress ¶
func (*Cache) GetNumPeers ¶
func (*Cache) Reset ¶
Reset the cache to empty initialising the backing map to the same size as the previous iteration
func (*Cache) Sync ¶
Sync writes whatever is in the cache to the output state. Does not flush the cache, to do that call Reset() after Sync or use Flush if your wish to use the output state as your next backend
func (*Cache) UpdateNode ¶
func (cache *Cache) UpdateNode(id crypto.Address, node *NodeIdentity) error
type Iterable ¶
type Iterable interface {
IterateNodes(consumer func(crypto.Address, *NodeIdentity) error) (err error)
}
type IterableReader ¶
type IterableReaderWriter ¶
type IterableReaderWriter interface { Iterable ReaderWriter }
type NodeFilter ¶
type NodeFilter struct {
// contains filtered or unexported fields
}
func NewNodeFilter ¶
func NewNodeFilter(state IterableReader) *NodeFilter
func (*NodeFilter) NumPeers ¶
func (nf *NodeFilter) NumPeers() int
func (*NodeFilter) QueryPeerByAddress ¶
func (nf *NodeFilter) QueryPeerByAddress(addr string) bool
func (*NodeFilter) QueryPeerByID ¶
func (nf *NodeFilter) QueryPeerByID(id string) bool
type NodeIdentity ¶
type NodeIdentity struct { // Peer moniker name Moniker string `protobuf:"bytes,1,opt,name=Moniker,proto3" json:"Moniker,omitempty"` // Peer network address NetworkAddress string `protobuf:"bytes,2,opt,name=NetworkAddress,proto3" json:"NetworkAddress,omitempty"` // The Tendermint p2p node ID TendermintNodeID github_com_hyperledger_burrow_crypto.Address `` /* 131-byte string literal not displayed */ // The public key that this node will validate with if it becomes a validator // (use this to create a binding between p2p node ID and validator) ValidatorPublicKey github_com_hyperledger_burrow_crypto.PublicKey `` /* 137-byte string literal not displayed */ XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
NodeIdentity stores and establishes a binding between 4 different types of identifiers, a human readable name, a advertised network address, a p2p station-to-station key, and a validator key. Updates must be signed by the node key and the validator key to prove the update is consensual.
func (*NodeIdentity) Descriptor ¶
func (*NodeIdentity) Descriptor() ([]byte, []int)
func (*NodeIdentity) GetMoniker ¶
func (m *NodeIdentity) GetMoniker() string
func (*NodeIdentity) GetNetworkAddress ¶
func (m *NodeIdentity) GetNetworkAddress() string
func (*NodeIdentity) Marshal ¶
func (m *NodeIdentity) Marshal() (dAtA []byte, err error)
func (*NodeIdentity) MarshalToSizedBuffer ¶ added in v0.30.0
func (m *NodeIdentity) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*NodeIdentity) ProtoMessage ¶
func (*NodeIdentity) ProtoMessage()
func (*NodeIdentity) Reset ¶
func (m *NodeIdentity) Reset()
func (*NodeIdentity) Size ¶
func (m *NodeIdentity) Size() (n int)
func (*NodeIdentity) String ¶
func (rn *NodeIdentity) String() string
func (*NodeIdentity) Unmarshal ¶
func (m *NodeIdentity) Unmarshal(dAtA []byte) error
func (*NodeIdentity) XXX_DiscardUnknown ¶
func (m *NodeIdentity) XXX_DiscardUnknown()
func (*NodeIdentity) XXX_Marshal ¶
func (m *NodeIdentity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*NodeIdentity) XXX_Merge ¶
func (m *NodeIdentity) XXX_Merge(src proto.Message)
func (*NodeIdentity) XXX_MessageName ¶
func (*NodeIdentity) XXX_MessageName() string
func (*NodeIdentity) XXX_Size ¶
func (m *NodeIdentity) XXX_Size() int
func (*NodeIdentity) XXX_Unmarshal ¶
func (m *NodeIdentity) XXX_Unmarshal(b []byte) error
type NodeStats ¶
func NewNodeStats ¶
func NewNodeStats() NodeStats
func (*NodeStats) Remove ¶
func (ns *NodeStats) Remove(node *NodeIdentity) bool