Giter Club home page Giter Club logo

Comments (3)

laurentsenta avatar laurentsenta commented on June 4, 2024 2

@lidel I took the opportunity to learn about IPLD and car files,

Made a PR in ipld/go-car#457
Which enabled: #85

This is the code I use to generate the car files:

dd if=/dev/urandom of="file-3k-and-3-blocks.bin" bs=1024 count=3
CID=$(ipfs add ./file-3k-and-3-blocks.bin --chunker=size-1024 -q)
ipfs dag export $CID > file-3k-and-3-blocks.car
REMOVE_BLOCK=$(ipfs dag get $CID | jq '.Links[1].Hash["/"]' -r)
echo $REMOVE_BLOCK | car filter --version 1 --inverse ./file-3k-and-3-blocks.car ./file-3k-and-3-blocks-missing-block.car 

Let me know if that works for you!

from gateway-conformance.

lidel avatar lidel commented on June 4, 2024 1

Thank you @laurentsenta, this ability to filter CAR contents per CID is great addition to our CAR tooling ❤️

from gateway-conformance.

lidel avatar lidel commented on June 4, 2024

As for logistics, we could write custom go code, or it is possible to do it semi-manually with two Kubo repos: create big file from /dev/urandom, then export individual blocks via ipfs block get (from node being offline) and then on second node import them via ipfs block put and create dag-cbor envelope document that links to these CIDs (json → ipfs dag put), and then do ipfs dag export of the DAG of the envelope → produced .car fixture will only have 2 blocks, and the rest of the original DAG won't ever be available.

from gateway-conformance.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.