Skip to main content

Questions tagged [solana-client]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
30 views

How to use solana-client from a tokio async runtime?

I am working in a tokio async environment, built from tokio::runtime::Runtime::block_on. fn start() { ... enter preformatted text here let runtime = tokio::runtime::Runtime::...
Nathan's user avatar
  • 123
0 votes
1 answer
46 views

Loading lookup table accounts with rust RPC client

I'm struggling to understand how do I get all accounts (static + dynamic) from executed on chain transaction using rust RPC client (get_transaction). I kinda figured out that I can just make another ...
Nerver Corameiro's user avatar
1 vote
1 answer
37 views

How to fetch constants from a program?

So to fetch the current state of given account I'd do: let acc = await program.account.<ACCOUNT_TYPE>.fetch(<ADDRESS>); Programs can have hardcoded constants (which can be changed upon ...
mega_creamery's user avatar
0 votes
1 answer
454 views

Solana TPU client and sending versioned transactions

The solana tpu client (rust) takes a &Transaction argument however I deal with VersionedTransaction's. I would like to know 2 things.. How can I send a VersionedTransaction via the tpu client. ...
MHCH's user avatar
  • 45
1 vote
1 answer
113 views

websocket_url for solana_client::tpu_client::TpuClient

I'm wondering which URL I need to provide as websocket_url when I call TpuClient::new()? use solana_client::tpu_client::{TpuClient, TpuClientConfig}; use solana_client::rpc_client::RpcClient; fn main(...
Stefan D.'s user avatar
  • 181
0 votes
2 answers
141 views

Can't get solana client working [duplicate]

I'm running into a ton of issues with solana dependencies unfortunately. I created a new crate with cargo init --bin rust_client and edited my Cargo.toml file to contain [package] name = "...
Curious 's user avatar
3 votes
2 answers
548 views

how can i check / verify past events of my smartcontract?

I want to check my past event emitted by smart contract during function call so that I can verify that the function is actually called. ``program.addEventListner()``` is used only for real-time I need ...
vipin saini's user avatar
1 vote
1 answer
70 views

How to retrieve a FileSystem Wallet in a .ts file

I am new to learning Solana development. Is there any way to retrieve the keypair from a Filesystem path? I am doing a tutorial and I want to use the same keypair to sign transactions, instead of ...
LAUR_NASA's user avatar
  • 173
1 vote
1 answer
573 views

Getting an error when attempting to send transactions to the TPU from a Rust client

When attempting to send transactions to the TPU from a Rust client using a TpuClient connection, I am encountering the following error: panicked at 'QuicLazyInitializedEndpoint::create_endpoint ...
guillermo's user avatar
3 votes
2 answers
1k views

How can I get the transaction history of a wallet with more than 1000 transactions/signatures?

Trying to get the full transaction history of a wallet address, but get_signatures_for_address() has a limit of 1000 most recent signatures. How can I get the entire chain of transactions? Thanks!
jfaz1's user avatar
  • 33
1 vote
1 answer
176 views

How to verify data on chain with Solana

I am currently facing a big problem with Solana. I will start with a very simple example for the explanation: In fact I want to create a smart contract, in this smart contract there will be the name ...
RevOneX9's user avatar
1 vote
2 answers
779 views

How to obtain transaction logs via RPC?

My off-chain program is sending transactions to Solana, and I want to inspect the logs of the transaction inside this program. // Send transaction let transaction_signature = client.send_transaction(&...
totikom's user avatar
  • 365
2 votes
1 answer
132 views

Depencencies in Cargo.toml file Solana-SDK and Solana-Client doesn't work

Hello I am trying desperately to use solana-sdk and solana-client but when I do cargo build-bpf it doesn't work. Can someone help me please? When I use only solana-client as a dependency the ...
RevOneX9's user avatar
1 vote
2 answers
135 views

Build solana-client for wasm target

Has anyone been able to build solana-client for a wasm32-unknown-unknown target (wasm-pack build --target web)? Getting the following error building gethostname dependency error[E0425]: cannot find ...
floorsweeper's user avatar
1 vote
1 answer
114 views

Solana-SDK and Solana-Client doesn't work as a dependencies

Hello I am trying desperately to use solana-sdk and solana-client but when I do cargo build-bpf it doesn't work. Can someone help me please? If I specify only solana-client and solana-sdk, I get this ...
RevOneX9's user avatar
1 vote
1 answer
104 views

Trouble initializing solana contract on front-end client

I have a very simple program which stores GIFs in a solana contract. Before I can get the gifs, however, I believe I need to call the "initialize" function in my front-end. I have created ...
user2487's user avatar
3 votes
1 answer
196 views

Connection to solana cluster using the ThinClient of the rust client library giving timeout error?

I am trying to connect to solana using the ThinClient provided by the solana client library: https://docs.rs/solana-client/latest/solana_client/thin_client/struct.ThinClient.html It requires a Rpc ...
LionCatDev Studio's user avatar
3 votes
1 answer
150 views

Is there a rust equivalent of onProgramAccountChange()?

What I am trying to do is listen to some onchain program accounts being changed. I could do this pretty easily in typescript with onProgramAccountChange() method provided in the Connection class in @...
Farrukh Raza's user avatar
1 vote
1 answer
106 views

Sometimes receiving duplicate logs using solana_client::nonblocking::pubsub_client::PubsubClient

I am using solana_client v1.10.34 nonblocking PubsubClient to subscribe to program logs and I am sometimes seeing duplicate logs with the same metadata but 1 slot apart. Is this a bug? Ps: Must use ...
Jayyunit's user avatar
5 votes
1 answer
309 views

How to use Solana rust client to request SOL balance?

I am trying to use Rust (not Typescript) to query Solana and retrieve the SOL balance of a given account. But I can't seem to be able to do this. What I have thus far. As dependencies I have the ...
Finlay Weber's user avatar
0 votes
1 answer
23 views

Get transactionID string with Transaction object

I currently have a buffer that I deserialized into a Transaction Object. I need the transaction ID to search on lets say Solscan.
Michael Beer's user avatar
2 votes
1 answer
340 views

"Error: receiving on an empty and disconnected channel" from `solana_client::PubsubClient`

Consider this simple bit of code: use anyhow::Result; use solana_client::pubsub_client::PubsubClient; const WS_URL: &str = "wss://api.devnet.solana.com"; fn main() -> Result<()&...
TovarishFin's user avatar