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

Commit

Permalink
update dependency: Neo v2.7.5
Browse files Browse the repository at this point in the history
  • Loading branch information
erikzhang committed May 18, 2018
1 parent 95e25ce commit 6a4be21
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 128 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,19 @@
All notable changes to this project will be documented in this file.

## [Unreleased]

## [2.7.5] - 2018-05-18
### Added
- Importing/exporting blocks with sharding.
- Daemonizing the neo process.
- Support for Neo Plugins System.
- New smart contract API: `Neo.Contract.IsPayable`.

### Changed
- Optimize RPC command `getbalance` for NEP-5.
- Optimize config.json
- Improve the performance of p2p network.
- Improve the performance of block synchronization.

### Fixed
- Prevents blocking when the second instance is started.
Expand Down
32 changes: 32 additions & 0 deletions neo-cli/Consensus/ConsensusWithLog.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using Neo.Network;
using Neo.Wallets;
using System;
using System.IO;

namespace Neo.Consensus
{
internal class ConsensusWithLog : ConsensusService
{
private string log_dictionary;

public ConsensusWithLog(LocalNode localNode, Wallet wallet, string log_dictionary)
: base(localNode, wallet)
{
this.log_dictionary = log_dictionary;
}

protected override void Log(string message)
{
DateTime now = DateTime.Now;
string line = $"[{now.TimeOfDay:hh\\:mm\\:ss}] {message}";
Console.WriteLine(line);
if (string.IsNullOrEmpty(log_dictionary)) return;
lock (log_dictionary)
{
Directory.CreateDirectory(log_dictionary);
string path = Path.Combine(log_dictionary, $"{now:yyyy-MM-dd}.log");
File.AppendAllLines(path, new[] { line });
}
}
}
}
54 changes: 0 additions & 54 deletions neo-cli/Consensus/ConsensusWithPolicy.cs

This file was deleted.

38 changes: 0 additions & 38 deletions neo-cli/Consensus/Policy.cs

This file was deleted.

10 changes: 0 additions & 10 deletions neo-cli/Consensus/PolicyLevel.cs

This file was deleted.

27 changes: 3 additions & 24 deletions neo-cli/Shell/MainService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ internal class MainService : ConsoleServiceBase
private const string PeerStatePath = "peers.dat";

private RpcServerWithWallet rpc;
private ConsensusWithPolicy consensus;
private ConsensusWithLog consensus;

protected LocalNode LocalNode { get; private set; }
protected override string Prompt => "neo";
Expand Down Expand Up @@ -78,8 +78,6 @@ protected override bool OnCommand(string[] args)
return OnOpenCommand(args);
case "rebuild":
return OnRebuildCommand(args);
case "refresh":
return OnRefreshCommand(args);
case "send":
return OnSendCommand(args);
case "show":
Expand Down Expand Up @@ -407,8 +405,7 @@ private bool OnHelpCommand(string[] args)
"\texport block[s] [path=chain.acc]\n" +
"\texport block[s] <start> [count]\n" +
"Advanced Commands:\n" +
"\tstart consensus\n" +
"\trefresh policy\n");
"\tstart consensus\n");
return true;
}

Expand Down Expand Up @@ -617,24 +614,6 @@ private bool OnRebuildIndexCommand(string[] args)
return true;
}

private bool OnRefreshCommand(string[] args)
{
switch (args[1].ToLower())
{
case "policy":
return OnRefreshPolicyCommand(args);
default:
return base.OnCommand(args);
}
}

private bool OnRefreshPolicyCommand(string[] args)
{
if (consensus == null) return true;
consensus.RefreshPolicy();
return true;
}

private bool OnSendCommand(string[] args)
{
if (args.Length < 4 || args.Length > 5)
Expand Down Expand Up @@ -941,7 +920,7 @@ private bool OnStartConsensusCommand(string[] args)
return true;
}
string log_dictionary = Path.Combine(AppContext.BaseDirectory, "Logs");
consensus = new ConsensusWithPolicy(LocalNode, Program.Wallet, log_dictionary);
consensus = new ConsensusWithLog(LocalNode, Program.Wallet, log_dictionary);
ShowPrompt = false;
consensus.Start();
return true;
Expand Down
4 changes: 2 additions & 2 deletions neo-cli/neo-cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Copyright>2016-2017 The Neo Project</Copyright>
<AssemblyTitle>Neo.CLI</AssemblyTitle>
<Version>2.7.4</Version>
<Version>2.7.5</Version>
<Authors>The Neo Project</Authors>
<TargetFramework>netcoreapp2.0</TargetFramework>
<AssemblyName>neo-cli</AssemblyName>
Expand All @@ -28,7 +28,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Neo" Version="2.7.4" />
<PackageReference Include="Neo" Version="2.7.5" />
</ItemGroup>

</Project>

0 comments on commit 6a4be21

Please sign in to comment.