Documentation ¶
Index ¶
- Constants
- Variables
- func Broadcast(msg string)
- func BroadcastToGroup(gid discover.NodeID, msg string, p2pType int, myself bool) (string, error)
- func CC_startTest()
- func CheckAddPeer(enodes []string) error
- func CreateSDKGroup(mode string, enodes []string) (string, int, string)
- func DcrmProtocol_broadcastInGroupAll(msg string)
- func DcrmProtocol_broadcastInGroupOthers(msg string)
- func DcrmProtocol_getEnodes() (int, string)
- func DcrmProtocol_getGroup() (int, string)
- func DcrmProtocol_registerMsgRecvCallback(dcrmcallback func(interface{}) <-chan string)
- func DcrmProtocol_registerMsgRetCallback(dcrmcallback func(interface{}))
- func DcrmProtocol_registerPriKeyCallback(recvPrivkeyFunc func(interface{}))
- func DcrmProtocol_registerRecvCallback(recvDcrmFunc func(interface{}) <-chan string)
- func DcrmProtocol_sendMsgToNode(toid discover.NodeID, toaddr *net.UDPAddr, msg string) error
- func DcrmProtocol_sendMsgToPeer(enode string, msg string) error
- func DcrmProtocol_sendToGroupOneNode(msg string) (string, error)
- func Dcrm_callEvent(msg string)
- func GetEnode() string
- func GetEnodeStatus(enode string) (string, string)
- func GetEnodes() (int, string)
- func GetGroup() (int, string)
- func GetSelfID() string
- func HandlePeer(peer *p2p.Peer, rw p2p.MsgReadWriter) error
- func InitServer(nodeserv interface{})
- func ParseNodeID(enode string) string
- func RegisterCallback(recvFunc func(interface{}, string))
- func RegisterDcrmCallback(dcrmcallback func(interface{}) <-chan string)
- func RegisterDcrmRetCallback(dcrmcallback func(interface{}))
- func RegisterRecvCallback(recvPrivkeyFunc func(interface{}))
- func RegisterSendCallback(callbackfunc func(interface{}))
- func RegisterUpdateOrderCacheCallback(recvDcrmFunc func(interface{}))
- func SdkProtocol_SendToGroupAllNodes(gID, msg string) (string, error)
- func SdkProtocol_broadcastInGroupAll(gID, msg string) (string, error)
- func SdkProtocol_broadcastInGroupOthers(gID, msg string) (string, error)
- func SdkProtocol_getGroup(gID string) (int, string)
- func SdkProtocol_registerBroadcastInGroupCallback(recvSdkFunc func(interface{}, string))
- func SdkProtocol_registerSendToGroupCallback(sdkcallback func(interface{}, string) <-chan string)
- func SdkProtocol_registerSendToGroupReturnCallback(sdkcallback func(interface{}, string))
- func SdkProtocol_sendToGroupOneNode(gID, msg string) (string, error)
- func Sdk_callEvent(msg string, fromID string)
- func SendMsg(msg string)
- func SendMsgToPeer(enode string, msg string) error
- func SendToDcrmGroupAllNodes(msg string) (string, error)
- func SendToMyself(enode, msg string, p2pType int) error
- func SendToPeer(enode string, msg string)
- func Xp_callEvent(msg string)
- func Xprotocol_broadcastInGroupAll(msg string)
- func Xprotocol_broadcastInGroupOthers(msg string)
- func Xprotocol_getEnodes() (int, string)
- func Xprotocol_getGroup() (int, string)
- func Xprotocol_registerMsgRecvCallback(xpcallback func(interface{}) <-chan string)
- func Xprotocol_registerMsgRetCallback(xpcallback func(interface{}))
- func Xprotocol_registerRecvCallback(recvXpFunc func(interface{}))
- func Xprotocol_sendMsgToNode(toid discover.NodeID, toaddr *net.UDPAddr, msg string) error
- func Xprotocol_sendMsgToPeer(enode string, msg string) error
- func Xprotocol_sendToGroupOneNode(msg string) (string, error)
- func Xprotocol_startTest()
- type Config
- type Dcrm
- type DcrmAPI
- type Emitter
- type Group
- type Transaction
- type Xp
- type XpAPI
Constants ¶
const ( DcrmProtocol_type = discover.Dcrmprotocol_type Xprotocol_type = discover.Xprotocol_type Sdkprotocol_type = discover.Sdkprotocol_type ProtocolName = "dcrm" Xp_ProtocolName = "xp" Dcrm_msgCode Sdk_msgCode Xp_msgCode ProtocolVersion = 1 ProtocolVersionStr = "1" NumberOfMessageCodes = 8 + iota // msgLength )
TODO
Variables ¶
var ( Dcrm_callback func(interface{}) <-chan string Sdk_callback func(interface{}, string) Xp_callback func(interface{}) SdkGroup map[discover.NodeID]*discover.Group = make(map[discover.NodeID]*discover.Group) )
var DefaultConfig = Config{ Nodes: make([]*discover.Node, 0), }
Functions ¶
func BroadcastToGroup ¶
func CC_startTest ¶
func CC_startTest()
func CheckAddPeer ¶
func CreateSDKGroup ¶
1 + 1 + 1
func DcrmProtocol_broadcastInGroupAll ¶
func DcrmProtocol_broadcastInGroupAll(msg string)
broadcast to group's nodes
func DcrmProtocol_broadcastInGroupOthers ¶
func DcrmProtocol_broadcastInGroupOthers(msg string)
func DcrmProtocol_getEnodes ¶
func DcrmProtocol_registerMsgRecvCallback ¶
func DcrmProtocol_registerMsgRecvCallback(dcrmcallback func(interface{}) <-chan string)
receive message from dccp
func DcrmProtocol_registerMsgRetCallback ¶
func DcrmProtocol_registerMsgRetCallback(dcrmcallback func(interface{}))
receive message from dccp result
func DcrmProtocol_registerPriKeyCallback ¶
func DcrmProtocol_registerPriKeyCallback(recvPrivkeyFunc func(interface{}))
callback receive private key
func DcrmProtocol_registerRecvCallback ¶
func DcrmProtocol_registerRecvCallback(recvDcrmFunc func(interface{}) <-chan string)
receive message form peers
func DcrmProtocol_sendMsgToNode ¶
unicast to anyone
func DcrmProtocol_sendMsgToPeer ¶
to peers
func DcrmProtocol_sendToGroupOneNode ¶
txs start
func Dcrm_callEvent ¶
func Dcrm_callEvent(msg string)
func GetEnodeStatus ¶
func HandlePeer ¶
func HandlePeer(peer *p2p.Peer, rw p2p.MsgReadWriter) error
func InitServer ¶
func InitServer(nodeserv interface{})
func ParseNodeID ¶
func RegisterCallback ¶
func RegisterCallback(recvFunc func(interface{}, string))
receive message form peers
func RegisterDcrmCallback ¶
func RegisterDcrmCallback(dcrmcallback func(interface{}) <-chan string)
func RegisterDcrmRetCallback ¶
func RegisterDcrmRetCallback(dcrmcallback func(interface{}))
func RegisterRecvCallback ¶
func RegisterRecvCallback(recvPrivkeyFunc func(interface{}))
func RegisterSendCallback ¶
func RegisterSendCallback(callbackfunc func(interface{}))
func RegisterUpdateOrderCacheCallback ¶
func RegisterUpdateOrderCacheCallback(recvDcrmFunc func(interface{}))
func SdkProtocol_getGroup ¶
func SdkProtocol_registerBroadcastInGroupCallback ¶
func SdkProtocol_registerBroadcastInGroupCallback(recvSdkFunc func(interface{}, string))
--------------------- API callback ----------------------
recv from broadcastInGroup...
func SdkProtocol_registerSendToGroupCallback ¶
recv from sendToGroup...
func SdkProtocol_registerSendToGroupReturnCallback ¶
func SdkProtocol_registerSendToGroupReturnCallback(sdkcallback func(interface{}, string))
recv return from sendToGroup...
func SdkProtocol_sendToGroupOneNode ¶
================ API SDK =====================
func Sdk_callEvent ¶
func SendMsg ¶
func SendMsg(msg string)
=============================== DCRM =================================
func SendMsgToPeer ¶
func SendToDcrmGroupAllNodes ¶
func SendToMyself ¶
func SendToPeer ¶
func Xp_callEvent ¶
func Xp_callEvent(msg string)
func Xprotocol_broadcastInGroupAll ¶
func Xprotocol_broadcastInGroupAll(msg string)
func Xprotocol_broadcastInGroupOthers ¶
func Xprotocol_broadcastInGroupOthers(msg string)
broadcast to group's nodes
func Xprotocol_getEnodes ¶
func Xprotocol_getGroup ¶
func Xprotocol_registerMsgRecvCallback ¶
func Xprotocol_registerMsgRecvCallback(xpcallback func(interface{}) <-chan string)
receive message from xp
func Xprotocol_registerMsgRetCallback ¶
func Xprotocol_registerMsgRetCallback(xpcallback func(interface{}))
receive message from dccp result
func Xprotocol_registerRecvCallback ¶
func Xprotocol_registerRecvCallback(recvXpFunc func(interface{}))
receive message form peers
func Xprotocol_sendMsgToNode ¶
unicast to anyone
func Xprotocol_sendMsgToPeer ¶
to peers
func Xprotocol_sendToGroupOneNode ¶
txs start
func Xprotocol_startTest ¶
func Xprotocol_startTest()
Types ¶
type Dcrm ¶
type Dcrm struct {
// contains filtered or unexported fields
}
func DcrmNew ¶
p2p layer 2 New creates a Whisper client ready to communicate through the Ethereum P2P network.
type Emitter ¶
func NewEmitter ¶
func NewEmitter() *Emitter
type Transaction ¶
type Xp ¶
type Xp struct {
// contains filtered or unexported fields
}
func XpNew ¶
p2p layer 2 New creates a Whisper client ready to communicate through the Ethereum P2P network.