diff --git a/cmd/pssTest/psstest.go b/cmd/pssTest/psstest.go index 9948c3b..f07f0a7 100644 --- a/cmd/pssTest/psstest.go +++ b/cmd/pssTest/psstest.go @@ -15,7 +15,7 @@ func main() { return } - sn := new(swarm.SwarmNet) + sn := new(swarm.SimplePss) err := sn.Init() if err != nil { fmt.Printf("%v\n", err) diff --git a/net/swarm/swarm.go b/net/swarm/swarm.go index 6b6e644..2ce116f 100644 --- a/net/swarm/swarm.go +++ b/net/swarm/swarm.go @@ -125,7 +125,7 @@ type pssSub struct { Address string } -type SwarmNet struct { +type SimplePss struct { Node *node.Node NodeConfig *node.Config EnodeID string @@ -139,7 +139,7 @@ type SwarmNet struct { Ports *swarmPorts } -func (sn *SwarmNet) SetLog(level string) error { +func (sn *SimplePss) SetLog(level string) error { // ensure good log formats for terminal // handle verbosity flag loglevel, err := log.LvlFromString(level) @@ -153,7 +153,7 @@ func (sn *SwarmNet) SetLog(level string) error { return nil } -func (sn *SwarmNet) PrintStats() { +func (sn *SimplePss) PrintStats() { // statistics thread go func() { for { @@ -169,15 +169,15 @@ func (sn *SwarmNet) PrintStats() { }() } -func (sn *SwarmNet) SetDatadir(datadir string) { +func (sn *SimplePss) SetDatadir(datadir string) { sn.Datadir = datadir } -func (sn *SwarmNet) SetKey(key *ecdsa.PrivateKey) { +func (sn *SimplePss) SetKey(key *ecdsa.PrivateKey) { sn.Key = key } -func (sn *SwarmNet) Init() error { +func (sn *SimplePss) Init() error { var err error if len(sn.Datadir) < 1 { usr, err := user.Current() @@ -269,7 +269,7 @@ func strAddress(addr string) pss.PssAddress { return pssAddress } -func (sn *SwarmNet) PssSub(subType, key, topic, address string) error { +func (sn *SimplePss) PssSub(subType, key, topic, address string) error { pssTopic := strTopic(topic) pssAddress := strAddress(address) if subType == "sym" { @@ -299,7 +299,7 @@ func (sn *SwarmNet) PssSub(subType, key, topic, address string) error { return nil } -func (sn *SwarmNet) PssPub(subType, key, topic, msg, address string) error { +func (sn *SimplePss) PssPub(subType, key, topic, msg, address string) error { var err error dstAddr := strAddress(address) dstTopic := strTopic(topic)