fuels = { version = “0.56.0”, features = [“fuel-core-lib”] }
tokio = { version = “1.28.2”, default-features = false }
This is the demo on the official website:
#[tokio::main]
async fn main(){
use std::str::FromStr;
use fuels::{accounts::{fuel_crypto::SecretKey,wallet::WalletUnlocked}, prelude::*};
// Create a provider pointing to the testnet.
let provider = Provider::connect(“beta-5.fuel.network”).await.unwrap();
// Setup a private key
let secret =
SecretKey::from_str(“a1447cd75accc6b71a976fd3401a1f6ce318d27ba660b0315ee6ac347bf39568”)
.unwrap();
// Create the wallet
let wallet = WalletUnlocked::new_from_private_key(secret, Some(provider));
// Get the wallet address. Used later with the faucet
dbg!(wallet.address().to_string());
}
The error is as follows:
thread ‘main’ panicked at src\main.rs:7:66:
called Result::unwrap() on an Err value: Provider("Server returned 404 Not Found: ")
stack backtrace:
// connect to the testnet.
let provider = Provider::connect(“beta-5.fuel.network”).await.unwrap(); #this error
→ called Result::unwrap() on an Err value: Provider("Server returned 404 Not Found: ")note: run with RUST_BACKTRACE=1 environment variable to display a backtrace