mediachain / aleph

א: The mediachain universe manipulation engine
MIT License
38 stars 16 forks source link

Batch data object fetching for mcclient #123

Closed yusefnapora closed 7 years ago

yusefnapora commented 7 years ago

Adds support for the batch get support added in https://github.com/mediachain/concat/pull/100

The mcclient data get command now accepts multiple keys and will fetch them with the batch interface.

Right now it prints the returned objects directly to the console one after another; I'm torn on whether we should wrap them in an array literal first, so that the entire output would be valid JSON.

vyzo commented 7 years ago

It fails to handle null data objects correctly -- these are returned by the batch interface when the object is not found in the datastore:

$ cat /tmp/non-existent-key 
QmeBkfxcaBfA9pvzivRwhF2PM7sXpp4HHQbp7jfTkRCWEa
$ mcclient getData QmeBkfxcaBfA9pvzivRwhF2PM7sXpp4HHQbp7jfTkRCWEa
First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.