Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

take time too long #104

Open
sxfreesky123 opened this issue Oct 7, 2024 · 0 comments
Open

take time too long #104

sxfreesky123 opened this issue Oct 7, 2024 · 0 comments

Comments

@sxfreesky123
Copy link

image

env:
macos x86, cargo 1.79.0,

cargo.toml:
tonlib-core = { git="https://github.com/ston-fi/tonlib-rs.git", branch="main" }
tonlib-client = { git="https://github.com/ston-fi/tonlib-rs.git", branch="main" }
tonlib-sys = { version="2024.9" }

testnet config: https://ton.org/testnet-global.config.json

`
async fn create_client()-> anyhow::Result{
TonClient::set_log_verbosity_level(2);
let retry = RetryStrategy {
interval_ms: 1000,
max_retries: 10,
};
let client = TonClientBuilder::new()
.with_connection_params(&TonConnectionParams {
config: TESTNET_ACTUAL.to_string(),
blockchain_name: None,
use_callbacks_for_network: false,
ignore_cache: false,
keystore_dir: None,
notification_queue_length: DEFAULT_NOTIFICATION_QUEUE_LENGTH,
concurrency_limit: DEFAULT_CONNECTION_CONCURRENCY_LIMIT,
})
.with_pool_size(10)
// .with_retry_strategy(&retry)
.build()
.await?;
Ok(client)
}

pub async fn test() -> anyhow::Result<()> {
let client = create_client().await?;
let (_, info) = client.get_masterchain_info().await?;
info!("MasterchainInfo: {:?}", &info);

let block_id = BlockId {
workchain: info.last.workchain,
shard: info.last.shard,
seqno: info.last.seqno,
};
let block_id_ext = client.lookup_block(1, &block_id, 0, 0).await?;
info!("BlockIdExt: {:?}", &block_id_ext);
}
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant