I am new to solana. Can someone suggests ways to:
- calculate number of spl-tokens per solana block?
- Is there any rpc methods to do so?
- How to get solana block height in solana?
The first question is nearly impossible, since you'll need to query all spl-token mints and sum up their supplies. If you have a snapshot or a ledger tool, then you should be able to do it.
If, however, you just want the supply of a particular spl-token, you can do getTokenSupply
from RPC:
curl https://api.mainnet-beta.solana.com -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0", "id":1, "method":"getTokenSupply", "params": ["3wyAj7Rt1TWVPZVteFJPLa26JmLvdb1CAKEFZm3NY75E"]}
'
More info at https://docs.solana.com/developing/clients/jsonrpc-api#gettokensupply
To get the block height, you can use getBlockHeight
from RPC:
curl https://api.mainnet-beta.solana.com -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getBlockHeight"}
'
More info at https://docs.solana.com/developing/clients/jsonrpc-api#getblockheight