Documentation ¶
Index ¶
- type Info
- type Swarm
- func (self *Swarm) API() *SwarmAPI
- func (self *Swarm) APIs() []rpc.API
- func (self *Swarm) Api() *api.API
- func (self *Swarm) Protocols() (protos []p2p.Protocol)
- func (self *Swarm) RegisterPssProtocol(spec *protocols.Spec, targetprotocol *p2p.Protocol, ...) (*pss.Protocol, error)
- func (self *Swarm) SetChequebook(ctx context.Context) error
- func (self *Swarm) Start(srv *p2p.Server) error
- func (self *Swarm) Stop() error
- type SwarmAPI
- type Voidstore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Swarm ¶
type Swarm struct {
// contains filtered or unexported fields
}
the swarm stack
func NewSwarm ¶
creates a new swarm service instance implements node.Service If mockStore is not nil, it will be used as the storage for chunk data. MockStore should be used only for testing.
func (*Swarm) APIs ¶
implements node.Service APIs returns the RPC API descriptors the Swarm implementation offers
func (*Swarm) RegisterPssProtocol ¶
func (*Swarm) SetChequebook ¶
SetChequebook ensures that the local checquebook is set up on chain.
func (*Swarm) Start ¶
Start is called when the stack is started * starts the network kademlia hive peer management * (starts netStore level 0 api) * starts DPA level 1 api (chunking -> store/retrieve requests) * (starts level 2 api) * starts http proxy server * registers url scheme handlers for bzz, etc * TODO: start subservices like sword, swear, swarmdns
implements the node.Service interface
type SwarmAPI ¶
type SwarmAPI struct { Api *api.API Backend chequebook.Backend PrvKey *ecdsa.PrivateKey }
Directories ¶
Path | Synopsis |
---|---|
http
Show nicely (but simple) formatted HTML error pages (or respond with JSON if the appropriate `Accept` header is set)) for the http package.
|
Show nicely (but simple) formatted HTML error pages (or respond with JSON if the appropriate `Accept` header is set)) for the http package. |
Package bmt provides a binary merkle tree implementation
|
Package bmt provides a binary merkle tree implementation |
simulations
You can run this simulation using
|
You can run this simulation using |
Package pot see doc.go
|
Package pot see doc.go |
Pss provides devp2p functionality for swarm nodes without the need for a direct tcp connection between them.
|
Pss provides devp2p functionality for swarm nodes without the need for a direct tcp connection between them. |
client
simple abstraction for implementing pss functionality
|
simple abstraction for implementing pss functionality |
services
|
|
mock
Package mock defines types that are used by different implementations of mock storages.
|
Package mock defines types that are used by different implementations of mock storages. |
mock/db
Package db implements a mock store that keeps all chunk data in LevelDB database.
|
Package db implements a mock store that keeps all chunk data in LevelDB database. |
mock/mem
Package mem implements a mock store that keeps all chunk data in memory.
|
Package mem implements a mock store that keeps all chunk data in memory. |
mock/rpc
Package rpc implements an RPC client that connect to a centralized mock store.
|
Package rpc implements an RPC client that connect to a centralized mock store. |
mock/test
Package test provides functions that are used for testing GlobalStorer implementations.
|
Package test provides functions that are used for testing GlobalStorer implementations. |