upload_archive_to_liquidstorage
Upload packaged archive and have it pinned
1
import { getClient } from "./client";
2
const fs = require("fs");
3
​
4
(async () => {
5
const service = await (await getClient()).service('storage', "5jqee4kl1ns1");
6
const key = "5J5hLqZrc3DvURBtwapKjpYH676QMmoZvFUy2NGkyeYv4ZuxxhK";
7
const permission = "active";
8
const path = __dirname + "/../../../../test/utils/YourTarBall.tar";
9
const content = fs.readFileSync(path);
10
const options = {
11
rawLeaves: true
12
};
13
const result = await service.upload_public_archive(
14
content,
15
key,
16
permission,
17
'tar',
18
null,
19
options
20
);
21
console.log(`uri: ${result.uri}`);
22
})().catch((e) => { console.log(e); });
23
​
Copied!
Last modified 9mo ago
Copy link