swarm

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2018 License: GPL-3.0 Imports: 34 Imported by: 0

README

Swarm

https://swarm.ethereum.org

Swarm is a distributed storage platform and content distribution service, a native base layer service of the ethereum web3 stack. The primary objective of Swarm is to provide a decentralized and redundant store for dapp code and data as well as block chain and state data. Swarm is also set out to provide various base layer services for web3, including node-to-node messaging, media streaming, decentralised database services and scalable state-channel infrastructure for decentralised service economies.

Travis Gitter

Building the source

Building Swarm requires Go (version 1.10 or later).

go get -d github.com/ethereum/go-ethereum

go install github.com/ethereum/go-ethereum/cmd/swarm

Documentation

Swarm documentation can be found at https://swarm-guide.readthedocs.io.

Contribution

Thank you for considering to help out with the source code! We welcome contributions from anyone on the internet, and are grateful for even the smallest of fixes!

If you'd like to contribute to Swarm, please fork, fix, commit and send a pull request for the maintainers to review and merge into the main code base. If you wish to submit more complex changes though, please check up with the core devs first on our Swarm gitter channel to ensure those changes are in line with the general philosophy of the project and/or get some early feedback which can make both your efforts much lighter as well as our review and merge procedures quick and simple.

Please make sure your contributions adhere to our coding guidelines:

  • Code must adhere to the official Go formatting guidelines (i.e. uses gofmt).
  • Code must be documented adhering to the official Go commentary guidelines.
  • Pull requests need to be based on and opened against the master branch.
  • Code review guidelines.
  • Commit messages should be prefixed with the package(s) they modify.
    • E.g. "swarm/fuse: ignore default manifest entry"

License

The eosclassic library (i.e. all code outside of the cmd directory) is licensed under the GNU Lesser General Public License v3.0, also included in our repository in the COPYING.LESSER file.

The go-ethereum binaries (i.e. all code inside of the cmd directory) is licensed under the GNU General Public License v3.0, also included in our repository in the COPYING file.

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 NewSwarm

func NewSwarm(config *api.Config, mockStore *mock.NodeStore) (self *Swarm, err error)

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) 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() (protos []p2p.Protocol)

implements the node.Service interface

func (*Swarm) RegisterPssProtocol added in v1.8.15

func (self *Swarm) RegisterPssProtocol(spec *protocols.Spec, targetprotocol *p2p.Protocol, options *pss.ProtocolParams) (*pss.Protocol, error)

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
}

type Voidstore added in v1.8.15

type Voidstore struct {
}

func (Voidstore) Load added in v1.8.15

func (self Voidstore) Load(string) ([]byte, error)

func (Voidstore) Save added in v1.8.15

func (self Voidstore) Save(string, []byte) error

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.
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
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.
mru
Package mru defines Mutable resource updates.
Package mru defines Mutable resource updates.

Jump to

Keyboard shortcuts

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