Skip to content

Commit

Permalink
Merge pull request #14 from cypher-network/serf-client-id
Browse files Browse the repository at this point in the history
Serf node name should be consistent between restarts.
  • Loading branch information
0xn3bs committed Jan 23, 2021
2 parents c2264a8 + 529e4e4 commit f1b3ec6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cypcore/Services/SerfService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public async Task StartAsync(CancellationToken stoppingToken)

var pubKey = await _signing.GePublicKey(_signing.DefaultSigningKeyName);

_serfClient.Name = $"{_serfClient.SerfConfigurationOptions.NodeName}-{Helper.Util.SHA384ManagedHash(Guid.NewGuid().ToString().ToBytes()).ByteToHex()}";
_serfClient.Name = $"{_serfClient.SerfConfigurationOptions.NodeName}-{Helper.Util.SHA384ManagedHash(pubKey).ByteToHex()}";
_serfClient.P2PConnectionOptions.ClientId = Helper.Util.HashToId(pubKey.ByteToHex());

var serfPath = GetFilePath();
Expand Down

0 comments on commit f1b3ec6

Please sign in to comment.