diff --git a/neo-cli/Shell/MainService.cs b/neo-cli/Shell/MainService.cs index bd0ac1153..f7fd66d43 100644 --- a/neo-cli/Shell/MainService.cs +++ b/neo-cli/Shell/MainService.cs @@ -1,4 +1,5 @@ using Akka.Actor; +using Neo.Consensus; using Neo.IO; using Neo.Ledger; using Neo.Network.P2P; @@ -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": @@ -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()) @@ -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": @@ -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: @@ -645,6 +669,7 @@ private bool OnOpenWalletCommand(string[] args) { Console.WriteLine($"failed to open file \"{path}\""); } + system.RpcServer.OpenWallet(Program.Wallet); return true; } diff --git a/neo-cli/neo-cli.csproj b/neo-cli/neo-cli.csproj index 2071e443a..75df2339f 100644 --- a/neo-cli/neo-cli.csproj +++ b/neo-cli/neo-cli.csproj @@ -3,7 +3,7 @@ 2016-2018 The Neo Project Neo.CLI - 2.9.1 + 2.9.2 The Neo Project netcoreapp2.0 neo-cli diff --git a/neo-cli/protocol.json b/neo-cli/protocol.json index ab452c314..c37ec0400 100644 --- a/neo-cli/protocol.json +++ b/neo-cli/protocol.json @@ -2,7 +2,8 @@ "ProtocolConfiguration": { "Magic": 7630401, "AddressVersion": 23, - "SecondsPerBlock": 15, + "SecondsPerBlock": 15, + "LowPriorityThreshold": 0.001, "StandbyValidators": [ "03b209fd4f53a7170ea4444e0cb0a6bb6a53c2bd016926989cf85f9b0fba17a70c", "02df48f60e8f3e01c48ff40b9b7f1310d7a8b2a193188befe1c2e3df740e895093", diff --git a/neo-cli/protocol.mainnet.json b/neo-cli/protocol.mainnet.json index 4e3fe51aa..c37ec0400 100644 --- a/neo-cli/protocol.mainnet.json +++ b/neo-cli/protocol.mainnet.json @@ -3,6 +3,7 @@ "Magic": 7630401, "AddressVersion": 23, "SecondsPerBlock": 15, + "LowPriorityThreshold": 0.001, "StandbyValidators": [ "03b209fd4f53a7170ea4444e0cb0a6bb6a53c2bd016926989cf85f9b0fba17a70c", "02df48f60e8f3e01c48ff40b9b7f1310d7a8b2a193188befe1c2e3df740e895093", diff --git a/neo-cli/protocol.testnet.json b/neo-cli/protocol.testnet.json index 83b22b1a7..9384d0b7c 100644 --- a/neo-cli/protocol.testnet.json +++ b/neo-cli/protocol.testnet.json @@ -3,6 +3,7 @@ "Magic": 1953787457, "AddressVersion": 23, "SecondsPerBlock": 15, + "LowPriorityThreshold": 0, "StandbyValidators": [ "0327da12b5c40200e9f65569476bbff2218da4f32548ff43b6387ec1416a231ee8", "026ce35b29147ad09e4afe4ec4a7319095f08198fa8babbe3c56e970b143528d22",