dcrm

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 28, 2018 License: GPL-3.0, LGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProtocolName = "dcrm"

	ProtocolVersion      = 1
	ProtocolVersionStr   = "1"
	NumberOfMessageCodes = 8 + iota // msgLength

)

TODO

Variables

View Source
var DefaultConfig = Config{
	DcrmNodes: make([]*discover.Node, 0),
}

Functions

func Broatcast added in v0.4.1

func Broatcast(msg string)

func BroatcastToGroup added in v0.4.1

func BroatcastToGroup(msg string)

func GetEnodes

func GetEnodes() (int, string)

func GetGroup

func GetGroup() (int, string)

func GetSelfID added in v0.4.1

func GetSelfID() discover.NodeID

func HandlePeer added in v0.4.1

func HandlePeer(peer *p2p.Peer, rw p2p.MsgReadWriter) error

func RegisterCallback

func RegisterCallback(recvDcrmFunc func(interface{}))

func RegisterDcrmCallback added in v0.4.1

func RegisterDcrmCallback(dcrmcallback func(interface{}) <-chan string)

func RegisterDcrmRetCallback added in v0.4.1

func RegisterDcrmRetCallback(dcrmcallback func(interface{}))

func RegisterRecvCallback added in v0.4.1

func RegisterRecvCallback(recvPrivkeyFunc func(interface{}))

func SendMsg

func SendMsg(msg string)

func SendMsgToPeer added in v0.4.1

func SendMsgToPeer(toid discover.NodeID, toaddr *net.UDPAddr, msg string) error

func SendToDcrmGroup added in v0.4.1

func SendToDcrmGroup(msg string) string

func SendToPeer added in v0.4.1

func SendToPeer(enode string, msg string)

func StartTest

func StartTest()

Types

type Config added in v0.4.1

type Config struct {
	DcrmNodes []*discover.Node
	DataPath  string
}

type Dcrm added in v0.4.1

type Dcrm struct {
	// contains filtered or unexported fields
}

func New added in v0.4.1

func New(cfg *Config) *Dcrm

New creates a Whisper client ready to communicate through the Ethereum P2P network.

func (*Dcrm) APIs added in v0.4.1

func (dcrm *Dcrm) APIs() []rpc.API

APIs returns the RPC descriptors the Whisper implementation offers

func (*Dcrm) Protocols added in v0.4.1

func (dcrm *Dcrm) Protocols() []p2p.Protocol

Protocols returns the whisper sub-protocols ran by this particular client.

func (*Dcrm) Start added in v0.4.1

func (dcrm *Dcrm) Start(server *p2p.Server) error

Start implements node.Service, starting the background data propagation thread of the Whisper protocol.

func (*Dcrm) Stop added in v0.4.1

func (dcrm *Dcrm) Stop() error

Stop implements node.Service, stopping the background data propagation thread of the Whisper protocol.

type DcrmAPI added in v0.4.1

type DcrmAPI struct {
	// contains filtered or unexported fields
}

func (*DcrmAPI) Peers added in v0.4.1

func (dcrm *DcrmAPI) Peers(ctx context.Context) []*p2p.PeerInfo

func (*DcrmAPI) Version added in v0.4.1

func (dcrm *DcrmAPI) Version(ctx context.Context) (v string)

type Emitter

type Emitter struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewEmitter

func NewEmitter() *Emitter

type Group added in v0.4.1

type Group struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewDcrmGroup added in v0.4.1

func NewDcrmGroup() *Group

type Peer added in v0.4.1

type Peer struct {
	Peer *p2p.Peer
	// contains filtered or unexported fields
}

peer represents a whisper protocol peer connection.

type Transaction added in v0.4.1

type Transaction struct {
	Payload []byte
	Hash    atomic.Value
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL