package gate import ( "context" "testing" "time" btcdwire "github.com/btcsuite/btcd/wire/v2" "git.smesh.lol/btcd-lite/internal/litedial" ) // TestInstanceHandshakeWithTheNode runs the instance's own dialler against the // node's p2p port, which is the call the daemon makes on startup. func TestInstanceHandshakeWithTheNode(t *testing.T) { addr := p2pAddr(t) start := time.Now() p, err := litedial.Connect(context.Background(), addr, "/btcd-lite:0.1.0/", btcdwire.BitcoinNet(0xDAB5BFFA), 20*time.Second, true, t.Logf) took := time.Since(start).Round(time.Millisecond) if err != nil { t.Fatalf("instance dial to %s after %s: %v", addr, took, err) } defer p.Close() t.Logf("instance dial to %s completed in %s", addr, took) }