Skip to content

Commit 5f0211e

Browse files
committed
Unify logging for features
- Makes the logging for API, RPC and WS similar. - Sets a default WS port for XDS. "API listening on: http://localhost:48334/" "RPC listening on: http://127.0.0.1:48333/" "WS listening on: http://localhost:48335/" "Node listening on: 0.0.0.0:38333" And shutdown: "WS stopping on URL 'http://localhost:48335/'." "API stopping on URL 'http://localhost:48334/'."
1 parent 0289121 commit 5f0211e

5 files changed

Lines changed: 11 additions & 3 deletions

File tree

src/Features/Blockcore.Features.Api/ApiFeature.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ public ApiFeature(
5252

5353
public override Task InitializeAsync()
5454
{
55-
this.logger.LogInformation("API starting on URL '{0}'.", this.apiSettings.ApiUri);
55+
this.logger.LogInformation($"API listening on: {Environment.NewLine}{this.apiSettings.ApiUri}");
56+
5657
this.webHost = Program.Initialize(this.fullNodeBuilder.Services, this.fullNode, this.apiSettings, this.certificateStore, new WebHostBuilder());
5758

5859
if (this.apiSettings.KeepaliveTimer == null)

src/Features/Blockcore.Features.RPC/RPCFeature.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public override Task InitializeAsync()
102102
.Build();
103103

104104
this.fullNode.RPCHost.Start();
105-
this.logger.LogInformation("RPC Server listening on: " + Environment.NewLine + string.Join(Environment.NewLine, this.rpcSettings.GetUrls()));
105+
this.logger.LogInformation("RPC listening on: " + Environment.NewLine + string.Join(Environment.NewLine, this.rpcSettings.GetUrls()));
106106
}
107107
else
108108
{

src/Features/Blockcore.Features.SignalR/SignalRFeature.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ public override Task InitializeAsync()
5252
clientEventBroadcaster.Init(eventBroadcasterSettings[clientEventBroadcaster.GetType()]);
5353
}
5454

55+
this.logger.LogInformation($"WS listening on: {Environment.NewLine}{this.settings.SignalRUri}");
56+
5557
return Task.CompletedTask;
5658
}
5759

@@ -79,7 +81,7 @@ public override void Dispose()
7981
{
8082
// Make sure we are releasing the listening ip address / port.
8183
if (this.webHost == null) return;
82-
this.logger.LogInformation("API stopping on URL '{0}'.", this.settings.SignalRUri);
84+
this.logger.LogInformation("WS stopping on URL '{0}'.", this.settings.SignalRUri);
8385
this.webHost.StopAsync(TimeSpan.FromSeconds(SignalRStopTimeoutSeconds)).Wait();
8486
this.webHost = null;
8587
}

src/Networks/Xds/Blockcore.Networks.Xds/XdsMain.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public XdsMain()
3838
this.DefaultPort = 38333;
3939
this.DefaultRPCPort = 48333;
4040
this.DefaultAPIPort = 48334;
41+
this.DefaultSignalRPort = 48335;
4142
this.DefaultMaxOutboundConnections = 16;
4243
this.DefaultMaxInboundConnections = 109;
4344
this.MaxTimeOffsetSeconds = 25 * 60;

src/Node/Blockcore.Node/Properties/launchSettings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@
5959
"XDS (TEST/LOCAL/RPC)": {
6060
"commandName": "Project",
6161
"commandLineArgs": "--chain=XDS -server -rpcallowip=127.0.0.1 -rpcbind=127.0.0.1 -rpcpassword=rpcpassword -rpcuser=rpcuser -datadir=nodedata -testnet"
62+
},
63+
"XDS (MAIN/LOCAL/RPC/SIGNALR)": {
64+
"commandName": "Project",
65+
"commandLineArgs": "--chain=XDS -server -rpcallowip=127.0.0.1 -rpcbind=127.0.0.1 -rpcpassword=rpcpassword -rpcuser=rpcuser -datadir=nodedata -enableSignalR=true"
6266
}
6367
}
6468
}

0 commit comments

Comments
 (0)