filecoinfilecoin-lotus

Can't import directory in filecoin lotus node


I am running a lotus client, but when I run:

lotus client import <path/to/directory>

I get:

ERROR: failed to import file using unixfs: failed to import file to store to compute root: read /home/patrick_alphachain_io/code/unstoppable-ui/unstoppable-ui-static-export: is a directory

Can we not upload directories like we can with IPFS? Is there a way to just upload an IPFS CID?


Solution

  • You can wrap your folder into a .car file and upload that to filecoin.

    You could use a tool like ipfs-car.

    yarn ipfs-car --pack /path/to/directory/ --output my-output.car
    

    And then upload that to filecoin

    lotus client import --car my-output.car