thetatoken / guardian-mainnet-guide

Guide for setting up the Guardian Node for the mainnet
https://docs.thetatoken.org/
147 stars 34 forks source link

running multiple instances #13

Open bousalman opened 4 years ago

bousalman commented 4 years ago

Hi there,

I have 2 separate wallets and would like to do staking for both of them using my Server. the first instance of the theta guardian app works fine. However I am trying to run the another instance but have the following error: WARN[0269] Failed to detect the NAT device: no NAT found prefix=p2p WARN[0269] Failed to perform NAT port mapping: No available NAT device prefix=p2p FATA[0273] Failed to initiate net listener: listen tcp 0.0.0.0:30001: bind: address already in use prefix=p2p

I can see that the port already binded with the first instance of the theta guardian, What can I do to have both of them run on my Server ? I don't want to put all of tokens in one wallet.

Regards,

jieyilong commented 4 years ago

I see, I think there are a few options: 1) you can stake to the same Guardian node from two different wallets. Or 2) you can run two nodes on two different servers. If you only have one server, you can change the p2p.port setting in the config.yaml file to use another p2p port instead of 30001. Hope this helps!

bousalman commented 4 years ago

Hi Jieyi, yup now works fine. also I had to change the rpc port. However when running the query guardian command I got the same Summary and Address for the first instance! be noted I am running the instances in separate linux user accounts.

jieyilong commented 4 years ago

I see, good catch! Yeah to query the second guardian, you can set the REMOTERPCENDPOINT env variable. For example, if the RPC port of your second guardian is 16889, you can query its status like this:

REMOTERPCENDPOINT=http://127.0.0.1:16889/rpc thetacli query status
bousalman commented 4 years ago

Hi Jieyi, even after setting the env variable, I am still having the same 1st node address & summary. Am I missing something here ?

jieyilong commented 4 years ago

Hmm that's strange, on which RPC ports did you run the first and second guardian node?

bousalman commented 4 years ago

the first runs on ports: 30001 , 16888 the second run on ports: 30002 , 16889

bousalman commented 4 years ago

Any updates ?