Search code examples
solanasolana-web3js

Is there a way to get transaction data from Solana blockchain live?


I would like to be able to "listen" live to transactions on Solana for specific NFTs, is this possible?

I have managed to do this for Ethereum, using web3, a hash address and ABIs which allow us to listen to any NFT transaction within the NFT contract (e.g. any CryptoPunk transaction), is a similar thing possible for Solana?

I know solscan.io provides most of the data I would need (so I could scrape from there), but is there a way to do it directly from my own computer (like Ethereum)?


Solution

  • Absolutely! You can listen to different parts of the chain using the subscription websocket. For example, if you want to listen to all transactions by a program, you can use https://docs.solana.com/developing/clients/jsonrpc-api#programsubscribe