-
Notifications
You must be signed in to change notification settings - Fork 91
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
Migrate SignalR feature into WebHost #121
Conversation
sondreb
commented
May 12, 2020
- Migrate the SignalR feature into WebHost.
- Further refactor WebHost from "Api" to "WebHost.
- Remove the versioning support from REST API.
- Enable flags to enable/disable UI, API and WS.
- Generate and include XML documentation in the REST API for all features.
- Add a basic example on Web Socket listener.
- Migrate the SignalR feature into WebHost. - Further refactor WebHost from "Api" to "WebHost. - Remove the versioning support from REST API. - Enable flags to enable/disable UI, API and WS. - Generate and include XML documentation in the REST API for all features. - Add a basic example on Web Socket listener.
src/Features/Blockcore.Features.WebHost/Blockcore.Features.WebHost.csproj
Outdated
Show resolved
Hide resolved
src/Features/Blockcore.Features.WebHost/KeepAliveActionFilter.cs
Outdated
Show resolved
Hide resolved
@@ -28,6 +28,21 @@ public class ApiSettings | |||
/// <summary>URI to node's API interface.</summary> | |||
public Timer KeepaliveTimer { get; private set; } | |||
|
|||
/// <summary> | |||
/// If true then the node will add and start the SignalR feature. This should never be enabled if node is accessible to the public. |
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.
Are they on by default? should we document that?
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.
this.EnableWS = config.GetOrDefault("enableWS", false, this.logger);
this.EnableUI = config.GetOrDefault("enableUI", true, this.logger);
this.EnableAPI = config.GetOrDefault("enableAPI", true, this.logger);
Probably document somewhere, and we should decide what we want on by default.
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.
Brilliant PR just the one comment to move broadcasters to their parent projects and this is good
src/Features/Blockcore.Features.WebHost/Broadcasters/WalletInfoBroadcaster.cs
Outdated
Show resolved
Hide resolved
- Return the EventBase directly to Web Socket consumers. - Remove unused code. - Remove references in WebHost project.
- Move the Assembly extension from Swagger scaffolding to Utilities. - Minor bug discovered in dispose when object is null (happened during an integration test).
- Next commit will rename the physical folder.
- Updates all references, etc. from WebHost to NodeHost.
@@ -311,8 +311,11 @@ private void StartAddressManager(NetworkPeerConnectionParameters connectionParam | |||
/// <inheritdoc /> | |||
public override void Dispose() | |||
{ | |||
this.logger.LogInformation("Flushing peers."); | |||
this.flushAddressManagerLoop.Dispose(); | |||
if (this.flushAddressManagerLoop != null) |
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.
Fingers crossed
src/Features/Blockcore.Features.NodeHost/Blockcore.Features.NodeHost.csproj
Outdated
Show resolved
Hide resolved
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.
Brilliant commit, I am gonna push a small change to fix the static service provider field.
- We're returning the whole object in the evernt, no longer needed to read out hash and height.
This reverts commit 4f8af1b.
…om/block-core/blockcore into feature/migrate-signalr-to-webhost
- Minor cleanup of events, removing older properties.
- Update to use relative path when hosted on the NodeHost. - Add JsonIgnore on objects that can't serialize. This needs to be added to more.
…h node - Certain types will crash the node when sent to the Web Socket consumer. - Beware of this issue in the future when working on the event types. - Remove the EventType and instead only have EventName.
…ice is registered - When using the node without .UseWebHost, no implementation of IEventsSubscriptionService is registered. This fixes the broadcasters by handling them as empty if one is not provided.
- Reverted the changes to check for nulls on IBD check.