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

Validate Node on Selection #604

Closed
ohager opened this issue Jul 11, 2019 · 6 comments

Comments

@ohager
Copy link
Member

commented Jul 11, 2019

Is your feature request related to a problem? Please describe.
Currently, the nodes are predefined, but can also be edited. The problem of "custom" nodes is that no additional version information is available. Due to new features in BRS >=2.3.1 (i.e. MultiOut) different results may occur leading to eventual inconsistency and uncaught exceptions

Describe the solution you'd like
When selecting a new node, the node should be checked by it's availability, and the current version must be requested using getPeer. The node can be only changed, if the node is reachable/exists.

@ohager ohager changed the title Node Selection should get Version dynamically Validate Node on Selection Jul 11, 2019

@ohager ohager self-assigned this Jul 11, 2019

@harry1453

This comment has been minimized.

Copy link
Member

commented Jul 12, 2019

Surely you would use getState?

@ohager

This comment has been minimized.

Copy link
Member Author

commented Jul 12, 2019

GetState assumes that I'm already connected. But getPeer allows me to check whether that node exists. The idea is to make node selection more robust and avoid invalid values.

@harry1453

This comment has been minimized.

Copy link
Member

commented Jul 12, 2019

can't you just ping the node's getState endpoint? Then you would confirm connectivity at the same time

@harry1453

This comment has been minimized.

Copy link
Member

commented Jul 12, 2019

Additionally, it allows traversal across eg. mainnet and testnet where nodes may not be connected. And nodes are not guaranteed to be in every other node's peer list.

@ohager

This comment has been minimized.

Copy link
Member Author

commented Jul 13, 2019

I figured out that getState needs several seconds, as I just need the version info I changed to getBlockchainStatus, which is much faster. getPeer does not really work, as it has probswith urls...

@harry1453

This comment has been minimized.

Copy link
Member

commented Jul 14, 2019

getState on 2.4.0 is faster. But yes it takes a while on older versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.