GithubHelp home page GithubHelp logo

Comments (10)

CalebEverett avatar CalebEverett commented on July 22, 2024 1

ok - is the endpoint down, or is it timing out because of too many concurrent requests? I'll take a look and handle the error.

from arloader.

CalebEverett avatar CalebEverett commented on July 22, 2024 1

Hi - yes that is right - the arloader.io endpoint only works with main net. Since there is no Arweave testnet, all the transactions have to be paid for and so real sol has to be used. I usually test with a small number of ar files just on mainnet since the absolute cost of uploads to arweave is low.

from arloader.

CalebEverett avatar CalebEverett commented on July 22, 2024 1

@ozgrakkurt Ok, I added an error there that contains the unspecified network status code. Up on master now - v0.1.60 building

return Err(Error::ArweaveNetworkError(other_status));

from arloader.

ozgrakkurt avatar ozgrakkurt commented on July 22, 2024

we are calling https://arweave.net/ so it should be up I think. also we aren't making concurrent requests it is only one

from arloader.

enzotar avatar enzotar commented on July 22, 2024

Here is the code used for the call. Also had a question about running tests with Solana Testnet or Devnet: we can only make it work paying with Arweave and not Sol, hence the match in the code below. Are we doing something wrong? Can move this to a separate issue if you want.

 let (arweave, mut status) = match ctx.solana_net {
            SolanaNet::Mainnet => {
                let arweave = Arweave {
                    name: String::from("arweave"),
                    units: String::from("sol"),
                    base_url: url::Url::parse("https://arweave.net/").unwrap(),
                    crypto: arloader::crypto::Provider::from_keypair_path(arweave_key_path.into())
                        .await?,
                };

                let price_terms = arweave.get_price_terms(reward_mult).await?;

                let status = arweave
                    .upload_file_from_path_with_sol(
                        file_path.into(),
                        None,
                        None,
                        None,
                        price_terms,
                        ctx.solana_net.url(),
                        url::Url::parse("https://arloader.io/sol").unwrap(),
                        &fee_payer,
                    )
                    .await?;

                (arweave, status)
            }
            _ => {
                let arweave = Arweave {
                    name: String::from("arweave"),
                    units: String::from("winstons"),
                    base_url: url::Url::parse("https://arweave.net/").unwrap(),
                    crypto: arloader::crypto::Provider::from_keypair_path(arweave_key_path.into())
                        .await?,
                };

                let price_terms = arweave.get_price_terms(reward_mult).await?;

                let status = arweave
                    .upload_file_from_path(file_path.into(), None, None, None, price_terms)
                    .await?;

                (arweave, status)
            }
        };

        loop {
            match status.status {
                StatusCode::Confirmed => break,
                StatusCode::NotFound => {
                    return Err(Error::ArweaveTxNotFound(status.id.to_string()))
                }
                StatusCode::Submitted | StatusCode::Pending => {
                    tokio::time::sleep(Duration::from_secs(1)).await;
                    status = arweave.get_status(&status.id).await?;
                }
            }
        }

from arloader.

CalebEverett avatar CalebEverett commented on July 22, 2024

we are calling https://arweave.net/ so it should be up I think. also we aren't making concurrent requests it is only one

ok - I can add an error there that indicates there was a problem with the network.

from arloader.

ozgrakkurt avatar ozgrakkurt commented on July 22, 2024

thanks!

from arloader.

ozgrakkurt avatar ozgrakkurt commented on July 22, 2024

Here is the code used for the call. Also had a question about running tests with Solana Testnet or Devnet: we can only make it work paying with Arweave and not Sol, hence the match in the code below. Are we doing something wrong? Can move this to a separate issue if you want.

 let (arweave, mut status) = match ctx.solana_net {
            SolanaNet::Mainnet => {
                let arweave = Arweave {
                    name: String::from("arweave"),
                    units: String::from("sol"),
                    base_url: url::Url::parse("https://arweave.net/").unwrap(),
                    crypto: arloader::crypto::Provider::from_keypair_path(arweave_key_path.into())
                        .await?,
                };

                let price_terms = arweave.get_price_terms(reward_mult).await?;

                let status = arweave
                    .upload_file_from_path_with_sol(
                        file_path.into(),
                        None,
                        None,
                        None,
                        price_terms,
                        ctx.solana_net.url(),
                        url::Url::parse("https://arloader.io/sol").unwrap(),
                        &fee_payer,
                    )
                    .await?;

                (arweave, status)
            }
            _ => {
                let arweave = Arweave {
                    name: String::from("arweave"),
                    units: String::from("winstons"),
                    base_url: url::Url::parse("https://arweave.net/").unwrap(),
                    crypto: arloader::crypto::Provider::from_keypair_path(arweave_key_path.into())
                        .await?,
                };

                let price_terms = arweave.get_price_terms(reward_mult).await?;

                let status = arweave
                    .upload_file_from_path(file_path.into(), None, None, None, price_terms)
                    .await?;

                (arweave, status)
            }
        };

        loop {
            match status.status {
                StatusCode::Confirmed => break,
                StatusCode::NotFound => {
                    return Err(Error::ArweaveTxNotFound(status.id.to_string()))
                }
                StatusCode::Submitted | StatusCode::Pending => {
                    tokio::time::sleep(Duration::from_secs(1)).await;
                    status = arweave.get_status(&status.id).await?;
                }
            }
        }

@CalebEverett if we execute this code we get ArweaveTxNotFound error. Is there any reason that can be seen from the code why this would happen?

from arloader.

CalebEverett avatar CalebEverett commented on July 22, 2024

@ozgrakkurt maybe check to make sure the wallet balance is sufficient - also make sure the reward is high enough. I think if the balance is not high enough, it wouldn't get submitted to arloader.io endpoint, but if the reward is not high enough it will be not found. Also maybe check the id after some time at arweave.net, just to make sure it isn't resulting from a network delay.

from arloader.

ozgrakkurt avatar ozgrakkurt commented on July 22, 2024

thanks!

from arloader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.