tonlib-rs icon indicating copy to clipboard operation
tonlib-rs copied to clipboard

Cannot Reach the test network

Open N1ghtStorm opened this issue 7 months ago • 1 comments

Hello I am facing an issue - I can not reach the test network using tonlib = "0.15"

use tonlib::client::TonClientBuilder;
use tonlib::client::TonConnectionParams;
use tonlib::config::TESTNET_CONFIG;
use tonlib::client::TonClient;
use tonlib::contract::TonContractFactory;
use tonlib::contract::TonContractInterface;

async fn contract() -> anyhow::Result<()> {
    let client = TonClientBuilder::new()
        .with_connection_params(&TonConnectionParams {
            config: TESTNET_CONFIG.to_string(),
            blockchain_name: None,
            use_callbacks_for_network: false,
            ignore_cache: false,
            keystore_dir: None,
            notification_queue_length: 10,
            concurrency_limit: 10,
        })
        .with_pool_size(10)
        .build()
        .await?;

    let contract_factory = TonContractFactory::builder(&client).build().await?;
    let contract =
        contract_factory.get_contract(&"EQCpZMzawIgbus2orvZFlV5p20IrR5LvlsHh7aFLwI94_MyM".parse()?);
    TonClient::set_log_verbosity_level(1);

    let state = contract
        .run_get_method("get_id", &Vec::new())
        .await
        .expect("FAILED");
    println!("{:?}", state);

    Ok(())
}

#[tokio::main]
async fn main() {
    contract().await.unwrap();
}

and i recieve these errors

[ 1][t 1][2024-07-09 00:22:04.711640][adnl-ext-connection.cpp:129][!outconn]	Client got error [PosixError : Connection refused : 61 : Read from [fd:15] has failed]
[ 1][t 1][2024-07-09 00:22:14.713434][adnl-ext-connection.cpp:129][!outconn]	Client got error [PosixError : Connection refused : 61 : Read from [fd:22] has failed]
[ 1][t 1][2024-07-09 00:22:24.713244][adnl-ext-connection.cpp:129][!outconn]	Client got error [PosixError : Connection refused : 61 : Read from [fd:30] has failed]
[ 1][t 7][2024-07-09 00:22:25.918695][adnl-ext-connection.cpp:129][!outconn]	Client got error [PosixError : Connection refused : 61 : Read from [fd:37] has failed]

Am I using the the library right? Thank you!

my Cargo.toml dependecies

[dependencies]
tonlib = "0.15"
anyhow = "1.0"
tokio = { version = "1", features = ["full"] }

N1ghtStorm avatar Jul 09 '24 14:07 N1ghtStorm