Hi there, I feel uncertain about the wantlist in BitSwap, hope to get your help
the command " ipfs bitswap wantlist" is to show blocks currently on the wantlist, what command to set?
wantlist store blocks the peer want, could I set my node request and send all files in certain file path to wantlist? like: “/ipfs/xxxfiles/” or “/ipfs/<hash of xxxfiles>”, if some new files added to “xxxfiles” in my node, it could send to others who stored “xxxfiles” in it’s wantlist
Appreciate for your help!
Additional explanations:
I hope to use IPFS as a personal sync folder, like they said in white paper 3.8 2, only store and sync concerned datas, once any node add a file in, broadcast to others, how this achieved?
wantlists are an underlying detail that most users don’t need to interact with. They are part of how nodes request content from the network.
To retrieve content from the network (if you “want” that content), use commands like ipfs cat or ipfs get. Those will retrieve the content for you.
If you want to retrieve content onto your node and hold it there, use ipfs pin add. That will retrieve the content (if you don’t already have it on the node) and keep the content on your node until you un-pin it with ipfs pin rm.
is there a way to asynchronously put a hash inside the wantlist?
The reason is that ipfs get and ipfs pin add are waiting for the file to be added.
Is this a feature that maybe you are working on?
Thanks for reply
I hope to use IPFS as a personal sync folder, like they said in white paper 3.8 2, once any node add a file in, others will synchronize automatically, how this achieved, by wantlist set given folder?
IPFS doesn’t work that way. If you add a folder into IPFS, every time you change anything, you must re-add the folder as it will be under a different hash. This is really powerful actually.
But my point is to do pinning in a way that the command doesn’t have to wait for a peer to have the content, but can just add the hash in the wantlist and so, as soon as the content appears in the network it will be added.
Currently there is no way to passively ask for some content. Main reason for that is because you not really want to ask for just this one hash but also all the hashes that it references to. API calls/Commands lifetimes is how we handle it currently.
You can use ipfs refs -r or ipfs pin add and run them in background.
I found a reply by @flyingzumwalt that Tevere could achieve what i want.
localDB+IPFS, localDB store key-hash and changes(put, get, iterator), IPFS store values. and localDB keeps in sync with remote nodes.