The core protocol of WoopChain
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
woop/api/service/discovery/discovery_test.go

34 lines
695 B

package discovery
import (
"testing"
"github.com/harmony-one/harmony/api/service"
"github.com/harmony-one/harmony/internal/utils"
"github.com/harmony-one/harmony/p2p"
"github.com/harmony-one/harmony/p2p/p2pimpl"
)
var (
ip = "127.0.0.1"
port = "7099"
dService *Service
)
func TestDiscoveryService(t *testing.T) {
selfPeer := p2p.Peer{IP: ip, Port: port}
priKey, _, err := utils.GenKeyP2P(ip, port)
host, err := p2pimpl.NewHost(&selfPeer, priKey)
if err != nil {
t.Fatalf("unable to new host in harmony: %v", err)
}
config := service.NodeConfig{}
dService = New(host, config, nil)
if dService == nil {
t.Fatalf("unable to create new discovery service")
}
}