diff --git a/accesscontroller/orbitdb/accesscontroller_orbitdb.go b/accesscontroller/orbitdb/accesscontroller_orbitdb.go index a976873..69b506f 100644 --- a/accesscontroller/orbitdb/accesscontroller_orbitdb.go +++ b/accesscontroller/orbitdb/accesscontroller_orbitdb.go @@ -16,6 +16,7 @@ import ( cid "github.com/ipfs/go-cid" "github.com/libp2p/go-libp2p/core/event" + "github.com/libp2p/go-libp2p/p2p/host/eventbus" "go.uber.org/zap" ) @@ -217,7 +218,7 @@ func (o *orbitDBAccessController) Load(ctx context.Context, address string) erro new(stores.EventWrite), new(stores.EventReady), new(stores.EventReplicated), - }) + }, eventbus.Name("odb/load")) if err != nil { return fmt.Errorf("unable subscribe to store events: %w", err) } diff --git a/baseorbitdb/orbitdb.go b/baseorbitdb/orbitdb.go index 98b85fc..5461242 100644 --- a/baseorbitdb/orbitdb.go +++ b/baseorbitdb/orbitdb.go @@ -813,7 +813,8 @@ func (o *orbitDB) EventBus() event.Bus { } func (o *orbitDB) monitorDirectChannel(ctx context.Context, bus event.Bus) error { - sub, err := bus.Subscribe(new(iface.EventPubSubPayload), eventbus.BufSize(128)) + sub, err := bus.Subscribe(new(iface.EventPubSubPayload), + eventbus.BufSize(128), eventbus.Name("odb/monitor-direct-channel")) if err != nil { return fmt.Errorf("unable to init pubsub subscriber: %w", err) } diff --git a/stores/basestore/base_store.go b/stores/basestore/base_store.go index 893c043..45880b8 100644 --- a/stores/basestore/base_store.go +++ b/stores/basestore/base_store.go @@ -268,7 +268,8 @@ func (b *BaseStore) InitBaseStore(ipfs coreapi.CoreAPI, identity *identityprovid b.options = options - sub, err := b.replicator.EventBus().Subscribe(replicator.Events, eventbus.BufSize(128)) + sub, err := b.replicator.EventBus().Subscribe(replicator.Events, + eventbus.BufSize(128), eventbus.Name("odb/base-store-main-loop")) if err != nil { return fmt.Errorf("unable to subscribe to replicator events: %w", err) } @@ -1008,7 +1009,7 @@ func (b *BaseStore) replicate() error { } func (b *BaseStore) storeListener(topic iface.PubSubTopic) error { - sub, err := b.EventBus().Subscribe(new(stores.EventWrite)) + sub, err := b.EventBus().Subscribe(new(stores.EventWrite), eventbus.Name("odb/store-listener")) if err != nil { return fmt.Errorf("unable to init event bus: %w", err) }