Prerequisites
Before broadcasting, ensure your transaction is:1
Built with valid operations
Your transaction must contain at least one operation.
2
Properly signed
The transaction must have valid signatures for all required authorities.
3
Validated
Run validation to catch any errors before broadcasting.
Basic broadcasting
Use thebroadcast() method on your chain instance to send a transaction to the network.
- TypeScript
- Python
Broadcasting is an asynchronous operation. It sends your transaction to the network where it will be included in a block by witness nodes.
Broadcasting with custom endpoint
You can specify a custom API endpoint when creating your chain instance.- TypeScript
- Python
Handling broadcast responses
The broadcast method doesn’t return much data, but you can check the transaction status using the transaction ID.- TypeScript
- Python
Common broadcast errors
Understanding common errors helps you handle them appropriately.Duplicate transaction
Duplicate transaction
Error:
Duplicate transaction check failedCause: The same transaction was already broadcast.Solution: Create a new transaction or wait for the previous one to expire.Transaction expired
Transaction expired
Error:
Transaction expiredCause: The transaction’s expiration time has passed.Solution: Create a new transaction with a fresh expiration time.Invalid signature
Invalid signature
Error:
Invalid signatureCause: The signature doesn’t match the transaction or was created with wrong chain ID.Solution: Ensure you’re using the correct chain ID and signing properly.Insufficient funds
Insufficient funds
Error:
Insufficient funds or Account does not have sufficient fundsCause: The account doesn’t have enough balance for the operation.Solution: Check account balance before creating transfer operations.Broadcasting with retry logic
Implement retry logic to handle temporary network issues.- TypeScript
- Python
Complete example
Here’s a complete example that builds, signs, and broadcasts a transaction.- TypeScript
- Python
Best practices
Broadcast checklist
Before broadcasting, ensure:
- ✅ Transaction is validated
- ✅ Transaction is properly signed
- ✅ You’re using the correct network (mainnet vs testnet)
- ✅ Account has sufficient funds for the operation
- ✅ You have error handling in place
- ✅ Transaction hasn’t expired
After broadcasting
After a successful broadcast:
- ⏱️ Transactions typically appear in blocks within 3 seconds
- 🔍 Use the transaction ID to track status
- 📝 Save the transaction ID for your records
- ⚠️ Wait for irreversibility (about 1 minute) for critical operations
Next steps
Complex operations
Learn about high-level operation helpers
API calls
Explore the Hive API for checking transaction status
Error handling
Comprehensive error handling guide
Network broadcast API
API reference for broadcasting