Querying Blockchain Data
Querying blockchain data on Celestium allows users and developers to retrieve information about blocks, transactions, balances, and contract states. This can be done using Ethereum-compatible JSON-RPC API methods.
Common RPC Methods
Below are the most commonly used RPC methods to query data from Celestium:
Get the Latest Block Number
Returns the current block number.
Get Block Details by Number
Fetches details of a specific block.
Replace BLOCK_NUMBER
with a hexadecimal block number (e.g., 0x1A
for block 26).
Get Transaction Details
Fetches the details of a transaction by its hash.
Replace TRANSACTION_HASH
with the transaction hash.
Get Transaction Receipt
Checks the status and logs of a transaction.
Get Account Balance
Retrieves the balance of an account in wei.
Replace ADDRESS
with the account address.
Interacting with Blockchain Programmatically
You can also use libraries like ethers.js or web3.js to query blockchain data within your application:
Using Celestium Explorer
For a user-friendly way to explore transactions, blocks, and addresses, visit the Celestium Testnet Explorer:
🔗 http://testnet.celestium.network
Querying blockchain data is essential for monitoring transactions, tracking balances, and interacting with smart contracts. Celestium’s compatibility with the Ethereum API ensures that developers can integrate with existing tools seamlessly.
Last updated