Can't connect to fule node with rust sdk

use std::str::FromStr;

use fuels::prelude::{FuelService, Provider};
use fuels::{crypto::SecretKey, prelude::*};

async fn main() -> Result<()> {
    println!("Hello, world!");

    // Create a provider pointing to the testnet.
    let provider = Provider::connect("").await.unwrap();

    // Setup a private key
    let secret =

    // Create the wallet
    let wallet = WalletUnlocked::new_from_private_key(secret, Some(provider));

    println!("{}", wallet.address().to_string());

╰─$ cargo run 130 ↵
Compiling FuleRustScripts v0.1.0
warning: unused import: FuelService
→ src/
3 | use fuels::prelude::{FuelService, Provider};
| ^^^^^^^^^^^
= note: #[warn(unused_imports)] on by default

warning: crate FuleRustScripts should have a snake case name
= help: convert the identifier to snake case: fule_rust_scripts
= note: #[warn(non_snake_case)] on by default

warning: FuleRustScripts (bin “FuleRustScripts”) generated 2 warnings (run cargo fix --bin "FuleRustScripts" to apply 1 suggestion)
Finished dev [unoptimized + debuginfo] target(s) in 1.48s
Running target/debug/FuleRustScripts
Hello, world!
thread ‘main’ panicked at src/
called Result::unwrap() on an Err value: IO("Server returned 404 Not Found: ")
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace


fuels = “0.64.0”
tokio = { version = “1”, features = [“full”] }

Hey @markwh1te, thanks for pointing it out. The Provider is trying to connect to the wrong URL, the beta-5 network is deprecated and thus its having problems with the connectivity. The correct node URL is lmk how it goes

@Nazeeh21 Thank you, it’s working perfectly!
By the way, may I ask if there is any way I can contribute to the documentation? I would like to correct this error in the docs.

1 Like

If you’re interested, you can make the PR to this repo by following the contribution guide

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