Can not add peer in local ethereum blockchain

0 votes

I am trying to add one node to my local ethereum , I am running the first node with :

geth --port 30303 --networkid 1234 --nodiscover --datadir ethereum/paradox --rpc --rpcport 8545 --rpccorsdomain "http://localhost:8000" --allow-insecure-unlock --ethstats paradox:s3cr3t@localhost:3000 --rpcapi "eth,net,web3,personal,miner"



My Second node with :

geth --datadir "$ethereum_home/sample" --nodiscover --networkid 1234 --port 30304



they both points to the same genesis block.

When i run the command "address" it returns true but the It does not show peers when I run "admin.peer"

My genesis file:

{ "config": { "chainId": 4224, "homesteadBlock": 0, "eip150Block": 0, "eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000", "eip155Block": 0, "eip158Block": 0, "byzantiumBlock": 0, "constantinopleBlock": 0, "petersburgBlock": 0, "istanbulBlock": 0, "ethash": {} }, "nonce": "0x0", "timestamp": "0x5f350017", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x47b760", "difficulty": "0x80000", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "coinbase": "0x0000000000000000000000000000000000000000", "alloc": { "0000000000000000000000000000000000000000": { "balance": "0x1" }, "00000000000000000000000000000000000000ff": { "balance": "0x1" } }, "number": "0x0", "gasUsed": "0x0", "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000" }

enter image description here

The interesting thing is when I stop both nodes and restart again and then do "address" it shows another node in the peer array but just for a second and if I run command admin.peer it shows noting

Apr 5, 2022 in Blockchain by Soham
• 9,700 points
174 views

1 answer to this question.

0 votes
You have port 30305 running in your lines for one node, and 30303 for another. Why have you tried addPeer with port 30304? Check the availability of the ports listed on the command line while running the instances and also check correctly the node key and port.
answered Apr 7, 2022 by Aditya
• 7,660 points

Related Questions In Blockchain

0 votes
1 answer
0 votes
1 answer

Blockchain peer not able to min block in Azure.

After trying out various ideas, making sure ...READ MORE

answered Aug 21, 2018 in Blockchain by Perry
• 17,100 points
242 views
0 votes
1 answer

Add Peers does not add a peer in Geth console

Setup actual boot node, don't treat base ...READ MORE

answered Sep 28, 2018 in Blockchain by slayer
• 29,330 points
1,723 views
0 votes
1 answer

Can not make a peer in Hyperledger Fabric

You have not installed jdk on your system. ...READ MORE

answered Nov 22, 2018 in Blockchain by Omkar
• 69,190 points
260 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
1,201 views
0 votes
1 answer
+1 vote
1 answer

Protocols used in a distributed/dlt system for the nodes to establish communication

yes all are over TCP/IP connections secured by TLS encryption in hashgraph architecture-hashgraph, ...READ MORE

answered Aug 6, 2018 in Blockchain by aryya
• 7,450 points
811 views
0 votes
1 answer

On-Chain NFT: How to store a pixel image on the ethereum blockchain?

The images are usually not stored in ...READ MORE

answered Feb 24, 2022 in Blockchain by Aditya
• 7,660 points
525 views
+1 vote
1 answer

Is it possible to store images on the Ethereum blockchain?

This is possible for your information but, ...READ MORE

answered Feb 24, 2022 in Blockchain by Aditya
• 7,660 points
939 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP