permaweb / ao

The ao component and tools Monorepo - šŸ° šŸ•³ļø šŸ‘ˆ
https://cookbook_ao.arweave.dev
Other
190 stars 63 forks source link

`ao bundler fund` (possibly) needs to fund bundler with Turbo creds, in order to perform uploads >100kb #1000

Open av1ctor opened 2 months ago

av1ctor commented 2 months ago

Version: 0.1.3

Hi. I'm trying to publish a simple wasm file (written in lua) and I'm getting this error:

ao publish process.wasm --wallet ../arweave-keyfile.json

bigint: Failed to load bindings, pure JS will be used (try npm run rebuild?) undefined:1
Insufficient balance
^

SyntaxError: Unexpected token I in JSON at position 0 at JSON.parse () at parseJSONFromBytes (node:internal/deps/undici/undici:6662:19) at successSteps (node:internal/deps/undici/undici:6636:27) at node:internal/deps/undici/undici:1236:60 at node:internal/process/task_queues:140:7 at AsyncResource.runInAsyncScope (node:async_hooks:203:9) at AsyncResource.runMicrotask (node:internal/process/task_queues:137:8) at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v18.17.0

If I try to add funds, this happens:

ao bundler fund 100000000 -w ../arweave-keyfile.json

bigint: Failed to load bindings, pure JS will be used (try npm run rebuild?) up.arweave.net is 100% subsidized and requires no funding

If I try to pass irys.xyz as the bundler, it will keep using up.arweave.net instead:

ao bundler fund 100000000 -w ../arweave-keyfile.json -b "https://irys.xyz"

bigint: Failed to load bindings, pure JS will be used (try npm run rebuild?) up.arweave.net is 100% subsidized and requires no funding

Btw, process.wasm is around 450kb. I tried with a 10kb file and publish worked fine.

Thanks in advance!

TillaTheHun0 commented 2 months ago

Hey @av1ctor, thanks for reporting.

Yep you're running into something stale: up.arweave.net is no longer 100% subsidized for transactions larger than, I believe, 100kb. I that case, I think your wallet will either need to have AR, or will need Turbo creds funded via ArDrive, in order to upload via up.arweave.net.

We will need to update that copy, as well as adapt bundler fund -- i'm honestly not sure what would be most kosher behavior, will need to check with the ArDrive team.

Sorry about this, we will need to get it fixed.

av1ctor commented 2 months ago

@TillaTheHun0 My wallet had AR but no Turbo credits. Adding Turbo credits using ArDrive fixed it. Thanks!

av1ctor commented 2 months ago

@TillaTheHun0 If think the bundler can't be changed because the field name is wrong at https://github.com/permaweb/ao/blob/d3704747e08a2bc53c854578cc30ad33d0ea2bfb/dev-cli/src/commands/publish.js#L52

Shouldn't the correct field name be "bundler" and not "host"?

TillaTheHun0 commented 2 months ago

@av1ctor doh, that's definitely part of it. We will need to get it fixed.

Thanks for your patience and looking into this further.

av1ctor commented 2 months ago

@TillaTheHun0, thanks again!

I opened the PR #1005 to fix this issue.