Documentation ¶
Index ¶
- type Info
- type Swarm
- func (s *Swarm) APIs() []rpc.API
- func (s *Swarm) Protocols() (protos []p2p.Protocol)
- func (s *Swarm) RegisterPssProtocol(topic *pss.Topic, spec *protocols.Spec, targetprotocol *p2p.Protocol, ...) (*pss.Protocol, error)
- func (s *Swarm) SetChequebook(ctx context.Context) error
- func (s *Swarm) Start(srv *p2p.Server) error
- func (s *Swarm) Stop() error
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 ¶
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 (s *Swarm) RegisterPssProtocol(topic *pss.Topic, spec *protocols.Spec, targetprotocol *p2p.Protocol, options *pss.ProtocolParams) (*pss.Protocol, error)
RegisterPssProtocol adds a devp2p protocol to the swarm node's Pss instance
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
Directories ¶
Path | Synopsis |
---|---|
http
A simple http server interface to Swarm
|
A simple http server interface to Swarm |
Package bmt provides a binary merkle tree implementation used for swarm chunk hash
|
Package bmt provides a binary merkle tree implementation used for swarm chunk hash |
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
|
|
Package shed provides a simple abstraction components to compose more complex operations on storage data organized in fields and indexes.
|
Package shed provides a simple abstraction components to compose more complex operations on storage data organized in fields and indexes. |
feed
Package feeds defines Swarm Feeds.
|
Package feeds defines Swarm Feeds. |
feed/lookup
Package lookup defines feed lookup algorithms and provides tools to place updates so they can be found
|
Package lookup defines feed lookup algorithms and provides tools to place updates so they can be found |
localstore
Package localstore provides disk storage layer for Swarm Chunk persistence.
|
Package localstore provides disk storage layer for Swarm Chunk persistence. |
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. |