Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add samples of contract services usages. #29

Open
wants to merge 22 commits into
base: dev
Choose a base branch
from
Open
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
37 changes: 37 additions & 0 deletions AElf.Client.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{940361AC-2167-4D30-A4F6-9A543C608196}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{7CD2B508-C765-4720-B430-94E79135797A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.Client", "src\AElf.Client\AElf.Client.csproj", "{1AE7844D-B4D9-4F5A-9D25-7E551B61138E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.Client.Test", "test\AElf.Client.Test\AElf.Client.Test.csproj", "{4D019C99-8B1C-42B0-8630-F1E3661F414B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.Client.Protobuf", "src\AElf.Client.Protobuf\AElf.Client.Protobuf.csproj", "{01B13EE5-9892-4D2A-8E77-C0A4A9575753}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{1AE7844D-B4D9-4F5A-9D25-7E551B61138E} = {940361AC-2167-4D30-A4F6-9A543C608196}
{4D019C99-8B1C-42B0-8630-F1E3661F414B} = {7CD2B508-C765-4720-B430-94E79135797A}
{01B13EE5-9892-4D2A-8E77-C0A4A9575753} = {940361AC-2167-4D30-A4F6-9A543C608196}
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1AE7844D-B4D9-4F5A-9D25-7E551B61138E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1AE7844D-B4D9-4F5A-9D25-7E551B61138E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1AE7844D-B4D9-4F5A-9D25-7E551B61138E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1AE7844D-B4D9-4F5A-9D25-7E551B61138E}.Release|Any CPU.Build.0 = Release|Any CPU
{4D019C99-8B1C-42B0-8630-F1E3661F414B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4D019C99-8B1C-42B0-8630-F1E3661F414B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4D019C99-8B1C-42B0-8630-F1E3661F414B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4D019C99-8B1C-42B0-8630-F1E3661F414B}.Release|Any CPU.Build.0 = Release|Any CPU
{01B13EE5-9892-4D2A-8E77-C0A4A9575753}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{01B13EE5-9892-4D2A-8E77-C0A4A9575753}.Debug|Any CPU.Build.0 = Debug|Any CPU
{01B13EE5-9892-4D2A-8E77-C0A4A9575753}.Release|Any CPU.ActiveCfg = Release|Any CPU
{01B13EE5-9892-4D2A-8E77-C0A4A9575753}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
58 changes: 43 additions & 15 deletions all.sln
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,23 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.Client", "src\AElf.Cli
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.Client.Protobuf", "src\AElf.Client.Protobuf\AElf.Client.Protobuf.csproj", "{E7DF7523-2FB5-45B3-9EAA-9B759FDDC2EB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TokenManager", "examples\TokenManager\TokenManager.csproj", "{CA0B4594-2549-4DB1-9079-EA5FD739C6B6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ElectionViewer", "examples\ElectionViewer\ElectionViewer.csproj", "{E678AABE-AF7B-45F4-B931-CF0D77C5AECA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AEDPoSViewer", "examples\AEDPoSViewer\AEDPoSViewer.csproj", "{BE0E29FA-A9C6-4E03-9E0C-297CCF7C5729}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.Client.Test", "test\AElf.Client.Test\AElf.Client.Test.csproj", "{4D019C99-8B1C-42B0-8630-F1E3661F414B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.Client.Abp", "src\AElf.Client.Abp\AElf.Client.Abp.csproj", "{BBE11EF4-5CD6-4918-8E6C-74BF61C1A87F}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.Client.Core", "src\AElf.Client.Core\AElf.Client.Core.csproj", "{BBE11EF4-5CD6-4918-8E6C-74BF61C1A87F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.Client.TestBase", "test\AElf.Client.TestBase\AElf.Client.TestBase.csproj", "{D542FBDB-DFE1-46C2-8C4E-9A5643F3C401}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.Client.Genesis", "examples\AElf.Client.Genesis\AElf.Client.Genesis.csproj", "{A6F6AF4C-A783-4EC3-A03F-F1576020BC49}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.Client.Consensus.AEDPoS", "examples\AElf.Client.Consensus.AEDPoS\AElf.Client.Consensus.AEDPoS.csproj", "{46531278-7E47-4D6F-AD45-A6870E624105}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.Client.Parliament", "examples\AElf.Client.Parliament\AElf.Client.Parliament.csproj", "{12B17C25-1A00-4BB7-9911-9AC06988C261}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.Client.Token", "examples\AElf.Client.Token\AElf.Client.Token.csproj", "{0FD6224B-4C4B-49C3-BC25-5C0B1FDBB077}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.Client.CrossChain", "examples\AElf.Client.CrossChain\AElf.Client.CrossChain.csproj", "{0657BEEB-97B1-4250-9252-6685A99B5D10}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -28,11 +36,15 @@ Global
GlobalSection(NestedProjects) = preSolution
{1AE7844D-B4D9-4F5A-9D25-7E551B61138E} = {940361AC-2167-4D30-A4F6-9A543C608196}
{E7DF7523-2FB5-45B3-9EAA-9B759FDDC2EB} = {940361AC-2167-4D30-A4F6-9A543C608196}
{CA0B4594-2549-4DB1-9079-EA5FD739C6B6} = {5D1BDC45-D6F1-4359-868B-CB85CEC4ABD8}
{E678AABE-AF7B-45F4-B931-CF0D77C5AECA} = {5D1BDC45-D6F1-4359-868B-CB85CEC4ABD8}
{BE0E29FA-A9C6-4E03-9E0C-297CCF7C5729} = {5D1BDC45-D6F1-4359-868B-CB85CEC4ABD8}
{4D019C99-8B1C-42B0-8630-F1E3661F414B} = {7CD2B508-C765-4720-B430-94E79135797A}
{BBE11EF4-5CD6-4918-8E6C-74BF61C1A87F} = {940361AC-2167-4D30-A4F6-9A543C608196}
{D542FBDB-DFE1-46C2-8C4E-9A5643F3C401} = {7CD2B508-C765-4720-B430-94E79135797A}
{A6F6AF4C-A783-4EC3-A03F-F1576020BC49} = {5D1BDC45-D6F1-4359-868B-CB85CEC4ABD8}
{46531278-7E47-4D6F-AD45-A6870E624105} = {5D1BDC45-D6F1-4359-868B-CB85CEC4ABD8}
{12B17C25-1A00-4BB7-9911-9AC06988C261} = {5D1BDC45-D6F1-4359-868B-CB85CEC4ABD8}
{0FD6224B-4C4B-49C3-BC25-5C0B1FDBB077} = {5D1BDC45-D6F1-4359-868B-CB85CEC4ABD8}
{0657BEEB-97B1-4250-9252-6685A99B5D10} = {5D1BDC45-D6F1-4359-868B-CB85CEC4ABD8}
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1AE7844D-B4D9-4F5A-9D25-7E551B61138E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
Expand All @@ -43,14 +55,6 @@ Global
{E7DF7523-2FB5-45B3-9EAA-9B759FDDC2EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E7DF7523-2FB5-45B3-9EAA-9B759FDDC2EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E7DF7523-2FB5-45B3-9EAA-9B759FDDC2EB}.Release|Any CPU.Build.0 = Release|Any CPU
{CA0B4594-2549-4DB1-9079-EA5FD739C6B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CA0B4594-2549-4DB1-9079-EA5FD739C6B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CA0B4594-2549-4DB1-9079-EA5FD739C6B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CA0B4594-2549-4DB1-9079-EA5FD739C6B6}.Release|Any CPU.Build.0 = Release|Any CPU
{E678AABE-AF7B-45F4-B931-CF0D77C5AECA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E678AABE-AF7B-45F4-B931-CF0D77C5AECA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E678AABE-AF7B-45F4-B931-CF0D77C5AECA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E678AABE-AF7B-45F4-B931-CF0D77C5AECA}.Release|Any CPU.Build.0 = Release|Any CPU
{BE0E29FA-A9C6-4E03-9E0C-297CCF7C5729}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BE0E29FA-A9C6-4E03-9E0C-297CCF7C5729}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BE0E29FA-A9C6-4E03-9E0C-297CCF7C5729}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -63,5 +67,29 @@ Global
{BBE11EF4-5CD6-4918-8E6C-74BF61C1A87F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BBE11EF4-5CD6-4918-8E6C-74BF61C1A87F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BBE11EF4-5CD6-4918-8E6C-74BF61C1A87F}.Release|Any CPU.Build.0 = Release|Any CPU
{D542FBDB-DFE1-46C2-8C4E-9A5643F3C401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D542FBDB-DFE1-46C2-8C4E-9A5643F3C401}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D542FBDB-DFE1-46C2-8C4E-9A5643F3C401}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D542FBDB-DFE1-46C2-8C4E-9A5643F3C401}.Release|Any CPU.Build.0 = Release|Any CPU
{A6F6AF4C-A783-4EC3-A03F-F1576020BC49}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A6F6AF4C-A783-4EC3-A03F-F1576020BC49}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A6F6AF4C-A783-4EC3-A03F-F1576020BC49}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A6F6AF4C-A783-4EC3-A03F-F1576020BC49}.Release|Any CPU.Build.0 = Release|Any CPU
{46531278-7E47-4D6F-AD45-A6870E624105}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{46531278-7E47-4D6F-AD45-A6870E624105}.Debug|Any CPU.Build.0 = Debug|Any CPU
{46531278-7E47-4D6F-AD45-A6870E624105}.Release|Any CPU.ActiveCfg = Release|Any CPU
{46531278-7E47-4D6F-AD45-A6870E624105}.Release|Any CPU.Build.0 = Release|Any CPU
{12B17C25-1A00-4BB7-9911-9AC06988C261}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{12B17C25-1A00-4BB7-9911-9AC06988C261}.Debug|Any CPU.Build.0 = Debug|Any CPU
{12B17C25-1A00-4BB7-9911-9AC06988C261}.Release|Any CPU.ActiveCfg = Release|Any CPU
{12B17C25-1A00-4BB7-9911-9AC06988C261}.Release|Any CPU.Build.0 = Release|Any CPU
{0FD6224B-4C4B-49C3-BC25-5C0B1FDBB077}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0FD6224B-4C4B-49C3-BC25-5C0B1FDBB077}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0FD6224B-4C4B-49C3-BC25-5C0B1FDBB077}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0FD6224B-4C4B-49C3-BC25-5C0B1FDBB077}.Release|Any CPU.Build.0 = Release|Any CPU
{0657BEEB-97B1-4250-9252-6685A99B5D10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0657BEEB-97B1-4250-9252-6685A99B5D10}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0657BEEB-97B1-4250-9252-6685A99B5D10}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0657BEEB-97B1-4250-9252-6685A99B5D10}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
6 changes: 3 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- task: UseDotNet@2
displayName: 'Install .NET Core SDK'
inputs:
version: 3.1.101
version: 6.0.300
- powershell: ./scripts/aelf-node/start-window.ps1
displayName: 'Build and Test'
# All tasks on Linux
Expand All @@ -25,7 +25,7 @@ jobs:
steps:
- task: DotNetCoreInstaller@0
inputs:
version: '3.1.101'
version: '6.0.300'
- script: cd scripts/aelf-node && bash start.sh
displayName: 'Deploy a full node'
- script: bash build.sh -target=test
Expand All @@ -40,7 +40,7 @@ jobs:
steps:
- task: DotNetCoreInstaller@0
inputs:
version: '3.1.101'
version: '6.0.300'
- script: cd scripts/aelf-node && bash start-mac.sh
displayName: 'Deploy a full node'
- script: bash build.sh -target=test
Expand Down
2 changes: 1 addition & 1 deletion build.config
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash
CAKE_VERSION=0.37.0
DOTNET_VERSION=3.1.101
DOTNET_VERSION=6.0.300
3 changes: 2 additions & 1 deletion examples/AEDPoSViewer/AEDPoSViewer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\AElf.Client.Abp\AElf.Client.Abp.csproj" />
<ProjectReference Include="..\..\src\AElf.Client.Core\AElf.Client.Core.csproj" />
</ItemGroup>

<ItemGroup>
Expand All @@ -18,6 +18,7 @@
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="Spectre.Console" Version="0.44.1-preview.0.29" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 2 additions & 4 deletions examples/AEDPoSViewer/AEDPoSViewerHostedService.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
Expand Down Expand Up @@ -34,8 +32,8 @@ public async Task StartAsync(CancellationToken cancellationToken)

await _abpApplication.InitializeAsync();

var helloWorldService = _abpApplication.ServiceProvider.GetRequiredService<AEDPoSViewerService>();
await helloWorldService.RunAsync();
var viewerService = _abpApplication.ServiceProvider.GetRequiredService<AEDPoSViewerService>();
await viewerService.RunAsync();
}

public async Task StopAsync(CancellationToken cancellationToken)
Expand Down
5 changes: 4 additions & 1 deletion examples/AEDPoSViewer/AEDPoSViewerModule.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using AElf.Client.Abp;
using AElf.Client.Core;
using Volo.Abp.Modularity;

namespace AEDPoSViewer;
Expand All @@ -8,5 +8,8 @@ namespace AEDPoSViewer;
)]
public class AEDPoSViewerModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{

}
}
77 changes: 64 additions & 13 deletions examples/AEDPoSViewer/AEDPoSViewerService.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
using AElf.Client;
using AEDPoSViewer.Data;
using AElf;
using AElf.Client.Core;
using AElf.Client.Core.Options;
using AElf.Contracts.Consensus.AEDPoS;
using Google.Protobuf;
using AElf.Types;
using Google.Protobuf.WellKnownTypes;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using Spectre.Console;
using Volo.Abp.DependencyInjection;

namespace AEDPoSViewer;
Expand All @@ -13,26 +16,74 @@ public class AEDPoSViewerService : ITransientDependency
{
private IServiceScopeFactory ServiceScopeFactory { get; }

public ILogger<AEDPoSViewerService> Logger { get; set; }

public AEDPoSViewerService(IServiceScopeFactory serviceScopeFactory)
{
ServiceScopeFactory = serviceScopeFactory;

Logger = NullLogger<AEDPoSViewerService>.Instance;
}

public async Task RunAsync()
{
var currentRound = await GetCurrentRoundAsync();
for (var i = currentRound.RoundNumber - 4; i < currentRound.RoundNumber; i++)
{
DisplayRound(await GetRoundAsync(i));
}

DisplayRound(currentRound);
}

private async Task<Round> GetRoundAsync(long roundNumber)
{
using var scope = ServiceScopeFactory.CreateScope();

var clientConfig = scope.ServiceProvider.GetRequiredService<IOptionsSnapshot<AElfClientConfigOptions>>();

var clientService = scope.ServiceProvider.GetRequiredService<IAElfClientService>();

var result = await clientService.ViewSystemAsync(AEDPoSViewerConstants.ConsensusSmartContractName,
"GetCurrentRoundInformation", new Empty(), EndpointType.MainNetSidechain.ToString(), "Ean");
return await clientService.ViewSystemAsync<Round>(AEDPoSViewerConstants.ConsensusSmartContractName,
"GetRoundInformation", new Int64Value { Value = roundNumber }, clientConfig.Value.ClientAlias);
}

private async Task<Round> GetCurrentRoundAsync()
{
using var scope = ServiceScopeFactory.CreateScope();

var clientConfig = scope.ServiceProvider.GetRequiredService<IOptionsSnapshot<AElfClientConfigOptions>>();

var clientService = scope.ServiceProvider.GetRequiredService<IAElfClientService>();

return await clientService.ViewSystemAsync<Round>(AEDPoSViewerConstants.ConsensusSmartContractName,
"GetCurrentRoundInformation", new Empty(), clientConfig.Value.ClientAlias);
}

private void DisplayRound(Round round)
{
//AnsiConsole.MarkupLine($"[blue]Term:[/]\t{round.TermNumber}");
AnsiConsole.MarkupLine($"[blue]Round:[/]\t{round.RoundNumber}");
//AnsiConsole.MarkupLine($"[blue]Days:[/]\t{new TimeSpan(0, 0, 0, (int)round.BlockchainAge).TotalDays}");

var table = new Table();
table.AddColumn(new TableColumn(new Markup("[blue]Pubkey[/]")));
table.AddColumn(new TableColumn("[blue]Address[/]"));
table.AddColumn(new TableColumn("[blue]Order[/]"));
table.AddColumn(new TableColumn("[blue]Produced[/]"));
table.AddColumn(new TableColumn("[blue]Missed Slots[/]"));
foreach (var info in round.RealTimeMinersInformation.OrderBy(i => i.Value.Order))
{
var pubkey = info.Key;
var minerInRound = info.Value;
var address = Address.FromPublicKey(ByteArrayHelper.HexStringToByteArray(pubkey)).ToBase58();
BlockProducer.Map.TryGetValue(pubkey, out var displayPubkey);
var actualMiningTimes = minerInRound.ActualMiningTimes.Count;
var isAlarm = actualMiningTimes == 0;
table.AddRow(
(isAlarm ? "[red]" : "") + (displayPubkey ?? pubkey[..10]) + (isAlarm ? "[/]" : ""),
address,
minerInRound.Order.ToString(),
(isAlarm ? "[red]" : "") + actualMiningTimes + (isAlarm ? "[/]" : ""),
minerInRound.MissedTimeSlots.ToString());
}

var round = new Round();
round.MergeFrom(result);
Logger.LogInformation($"Current round: {round}");
AnsiConsole.Write(table);
}
}
47 changes: 47 additions & 0 deletions examples/AEDPoSViewer/Data/BlockProducerMap.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
namespace AEDPoSViewer.Data;

public static class BlockProducer
{
public static Dictionary<string, string> Map;

static BlockProducer()
{
Map = new Dictionary<string, string>
{
["048a8e7562f14207a5e9cc41163a8b947cf826bd1628fa79b4e5345e014bd3cb139617ccbb1fed60a4cdd691a238f9d30f30bf50452d5a4d9b050de73d16ccd606"] =
"FBG",
["04f34af28e68d7c9bcfc7a9797a4d894ee9a9d3d142e275cd254b6495ed7ec95f95411c9819950c23c36fd00a2c610947487bd6e0b3e3ed8d2c90f089fa4f0c02a"] =
"RockX",
["04d92f55aa3ea457c24836b263aca894b7aa890eb17176b8d46b17d35d5a417e491a024c8974c1bfc7b586c15f329e5d7e707f888841ba984f32dec7631efd891a"] =
"CoinHuntingCommunity",
["04cfe24816b93a4936d564c63fd7cdcc3e77c8f26037dec96b8ab5f209b161c6567df2a317d1bb5b5494eac41d8c457ac6b8242dff9af0147beabe0ecb28ea2b79"] =
"LumosSocial",
["0454c2e605e790e8c6e295604eeb6e169af97e25862882f44cbff19502096e29460b425e7cb50da1215b5931057fa84dd812a66a15ead46a66a9972d3e3c3fe38b"] =
"bountyblok",
["0476d07226df54bc3f0cbbf6ab86f5c9d2324860e9e3c36db2886555d7832eed89214f73dfe8c43e7efdd7157dfbb148966944fbcb1ad0bf812b6d3350858e9104"] =
"ChainExplorers",
["04a45c95d121c659d9f90ce7c43236f0204b87e5d180a700d6a040f2ad60a4b7cb7f22aed7e2ed7205376edcabfd2d1efb011e46e45ec94eed23cad48b794ce89e"] =
"marbleGameFI",
["040bcbc49d65a89e49dc7152b2720f5769e6132a2c2d8742d0b7d6efb7bc1a977355f5dbd05f565e3c8848cbce8c8a0250a8a2296dc74b3d4fa0335637de5b1ec7"] =
"Genesis5",
["04c7132a91d3b3924d1afcf99b255dde5fc0fbb437e8cb3b0d3858e9bbbf7f30e2e39e3819ebb9f034963b6a7ed3e3c12e8528cfce6210f39cf12803f89877a890"] =
"OKX",
["042f7cab8272e1f4e90e59e91bbe2c211f1a0e15a5b670aff517a02f625d678607a96723b6ce3232fcf6ad0fc988e3e198cdedebcc10cd4d86b4dddfd8a99edcf0"] =
"aelfin",
["04f7760c46da886f7e06e8e665cbab7d63cfe825c680dce990fcb2c3b7a01c7236e0ae40aacb32bbc4fffc57ae45bc1fe5344461efeed2b4660aef3ec3f9e35b15"] =
"HuobiPool",
["0458ad2ec4d8944bff7f3ab7b56a90ffca784b0632bdf8c4a952da153b24b3fbbda5432f5ef293ab7ced791969f5fe02b0b5e6bc5af7ce074a9dc386c8dab0e6db"] =
"MetaDefy",
["04e6b61a5904cfa1e242051bd71a6adba572eaf325213f41a0ae4d0139fe63627d130e6e525c3d23732ae64f3bfc8959ca4174f6aef8ea7901b4c436f5cfc81371"] =
"Genesis2",
["04ace35149bf24792b0a4c9ea327ef44061e4a6dffa598a24be054b8068d173e0c59f4a070417b7f544057c447f27678d6aa6b531b14ee996af9728ff2fabe7f42"] =
"Genesis3",
["04dfc5398e6c0485cb4ee98f6202f81fd49c971fa21ef9f62e309a4b983cffae9149c13cf9a8d00c10153f45855943e1ec5ca399b7143cf336cc901c457e905236"] =
"Genesis1",
["0485bc2868f15dc6ff07ec85e3ee6f5900bb3bf3c6c50c3f40d377a203c476fdade815ab5bba1ade2eefb20de26085ab1ab84317ba07b093aa622a536f32d35682"] =
"CoinMultiDex",
["04c1b4a75fd9ba37e0a84b9916e517e9c591c5b9efacabf1feb1a3d34f38920a250454dc9dce0f811956d210804c904959be96a75a9d9b1410aa25f7d9e1b6f69c"] =
"Genesis4",
};
}
}
7 changes: 6 additions & 1 deletion examples/AEDPoSViewer/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
}
]
},
"AElfAccount":{
"AElfAccount": {
"KeyDirectory": "",
"AccountConfigList": [
{
Expand All @@ -36,5 +36,10 @@
"PrivateKey": "5e2f12d13e4527ad1128e07db00f1614ec6b8b51662e68d4fdb42125ab384195",
}
]
},
"AElfClientConfig": {
"ClientAlias": "MainNetMainChain",
"AccountAlias": "Ean",
"CamelCase": false
}
}
Loading