Registry / messaging / libp2p-go-libp2p-pubsub

libp2p-go-libp2p-pubsub

JSON →
library0.16.0gogounverified

The pubsub package provides facilities for the Publish/Subscribe pattern of message propagation, also known as overlay multicast.

go get github.com/libp2p/go-libp2p-pubsub
INSTALL
IMPORT
SIG · LIBP2P-GO-LIBP2P-P
L
libp2p-go-libp2p-pubsub
messaginggov0.16.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

pubsub
github.com/libp2p/go-libp2p-pubsub

Subscribe to a topic using GossipSub.

package main import ( "context" "fmt" pubsub "github.com/libp2p/go-libp2p-pubsub" "github.com/libp2p/go-libp2p" ) func main() { ctx := context.Background() host, _ := libp2p.New(libp2p.ListenAddrStrings("/ip4/0.0.0.0/tcp/0")) ps, _ := pubsub.NewGossipSub(ctx, host) sub, _ := ps.Subscribe("test-topic") msg, _ := sub.Next(ctx) fmt.Println(string(msg.Data)) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.16.0latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
OpenAI (training)
1
Resources
libp2p-go-libp2p-pubsub — go get libp2p-go-libp2p-pubsub · libregistry