Documentation ¶
Overview ¶
Package whisper implements the Whisper PoC-1.
(https://github.com/ethereum/wiki/wiki/Whisper-PoC-1-Protocol-Spec)
Whisper combines aspects of both DHTs and datagram messaging systems (e.g. UDP). As such it may be likened and compared to both, not dissimilar to the matter/energy duality (apologies to physicists for the blatant abuse of a fundamental and beautiful natural principle).
Whisper is a pure identity-based messaging system. Whisper provides a low-level (non-application-specific) but easily-accessible API without being based upon or prejudiced by the low-level hardware attributes and characteristics, particularly the notion of singular endpoints.
Index ¶
- Constants
- func NewPeer(host *Whisper, p *p2p.Peer, ws p2p.MsgReadWriter) *peer
- func Topics(data [][]byte) [][]byte
- func TopicsFromString(data ...string) [][]byte
- type Envelope
- type Filter
- type Hash
- type Message
- type MessageEvent
- type Opts
- type Whisper
- func (self *Whisper) GetIdentity(key *ecdsa.PublicKey) *ecdsa.PrivateKey
- func (self *Whisper) HasIdentity(key *ecdsa.PublicKey) bool
- func (self *Whisper) Messages(id int) (messages []*Message)
- func (self *Whisper) NewIdentity() *ecdsa.PrivateKey
- func (self *Whisper) Protocol() p2p.Protocol
- func (self *Whisper) Send(envelope *Envelope) error
- func (self *Whisper) Start()
- func (self *Whisper) Stop()
- func (self *Whisper) Watch(opts Filter) int
Constants ¶
const (
DefaultPow = 50 * time.Millisecond
)
const DefaultTtl = 50 * time.Second
Variables ¶
This section is empty.
Functions ¶
func Topics ¶
Returns a formatted topics byte slice. data: unformatted data (e.g., no hashes needed)
func TopicsFromString ¶
Types ¶
type Envelope ¶
type Hash ¶
type Hash struct {
// contains filtered or unexported fields
}
MOVE ME
var EmptyHash Hash
type Message ¶
func NewMessage ¶
type MessageEvent ¶
type MessageEvent struct { To *ecdsa.PrivateKey From *ecdsa.PublicKey Message *Message }
type Whisper ¶
type Whisper struct {
// contains filtered or unexported fields
}
func (*Whisper) GetIdentity ¶ added in v0.8.5
func (self *Whisper) GetIdentity(key *ecdsa.PublicKey) *ecdsa.PrivateKey
func (*Whisper) NewIdentity ¶
func (self *Whisper) NewIdentity() *ecdsa.PrivateKey