ceremonyclient/go-libp2p-blossomsub
2024-08-11 22:56:30 -05:00
..
pb v2.0.0 - Bootstrap Only Edition 2024-08-08 00:41:46 -05:00
timecache tighten up the defers on mutexes, it's hitting hard locks 2024-08-11 22:56:30 -05:00
.gitignore Add ceremony-targeted go-libp2p-blossomsub 2023-07-07 01:07:10 -05:00
backoff_test.go Add ceremony-targeted go-libp2p-blossomsub 2023-07-07 01:07:10 -05:00
backoff.go tighten up the defers on mutexes, it's hitting hard locks 2024-08-11 22:56:30 -05:00
bitmask_test.go v2.0.0 - Bootstrap Only Edition 2024-08-08 00:41:46 -05:00
bitmask.go tighten up the defers on mutexes, it's hitting hard locks 2024-08-11 22:56:30 -05:00
blacklist_test.go v2.0.0 - Bootstrap Only Edition 2024-08-08 00:41:46 -05:00
blacklist.go Add ceremony-targeted go-libp2p-blossomsub 2023-07-07 01:07:10 -05:00
blossomsub_connmgr_test.go v2.0.0 - Bootstrap Only Edition 2024-08-08 00:41:46 -05:00
blossomsub_feat_test.go v2.0.0 - Bootstrap Only Edition 2024-08-08 00:41:46 -05:00
blossomsub_feat.go v2.0.0 - Bootstrap Only Edition 2024-08-08 00:41:46 -05:00
blossomsub_matchfn_test.go v2.0.0 - Bootstrap Only Edition 2024-08-08 00:41:46 -05:00
blossomsub_spam_test.go fix: don't allow sync.mutex copies from protobuf to lock up dropRPC 2024-08-10 18:04:23 -05:00
blossomsub_test.go fix: don't allow sync.mutex copies from protobuf to lock up dropRPC 2024-08-10 18:04:23 -05:00
blossomsub.go tighten up the defers on mutexes, it's hitting hard locks 2024-08-11 22:56:30 -05:00
comm.go tighten up the defers on mutexes, it's hitting hard locks 2024-08-11 22:56:30 -05:00
discovery_test.go v2.0.0 - Bootstrap Only Edition 2024-08-08 00:41:46 -05:00
discovery.go tighten up the defers on mutexes, it's hitting hard locks 2024-08-11 22:56:30 -05:00
go.mod v2.0.0 - Bootstrap Only Edition 2024-08-08 00:41:46 -05:00
go.sum v2.0.0 - Bootstrap Only Edition 2024-08-08 00:41:46 -05:00
gossip_tracer_test.go v2.0.0 - Bootstrap Only Edition 2024-08-08 00:41:46 -05:00
gossip_tracer.go tighten up the defers on mutexes, it's hitting hard locks 2024-08-11 22:56:30 -05:00
LICENSE Add ceremony-targeted go-libp2p-blossomsub 2023-07-07 01:07:10 -05:00
LICENSE-APACHE Add ceremony-targeted go-libp2p-blossomsub 2023-07-07 01:07:10 -05:00
LICENSE-MIT Add ceremony-targeted go-libp2p-blossomsub 2023-07-07 01:07:10 -05:00
mcache_test.go v2.0.0 - Bootstrap Only Edition 2024-08-08 00:41:46 -05:00
mcache.go v2.0.0 - Bootstrap Only Edition 2024-08-08 00:41:46 -05:00
midgen.go v2.0.0 - Bootstrap Only Edition 2024-08-08 00:41:46 -05:00
peer_gater_test.go Add ceremony-targeted go-libp2p-blossomsub 2023-07-07 01:07:10 -05:00
peer_gater.go tighten up the defers on mutexes, it's hitting hard locks 2024-08-11 22:56:30 -05:00
peer_notify.go tighten up the defers on mutexes, it's hitting hard locks 2024-08-11 22:56:30 -05:00
pubsub_test.go v2.0.0 - Bootstrap Only Edition 2024-08-08 00:41:46 -05:00
pubsub.go fix: don't allow sync.mutex copies from protobuf to lock up dropRPC 2024-08-10 18:04:23 -05:00
README.md v2.0.0 - Bootstrap Only Edition 2024-08-08 00:41:46 -05:00
score_params_test.go Add ceremony-targeted go-libp2p-blossomsub 2023-07-07 01:07:10 -05:00
score_params.go Add ceremony-targeted go-libp2p-blossomsub 2023-07-07 01:07:10 -05:00
score_test.go Add ceremony-targeted go-libp2p-blossomsub 2023-07-07 01:07:10 -05:00
score.go tighten up the defers on mutexes, it's hitting hard locks 2024-08-11 22:56:30 -05:00
sign_test.go Add ceremony-targeted go-libp2p-blossomsub 2023-07-07 01:07:10 -05:00
sign.go fix: don't allow sync.mutex copies from protobuf to lock up dropRPC 2024-08-10 18:04:23 -05:00
subscription_filter_test.go v2.0.0 - Bootstrap Only Edition 2024-08-08 00:41:46 -05:00
subscription_filter.go Add ceremony-targeted go-libp2p-blossomsub 2023-07-07 01:07:10 -05:00
subscription.go Add ceremony-targeted go-libp2p-blossomsub 2023-07-07 01:07:10 -05:00
tag_tracer_test.go v2.0.0 - Bootstrap Only Edition 2024-08-08 00:41:46 -05:00
tag_tracer.go tighten up the defers on mutexes, it's hitting hard locks 2024-08-11 22:56:30 -05:00
trace_test.go v2.0.0 - Bootstrap Only Edition 2024-08-08 00:41:46 -05:00
trace.go tighten up the defers on mutexes, it's hitting hard locks 2024-08-11 22:56:30 -05:00
tracer.go tighten up the defers on mutexes, it's hitting hard locks 2024-08-11 22:56:30 -05:00
validation_builtin_test.go v2.0.0 - Bootstrap Only Edition 2024-08-08 00:41:46 -05:00
validation_builtin.go tighten up the defers on mutexes, it's hitting hard locks 2024-08-11 22:56:30 -05:00
validation_test.go v2.0.0 - Bootstrap Only Edition 2024-08-08 00:41:46 -05:00
validation.go tighten up the defers on mutexes, it's hitting hard locks 2024-08-11 22:56:30 -05:00

go-libp2p-blossomsub

This repo contains the canonical blossomsub implementation for Quilibrium. It has historical origins in Gossipsub, but has diverged significantly. Floodsub and Randomsub are not included in this fork.

Table of Contents

Install

go get source.quilibrium.com/quilibrium/monorepo/go-libp2p-pubsub

Usage

To be used for messaging in high scale, high throughput p2p instrastructure such as Quilibrium.

Overview

.
├── LICENSE
├── README.md
# Regular Golang repo set up
├── codecov.yml
├── pb
├── go.mod
├── go.sum
├── doc.go
# PubSub base
├── backoff.go
├── bitmask.go
├── blacklist.go
├── comm.go
├── discovery.go
├── gossip_tracer.go
├── midgen.go
├── peer_gater.go
├── peer_notify.go
├── pubsub.go
├── sign.go
├── subscription.go
├── tag_tracer.go
├── trace.go
├── tracer.go
├── validation.go
# Blossomsub router
├── blossomsub_feat.go
├── blossomsub.go
├── mcache.go
├── score.go
└── score_params.go

Tracing

The pubsub system supports tracing, which collects all events pertaining to the internals of the system. This allows you to recreate the complete message flow and state of the system for analysis purposes.

To enable tracing, instantiate the pubsub system using the WithEventTracer option; the option accepts a tracer with three available implementations in-package (trace to json, pb, or a remote peer). If you want to trace using a remote peer in the same way gossipsub tracing worked, you would need to do so by forking the traced daemon from go-libp2p-pubsub-tracer.

For instance, to capture the trace as a json file, you can use the following option:

tracer, err := pubsub.NewJSONTracer("/path/to/trace.json")
if err != nil {
  panic(err)
}

pubsub.NewBlossomSub(..., pubsub.WithEventTracer(tracer))

To capture the trace as a protobuf, you can use the following option:

tracer, err := pubsub.NewPBTracer("/path/to/trace.pb")
if err != nil {
  panic(err)
}

pubsub.NewBlossomSub(..., pubsub.WithEventTracer(tracer))

Finally, to use the remote tracer, you can use the following incantations:

// assuming that your tracer runs in x.x.x.x and has a peer ID of QmTracer
pi, err := peer.AddrInfoFromP2pAddr(ma.StringCast("/ip4/x.x.x.x/tcp/4001/p2p/QmTracer"))
if err != nil {
  panic(err)
}

tracer, err := pubsub.NewRemoteTracer(ctx, host, pi)
if err != nil {
  panic(err)
}

ps, err := pubsub.NewBlossomSub(..., pubsub.WithEventTracer(tracer))

Contribute

Contributions welcome. Please check out the issues.

Quilibrium does not have a code of conduct for contributions  contributions are accepted on merit and benefit to the protocol.

License

The go-libp2p-blossomsub project being forked from go-libp2p-pubsub inherits the dual-license under Apache 2.0 and MIT terms: