common

package
v0.0.0-...-499f638 Latest Latest
Warning

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

Go to latest
Published: May 3, 2019 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BzzDefaultNetworkId = 4242
	WSDefaultPort       = 18543
	BzzDefaultPort      = 8542
	P2pPort             = 30100
	IPCName             = "demo.ipc"
	DatadirPrefix       = ".data_"
)

Variables

View Source
var (
	// custom log, easily grep'able
	Log = log.New("DemoLog", "v1.0.1")

	// our working directory
	BasePath string
)

Functions

func LogCrit

func LogCrit(msg string, ctx ...interface{})

func LogDebug

func LogDebug(msg string, ctx ...interface{})

func LogError

func LogError(msg string, ctx ...interface{})

func LogInfo

func LogInfo(msg string, ctx ...interface{})

func LogTrace

func LogTrace(msg string, ctx ...interface{})

func LogWarn

func LogWarn(msg string, ctx ...interface{})

func NewServer

func NewServer(privkey *ecdsa.PrivateKey, name string, version string, proto *p2p.Protocol, port int) *p2p.Server

NewServer : create a server

func NewServiceNode

func NewServiceNode(port int, httpport int, wsport int, modules ...string) (*node.Node, error)

NewServiceNode : set up the local service node

func NewServiceNodeWithPrivateKey

func NewServiceNodeWithPrivateKey(privateKey *ecdsa.PrivateKey, port int, httpport int, wsport int, modules ...string) (*node.Node, error)

func NewServiceNodeWithPrivateKeyAndDataDir

func NewServiceNodeWithPrivateKeyAndDataDir(privateKey *ecdsa.PrivateKey, dataDir string, port int, httpport int, wsport int, modules ...string) (*node.Node, error)

func NewServiceNodeWithPrivateKeyAndDataDirAndProtocols

func NewServiceNodeWithPrivateKeyAndDataDirAndProtocols(privateKey *ecdsa.PrivateKey, dataDir string, port int, httpport int, wsport int, protocols []p2p.Protocol, modules ...string) (*node.Node, error)

func NewServiceNodeWithPrivateKeyAndProtocols

func NewServiceNodeWithPrivateKeyAndProtocols(privateKey *ecdsa.PrivateKey, port int, httpport int, wsport int, protocols []p2p.Protocol, modules ...string) (*node.Node, error)

func NewSwarmServiceWithProtocol

func NewSwarmServiceWithProtocol(stack *node.Node, bzzport int, specs []*protocols.Spec, protocols []*p2p.Protocol, topic *pss.Topic, pssprotos *[]*pss.Protocol) func(ctx *node.ServiceContext) (node.Service, error)

NewSwarmServiceWithProtocol : create new swarm service with protocol and topic

func NewSwarmServiceWithProtocolAndPrivateKey

func NewSwarmServiceWithProtocolAndPrivateKey(stack *node.Node, bzzport int, specs []*protocols.Spec, protocols []*p2p.Protocol, topic *pss.Topic, pssprotos *[]*pss.Protocol, prvkey *ecdsa.PrivateKey) func(ctx *node.ServiceContext) (node.Service, error)

func RandomID

func RandomID() (id enode.ID)

func ToJSON

func ToJSON(obj interface{}) string

func WaitForCtrlC

func WaitForCtrlC()

func WaitHealthy

func WaitHealthy(ctx context.Context, minbinsize int, rpcs ...*rpc.Client) error

WaitHealthy : wait for nodes

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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