celestia-node
celestia-node copied to clipboard
feat(blob): blobsub
Introduces blob.Subscribe
. Takes a share.Namespace
, returns a <-chan *BlobsubResponse
containing a height uint64
and blobs []*blob.Blob
.
I made the decision to not support subscribing to multiple namespaces with one call, because the complexity of the return type mitigates the benefits for the client. It is likely more convenient to have one subscription per namespace:
Imagine you are watching two namespaces for different things. On the client side, you would have a select
statement reading from the two channels in two cases. This is cleaner than receiving everything in one case, but then having to manually parse and send to the respective handlers yourself.
TODO:
- [ ] Unit tests
- [ ] Mockgen
- [ ] Document w @jcstein