Skip to content

Commit

Permalink
Change ReleaseVersion to ProtocolVersion && add publish version
Browse files Browse the repository at this point in the history
  • Loading branch information
rosona committed Dec 6, 2018
1 parent f6917a9 commit 328345a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
6 changes: 4 additions & 2 deletions AElf.Common/GlobalConfig.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
using System.Reflection;

namespace AElf.Common
{
// ReSharper disable InconsistentNaming
public static class GlobalConfig
{
// current release version
public static string ReleaseVersion = "0.6";
public static int ProtocolVersion = 1;

public static int AddressLength = 18;
public const ulong GenesisBlockHeight = 1;
public static readonly string GenesisSmartContractZeroAssemblyName = "AElf.Contracts.Genesis";
Expand Down
2 changes: 1 addition & 1 deletion AElf.Network.Tests/NetworkTestHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static (ECKeyPair, Handshake) CreateKeyPairAndHandshake(int port)
{
NodeInfo = nodeInfo,
PublicKey = ByteString.CopyFrom(key.GetEncodedPublicKey()),
Version = GlobalConfig.ReleaseVersion,
Version = GlobalConfig.ProtocolVersion,
R = ByteString.CopyFrom(sig.R),
S = ByteString.CopyFrom(sig.S),
};
Expand Down
2 changes: 1 addition & 1 deletion AElf.Network/Data/Protobuf/Definitions/messages.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ message Handshake {
NodeData NodeInfo = 1;
bytes PublicKey = 2;
int32 Height = 3;
string Version = 4;
int32 Version = 4;
// sig NodeData
bytes R = 9;
bytes S = 10;
Expand Down
6 changes: 3 additions & 3 deletions AElf.Network/Peers/Peer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,9 @@ private void StartAuthentification()
NodeInfo = nodeInfo,
PublicKey = ByteString.CopyFrom(_nodeKey.GetEncodedPublicKey()),
Height = CurrentHeight,
Version = GlobalConfig.ReleaseVersion,
Version = GlobalConfig.ProtocolVersion,
R = ByteString.CopyFrom(sig.R),
S = ByteString.CopyFrom(sig.S),
S = ByteString.CopyFrom(sig.S)
};

byte[] packet = nd.ToByteArray();
Expand Down Expand Up @@ -361,7 +361,7 @@ internal void AuthentifyWith(Handshake handshakeMsg)

try
{
if (string.IsNullOrEmpty(handshakeMsg.Version) || handshakeMsg.Version != GlobalConfig.ReleaseVersion)
if (handshakeMsg.Version != GlobalConfig.ProtocolVersion)
{
FireInvalidAuth(RejectReason.AuthWrongVersion);
return;
Expand Down
2 changes: 1 addition & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DOCKER_USERNAME=$2
DOCKER_PASSWORD=$3

# AElf node
dotnet publish -c Release -o ~/aelf/
dotnet publish /p:Version=$TAG -c Release -o ~/aelf/

docker build -t aelf/node:$TAG ~/aelf/.
docker tag aelf/node:$TAG aelf/node:latest
Expand Down

0 comments on commit 328345a

Please sign in to comment.