diff --git a/package.json b/package.json index 906d914..7c1f6f8 100644 --- a/package.json +++ b/package.json @@ -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 .", diff --git a/src/common/config.yml b/src/common/config.yml new file mode 100644 index 0000000..a692ca2 --- /dev/null +++ b/src/common/config.yml @@ -0,0 +1,3 @@ +stack_size: 262144 # 0.25 mb +initial_memory: 524288 # 0.5 mb +maximum_memory: 2097152 # 2 mb diff --git a/tools/spawn-module.mjs b/tools/spawn-module.mjs index 6e355ae..532b3da 100644 --- a/tools/spawn-module.mjs +++ b/tools/spawn-module.mjs @@ -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', @@ -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 @@ -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.');