mirror of
https://source.quilibrium.com/quilibrium/ceremonyclient.git
synced 2024-12-30 18:35:18 +00:00
.. | ||
.gitignore | ||
go.mod | ||
go.sum | ||
main.go | ||
README.md |
go-libp2p-pubsub chat with rendezvous example
This example project allows multiple peers to chat among each other using go-libp2p-pubsub.
Peers are discovered using a DHT, so no prior information (other than the rendezvous name) is required for each peer.
Running
Clone this repo, then cd
into the examples/pubsub/basic-chat-with-rendezvous
directory:
git clone https://github.com/libp2p/go-libp2p
cd go-libp2p/examples/pubsub/basic-chat-with-rendezvous
Now you can either run with go run
, or build and run the binary:
go run .
# or, build and run separately
go build .
./chat
To change the topic name, use the -topicName
flag:
go run . -topicName=adifferenttopic
Try opening several terminals, each running the app. When you type a message and hit enter in one, it should appear in all others that are connected to the same topic.
To quit, hit Ctrl-C
.