https://github.com/zot/textcraft-treerequest
IPFS protocol for requesting trees directly from peers
https://github.com/zot/textcraft-treerequest
Last synced: 5 months ago
JSON representation
IPFS protocol for requesting trees directly from peers
- Host: GitHub
- URL: https://github.com/zot/textcraft-treerequest
- Owner: zot
- License: mit
- Created: 2020-08-04T20:01:23.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-08-30T23:47:37.000Z (over 5 years ago)
- Last Synced: 2025-04-15T02:45:53.633Z (12 months ago)
- Language: Go
- Size: 209 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Treerequest, a libp2p protocol implementation for requesting trees directly from other peers
A block request protocol for ipfs
Each peer can provide a set of persistent root nodes and their children.
Other peers can ask for the CIDs of the trees and also any of the blocks.
Access can be restricted to a set of peers.
Known tree CIDs are stored in the data store you provide.
For convenience, there are http services to access the trees given a prefix you provide that
handle GET and (for your own peer) PUT requests with optional encryption for a provided URL prefix:
```
unencrypted access: /PREFIX/PEERID/PATH
encrypted access (only for your peer's files): /PREFIX/PATH
```
Before using the package, you must call InitTreeRequest().
IPFS-lite works well with TreeRequest and provides all of the required values for InitTreeRequest():
```
ipfslite.BadgerDatastore(PATH) returns a ds.Datastore
(*ipfslite.Peer).BlockStore() returns a blockstore.Blockstore
*ipfslite.Peer implements ipld.DAGService
(*ipfslite.Peer).Session(CTX) returns an ipld.NodeGetter
```