Provider::connect(RPC) error on 0.56v fuels-rs

Hi all, I want to switch to version 56 of fuels-rs for my script and have encountered this problem. My code

use dotenv::dotenv;
use fuels::prelude::{Provider, WalletUnlocked};
use src20_sdk::{constants::RPC, print_title, token_utils::deploy_token_contract};

#[tokio::main]
async fn main() {
    print_title("Deploy");

    dotenv().ok();
    let provider = Provider::connect(RPC).await.unwrap();
    let secret = std::env::var("ADMIN").unwrap();
    let wallet =
        WalletUnlocked::new_from_private_key(secret.parse().unwrap(), Some(provider.clone()));

    let contract = deploy_token_contract(&wallet).await;
    println!(
        "The token contract has been deployed {}\n",
        contract.contract_id().hash
    );
}
pub const RPC: &str = "beta-5.fuel.network";

Cargo.toml:

[dependencies]
dotenv = "0.15.0"
fuels = { version = "0.56.0", features = ["fuel-core-lib"] }
rand = "0.8.5"
serde = "1.0.197"
serde_json = "1.0.114"
sha2 = "0.10.8"
tai64 = "4.0.0"
tokio = { version = "1.12", features = ["full"] }

Error when running the script:

🏁 Deploy 🏁 


thread 'main' panicked at scripts/deploy.rs:10:49:
called `Result::unwrap()` on an `Err` value: Provider("Server returned 404 Not Found: ")
stack backtrace:
   0: rust_begin_unwind
             at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/std/src/panicking.rs:647:5
   1: core::panicking::panic_fmt
             at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/core/src/panicking.rs:72:14
   2: core::result::unwrap_failed
             at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/core/src/result.rs:1649:5
   3: core::result::Result<T,E>::unwrap
             at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/core/src/result.rs:1073:23
   4: deploy::main::{{closure}}
             at ./scripts/deploy.rs:10:20
   5: tokio::runtime::park::CachedParkThread::block_on::{{closure}}
             at /Users/master/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/runtime/park.rs:281:63
   6: tokio::runtime::coop::with_budget
             at /Users/master/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/runtime/coop.rs:107:5
   7: tokio::runtime::coop::budget
             at /Users/master/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/runtime/coop.rs:73:5
   8: tokio::runtime::park::CachedParkThread::block_on
             at /Users/master/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/runtime/park.rs:281:31
   9: tokio::runtime::context::blocking::BlockingRegionGuard::block_on
             at /Users/master/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/runtime/context/blocking.rs:66:9
  10: tokio::runtime::scheduler::multi_thread::MultiThread::block_on::{{closure}}
             at /Users/master/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/runtime/scheduler/multi_thread/mod.rs:87:13
  11: tokio::runtime::context::runtime::enter_runtime
             at /Users/master/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/runtime/context/runtime.rs:65:16
  12: tokio::runtime::scheduler::multi_thread::MultiThread::block_on
             at /Users/master/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/runtime/scheduler/multi_thread/mod.rs:86:9
  13: tokio::runtime::runtime::Runtime::block_on
             at /Users/master/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/runtime/runtime.rs:351:45
  14: deploy::main
             at ./scripts/deploy.rs:16:5
  15: core::ops::function::FnOnce::call_once
             at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
`
1 Like

fuels-rs: 0.56.0 is using fuel-core: 0.23.0 so it is not compatible with beta-5 which uses fuel-core: 0.22.4

If you have any specific feature from 0.56.0 you need we could try to add it to 0.55

2 Likes

great code on fuel…deploy

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.