Skip to content

Commit 3bc4235

Browse files
committed
improved client id
1 parent 0be27c0 commit 3bc4235

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/Nethermind/Nethermind.Core/Version.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,26 @@
1616
* along with the Nethermind. If not, see <http://www.gnu.org/licenses/>.
1717
*/
1818

19+
using System;
1920
using System.Runtime.InteropServices;
2021

2122
namespace Nethermind.Core
2223
{
2324
public static class ClientVersion
2425
{
26+
static ClientVersion()
27+
{
28+
string osDescription = RuntimeInformation.OSDescription;
29+
if (osDescription.Contains('#'))
30+
{
31+
int indexOfHash = osDescription.IndexOf('#');
32+
osDescription = osDescription.Substring(0, Math.Max(0, indexOfHash - 1));
33+
}
34+
35+
Description = $"Nethermind/v0.9.1-RC0/{RuntimeInformation.OSArchitecture}-{osDescription}/{RuntimeInformation.FrameworkDescription.Trim().Replace(".NET ", "").Replace(" ", "")}";
36+
}
37+
2538
// public static readonly string Description = $"Nethermind/v0.9.0-eth63test/{RuntimeInformation.OSArchitecture}-{RuntimeInformation.OSDescription.Trim().Replace(" ", "_")}/{RuntimeInformation.FrameworkDescription.Trim().Replace(".NET ", "").Replace(" ", "")}";
26-
public static readonly string Description = $"Nethermind/v0.9.1-RC0/{RuntimeInformation.OSArchitecture}/{RuntimeInformation.FrameworkDescription.Trim().Replace(".NET ", "").Replace(" ", "")}";
39+
public static string Description { get; }
2740
}
2841
}

0 commit comments

Comments
 (0)