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

Migrate SignalR feature into WebHost #121

Merged
merged 15 commits into from
May 14, 2020

Conversation

sondreb
Copy link
Member

@sondreb 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.
@sondreb sondreb requested a review from dangershony May 12, 2020 01:01
@@ -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.
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

@dangershony dangershony left a 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

sondreb and others added 5 commits May 13, 2020 20:41
- 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)
Copy link
Member

Choose a reason for hiding this comment

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

Fingers crossed

Copy link
Member

@dangershony dangershony left a 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.

dangershony and others added 6 commits May 14, 2020 01:32
- We're returning the whole object in the evernt, no longer needed to read out hash and height.
- 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.
sondreb added 2 commits May 14, 2020 13:30
…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.
@dangershony dangershony merged commit 7917a2f into master May 14, 2020
@dangershony dangershony deleted the feature/migrate-signalr-to-webhost branch May 14, 2020 22:39
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