Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove --nodiscover from non bootnodes #320

Merged

Conversation

rodion-lim-partior
Copy link
Contributor

Currently when starting multiple members Quorum network, there is an error being thrown when trying to register organization and nodes for members whom are not part of the bootnode (i.e. bootnodes are used for auto discovery of peers).

Removing --nodiscover flag from all members prevent nodes from being discovered by the bootnode. This PR is raised to retain the --nodiscover flag on the bootnode itself, while removing the flag on the remaining nodes so that they can be connected in the same network.

@rodion-lim-partior rodion-lim-partior force-pushed the feature/set516_correct_no_discover branch from 84b6c6b to 3635acf Compare August 1, 2024 04:37
Copy link
Contributor

@jimthematrix jimthematrix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rodion-lim-partior thanks for proposing the PR. please check the suggested changes I made below. after that it should work as expected.

note that with this setup, such that the bootnode (the node at index 0) has discovery turn on whereas the rest of the nodes have discovery turned off, only the bootnode is connected to the other nodes, while any other nodes are only connected to the bootnode, but not to each other. while this is not ideal, it serves the purpose because the only block signer in the network is the node at index 0. This means the network will function properly, as long as no other nodes are voted in as additional block signers.

Getting all nodes to be connected with each other will take more work. If that's desirable or becomes mandatory in the future, we can work on adding that.

connectTimeout := 15
if memberIndex != 0 {
discoveryCmd = fmt.Sprintf(`bootnode=$(curl http://quorum_0:%s -s --connect-timeout %[2]d --max-time %[2]d --retry 5 --retry-connrefused --retry-delay 0 --retry-max-time 60 --fail --header "Content-Type: application/json" --data '{"jsonrpc":"2.0", "method": "admin_nodeInfo", "params": [], "id": 1}' | grep -o "enode://[a-z0-9@.:]*")
BOOTNODE_CMD="--bootnodes $bootnode"
BOOTNODE_CMD="BOOTNODE_CMD=--bootnodes $bootnode"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
BOOTNODE_CMD="BOOTNODE_CMD=--bootnodes $bootnode"
BOOTNODE_CMD="--bootnodes $bootnode --nodiscover"

BOOTNODE_CMD=${BOOTNODE_CMD/127.0.0.1/quorum_0}`, QuorumPort, connectTimeout)
} else {
discoveryCmd = "BOOTNODE_CMD=--nodiscover"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
discoveryCmd = "BOOTNODE_CMD=--nodiscover"
discoveryCmd = `BOOTNODE_CMD=""`

@EnriqueL8
Copy link
Contributor

Will merge these changes, and @jimthematrix will include his proposed changes in a new PR. I believe getting this working for v1.3.1 is critical so going ahead and merging

Copy link
Contributor

@EnriqueL8 EnriqueL8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As explained above, merging and Jim will raise a PR with proposed fixes! Thanks for the contribution @rodion-lim-partior 😃

@EnriqueL8 EnriqueL8 merged commit bea8476 into hyperledger:main Aug 5, 2024
11 checks passed
@rodion-lim-partior
Copy link
Contributor Author

rodion-lim-partior commented Aug 22, 2024

@jimthematrix, apologies for the late reply, the original PR that I raised for adding Quorum/Tessera support is in line with your suggested changes. I kept --no-discover in this PR due to this commit that was added by Peter e1707ea, I wasn't sure if no-discover was added due to unwanted connections from people outside the network. I tested your changes, it worked fine on our environments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants