Understanding how to send and receive transactions is fundamental to interacting with the Ethereum blockchain. Whether you're transferring ETH between personal accounts or preparing for more complex smart contract interactions, every action on Ethereum begins with a transaction. This guide walks you through the full lifecycle of an Ethereum transaction—from initiation to confirmation—using practical commands and real-time blockchain inspection.
Understanding Ethereum Transactions
At its core, a transaction is the only way to interact with the Ethereum network. As covered in earlier discussions on blockchain mechanics, all operations—including simple value transfers or executing smart contracts—are encapsulated within transactions and broadcast to the network.
In this tutorial, we’ll demonstrate how to:
- Send a basic ETH transfer between two accounts
- Monitor transaction status in the mempool
- Confirm inclusion in a block
- Inspect block details and validate outcomes
This hands-on approach uses Geth (Go-Ethereum), one of the most widely used Ethereum clients, running on a private test network.
👉 Learn how blockchain transactions work under the hood — explore deeper insights here.
Setting Up Your Geth Node
Before initiating any transaction, ensure your Geth node is active and synchronized. If it's currently stopped, restart it using the following command (replace the etherbase address with your mining reward address):
cd ether-test
geth --datadir ./db/ \
--rpc \
--rpcaddr=127.0.0.1 \
--rpcport 8545 \
--rpccorsdomain "*" \
--rpcapi "eth,net,web3,personal,admin,shh,txpool,debug,miner" \
--nodiscover \
--maxpeers 30 \
--networkid 198989 \
--port 30303 \
--mine \
--minerthreads 1 \
--etherbase "0x53dc408a8fa060fd3b72b30ca312f4b3f3232f4f"This configuration enables JSON-RPC access, restricts peer discovery for security, sets a custom network ID, and starts mining on a single thread.
Initiating a Transaction
Open a new terminal window and attach to the running Geth instance via IPC:
cd ether-test
geth --datadir ./db attach ipc:./db/geth.ipcOnce connected to the console:
Pause mining temporarily to simulate real-world transaction queuing:
> miner.stop()Unlock the sender account for signing:
> personal.unlockAccount(eth.accounts[0], '123', 300) true🔐 Note: Unlocking decrypts the account’s private key from the keystore file and holds it in memory for the specified duration (300 seconds). After this period—or after transaction signing—the key is purged for security.
Send 10 ETH from the first account to another:
> eth.sendTransaction({ from: eth.accounts[0], to: eth.accounts[1], value: web3.toWei(10, 'ether') }) "0x45b6be881cf86b79dc7ad8bf4d9cbfafc9aa191062411d6606a086bbc42042ed"
You’ve successfully submitted a transaction! The returned string is the Transaction Hash (TxHash)—a unique identifier used to track your transaction across the network.
Monitoring Transaction Status
With mining paused, let’s inspect where our transaction stands.
Check the Transaction Pool
Use txpool.status to view pending and queued transactions:
> txpool.status
{ pending: 1, queued: 0 }The result shows one pending transaction—our transfer is waiting to be included in a block.
Inspect Transaction Details
Query using the TxHash:
> eth.getTransaction("0x45b6be881cf86b79dc7ad8bf4d9cbfafc9aa191062411d6606a086bbc42042ed")Output includes:
from/to: Sender and recipient addressesvalue: Amount in Wei (10^18 Wei = 1 ETH)gas/gasPrice: Transaction fee parametersnonce: Sequence number for replay protectioninput: Empty (0x) since this isn’t a contract callblockHash/blockNumber: Stillnull—not yet mined
👉 See how real-time blockchain data can enhance your development workflow.
Mining the Transaction
Now trigger mining to include the transaction:
> miner.start(1); admin.sleepBlocks(1); miner.stop();This command:
- Starts mining
- Waits until one block is mined
- Stops again for inspection
Recheck the pool:
> txpool.status
{ pending: 0, queued: 0 }No pending transactions—ours has been processed.
Requery the transaction:
> eth.getTransaction("0x...")Now observe:
blockNumber: 1450blockHash: Filled with valid hash- All other fields unchanged
The transaction is now permanently recorded on-chain.
Verify the recipient balance:
> web3.fromWei(eth.getBalance(eth.accounts[1]), "ether")
10✅ Success! The receiver now holds exactly 10 ETH.
Exploring the Block That Confirmed the Transaction
Let’s examine block #1450:
> eth.getBlock(1450)Key fields explained:
transactions: Array containing our TxHashlogsBloom: All zeros—no logs generated (non-contract interaction)miner: Address0x53dc...—same as sender, as we’re solo-mininguncles: Empty array—no competing blocks in this private chainextraData: Hex-encoded metadata (0xd983...)
Decode extraData from hex to ASCII:
geth go1.10.3 darwinThis reveals client version and OS info—commonly used for node identification.
Here’s a complete reference of Ethereum block fields:
Ethereum Block Structure Overview
- number: Block height in the chain
- timestamp: Unix timestamp of block creation
- hash: Cryptographic fingerprint of the block
- parentHash: Reference to previous block
- nonce: Proof-of-Work solution
- extraData: Arbitrary data up to 32 bytes
- transactionsRoot: Merkle root of all transactions
- stateRoot: State trie root after execution
- receiptsRoot: Root of transaction receipts
- logsBloom: Bloom filter for efficient log queries
- miner: Address receiving mining rewards
- gasLimit: Maximum gas allowed per block
- gasUsed: Total gas consumed by transactions
- difficulty: PoW difficulty level
- totalDifficulty: Cumulative difficulty up to this block
- size: Block size in bytes
- sha3Uncles: Hash of uncle list
- uncles: List of included uncle blocks
Frequently Asked Questions
Q: What happens if I don’t unlock my account before sending?
A: Without unlocking, Geth cannot access your private key to sign the transaction. The request will fail silently or return an authorization error.
Q: Why does my transaction stay in “pending” state?
A: Transactions remain pending due to low gas prices, network congestion, or node connectivity issues. Miners prioritize higher-paying transactions.
Q: Can I cancel a pending Ethereum transaction?
A: Yes—by sending a replacement transaction from the same address with the same nonce but higher gas price, typically transferring 0 ETH to yourself.
Q: How do I check if a transaction was successful?
A: Use eth.getTransactionReceipt(hash)—if it returns null, the transaction hasn’t been mined yet. Once confirmed, it returns logs and gas usage.
Q: Is it safe to keep accounts unlocked?
A: No. Always limit unlock duration and avoid unlocking on public or untrusted systems. In production, use hardware wallets or signers like MetaMask or Ledger.
Q: What is the purpose of the nonce field?
A: Nonce ensures transaction order and prevents replay attacks. Each transaction from an account must have a sequentially increasing nonce starting at 0.
👉 Start tracking and analyzing Ethereum transactions like a pro — dive into advanced tools now.
By walking through each step—from sending ETH to inspecting block data—you’ve gained firsthand experience with Ethereum’s core mechanics. These foundational skills are essential for developers, auditors, and power users navigating decentralized applications and blockchain ecosystems.