diff --git a/README.md b/README.md index f7a8c70..da406c1 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,7 @@ cd pubsub This peer, which is not in bootstrapper mode, creates a node, subscribes to the shared topic string, spawns the same go routine, and then loops forever requesting user input and publishing each line to the topic. **Third terminal**: Create a JS peer to connect to bootstrap and publish on topic + ``` cd pubsub/js npm install # first time only diff --git a/pubsub/pubsub-interop.go b/pubsub/pubsub-interop.go index 7a44390..161c3cd 100644 --- a/pubsub/pubsub-interop.go +++ b/pubsub/pubsub-interop.go @@ -8,7 +8,6 @@ import ( "os" _ "time" - // ipfsaddr "github.com/ipfs/go-ipfs-addr" libp2p "github.com/libp2p/go-libp2p" host "github.com/libp2p/go-libp2p-host" inet "github.com/libp2p/go-libp2p-net" @@ -45,7 +44,7 @@ func parseArgs() (bool, string) { func handleConn(conn inet.Conn) { ctx := context.Background() h := ho - fmt.Printf(" Got connection from %v\n", conn.RemoteMultiaddr().String()) + fmt.Printf(" New peer joined: %v\n", conn.RemoteMultiaddr().String()) _ = h _ = ctx } @@ -60,7 +59,7 @@ func main() { } else { fmt.Printf("peer mode (port 6000)") } - fmt.Printf(" with private key '%s'\n", privKeyFilePath) + fmt.Printf("\nPrivate key '%s'\n", privKeyFilePath) // // Read the private key and unmarshall it into struct @@ -166,12 +165,11 @@ func main() { }, }) if bBootstrap { - fmt.Println("Bootstrapper running.\nDHT running.\nCtrl+C to exit and destroy DHT.") + fmt.Println("Bootstrapper running.\nPubSub object instantiated using FloodSubRouter.\nCtrl+C to exit.") for true { } } else { // Now, wait for input from the user, and send that out! - fmt.Println("Type something and hit enter to send to other subscribers:") scan := bufio.NewScanner(os.Stdin) for scan.Scan() { if err := fsub.Publish(TopicName, scan.Bytes()); err != nil {