-
Notifications
You must be signed in to change notification settings - Fork 5
/
deploy.js
35 lines (32 loc) · 1.15 KB
/
deploy.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { TurboFactory, ArweaveSigner } from '@ardrive/turbo-sdk';
import fs from "fs";
import path from 'path';
// load Arweave wallet
const wallet = JSON.parse(
fs.readFileSync(process.env.WALLET, 'utf-8')
);
const main = async () => {
const signer = new ArweaveSigner(wallet);
const turbo = TurboFactory.authenticated({ signer });
const _file = path.resolve('./aos/process/process.wasm')
const receipt = await turbo.uploadFile({
fileSizeFactory: () => fs.statSync(_file).size,
fileStreamFactory: () => fs.createReadStream(_file),
dataItemOpts: {
tags: [
{ name: 'Content-Type', value: 'application/wasm' },
{ name: 'Data-Protocol', value: 'ao' },
{ name: 'Type', value: 'Module' },
{ name: 'Variant', value: 'ao.TN.1' },
{ name: 'Module-Format', value: 'wasm64-unknown-emscripten-draft_2024_02_15' },
{ name: 'Input-Encoding', value: 'JSON-1' },
{ name: 'Output-Encoding', value: 'JSON-1' },
{ name: 'Memory-Limit', value: '1-gb' },
{ name: 'Compute-Limit', value: '9000000000000' }
]
}
});
console.log(receipt);
console.log('ModuleID: ', receipt.id)
}
main()