go-waku/waku/v2/node/wakunode2_test.go

35 lines
624 B
Go
Raw Normal View History

2021-11-12 09:19:42 +00:00
package node
import (
"context"
"net"
"testing"
"github.com/ethereum/go-ethereum/crypto"
"github.com/status-im/go-waku/tests"
"github.com/stretchr/testify/require"
)
func TestWakuNode2(t *testing.T) {
hostAddr, _ := net.ResolveTCPAddr("tcp", "0.0.0.0:0")
key, err := tests.RandomHex(32)
require.NoError(t, err)
prvKey, err := crypto.HexToECDSA(key)
require.NoError(t, err)
ctx := context.Background()
wakuNode, err := New(ctx,
WithPrivateKey(prvKey),
2021-11-17 16:19:42 +00:00
WithHostAddress(hostAddr),
2021-11-12 09:19:42 +00:00
WithWakuRelay(),
)
require.NoError(t, err)
err = wakuNode.Start()
defer wakuNode.Stop()
require.NoError(t, err)
}