From 63fe5cbdc871114c6a2221e1edad020b393379e4 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Fri, 13 Jul 2018 11:24:11 -0400 Subject: [PATCH] add jack.lbry.tech as a known node for debugging --- cmd/dht.go | 7 +++++++ dht/bootstrap.go | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/cmd/dht.go b/cmd/dht.go index 6d2adbb..2ba46b7 100644 --- a/cmd/dht.go +++ b/cmd/dht.go @@ -12,6 +12,7 @@ import ( "github.com/spf13/cobra" "log" "net/http" + "math/big" ) type NodeRPC string @@ -73,6 +74,12 @@ func dhtCmd(cmd *cobra.Command, args []string) { err = node.Connect(conn) checkErr(err) log.Println("started node") + node.AddKnownNode( + dht.Contact{ + bits.FromHexP("62c8ad9fb40a16062e884a63cd81f47b94604446319663d1334e1734dcefc8874b348ec683225e4852017a846e07d94e"), + net.ParseIP("34.231.152.182"), 4444, + }) + _, _, err = dht.FindContacts(&node.Node, nodeID.Sub(bits.FromBigP(big.NewInt(1))), false, nil) rpcServer := dht.RunRPCServer(":1234", "/", node) interruptChan := make(chan os.Signal, 1) signal.Notify(interruptChan, os.Interrupt, syscall.SIGTERM, syscall.SIGINT) diff --git a/dht/bootstrap.go b/dht/bootstrap.go index b31f0aa..20c614d 100644 --- a/dht/bootstrap.go +++ b/dht/bootstrap.go @@ -48,6 +48,10 @@ func (b *BootstrapNode) Add(c Contact) { b.upsert(c) } +func (b *BootstrapNode) AddKnownNode(c Contact) { + b.Node.rt.Update(c) +} + // Connect connects to the given connection and starts any background threads necessary func (b *BootstrapNode) Connect(conn UDPConn) error { err := b.Node.Connect(conn)