Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Commit

Permalink
v2.9.2 (#261)
Browse files Browse the repository at this point in the history
* update dependency: Neo v2.9.2

* allow changing view from CLI
  • Loading branch information
erikzhang authored Nov 16, 2018
1 parent a380a7c commit 626d16c
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 2 deletions.
25 changes: 25 additions & 0 deletions neo-cli/Shell/MainService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Akka.Actor;
using Neo.Consensus;
using Neo.IO;
using Neo.Ledger;
using Neo.Network.P2P;
Expand Down Expand Up @@ -60,6 +61,8 @@ protected override bool OnCommand(string[] args)
return OnRelayCommand(args);
case "sign":
return OnSignCommand(args);
case "change":
return OnChangeCommand(args);
case "create":
return OnCreateCommand(args);
case "export":
Expand Down Expand Up @@ -200,6 +203,25 @@ private bool OnSignCommand(string[] args)
return true;
}

private bool OnChangeCommand(string[] args)
{
switch (args[1].ToLower())
{
case "view":
return OnChangeViewCommand(args);
default:
return base.OnCommand(args);
}
}

private bool OnChangeViewCommand(string[] args)
{
if (args.Length != 3) return false;
if (!byte.TryParse(args[2], out byte viewnumber)) return false;
system.Consensus?.Tell(new ConsensusService.SetViewNumber { ViewNumber = viewnumber });
return true;
}

private bool OnCreateCommand(string[] args)
{
switch (args[1].ToLower())
Expand Down Expand Up @@ -281,6 +303,7 @@ private bool OnCreateWalletCommand(string[] args)
WalletAccount account = Program.Wallet.CreateAccount();
Console.WriteLine($"address: {account.Address}");
Console.WriteLine($" pubkey: {account.GetKey().PublicKey.EncodePoint(true).ToHexString()}");
system.RpcServer.OpenWallet(Program.Wallet);
}
break;
case ".json":
Expand All @@ -292,6 +315,7 @@ private bool OnCreateWalletCommand(string[] args)
Program.Wallet = wallet;
Console.WriteLine($"address: {account.Address}");
Console.WriteLine($" pubkey: {account.GetKey().PublicKey.EncodePoint(true).ToHexString()}");
system.RpcServer.OpenWallet(Program.Wallet);
}
break;
default:
Expand Down Expand Up @@ -645,6 +669,7 @@ private bool OnOpenWalletCommand(string[] args)
{
Console.WriteLine($"failed to open file \"{path}\"");
}
system.RpcServer.OpenWallet(Program.Wallet);
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion neo-cli/neo-cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Copyright>2016-2018 The Neo Project</Copyright>
<AssemblyTitle>Neo.CLI</AssemblyTitle>
<Version>2.9.1</Version>
<Version>2.9.2</Version>
<Authors>The Neo Project</Authors>
<TargetFramework>netcoreapp2.0</TargetFramework>
<AssemblyName>neo-cli</AssemblyName>
Expand Down
3 changes: 2 additions & 1 deletion neo-cli/protocol.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"ProtocolConfiguration": {
"Magic": 7630401,
"AddressVersion": 23,
"SecondsPerBlock": 15,
"SecondsPerBlock": 15,
"LowPriorityThreshold": 0.001,
"StandbyValidators": [
"03b209fd4f53a7170ea4444e0cb0a6bb6a53c2bd016926989cf85f9b0fba17a70c",
"02df48f60e8f3e01c48ff40b9b7f1310d7a8b2a193188befe1c2e3df740e895093",
Expand Down
1 change: 1 addition & 0 deletions neo-cli/protocol.mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"Magic": 7630401,
"AddressVersion": 23,
"SecondsPerBlock": 15,
"LowPriorityThreshold": 0.001,
"StandbyValidators": [
"03b209fd4f53a7170ea4444e0cb0a6bb6a53c2bd016926989cf85f9b0fba17a70c",
"02df48f60e8f3e01c48ff40b9b7f1310d7a8b2a193188befe1c2e3df740e895093",
Expand Down
1 change: 1 addition & 0 deletions neo-cli/protocol.testnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"Magic": 1953787457,
"AddressVersion": 23,
"SecondsPerBlock": 15,
"LowPriorityThreshold": 0,
"StandbyValidators": [
"0327da12b5c40200e9f65569476bbff2218da4f32548ff43b6387ec1416a231ee8",
"026ce35b29147ad09e4afe4ec4a7319095f08198fa8babbe3c56e970b143528d22",
Expand Down

0 comments on commit 626d16c

Please sign in to comment.