swarm

package
v1.0.2-alpha Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2021 License: GPL-3.0, GPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	*api.Config
	*chequebook.Params
}

serialisable info about swarm

func (*Info) Info

func (self *Info) Info() *Info

type Swarm

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

the swarm stack

func NewLocalSwarm

func NewLocalSwarm(datadir, port string) (self *Swarm, err error)

Local swarm without netStore

func NewSwarm

func NewSwarm(ctx *node.ServiceContext, backend chequebook.Backend, config *api.Config) (self *Swarm, err error)

creates a new swarm service instance implements node.Service

func (*Swarm) API

func (self *Swarm) API() *SwarmAPI

func (*Swarm) APIs

func (self *Swarm) APIs() []rpc.API

implements node.Service Apis returns the RPC Api descriptors the Swarm implementation offers

func (*Swarm) Api

func (self *Swarm) Api() *api.Api

func (*Swarm) Protocols

func (self *Swarm) Protocols() []p2p.Protocol

implements the node.Service interface

func (*Swarm) SetChequebook

func (self *Swarm) SetChequebook(ctx context.Context) error

SetChequebook ensures that the local checquebook is set up on chain.

func (*Swarm) Start

func (self *Swarm) Start(srv *p2p.Server) error

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

func (*Swarm) Stop

func (self *Swarm) Stop() error

implements the node.Service interface stops all component services.

type SwarmAPI

type SwarmAPI struct {
	Api     *api.Api
	Backend chequebook.Backend
	PrvKey  *ecdsa.PrivateKey
}

Directories

Path Synopsis
api
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.
services

Jump to

Keyboard shortcuts

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