https://geth.ethereum.org/
Note: Tick all the boxes during installation.
geth console
mkdir go-ethereum
cd go-ethereum
mkdir node1
mkdir node2
mkdir bnode
cd node1
geth --datadir "./data" account new
cd node2
geth --datadir "./data" account new
https://chainlist.org/
Note: ChainId must be unique or else our Private Blockchain could merge with Public Blockchain Network.
//Genesis_File
{
"config": {
"chainId": { CHAIN_ID },
"homesteadBlock": 0,
"eip150Block": 0,
"eip155Block": 0,
"eip158Block": 0,
"byzantiumBlock": 0,
"constantinopleBlock": 0,
"petersburgBlock": 0,
"istanbulBlock": 0,
"berlinBlock": 0,
"clique": {
"period": 5,
"epoch": 30000
}
},
"difficulty": "1",
"gasLimit": "8000000",
"extradata": "0x0000000000000000000000000000000000000000000000000000000000000000{ INITIAL_SIGNER_ADDRESS }0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"alloc": {
"{ FIRST_NODE_ADDRESS }": { "balance": "{ ETHER_AMOUNT }" },
"{ SECOND_NODE_ADDRESS }": { "balance": "{ EHTER_AMOUNT }" }
}
}
geth --datadir ./data init ../genesis.json
cd bnode
bootnode -genkey boot.key
bootnode -nodekey boot.key -verbosity 7 -addr "127.0.0.1:30302"
Note: Copy and save it to info.txt enode value from cmd.
geth --datadir "./data" --port 30304 --bootnodes enode://{ YOUR_VALUE } --authrpc.port 8547 --ipcdisable --allow-insecure-unlock --http --http.corsdomain="https://remix.ethereum.org" --http.api web3,eth,debug,personal,net --networkid { NETWORK_ID } --unlock { ADDRESS_NODE1 } --password { PASSWORD_FILE_NAME_EXTENSION } --mine --miner.etherbase= { SIGNER_ADDRESS }
Note: Store the password in Ethereum\node1\data\password.txt
geth --datadir "./data" --port 30306 --bootnodes enode://{ YOUR_VALUE } -authrpc.port 8546 --networkid { NETWORK_ID } --unlock { ADDRESS_NODE2 } --password { PASSWORD_FILE_WITH_EXTENSION }
Note: Store the password in Ethereum\node2\data\password.txt
https://remix.ethereum.org/
//SPDX-License-Identifier:MIT
pragma solidity ^0.8.19;
contract New{
string name;
function setName(string memory _name)public {
name=_name;
}
function getName()public view returns(string memory){
return name;
}
}