metaplex-foundation / umi

A Solana Framework for JS Clients.
https://umi.typedoc.metaplex.com
MIT License
151 stars 47 forks source link

IrysUploader URI doesn't exists #150

Open sineus opened 1 week ago

sineus commented 1 week ago

After downloading, I have a URI like arweave.net/{:id} but it doesn't work... What can I do? Has Arweave changed the composition of its URLs?

Create umi instance with IrysUploader

const connection = new Connection(RPC);

const umi = createUmi(connection)
  .use(mplCore())
  .use(
    irysUploader({
      timeout: 60000,
    })
  );

const keypair = umi.eddsa.createKeypairFromSecretKey(
  new Uint8Array(SOLANA_WALLET)
);
const signer = createSignerFromKeypair(umi, keypair);

umi.use(signerIdentity(signer));

Get uploaded file and create generic file to upload with umi uploader adapter

const fileBuffer = readFileSync(req.file.path);
    const filename = req.file.originalname;
    const extension = extname(filename);
    const contentType = req.file.mimetype;

    const [uri] = await umi.uploader.upload([
      createGenericFile(fileBuffer, filename, {
        contentType,
        extension,
      }),
    ]);

Then, I get URI like https://arweave.net/{:id} but when I access it, arweave tells me the URL doesn't exist...

See this PR

luke-mjtd commented 6 days ago

I have the same issue. I've tried to replace https://arweave.net/<id> with https://gateway.irys.xyz/<id> and it seems to work as it's referenced in the PR linked above. Waiting for the PR approval to remove my workaround.

mikhd commented 6 days ago

Experiencing the same issue on the devnet, gateway.irys.xyz urls work, whereas arweave.net from umi doesn't.