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

Node Connection Status #775

Merged
merged 6 commits into from
Feb 23, 2021
Merged

Node Connection Status #775

merged 6 commits into from
Feb 23, 2021

Conversation

m-janos
Copy link
Contributor

@m-janos m-janos commented Feb 11, 2021

Checklist

  • I have followed (at least) the PR section of the contributing guide.
  • I fixed all necessary PR warnings
  • The commit history is clean
  • The E2E tests are passing
  • If possible, the issue has been divided into more subtasks
  • I did a self review before requesting a review from another team member

Description

  • Display connection status of each node in the network list (/nodes page)
  • Used getpeerinfo to retrieve all connected peers, compare with node list to determine status

Test Plan

  1. in scripts/development/docker-compose.yml add following service right after master-node:
 slave-node:
   build:
     context: ../../blockchain
   environment:
     ORGANIZATION: ${ORGANIZATION}
     RPC_PORT: ${RPC_PORT}
     RPC_PASSWORD: ${RPC_PASSWORD}
     P2P_HOST: master-node
     P2P_PORT: ${P2P_PORT}
     API_PROTO: http
     API_HOST: master-api
     API_PORT: ${API_PORT}
     EXTERNAL_IP: master-node
   volumes:
     - /tmp/bcSlaveVolume:/root/.multichain
   ports:
     - "7448:7447"
  1. Run app as normal, approve new node and check that Network table on /nodes page displays two nodes with Connection status
  2. In new terminal window run docker exec -it trubudget-dev_slave-node_1 bash
  3. In afterwards-opened subshell run multichain-cli TrubudgetChain stop
  4. Check frontend, one node should be disconnected
  5. Return to the subshell and run multichaind -txindex -port=7447 -autosubscribe=streams TrubudgetChain@master-node:7447 “” -externalip=master-node
  6. Refresh the page on the frontend. The node should be connected again

Resources

Issue

Subtask of #746

@m-janos m-janos self-assigned this Feb 11, 2021
@openkfwCI
Copy link

openkfwCI commented Feb 11, 2021

NotesTime
Note for Reviewer: E2E tests on remote server succeededTue, 23 Feb 2021 14:19:55 +0000

Generated by E2E-Test

@m-janos m-janos marked this pull request as ready for review February 12, 2021 08:29
@m-janos m-janos removed their assignment Feb 12, 2021
@georgimld georgimld self-assigned this Feb 17, 2021
@georgimld
Copy link
Collaborator

Found a possible bug:
When a slave node is trying to connect to the network, it is retrying every 10 seconds and the logs in the container are

"Please ask blockchain admin or user having activate permission to let you connect and/or transact:
multichain-cli TrubudgetChain grant addressOfNode connect
multichain-cli TrubudgetChain grant addressOfNode connect,send,receive"

When approving a new node (Step 2 in the test plan), the node is given permissions (check using the multichain-cli command listpermissions * addressOfNode), but the node still appears offline (getpeerinfo shows no node) and according to the logs in the node's container the slave node keeps restarting every 10 seconds - which is why it appears not connected, even though it does have the necessary permissions to connect.

@m-janos
Copy link
Contributor Author

m-janos commented Feb 22, 2021

Found a possible bug:
When a slave node is trying to connect to the network, it is retrying every 10 seconds and the logs in the container are

"Please ask blockchain admin or user having activate permission to let you connect and/or transact:
multichain-cli TrubudgetChain grant addressOfNode connect
multichain-cli TrubudgetChain grant addressOfNode connect,send,receive"

When approving a new node (Step 2 in the test plan), the node is given permissions (check using the multichain-cli command listpermissions * addressOfNode), but the node still appears offline (getpeerinfo shows no node) and according to the logs in the node's container the slave node keeps restarting every 10 seconds - which is why it appears not connected, even though it does have the necessary permissions to connect.

A new node is registered as connected after some time (one case takes 14 Minutes) and the "Please ask blockchain admin" message will disappear by itself.

@georgimld georgimld merged commit b20c916 into master Feb 23, 2021
@georgimld georgimld deleted the 746-node-connection-status branch February 23, 2021 14:44
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