i installed the blockstack via pip and noticed that there are getFile and putFile functionality there as well as blockstack.js but i can’t find the required field t successfully get or put a file.
can you recommend a tutorial that use CLI to upload and download files or how I can find the datastore id and other parameters that are required by this command?
thank you @moxiegirl for your reply. i already created an app that uses blockstack.js to put and get files but i need to do the same function from nodeJs server (without any browser).
This is not an officially support method as far as I know, but with the authResponseToken and identityAddress, here’s a code snippet that will work in Node:
var request = require("request");
var options = { method: 'POST',
url: 'https://hub.blockstack.org/store/' + identityAddress + filename,
headers:
{
Authorization: 'bearer v1:' + authResponseToken,
'Content-Type': 'application/octet-stream' },
body: '{\n\t"title": "Test"\n}'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});