0

I have created 2 nodes on different systems. I created accounts and was able to transfer ethers across accounts in the same node. Now i want to connect the 2 nodes on different system. I have used following commands for the nodes:

Node 1:

geth --networkid 100 --identity node1 --verbosity 3 --nodiscover --nat none --datadir "C:\Rahul\blockchain\node1" 

Node 2:

geth --networkid 100 --identity node2 --port 30802 --rpcport 8902 --verbosity 3 --nodiscover --nat none --datadir "C:\Rahul\blockchain\node2"

Now i want to add node2 as a peer to node1. So i used "admin.addPeer(enode Address)".

admin.addPeer("enode://675908f0bbdcf8d19110dd84e0bfacbf60acd7c506c126213eedc71f315a95cdeb9a8f5
728832c37c9751ed74803141b9b07674bac015caebcbc73d7aef9798c@172.16.224.167:30802?discport=0")

here 172.16.224.167 is the IP of node2 i.e in another system and 30802 is the port it is listening to.

Now when i enter this command, following is the response i receive:

Error1: (anonymous): Line 1:15 Unexpected token ILLEGAL (and 2 more errors)

Please help me connect these two nodes or instruct me as to where is the mistake.

1

First: Take out --nodiscover, it disables automatic node discovery, it would work much better without it. Unless you want to add every node manually.

Second: I guess you're inserting the addpeer command in the first node console...

Third: I would take out ?discport=0 from your addpeer command.

Forth: check there's no invisible characters in this string (it sometimes happens, as in this post: https://stackoverflow.com/questions/12719859/no-visible-cause-for-unexpected-token-illegal)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.