Skip to content

Commit

Permalink
fix(memory): update memory for build config for small ants
Browse files Browse the repository at this point in the history
  • Loading branch information
atticusofsparta committed Dec 7, 2024
1 parent 3d8ce22 commit 064a173
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"type": "module",
"scripts": {
"module:build": "cd src/common && ao build && mv process.wasm ../../tools/fixtures/process.wasm && cd ../..",
"module:publish": "cd src && ao publish process.wasm -w ../tools/key.json --tag=\"Memory-Limit\" --value=\"1-gb\" --tag=\"Compute-Limit\" --value=\"9000000000000\" && cd ..",
"module:publish": "ao publish tools/fixtures/process.wasm -w tools/key.json --tag=\"Memory-Limit\" --value=\"2-mb\" --tag=\"Compute-Limit\" --value=\"9000000000000\"",
"module:load": "node tools/load-module.mjs",
"module:spawn": "node tools/spawn-module.mjs",
"lint": "luacheck .",
Expand Down
3 changes: 3 additions & 0 deletions src/common/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
stack_size: 262144 # 0.25 mb
initial_memory: 524288 # 0.5 mb
maximum_memory: 2097152 # 2 mb
20 changes: 11 additions & 9 deletions tools/spawn-module.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import { connect, createDataItemSigner } from '@permaweb/aoconnect';
import fs from 'fs';
import path from 'path';
import Arweave from 'arweave';
import { fileURLToPath } from 'url';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const arweave = Arweave.init({
host: 'arweave.net',
Expand All @@ -12,7 +16,7 @@ const arweave = Arweave.init({
const ao = connect({
GATEWAY_URL: 'https://arweave.net',
});
const moduleId = 'ZUEIijxJlV3UgZS9c7to5cgW5EhyPdAndHqVZxig7vE';
const moduleId = 'jKPXUTVEjn-CIvTXvoRA9yibc1BjAZbC4tuxQjZBxS0';
const scheduler = '_GQ33BkPtZrqxA84vM8Zk-N2aO0toNNu_C-l-rawrBA';
// with logo process: dcodF0DbVdzvRPE5nDTULn4aagHYruKnW3ulFkPkQC0

Expand All @@ -21,14 +25,12 @@ async function main() {
const address = await arweave.wallets.jwkToAddress(JSON.parse(wallet));
const signer = createDataItemSigner(JSON.parse(wallet));

// const processId = await ao.spawn({
// module: moduleId,
// scheduler,
// signer,
// });
//const processId = 'AxHXaiKg7c4FAYZ5eo4OPAaEhmB0I0PRxLqzW6ZNHXk';
// aos process
const processId = 'YD1XXiKJq-R-ruODJk7u_c5dMtZEVsV_Nh687ZmSvDQ';
const processId = await ao.spawn({
module: moduleId,
scheduler,
signer,
});

//---------------
console.log('Process ID:', processId);
console.log('Waiting 20 seconds to ensure process is readied.');
Expand Down

0 comments on commit 064a173

Please sign in to comment.