storeman

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2020 License: GPL-3.0, MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	StoremanNodes:     make([]*discover.Node, 0),
	SchnorrThreshold:  26,
	SchnorrTotalNodes: 50,
}

Functions

This section is empty.

Types

type Config

type Config struct {
	StoremanNodes     []*discover.Node
	Password          string
	DataPath          string
	SchnorrThreshold  int
	SchnorrTotalNodes int
}

type Peer

type Peer struct {
	Peer *p2p.Peer
	// contains filtered or unexported fields
}

peer represents a whisper protocol peer connection.

func (*Peer) ID

func (p *Peer) ID() discover.NodeID

type Storeman

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

////////////////////////////////// Storeman //////////////////////////////////

func New

func New(cfg *Config, accountManager *accounts.Manager, aKID, secretKey, region string) *Storeman

New creates a Whisper client ready to communicate through the Ethereum P2P network.

func (*Storeman) APIs

func (sm *Storeman) APIs() []rpc.API

APIs returns the RPC descriptors the Whisper implementation offers

func (*Storeman) HandlePeer

func (sm *Storeman) HandlePeer(peer *p2p.Peer, rw p2p.MsgReadWriter) error

HandlePeer is called by the underlying P2P layer when the whisper sub-protocol connection is negotiated.

func (*Storeman) IsActivePeer

func (sm *Storeman) IsActivePeer(peerID *discover.NodeID) bool

func (*Storeman) MaxMessageSize

func (sm *Storeman) MaxMessageSize() uint32

MaxMessageSize returns the maximum accepted message size.

func (*Storeman) Protocols

func (sm *Storeman) Protocols() []p2p.Protocol

Protocols returns the whisper sub-protocols ran by this particular client.

func (*Storeman) SendToPeer

func (sm *Storeman) SendToPeer(peerID *discover.NodeID, msgcode uint64, data interface{}) error

func (*Storeman) Start

func (sm *Storeman) Start(server *p2p.Server) error

Start implements node.Service, starting the background data propagation thread of the Whisper protocol.

func (*Storeman) Stop

func (sm *Storeman) Stop() error

Stop implements node.Service, stopping the background data propagation thread of the Whisper protocol.

type StoremanAPI

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

////////////////////////////////// StoremanAPI //////////////////////////////////

func (*StoremanAPI) AddValidData

func (sa *StoremanAPI) AddValidData(ctx context.Context, data mpcprotocol.SendData) error

func (*StoremanAPI) ApproveData

func (sa *StoremanAPI) ApproveData(ctx context.Context, data []mpcprotocol.SendData) []error

// non leader node ApproveData, and make sure that the data is really required to be signed by them.

func (*StoremanAPI) CreateGPK

func (sa *StoremanAPI) CreateGPK(ctx context.Context) (pk hexutil.Bytes, err error)

func (*StoremanAPI) GetDataForApprove

func (sa *StoremanAPI) GetDataForApprove(ctx context.Context) ([]mpcprotocol.SendData, error)

non leader node polling the data received from leader node

func (*StoremanAPI) Peers

func (sa *StoremanAPI) Peers(ctx context.Context) []*p2p.PeerInfo

func (*StoremanAPI) SignData

func (sa *StoremanAPI) SignData(ctx context.Context, data mpcprotocol.SendData) (result mpcprotocol.SignedResult, err error)

func (*StoremanAPI) SignDataByApprove added in v1.0.1

func (sa *StoremanAPI) SignDataByApprove(ctx context.Context, data mpcprotocol.SendData) (result mpcprotocol.SignedResult, err error)

func (*StoremanAPI) Version

func (sa *StoremanAPI) Version(ctx context.Context) (v string)

type StrmanAllPeers

type StrmanAllPeers struct {
	Ip     []string
	Port   []string
	Nodeid []string
}

type StrmanGetPeers

type StrmanGetPeers struct {
	LocalPort string
}

type StrmanKeepAlive

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

type StrmanKeepAliveOk

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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