-
Notifications
You must be signed in to change notification settings - Fork 286
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
Offline Node Support #3383
Offline Node Support #3383
Conversation
* Add IsOffline to node config Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
I would suggest add the following logic:
This can further prevent node from using network. Else the node is still using libp2p for peer discovery. Do you think this is reasonable? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reasonable request by @JackyWYX , please fix them. thanks.
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* Use default local listening ip for p2p hors if node is in offline Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* Fix TestAddPeer & TestConnectionToInvalidPeer p2p test Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
Sure seems fair enough, added this logic and fixed related tests along the way. |
I think this is a public variable right? Comments are required for public
stuff😂
…On Fri, Oct 9, 2020 at 2:09 AM Daniel Van Der Maden < ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In internal/configs/node/network.go
<#3383 (comment)>:
> @@ -39,6 +39,10 @@ const (
)
const (
+ // DefaultLocalListenIP ..
Ill remove it then
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3383 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJSNLCEZ3T6HV2C55PMA2VTSJ3HLNANCNFSM4SHISFHQ>
.
|
Yea... updated the comment right after |
25a981b
to
c70fdb9
Compare
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
c70fdb9
to
0b8fc7b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
This feature is needed for a correct deployment of a rosetta 'offline' node. That said, it is a perfectly reasonable feature to have on its own - rosetta notwithstanding. I imagine that it would great for debugging / devs.
One can run a node in offline mode by adding the
--run.offline
option. This option has been tested to be backwards compatible with older config files. It defaults to an 'online' setting if the option/config is not provided.An offline node simply means that it does not sync & is not subscribed to any p2p topic or has any p2p peers.
I've had to keep some service instantiations to ensure other services don't crash from a nil pointer.