mediachain / oldchain-client

[DEPRECATED] old mediachain client experiments
MIT License
4 stars 2 forks source link

add hash_only arg to datastore.put, and Writer.init, #99

Closed yusefnapora closed 8 years ago

yusefnapora commented 8 years ago

this adds a hash_only arg to the put method of the ipfs and rpc datastores (defaults to False, of course). This lets us skip the expensive ipfs DHT advertisement, etc when doing bulk ingestions but still get an ipfs hash that will resolve if we go back through and add the asset later.

To use it when ingesting things, the Writer should be initialized with the only_hash_assets arg set to True

also fixes a couple small things I discovered in the repl while adding this:

parkan commented 8 years ago

Given that announce/provide is the expensive step, this should get replaced with the --local flag as soon as support is added on the IPFS side so we get the files stored in the repo.

parkan commented 8 years ago

overall lgtm

yusefnapora commented 8 years ago

Maybe I should change the argument from only_hash_assets to local_ipfs or something? then we can swap out the implementation with ipfs add --local when that lands.

parkan commented 8 years ago

sounds good