-
Notifications
You must be signed in to change notification settings - Fork 37
Examples of connecting js-ipld to a local IPFS node? #295
Comments
Hi @jeffkhull. The JavaScript implementation of IPLD encountered a lot of changes over the past year and we are moving towards smaller building blocks that concentrate on the core of IPLD, e.g. codecs. The "new hot stuff" is currently here: https://github.com/multiformats/js-multiformats You would then use those building blocks and assemble them as you need. In your case it could be something like you use js-multiformats to encode your data and then use the IPFS Block API to actually store it in IPFS. In regards to IPLD Schema validation, your best bet is https://github.com/rvagg/js-ipld-schema-validator, though I don't know how up to date it is (it worked for me last time I used it though). I currently work on getting js-ipfs-unixfs to use the new js-multiformats stuff, so for you it might be helpful at looking at the code changes (especially the tests) I've done here: ipfs/js-ipfs-unixfs#116 |
Hey @vmx , thanks for the above info. I have been researching and trying out various libraries for a "simple" way to interact with IPFS using ipld schemas, and so far a combination of The next challenge I need to figure out is how to allow "entities" in the linked data graph to be mutable. So that people can edit entity content like wikipedia, and add links to other entities, I think I need mutability. However, I have no idea how to do this. I see "mutable filesystem (MFS)" on the IPFS docs pages, but I'm not sure if this is the right solution or not. As you are of course much more familiar with these technologies than I am, I was wondering if you might point me in the right direction for libraries I can use to mutate nodes in a linked data graph, yet preserve links to other data? |
@jeffkhull you can decode the blocks, manipulate the decoded data manually (directly in JS) and then encode and store them again. Though, is what you are asking for about also updating blocks that depend of each other? Let's say you have a link from block |
Hey @vmx, yes exactly, A would need to then automatically point to C. I was just reading about IPNS... would using IPNS to resolve entities be the answer? |
Hi, thanks for this library! I am trying to get started with IPLD, basic reading and writing to the network.... Is there a code sample that shows how to connect to a local node, write data, and read data? Also, is there a way to set up IPLD schemas to constrain the shape of the objects being written?
The text was updated successfully, but these errors were encountered: