Documentation ¶
Overview ¶
Package nodectx provides context for node.
Index ¶
- Constants
- func GetDbMgr() *storage.DbMgr
- func InitCtx(ctx context.Context, name string, node *p2p.Node, db *storage.DbMgr, ...)
- type NodeCtx
- func (nodeCtx *NodeCtx) AddPeers(peers []peer.AddrInfo) int
- func (nodeCtx *NodeCtx) GetNodePubKey() (string, error)
- func (nodeCtx *NodeCtx) ListGroupPeers(groupid string) []peer.ID
- func (nodeCtx *NodeCtx) PeersProtocol() *map[string][]string
- func (nodeCtx *NodeCtx) ProtocolPrefix() string
- func (nodeCtx *NodeCtx) UpdateOnlineStatus(status NodeStatus)
- type NodeStatus
Constants ¶
View Source
const ( USER_CHANNEL_PREFIX = "user_channel_" PRODUCER_CHANNEL_PREFIX = "prod_channel_" NODE_ONLINE = 0 NODE_OFFLINE = 1 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type NodeCtx ¶
type NodeCtx struct { Node *p2p.Node PeerId peer.ID Keystore localcrypto.Keystore PublickKey p2pcrypto.PubKey Name string Ctx context.Context Version string Status NodeStatus Economic int }
func GetNodeCtx ¶
func GetNodeCtx() *NodeCtx
func (*NodeCtx) GetNodePubKey ¶
func (*NodeCtx) PeersProtocol ¶
func (*NodeCtx) ProtocolPrefix ¶
func (*NodeCtx) UpdateOnlineStatus ¶
func (nodeCtx *NodeCtx) UpdateOnlineStatus(status NodeStatus)
type NodeStatus ¶
type NodeStatus int8
Click to show internal directories.
Click to hide internal directories.