Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions libplanet-console.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{4194F59A-6D6
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "common", "common", "{0F5944E2-178A-44BF-8A09-29CAD668764A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LibplanetConsole.Seed", "src\common\LibplanetConsole.Seed\LibplanetConsole.Seed.csproj", "{E91A50E1-2E90-446B-BDB0-D88E0F153290}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "console", "console", "{CAB76DA9-6E57-4422-98C6-DD2D6299F675}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LibplanetConsole.Console", "src\console\LibplanetConsole.Console\LibplanetConsole.Console.csproj", "{7B2D3BF1-A244-4868-A6B7-B717DB7BCAA2}"
Expand Down Expand Up @@ -55,16 +53,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibplanetConsole.Console.Ba
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibplanetConsole.Node.Bank", "src\node\LibplanetConsole.Node.Bank\LibplanetConsole.Node.Bank.csproj", "{27D02D73-6D2C-4E69-8BB7-CFE206B7872C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibplanetConsole.Console.Seed", "src\console\LibplanetConsole.Console.Seed\LibplanetConsole.Console.Seed.csproj", "{B7C47731-7948-42E4-87FA-E82BDA26BC7D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E91A50E1-2E90-446B-BDB0-D88E0F153290}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E91A50E1-2E90-446B-BDB0-D88E0F153290}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E91A50E1-2E90-446B-BDB0-D88E0F153290}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E91A50E1-2E90-446B-BDB0-D88E0F153290}.Release|Any CPU.Build.0 = Release|Any CPU
{7B2D3BF1-A244-4868-A6B7-B717DB7BCAA2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7B2D3BF1-A244-4868-A6B7-B717DB7BCAA2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7B2D3BF1-A244-4868-A6B7-B717DB7BCAA2}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -141,13 +137,16 @@ Global
{27D02D73-6D2C-4E69-8BB7-CFE206B7872C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{27D02D73-6D2C-4E69-8BB7-CFE206B7872C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{27D02D73-6D2C-4E69-8BB7-CFE206B7872C}.Release|Any CPU.Build.0 = Release|Any CPU
{B7C47731-7948-42E4-87FA-E82BDA26BC7D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B7C47731-7948-42E4-87FA-E82BDA26BC7D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B7C47731-7948-42E4-87FA-E82BDA26BC7D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B7C47731-7948-42E4-87FA-E82BDA26BC7D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{0F5944E2-178A-44BF-8A09-29CAD668764A} = {4194F59A-6D6B-4651-B133-3FE6081BF1F9}
{E91A50E1-2E90-446B-BDB0-D88E0F153290} = {0F5944E2-178A-44BF-8A09-29CAD668764A}
{CAB76DA9-6E57-4422-98C6-DD2D6299F675} = {4194F59A-6D6B-4651-B133-3FE6081BF1F9}
{7B2D3BF1-A244-4868-A6B7-B717DB7BCAA2} = {CAB76DA9-6E57-4422-98C6-DD2D6299F675}
{8F43268F-B73B-4737-8C2F-D74F066FA09A} = {56942891-CFBD-41E4-8881-47F455D7BEFD}
Expand All @@ -170,10 +169,11 @@ Global
{C13519B7-B343-44EE-8797-62B17AD4CC84} = {1DEAA4CE-E29B-4379-BAF6-20B79A5946CB}
{12758854-4C5E-491B-B187-590D788C3B1A} = {CAB76DA9-6E57-4422-98C6-DD2D6299F675}
{27D02D73-6D2C-4E69-8BB7-CFE206B7872C} = {4A8F8EE9-769C-4C97-89BC-19D038E69998}
{B7C47731-7948-42E4-87FA-E82BDA26BC7D} = {CAB76DA9-6E57-4422-98C6-DD2D6299F675}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {3227501A-47F1-4FA6-A69C-B5801260FEC9}
{1778FDCB-AC26-43E4-97FE-FC4F0C427672} = {23C68389-8F13-48E7-9878-440917F70DAF}
{FEF8E9D4-CBB7-4EFC-A5C2-2C9E91498D79} = {4A8F8EE9-769C-4C97-89BC-19D038E69998}
SolutionGuid = {3227501A-47F1-4FA6-A69C-B5801260FEC9}
EndGlobalSection
EndGlobal
3 changes: 2 additions & 1 deletion src/client/LibplanetConsole.Client.Bank/Bank.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Grpc.Core;
using LibplanetConsole.Bank;
using LibplanetConsole.Bank.Grpc;
using LibplanetConsole.Client.Services;
using LibplanetConsole.Grpc.Bank;
using static LibplanetConsole.Grpc.TypeUtility;

namespace LibplanetConsole.Client.Bank;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System.ComponentModel;
using JSSoft.Commands;
using LibplanetConsole.Bank;
using LibplanetConsole.Bank.DataAnnotations;
using LibplanetConsole.BlockChain;
using LibplanetConsole.Common.Extensions;

namespace LibplanetConsole.Client.Bank.Commands;
Expand Down
2 changes: 2 additions & 0 deletions src/client/LibplanetConsole.Client.Bank/CurrencyCollection.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using LibplanetConsole.Bank;

namespace LibplanetConsole.Client.Bank;

internal sealed class CurrencyCollection(Bank bank) : CurrencyCollectionBase, IClientContent
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using JSSoft.Commands;
using LibplanetConsole.Bank;
using LibplanetConsole.Client.Bank.Commands;

namespace LibplanetConsole.Client.Bank;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Grpc.Core;
using LibplanetConsole.Grpc.Bank;
using LibplanetConsole.Bank;
using LibplanetConsole.Bank.Grpc;
using static LibplanetConsole.Grpc.TypeUtility;

namespace LibplanetConsole.Client.Bank.Services;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public async Task RunAsync(CancellationToken cancellationToken)
app.MapGet("/", () => "Libplanet-Client");
app.MapGrpcReflectionService().AllowAnonymous();

await Console.Out.WriteLineAsync();
await System.Console.Out.WriteLineAsync();
await app.RunAsync(cancellationToken);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using LibplanetConsole.Client.Services;
using LibplanetConsole.Grpc.Console;
using LibplanetConsole.Console.Grpc;
using LibplanetConsole.Console.Services;
using Microsoft.Extensions.Options;

namespace LibplanetConsole.Client.Executable;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using LibplanetConsole.Client.Services;
using LibplanetConsole.Common;
using LibplanetConsole.Console.Grpc;
using LibplanetConsole.Console.Services;
using LibplanetConsole.Grpc;
using LibplanetConsole.Grpc.Console;

namespace LibplanetConsole.Client.Executable;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ protected override async Task OnExecuteAsync(CancellationToken cancellationToken
}
catch (CommandParsingException e)
{
e.Print(Console.Out);
e.Print(System.Console.Out);
Environment.Exit(1);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ protected override async Task OnExecuteAsync(CancellationToken cancellationToken
}
catch (CommandParsingException e)
{
e.Print(Console.Out);
e.Print(System.Console.Out);
Environment.Exit(1);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Text;
using JSSoft.Commands.Extensions;
using JSSoft.Terminals;
using LibplanetConsole.BlockChain;
using LibplanetConsole.Common.Extensions;

namespace LibplanetConsole.Client.Executable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ public async Task StartAsync(CancellationToken cancellationToken)
await sw.WriteLineAsync();
await commandContext.ExecuteAsync(args: [], cancellationToken);
await sw.WriteSeparatorAsync(TerminalColorType.BrightGreen);
commandContext.Out = Console.Out;
commandContext.Out = System.Console.Out;
await sw.WriteLineIfAsync(GetStartupCondition(options), GetStartupMessage());
await Console.Out.WriteAsync(sw.ToString());
await System.Console.Out.WriteAsync(sw.ToString());

await terminal.StartAsync(cancellationToken);
_terminal = terminal;
Expand Down Expand Up @@ -81,9 +81,10 @@ private static string GetStartupMessage()
private async Task WaitInputAsync()
{
using var cancellationTokenSource = new CancellationTokenSource();
var cancellationToken = cancellationTokenSource.Token;
applicationLifetime.ApplicationStopping.Register(cancellationTokenSource.Cancel);
await Console.Out.WriteLineAsync("Press any key to exit.");
await Task.Run(() => Console.ReadKey(intercept: true), cancellationTokenSource.Token);
await System.Console.Out.WriteLineAsync("Press any key to exit.");
await Task.Run(() => System.Console.ReadKey(intercept: true), cancellationToken);
applicationLifetime.StopApplication();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using LibplanetConsole.BlockChain;
using LibplanetConsole.Common.Extensions;

namespace LibplanetConsole.Client.Executable.Tracers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ internal sealed class ClientEventTracer : ClientContentBase
protected override Task OnStartAsync(CancellationToken cancellationToken)
{
var message = $"BlockChain has been started.";
Console.Out.WriteColoredLine(message, TerminalColorType.BrightGreen);
System.Console.Out.WriteColoredLine(message, TerminalColorType.BrightGreen);
return Task.CompletedTask;
}

protected override Task OnStopAsync(CancellationToken cancellationToken)
{
var message = $"BlockChain has been stopped.";
Console.Out.WriteColoredLine(message, TerminalColorType.BrightGreen);
System.Console.Out.WriteColoredLine(message, TerminalColorType.BrightGreen);
return Task.CompletedTask;
}
}
2 changes: 2 additions & 0 deletions src/client/LibplanetConsole.Client/AddressCollection.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using LibplanetConsole.BlockChain;

namespace LibplanetConsole.Client;

internal sealed class AddressCollection : AddressCollectionBase, IClientContent
Expand Down
4 changes: 2 additions & 2 deletions src/client/LibplanetConsole.Client/Client.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using Grpc.Net.Client;
using LibplanetConsole.Client.Converters;
using LibplanetConsole.BlockChain.Converters;
using LibplanetConsole.Client.Extensions;
using LibplanetConsole.Client.Services;
using LibplanetConsole.Common;
using LibplanetConsole.Common.Extensions;
using LibplanetConsole.Node.Services;

namespace LibplanetConsole.Client;

Expand Down
5 changes: 3 additions & 2 deletions src/client/LibplanetConsole.Client/ClientBlockChain.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
using System.Security.Cryptography;
using Grpc.Core;
using Grpc.Net.Client;
using LibplanetConsole.Client.Services;
using LibplanetConsole.BlockChain;
using LibplanetConsole.BlockChain.Grpc;
using LibplanetConsole.BlockChain.Services;
using LibplanetConsole.Common;
using LibplanetConsole.Grpc.BlockChain;
using static LibplanetConsole.Grpc.TypeUtility;

namespace LibplanetConsole.Client;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using JSSoft.Commands;
using LibplanetConsole.BlockChain;
using LibplanetConsole.BlockChain.Commands;
using LibplanetConsole.Client.Commands;
using LibplanetConsole.Common;
using Microsoft.Extensions.Configuration;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Grpc.Core;
using LibplanetConsole.BlockChain;
using LibplanetConsole.BlockChain.Grpc;
using LibplanetConsole.Grpc;
using LibplanetConsole.Grpc.BlockChain;
using Microsoft.Extensions.Hosting;
using static LibplanetConsole.Grpc.TypeUtility;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Grpc.Core;
using LibplanetConsole.Client.Grpc;
using LibplanetConsole.Common;
using LibplanetConsole.Grpc;
using LibplanetConsole.Grpc.Client;
using Microsoft.Extensions.Hosting;

namespace LibplanetConsole.Client.Services;
Expand Down
3 changes: 2 additions & 1 deletion src/console/LibplanetConsole.Console.Bank/ClientBank.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Grpc.Core;
using LibplanetConsole.Bank;
using LibplanetConsole.Bank.Grpc;
using LibplanetConsole.Console.Services;
using LibplanetConsole.Grpc.Bank;
using static LibplanetConsole.Grpc.TypeUtility;

namespace LibplanetConsole.Console.Bank;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System.ComponentModel;
using JSSoft.Commands;
using LibplanetConsole.Bank;
using LibplanetConsole.Bank.DataAnnotations;
using LibplanetConsole.BlockChain;
using LibplanetConsole.Common.Extensions;

namespace LibplanetConsole.Console.Bank.Commands;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System.ComponentModel;
using JSSoft.Commands;
using LibplanetConsole.Bank;
using LibplanetConsole.Bank.DataAnnotations;
using LibplanetConsole.BlockChain;
using LibplanetConsole.Common.Extensions;
using LibplanetConsole.Console.Commands;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System.ComponentModel;
using JSSoft.Commands;
using LibplanetConsole.Bank;
using LibplanetConsole.Bank.DataAnnotations;
using LibplanetConsole.BlockChain;
using LibplanetConsole.Common.Extensions;
using LibplanetConsole.Console.Commands;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using LibplanetConsole.Bank;

namespace LibplanetConsole.Console.Bank;

internal sealed class CurrencyCollection : CurrencyCollectionBase, IConsoleContent
Expand Down
3 changes: 2 additions & 1 deletion src/console/LibplanetConsole.Console.Bank/NodeBank.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Grpc.Core;
using LibplanetConsole.Bank;
using LibplanetConsole.Bank.Grpc;
using LibplanetConsole.Console.Services;
using LibplanetConsole.Grpc.Bank;
using static LibplanetConsole.Grpc.TypeUtility;

namespace LibplanetConsole.Console.Bank;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using JSSoft.Commands;
using LibplanetConsole.Bank;
using LibplanetConsole.Console.Bank.Commands;

namespace LibplanetConsole.Console.Bank;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Libplanet.Types.Evidence;
using LibplanetConsole.Evidence;

namespace LibplanetConsole.Console.Evidence;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using Grpc.Core;
using Libplanet.Types.Evidence;
using LibplanetConsole.Console.Services;
using LibplanetConsole.Grpc.Evidence;
using LibplanetConsole.Evidence;
using LibplanetConsole.Evidence.Grpc;
using static LibplanetConsole.Grpc.TypeUtility;

namespace LibplanetConsole.Console.Evidence;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using LibplanetConsole.Console.Evidence;
using LibplanetConsole.Console.Executable.Commands;
using LibplanetConsole.Console.Executable.Tracers;
using LibplanetConsole.Console.Seed;
using LibplanetConsole.Logging;
using Serilog;

Expand Down Expand Up @@ -51,6 +52,7 @@ public Application(WebApplicationBuilder builder)
services.AddSingleton<ICommand, DeleteClientCommand>();

services.AddConsole(configuration);
services.AddSeed();
services.AddEvidence();
services.AddBank();

Expand Down Expand Up @@ -90,6 +92,7 @@ public async Task RunAsync(CancellationToken cancellationToken)
using var app = _builder.Build();

app.UseConsole();
app.UseSeed();
app.MapGet("/", () => "Libplanet-Console");
app.MapGrpcReflectionService().AllowAnonymous();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using LibplanetConsole.Common.Extensions;
using LibplanetConsole.Common.IO;
using LibplanetConsole.DataAnnotations;
using LibplanetConsole.Node;
using static LibplanetConsole.Common.EndPointUtility;

namespace LibplanetConsole.Console.Executable.EntryCommands;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<ItemGroup>
<ProjectReference Include="..\..\common\LibplanetConsole.Common\LibplanetConsole.Common.csproj" />
<ProjectReference Include="..\LibplanetConsole.Console\LibplanetConsole.Console.csproj" />
<ProjectReference Include="..\LibplanetConsole.Console.Seed\LibplanetConsole.Console.Seed.csproj" />
<ProjectReference Include="..\LibplanetConsole.Console.Evidence\LibplanetConsole.Console.Evidence.csproj" />
<ProjectReference Include="..\LibplanetConsole.Console.Bank\LibplanetConsole.Console.Bank.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using LibplanetConsole.Common;
using LibplanetConsole.Node;

namespace LibplanetConsole.Console.Executable;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using LibplanetConsole.Common.DataAnnotations;
using LibplanetConsole.Common.Progresses;
using LibplanetConsole.Console.Extensions;
using LibplanetConsole.Node;
using LibplanetConsole.Options;
using static LibplanetConsole.Common.EndPointUtility;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Text;
using JSSoft.Commands.Extensions;
using JSSoft.Terminals;
using LibplanetConsole.BlockChain;
using LibplanetConsole.Common.Extensions;

namespace LibplanetConsole.Console.Executable;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
namespace LibplanetConsole.Seed;
using LibplanetConsole.Seed;

namespace LibplanetConsole.Console.Seed;

public interface ISeedService
{
bool IsEnabled { get; }

Task<SeedInfo> GetSeedAsync(PublicKey publicKey, CancellationToken cancellationToken);
}
Loading