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

ArweaveJS worked two weeks ago, but suddenly showing an error now. #145

Closed
IntelMin opened this issue Apr 19, 2022 · 3 comments
Closed

ArweaveJS worked two weeks ago, but suddenly showing an error now. #145

IntelMin opened this issue Apr 19, 2022 · 3 comments

Comments

@IntelMin
Copy link

I have run the following codes to upload a text file to Arweave storage:

  const arweave = Arweave.init({
    host: 'arweave.net',// Hostname or IP address for a Arweave host
    port: 443,          // Port
    protocol: 'https',  // Network protocol http or https
    timeout: 20000,     // Network request timeouts in milliseconds
    logging: false,     // Enable network request logging
  });
  
  const key = await arweave.wallets.generate();
  const transaction = await arweave.createTransaction({ data }, key);
  transaction.addTag('Content-Type', 'text/plain');
  await arweave.transactions.sign(transaction, key);

  let uploader = await arweave.transactions.getUploader(transaction);
  log.info(`Uploading files to Arweave...`);
  while (!uploader.isComplete) {
    await uploader.uploadChunk();
    log.info(`${uploader.pctComplete}% complete, ${uploader.uploadedChunks}/${uploader.totalChunks}`);
  }
  log.info(`\nContent added with TxID: ${transaction.id}`);

Got this error:

Error: Unable to upload transaction: 400, Bad Request
    at TransactionUploader.postTransaction (E:\arweave-upload\src\common\lib\transaction-uploader.ts:283:13)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async TransactionUploader.uploadChunk (E:\arweave-upload\src\common\lib\transaction-uploader.ts:126:7)
    at async saveToArweave (E:\arweave-upload\src\uploads\arweave.ts:38:5)
    at async Command.action (E:\arweave-upload\src\commands\swarm.ts:45:17)

It worked two weeks ago, but suddenly producing that error today.

What happened to arweave?

@rosmcmahon
Copy link
Member

nothing has changed with the library. it's working as it should.

what has changed recently is that the arweave.net gateway is now returning errors that have been passed to it by the protocol nodes when invalid transactions are posted to them.

you are using a generated wallet which:

  1. contains no AR balance for the storage fee
  2. doesn't exist in the protocol

i suggest you check if your previous transactions are actually stored on the permaweb. you can do this using a block explorer, or by checking the tx status via the endpoint:

https://arweave.net/tx/YOUR-TXID/status

if you need more clarification, please visit the #gateway channel in the Dev Discord server

i'm marking this as closed, thanks!

@IntelMin
Copy link
Author

So I should have a balance to upload data to storage?
Is there any way to upload data for free like on filecoin?

@rosmcmahon
Copy link
Member

Someone is always paying for you.
There is an initiative for files up to 300kb. You can ask in the Dev server for more info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants