Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix code syntax errors in loader #930

Merged
merged 1 commit into from
Jul 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 24 additions & 24 deletions loader/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ const env = {

// Create the handle function that executes the Wasm
const handle = await AoLoader(wasmBinary, {
format = "wasm32-unknown-emscripten2",
inputEncoding = "JSON-1",
outputEncoding = "JSON-1",
memoryLimit = "524288000", // in bytes
computeLimit = 9e12.toString(),
extensions = []
format: "wasm32-unknown-emscripten2",
inputEncoding: "JSON-1",
outputEncoding: "JSON-1",
memoryLimit: "524288000", // in bytes
computeLimit: 9e12.toString(),
extensions: []
});

// To spawn a process, pass null as the buffer
Expand All @@ -58,12 +58,12 @@ const result = await handle(null, {

```js
const options = {
format = "wasm32-unknown-emscripten2",
inputEncoding = "JSON-1",
outputEncoding = "JSON-1",
memoryLimit = "524288000", // in bytes
computeLimit = 9e12.toString(),
extensions = []
format: "wasm32-unknown-emscripten2",
inputEncoding: "JSON-1",
outputEncoding: "JSON-1",
memoryLimit: "524288000", // in bytes
computeLimit: 9e12.toString(),
extensions: []
}
const handle = await AoLoader(wasmBinary, options);
const buffer = await LoadFromCache();
Expand Down Expand Up @@ -96,12 +96,12 @@ import fs from "fs";
async function main() {
const wasmBinary = fs.readFileSync("process.wasm");
const options = {
format = "wasm32-unknown-emscripten2",
inputEncoding = "JSON-1",
outputEncoding = "JSON-1",
memoryLimit = "524288000", // in bytes
computeLimit = 9e12.toString(),
extensions = []
format: "wasm32-unknown-emscripten2",
inputEncoding: "JSON-1",
outputEncoding: "JSON-1",
memoryLimit: "524288000", // in bytes
computeLimit: 9e12.toString(),
extensions: []
}
const handle = AoLoader(wasmBinary, options);
const result = await handle(...);
Expand All @@ -121,12 +121,12 @@ async function main() {
const wasmBinary = await fetch(`https://arweave.net/${tx_id}`)
.then(res => res.arrayBuffer())
const options = {
format = "wasm32-unknown-emscripten2",
inputEncoding = "JSON-1",
outputEncoding = "JSON-1",
memoryLimit = "524288000", // in bytes
computeLimit = 9e12.toString(),
extensions = []
format: "wasm32-unknown-emscripten2",
inputEncoding: "JSON-1",
outputEncoding: "JSON-1",
memoryLimit: "524288000", // in bytes
computeLimit: 9e12.toString(),
extensions: []
}

const handle = AoLoader(wasmBinary, options);
Expand Down