synechron-finlabs / quorum-maker

Utility to create and monitor Quorum nodes
Apache License 2.0
196 stars 97 forks source link

2nd node not showing up on Quorum-Maker GUI #52

Closed Eithcowich closed 5 years ago

Eithcowich commented 5 years ago

I created a first node on an Ubuntu 18 server running on Azure. Then I connected to the manager and everything seems fine. Now I created a second node, gave the join approval from the first node and got the confirmation. So node 2 was also created successfully. But when connecting to the GUI on node 1 (http://node1ip:22004) I can only see 1 active node -- the node itself. On node 2, http://node2ip:22004 there is also 1 active node. When I click to see it, the Node Table is empty, without information even on the node itself. What's the issue here? Is the network setup? How do I solve it?

dhyansraj commented 5 years ago

This should have been a smooth process. Have you seen similar logs on node1?

image

Can you also check the total contracts deployed from UI? There should be initially 2 blocks and 2 txns, before any nodes join. For each join approvals, additional block and txns would be created. Can you use the transaction explorers to see if the register functions get called correctly?

image

Eithcowich commented 5 years ago

These are the messages on node 1:

{"level":"info","msg":"Node Manager listening on :22004...","time":"2018-09-23T09:17:26Z"}
{"level":"info","msg":"Deploying Network Manager Contract","time":"2018-09-23T09:17:27Z"}
{"level":"info","msg":"Adding whitelisted IPs","time":"2018-09-23T09:17:31Z"}
{"level":"info","msg":"Join request received from node: nodetwo with IP: omitted and enode: enode://e47...@omitted:22001?discport=0\u0026raftport=22003","time":"2018-09-23T09:32:45Z"}

On node 2:

{"level":"info","msg":"Node Manager listening on :22004...","time":"2018-09-23T09:34:05Z"}
{"level":"info","msg":"Adding whitelisted IPs","time":"2018-09-23T09:34:07Z"}

It seems like the blocks and transactions on node1 are ok. Here's a screenshot: screen shot 2018-09-23 at 4 07 31 pm

On both nodes the Whitelist list is empty.

Any ideas? Could it be a problem with the 2nd node's machine? It's a Standard DS1 v2 (1 vcpus, 3.5 GB memory) on Azure.

dhyansraj commented 5 years ago

If the screen shot above is after joining node2, it failed to register the node in smart contract. 1st tx is for deploying Node Manager contract, second tx is for registering the first node itself in the smart contract. So the second node registration should come as the 3rd tx. Since you said, you approved join request from 1st node, there might have something gone wrong in between. If you are using AWS, can you make sure, you allow UDP connections as well ?

Eithcowich commented 5 years ago

I'm using Azure. Some of the ports in the 22000 to 22005 where not open when I first posted. Since then I opened all of them to both TCP and UDP and repeated the registration process, with similar results. Node 2 was not registered.

I'm thinking maybe stopping both nodes and restarting the process. What is the best way to do it? In your Read Me it says that Ctrl+C stops the node, but I did that and the manager URL continued to work. So I'm not sure if the node was stopped, or just some of the services.

In short, two questions:

  1. What would be the best way to try again?

  2. How do I stop the node, then restart it?

dhyansraj commented 5 years ago

from a bash console, you should be able to Ctrl + C to kill the node. Run 'docker ps' and kill those still running. Also check 'docker ps -a' if there are any containers dangling. You can delete them by 'docker container prune'. After this you can do a fresh new setup and hopefully everything should work.

Eithcowich commented 5 years ago

Thank you, looks good now. So the problem was that the ports were not open when I first tried the setup, and then an existing container was lingering. Solved.

I have another issue. If you prefer I'll start a new one, but for now I'll write it here:

When trying to deploy a contract through nodejs and web3 I get the following error: authentication needed: password or unlock.

But looking at the doc it says the accounts are created with no passwords, and are therefore unlocked to begin with. So why the error?

This is the code I'm using:

const MyContract = new web3.eth.Contract(JSON.parse(abi));
MyContract.deploy({
    data: "0x" + code,
})
.send({
    from: account,
    gas: 98000000,
    privateFor: [node]
})
.then((instance) => {
    console.log("for node " + node);
    console.log(`Address: ${instance.options.address}`);
})
.catch((err) => {
    winston.error(err);
});
dhyansraj commented 5 years ago

pass empty password and unlockAccount.

Eithcowich commented 5 years ago

All working, thank you.