How to Send a Transaction on an Ethereum Private Network

·

This guide walks you through the process of sending Ether (ETH) on a private Ethereum blockchain network built using Geth. If you've set up your own private testnet, this tutorial will help you understand the core mechanics of transactions, mining, and balance management.

Ethereum includes a native cryptocurrency function similar to Bitcoin. Ether is the native currency unit on Ethereum, used for paying transaction fees (known as "Gas") and as a reward for miners who secure the network.

Creating Accounts for the Transaction

To send a transaction, you need at least two Externally Owned Accounts (EOAs)—one as the sender and one as the recipient.

Start by launching the Geth client with your private network configuration:

geth --networkid "10" --nodiscover --datadir "/root/eth_private_net" console 2>> /root/eth_private_net/geth.log

Once inside the Geth JavaScript console, create two new accounts:

personal.newAccount("PASSWORD_FOR_ACCOUNT_A")
personal.newAccount("PASSWORD_FOR_ACCOUNT_B")

These commands return public addresses for each account. You can review all accounts with:

eth.accounts

By default, the first account (eth.accounts[0]) is set as the coinbase address—where mining rewards are sent. You can change this with:

miner.setEtherbase(eth.accounts[1])

For this tutorial, we'll use:

Check the sender’s balance—it will initially be zero.

eth.getBalance(eth.accounts[0])

Executing Mining to Earn Ether

Since this is a private network, you can mine Ether easily. Begin mining with:

miner.start()

Confirm mining is active:

eth.mining

Allow some time for blocks to be mined. Check progress with:

eth.blockNumber

After sufficient blocks are mined, stop the miner:

miner.stop()

Now check the sender’s balance again. Note that balances are shown in Wei (1 Ether = 10^18 Wei). Convert to Ether for clarity:

web3.fromWei(eth.getBalance(eth.accounts[0]), "ether")

You should now see a positive balance.

Sending Ether Between Accounts

With a balance available, you can initiate a transaction.

First, unlock the sender’s account:

personal.unlockAccount(eth.accounts[0], "PASSWORD_FOR_ACCOUNT_A", 300)

The third parameter (optional) specifies the unlock duration in seconds.

Now, send 10 Ether to the recipient:

eth.sendTransaction({from: eth.accounts[0], to: eth.accounts[1], value: web3.toWei(10, "ether")})

This returns a transaction hash. However, the transaction is not yet confirmed—it’s in the mempool (pending state). You can verify this:

eth.pendingTransactions

To confirm the transaction, resume mining:

miner.start()

After a short time, check pending transactions again—it should be empty. Stop mining and verify the transaction details:

eth.getTransaction("TRANSACTION_HASH")

Now, check the recipient’s balance:

web3.fromWei(eth.getBalance(eth.accounts[1]), "ether")

The balance should reflect the received 10 Ether. Note that the sender may have earned additional mining rewards during this process.

👉 Explore more blockchain strategies

Frequently Asked Questions

What is an Ethereum private network?
A private Ethereum network is a customizable blockchain environment isolated from the mainnet. It is often used for development, testing, and learning purposes without spending real Ether.

Why is mining necessary to confirm a transaction?
Mining validates transactions and adds them to the blockchain. In a private network, you control the mining process, allowing instant block generation and confirmation.

What is the difference between Wei and Ether?
Wei is the smallest denomination of Ether, like cents to a dollar. One Ether equals 1,000,000,000,000,000,000 Wei. Transactions and balances are often handled in Wei for precision.

Can I change the mining reward in a private network?
Yes, in a private Ethereum network, you can modify the consensus algorithm, block time, and mining rewards by configuring the genesis block before initializing the chain.

Why did my transaction remain pending?
Transactions remain pending until included in a block. If mining is not active, transactions will not be processed. Always ensure a miner is running to confirm transactions.

Is it possible to automate transactions on a private network?
Yes, you can use scripts or smart contracts to automate transactions. Tools like web3.js or ethers.js can interact with your private node programmatically.


This tutorial demonstrated the end-to-end process of sending Ether on a private Ethereum network. By handling accounts, mining, and transactions manually, you gain a deeper understanding of how blockchain transactions work under the hood. In a public network, mining is highly competitive, but in a private setup, you have full control—making it ideal for experimentation and learning.