# Help With Rudimentary IPFS DHT Use

**URL:** <https://discuss.ipfs.tech/t/help-with-rudimentary-ipfs-dht-use/3304>\
**Category:** Help\
**Tags:** go-ipfs\
**Created:** [July 1, 2018, 6:21pm UTC](https://discuss.ipfs.tech/t/help-with-rudimentary-ipfs-dht-use/3304 "2018-07-01T18:21:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cretz](https://avatars.discourse-cdn.com/v4/letter/c/d2c977/32.png) [@cretz](https://discuss.ipfs.tech/u/cretz)\
**Post date:** [July 1, 2018, 6:21pm UTC](https://discuss.ipfs.tech/t/help-with-rudimentary-ipfs-dht-use/3304/1 "2018-07-01T18:21:46Z")

</div>

I am wanting to leverage the IPFS DHT (and existing nodes) with as little of the rest of the IPFS infrastructure as possible. Specifically, I want to use `go-libp2p-kad-dht` to “provide” a cid I have made to the existing network, and then be able to find providers on it later. I don’t want an IPFS filestore I would love to stay only in the libp2p libs if I can. I also want to use my own transport impl, but that bit of information is unimportant for this question.

I have created libp2p host w/ random identity, default peer store, etc and used that and a simple map datastore to instantiate the DHT. Of course, when I attempt to broadcast a provided CID, I get told there are no peers. When calling Bootstrap I see nothing happening and I know based on my own personal Kademlia impls that I need at least one peer hardcoded.

I am finding very little information on doing this. Can anyone help w/ a simple set of code for instantiating a DHT on the existing IPFS DHT and providing a CID? Where are the bootstrap nodes hardcoded? Do I need to set them in my “peerstore” before constructing the DHT? Any help is appreciated as wading through just the libp2p code and/or the ipfs core code is taking me a lot of time right now. Even the test cases which make local peers aren’t really helping me with starting a bootstrap (some use private APIs anyways).

Also, please move this to the proper category if this is not it. Or please let me know a better way to get assistance on a simple DHT setup. Thanks in advance.

---

<div class="post-metadata">

**Author:** ![stebalien](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/stebalien/32/156_2.png) [@stebalien](https://discuss.ipfs.tech/u/stebalien)\
**Post date:** [July 2, 2018, 10:43pm UTC](https://discuss.ipfs.tech/t/help-with-rudimentary-ipfs-dht-use/3304/2 "2018-07-02T22:43:35Z")

</div>

> <https://github.com/libp2p/go-libp2p/pull/302>

florian is has also been working on developing a separate “bootstrap” module to make this simpler but I’ve been having trouble finding time to properly review it.

---

<div class="post-metadata">

**Author:** ![cretz](https://avatars.discourse-cdn.com/v4/letter/c/d2c977/32.png) [@cretz](https://discuss.ipfs.tech/u/cretz)\
**Post date:** [July 3, 2018, 1:59pm UTC](https://discuss.ipfs.tech/t/help-with-rudimentary-ipfs-dht-use/3304/3 "2018-07-03T13:59:58Z")

</div>

Thanks for this, especially those node addresses. I will work from here on using that host in the DHT and report back. I would also appreciate any examples of simple uses of `go-libp2p-kad-dht` but this is definitely enough to get me over the initial hurdle (I was about to do the full IPFS node bootstrap and work backwards killing deps).

---

<div class="post-metadata">

**Author:** ![cretz](https://avatars.discourse-cdn.com/v4/letter/c/d2c977/32.png) [@cretz](https://discuss.ipfs.tech/u/cretz)\
**Post date:** [July 5, 2018, 11:28pm UTC](https://discuss.ipfs.tech/t/help-with-rudimentary-ipfs-dht-use/3304/4 "2018-07-05T23:28:48Z")

</div>

Ok, I worked through my bootstrapping issues, custom transport issues, etc and got a PoC up. I opened up another thread: [Anonymous DHT Proof-of-Concept Using libp2p and Tor](https://discuss.ipfs.tech/t/anonymous-dht-proof-of-concept-using-libp2p-and-tor/3331). Thanks for the help, this example and [https://github.com/libp2p/go-libp2p/pull/278](https://github.com/libp2p/go-libp2p/pull/278) were very helpful.
