Documentation ¶
Index ¶
- Constants
- Variables
- func InitConfig(c *Config)
- type ChanID
- type Config
- type NinjaNode
- func (nt *NinjaNode) DebugPeerMsg(w *worker.TopicWorker)
- func (nt *NinjaNode) DebugTopicMsg(topic, msg string) string
- func (nt *NinjaNode) DebugTopicPeers(topic string) string
- func (nt *NinjaNode) PeersOfTopic(topic string) []peer.ID
- func (nt *NinjaNode) RandomPeer(protocID protocol.ID) (network.Stream, error)
- func (nt *NinjaNode) ShutDown()
- func (nt *NinjaNode) Start() error
Constants ¶
View Source
const ( DefaultMaxUserNo = 1 << 10 MsgNoPerUser = 1 << 6 MsgAverageSize = 1 << 8 DefaultMaxMessageSize = DefaultMaxUserNo * MsgNoPerUser * MsgAverageSize DefaultWorkerTryTimeOut = 10 * time.Second DefaultOutboundQueueSize = 1 << 6 DefaultIMThreadNo = MsgNoPerUser * DefaultMaxUserNo DefaultLowConn = 1 << 5 DefaultHighConn = 1 << 10 DefaultConnGrace = time.Minute DHTPrefix = "ninja" MainChain ChanID = 1 TestChain ChanID = 2 P2pChanDebug = "/Global/TEST" //TODO:: scheme P2pChanUserOnOffLine = "/Global/user/on_offline" P2pChanImmediateMsg = "/Global/message/immediate" P2pChanChainAcc = "/Global/chain/account" StreamSyncOnline = "/Rendezvous/user/onlineSet" StreamSyncChainData = "/Rendezvous/chain/chainSync" )
Variables ¶
View Source
var ( MainP2pBoots = []string{"/ip4/0.0.0.0/tcp/16669/p2p/12D3KooWH1vt62wMAzSBHaAhH273MV8hnNuwF7jrDWptGzGFzPNe", "/ip4/0.0.0.0/tcp/16669/p2p/12D3KooWH1vt62wMAzSBHaAhH273MV8hnNuwF7jrDWptGzGFzPNe"} TestP2pBoots = []string{ "/ip4/34.96.141.169/tcp/16669/p2p/12D3KooWBhhVn4trfjwPGgDCjfdfnGF8rY5TLcUi8XVcvA6FvLLW", "/ip4/47.113.87.58/tcp/16669/p2p/12D3KooW9rMrpU6by3DdvSTuUoRR9YKrBAJM1hv78v2AfZGZPJGa", } )
Functions ¶
func InitConfig ¶
func InitConfig(c *Config)
Types ¶
type Config ¶
type Config struct { HttpEnabled bool `json:"http.enabled"` SrvPort int16 `json:"port"` WorkerStartTimeOut time.Duration `json:"worker.start.try"` ChainID ChanID P2oLogOpen bool `json:"p2pLog"` PsConf *pubSubConfig `json:"pub_sub"` DHTConf *dhtConfig `json:"dht"` ConnMngConf *connManagerConfig `json:"connManager"` SrvPost bool `json:"srv_post,omitempty"` }
func DefaultConfig ¶
type NinjaNode ¶
type NinjaNode struct {
// contains filtered or unexported fields
}
func (*NinjaNode) DebugPeerMsg ¶
func (nt *NinjaNode) DebugPeerMsg(w *worker.TopicWorker)
func (*NinjaNode) DebugTopicMsg ¶
func (*NinjaNode) DebugTopicPeers ¶
func (*NinjaNode) RandomPeer ¶
Click to show internal directories.
Click to hide internal directories.