Versions in this module Expand all Collapse all v0 v0.4.2 Jun 28, 2019 Changes in this version + const SimulationTypeExec + const SimulationTypeInproc type Simulation + func NewExec(services map[string]ServiceFunc) (s *Simulation, err error) + func NewInProc(services map[string]ServiceFunc) (s *Simulation) v0.4.1 Jun 13, 2019 Changes in this version + var DefaultHTTPSimAddr = ":8888" + var ErrNodeNotFound = errors.New("node not found") + func BzzPrivateKeyFromConfig(conf *adapters.NodeConfig) (*ecdsa.PrivateKey, error) + type AddNodeOption func(*adapters.NodeConfig) + func AddNodeWithMsgEvents(enable bool) AddNodeOption + func AddNodeWithService(serviceName string) AddNodeOption + type BucketKey string + var BucketKeyBzzPrivateKey BucketKey = "bzzprivkey" + var BucketKeyKademlia BucketKey = "kademlia" + type PeerEvent struct + Error error + Event *simulations.Event + NodeID enode.ID + PeerID enode.ID + type PeerEventsFilter struct + func NewPeerEventsFilter() *PeerEventsFilter + func (f *PeerEventsFilter) Connect() *PeerEventsFilter + func (f *PeerEventsFilter) Drop() *PeerEventsFilter + func (f *PeerEventsFilter) MsgCode(c uint64) *PeerEventsFilter + func (f *PeerEventsFilter) Protocol(p string) *PeerEventsFilter + func (f *PeerEventsFilter) ReceivedMessages() *PeerEventsFilter + func (f *PeerEventsFilter) SentMessages() *PeerEventsFilter + type Result struct + Duration time.Duration + Error error + type RunFunc func(context.Context, *Simulation) error + type ServiceFunc func(ctx *adapters.ServiceContext, bucket *sync.Map) (s node.Service, cleanup func(), err error) + type Simulation struct + Net *simulations.Network + func New(services map[string]ServiceFunc) (s *Simulation) + func (s *Simulation) AddNode(opts ...AddNodeOption) (id enode.ID, err error) + func (s *Simulation) AddNodes(count int, opts ...AddNodeOption) (ids []enode.ID, err error) + func (s *Simulation) AddNodesAndConnectChain(count int, opts ...AddNodeOption) (ids []enode.ID, err error) + func (s *Simulation) AddNodesAndConnectFull(count int, opts ...AddNodeOption) (ids []enode.ID, err error) + func (s *Simulation) AddNodesAndConnectRing(count int, opts ...AddNodeOption) (ids []enode.ID, err error) + func (s *Simulation) AddNodesAndConnectStar(count int, opts ...AddNodeOption) (ids []enode.ID, err error) + func (s *Simulation) Close() + func (s *Simulation) Done() <-chan struct{} + func (s *Simulation) DownNodeIDs() (ids []enode.ID) + func (s *Simulation) NodeIDs() (ids []enode.ID) + func (s *Simulation) NodeItem(id enode.ID, key interface{}) (value interface{}, ok bool) + func (s *Simulation) NodesItems(key interface{}) (values map[enode.ID]interface{}) + func (s *Simulation) PeerEvents(ctx context.Context, ids []enode.ID, filters ...*PeerEventsFilter) <-chan PeerEvent + func (s *Simulation) RandomService(name string) node.Service + func (s *Simulation) Run(ctx context.Context, f RunFunc) (r Result) + func (s *Simulation) RunSimulation(w http.ResponseWriter, req *http.Request) + func (s *Simulation) Service(name string, id enode.ID) node.Service + func (s *Simulation) Services(name string) (services map[enode.ID]node.Service) + func (s *Simulation) SetNodeItem(id enode.ID, key interface{}, value interface{}) + func (s *Simulation) StartNode(id enode.ID) (err error) + func (s *Simulation) StartRandomNode() (id enode.ID, err error) + func (s *Simulation) StartRandomNodes(count int) (ids []enode.ID, err error) + func (s *Simulation) StopNode(id enode.ID) (err error) + func (s *Simulation) StopRandomNode() (id enode.ID, err error) + func (s *Simulation) StopRandomNodes(count int) (ids []enode.ID, err error) + func (s *Simulation) UpNodeIDs() (ids []enode.ID) + func (s *Simulation) UpNodesItems(key interface{}) (values map[enode.ID]interface{}) + func (s *Simulation) UploadSnapshot(ctx context.Context, snapshotFile string, opts ...AddNodeOption) error + func (s *Simulation) WaitTillHealthy(ctx context.Context) (ill map[enode.ID]*network.Kademlia, err error) + func (s *Simulation) WaitTillSnapshotRecreated(ctx context.Context, snap *simulations.Snapshot) error + func (s *Simulation) WithServer(addr string) *Simulation