Go-ds-crdt: A distributed key-value store implementation for IPFS

Thanks for the prompt and very thorough response @hector! This indeed answers a lot for me!

In my specific case, I’m actually trying to scaffold some minor things (the least possible stuff needed to interact with the network). Currently I’m using go-ds-crdt as the DB layer and basically just bootstrapping my own libp2p host and DHT (looking at how Kubo builds and configures it, as reference).

I’m then trying to connect to my own ipfs daemon node as a bootstrap node of my libp2p small application. That works fine, and I can see both connections are setup properly and also the bitswap protocol is supported. However, when putting blocks to the crdt store from my app, the blocks are not fetchable from ipfs daemon (ipfs block get $cid hangs).

Maybe I’m doing something wrong or misinterpreting how everything is supposed to be glued together. In terms of the DAGService, I’m using merkledag.DagService and not using ipfs-lite (which has some upgrade issues and limitations too).

The high-level code of setting everything up looks a bit like this:

bs := blockstore.NewBlockstore(sync.MutexWrap(datastore.NewMapDatastore()))
network := bitswapnet.NewFromIpfsHost(host, routing)
exchange := bitswap.New(ctx, network, bs, bitswap.ProvideEnabled(true))
blsrv := blockservice.New(bs, exchange)
dag := merkledag.NewDAGService(blsrv)

And the bitswap stat looks like this after I try accessing the cid from the daemon’
s web UI:

bitswap status
	provides buffer: 0 / 256
	blocks received: 0
	blocks sent: 0
	data received: 0
	data sent: 0
	dup blocks received: 0
	dup data received: 0
	wantlist [1 keys]
		bafybeiaiv6b5bo5hkwehvrm2ppyzkqs6kmkynfyb2w2iqcuugklmmkhali
	partners [2]

Hope that clears the scenario for you to understand it a little bit better. Thanks!