Submitting Transactions
Submitting a transaction to the Celestium network involves creating a signed transaction and broadcasting it to the network through an RPC node. This section provides a step-by-step guide on how to submit transactions to Celestium Testnet.
1. Prepare a Transaction
A transaction can transfer CLT tokens, interact with a smart contract, or deploy a new contract. Transactions must include:
From: Sender’s address.
To: Recipient’s address (optional for contract creation).
Value: Amount of CLT to send (in wei).
Gas Limit: Maximum gas units to consume.
Gas Price: Fee per unit of gas (in wei).
Data: Optional data payload (e.g., smart contract call).
2. Sign the Transaction
Transactions must be signed using the sender’s private key. Popular libraries like ethers.js or web3.js can help with signing:
Replace PRIVATE_KEY
and 0xRecipientAddress
with your actual data.
3. Broadcast the Transaction
If you sign the transaction offline, broadcast it using eth_sendRawTransaction
:
Replace 0xSignedTransactionData
with the signed transaction hex string.
4. Check Transaction Status
Use eth_getTransactionReceipt
to check the status:
If the receipt is null
, the transaction is still pending.
5. View on Explorer
Track your transaction on http://testnet.celestium.network using your transaction hash.
Best Practices
Use eth_estimateGas to calculate gas before sending.
Ensure your balance covers the transaction value and gas fees.
Double-check your private key security; never expose it publicly.
This approach ensures that transactions are processed smoothly on the Celestium network.
Last updated