Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tutorial: modfiying one file out of a giant set without pulling the whole set #21

Open
flyingzumwalt opened this issue May 11, 2017 · 1 comment

Comments

@flyingzumwalt
Copy link
Collaborator

modfiying one file out of a giant set without pulling the whole set
steps:

  1. get the hash
  2. grab the file you're going ot change withfiles api
  3. modify the file
  4. add the modified file to ipfs
  5. get the new root hash of the modified dataset
@Kubuxu
Copy link

Kubuxu commented May 11, 2017

  1. get the hash
    DATASET_HASH=Qm...AAA
  2. grab the file you're going to change
    ipfs cat $DATASET_HASH/dir/change > change
  3. modify the file
    sed -e '...' change > new_change
  4. add the modified file to ipfs
    NEW_CHANGE=$(ipfs add -Q new_change)
  5. add link to the dataset to the Files API (Files API is virtual)
    ipfs files cp /ipfs/$DATASET_HASH /location the /ipfs/ prefix for the hash is required
  6. remove old file from the dataset
    ipfs files rm /location/dir/change
  7. put changed file to the dataset
    ipfs files cp /ipfs/$NEW_CHANGE /location/dir/change
  8. get the new root hash of the modified datase
    ipfs files stat --hash /location

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants