Creating Custom Ethereum Blockchain Using Geth :
Setup:
In this experiment, a private Ethereum blockchain was created using the Geth client with a Proof of Authority (PoA) consensus mechanism. Two Ethereum accounts were set up on separate nodes. Node 1 served as the miner, while Node 2 acted as a participant. The accounts were created using the geth account new command, generating public addresses and key paths for both nodes. A bootnode was configured to enable peer discovery and network connection, providing an enode URL that allowed both nodes to connect.
Node 1 was set up to unlock its account and begin mining using the geth --mine command, while Node 2 joined the network via the bootnode. A custom network ID (14333) and PoA mechanism ensured that only authorized nodes could mine. After initialization, the nodes synchronized successfully, enabling Node 1 to mine and validate transactions while Node 2 participated as a non-mining node. This setup effectively demonstrated a functional private Ethereum blockchain using Geth.
Boot Node :
bootnode --nodekey "E:\blockgeth\bnode\boot.key" --verbosity 7 --addr "127.0.0.1:30301"
Node 1 :
geth --networkid 14333 --datadir "E:\blockgeth\node1\data" --bootnodes enode://b822f9e8a88b824fd88d394dc8ebe9d84fb5cc9195a8e04173d28bcb6777aacbf1243b94fe1f8ef284885fcd6f007574684984a25ea834fc7dd69b48246b652e@127.0.0.1:0?discport=30301 --port 30303 --ipcdisable --syncmode full --http --http.addr "127.0.0.1" --http.port 8545 --http.corsdomain "*" --allow-insecure-unlock --unlock 0x521EbFAfEe931d5659759A6A1EA63376B047100e --password password.txt --mine console
Node2 :
geth --networkid 1433 --datadir "E:/blockgeth/node2/data" --bootnodes enode://b822f9e8a88b824fd88d394dc8ebe9d84fb5cc9195a8e04173d28bcb6777aacbf1243b94fe1f8ef284885fcd6f007574684984a25ea834fc7dd69b48246b652e@127.0.0.1:0?discport=30301 --port 30304 --ipcdisable --syncmode full --http --allow-insecure-unlock --http.corsdomain "*" --http.port 8546 --unlock 0x935ed4720b49284aDE901734861ed423Dd9Eb0cc --password password.txt console
Result :
The experiment successfully demonstrated the creation of a custom blockchain network using Geth with a Proof of Authority (PoA) consensus mechanism. Two nodes were deployed: Node 1 acted as the miner, while Node 2 participated by sending transactions. A bootnode with a specific enode URL was used to establish communication and facilitate peer connections between the nodes.
Node 1 mined blocks, controlled block generation, and validated transactions, while Node 2 interacted with the blockchain. The network was able to validate and securely store all transactions, operating as expected under the PoA model.
The results confirmed the successful setup and functionality of the network. Node 1 efficiently mined and validated blocks, while Node 2 synchronized and participated without issues. The Proof of Authority mechanism ensured that only authorized nodes could mine, highlighting the reliability of this consensus model. Overall, the experiment showcased the smooth operation and feasibility of implementing a private blockchain using Geth and PoA.
Connect IPFS to Ethereum :
The initiation phase involves setting up and starting the IPFS node.
Run ipfs init to initialize the local repository and then ipfs daemon to start the node.
This connects your node to the IPFS network, enabling interaction with other nodes.
Initiation
Web ui
Add data to the IPFS network using the ipfs add <filename> command.
This generates a unique CID (Content Identifier) that acts as the file's address.
The data is now distributed across the IPFS network and accessible by its CID.
Adding Data To IPFS
Using ipfs cat: Retrieve and display the content of a file directly in the terminal with ipfs cat <CID>.
Using Web UI: Open the IPFS Web UI by visiting http://127.0.0.1:5001/webui in your browser to browse and retrieve files visually.
Both methods fetch the file from the IPFS network using its CID.
Retrieval Through Cat Command