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)".


here 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 Answer 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 and acknowledge you have read our privacy policy.

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