From f3803f5e522ff55b1b47f3606b529f9b1b3f0296 Mon Sep 17 00:00:00 2001 From: SondreB Date: Sat, 24 Apr 2021 23:58:12 +0200 Subject: [PATCH] Add SERF node --- .github/workflows/build.yml | 6 ++- .github/workflows/release.yml | 6 ++- Blockcore.Reference.Nodes.sln | 6 +++ .../City.Node/Properties/launchSettings.json | 4 ++ Directory.Build.props | 2 +- LICENSE | 2 +- SERF/SERF.sln | 25 ++++++++++ SERF/src/SERF.Node/Program.cs | 49 +++++++++++++++++++ .../SERF.Node/Properties/launchSettings.json | 39 +++++++++++++++ SERF/src/SERF.Node/SERF.Node.csproj | 30 ++++++++++++ package.json | 2 +- 11 files changed, 166 insertions(+), 5 deletions(-) create mode 100644 SERF/SERF.sln create mode 100644 SERF/src/SERF.Node/Program.cs create mode 100644 SERF/src/SERF.Node/Properties/launchSettings.json create mode 100644 SERF/src/SERF.Node/SERF.Node.csproj diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 733e911..5ed07a5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: os: [ windows-latest, ubuntu-latest, macos-latest ] - chain: ['MULTI', 'AMS', 'BTC', 'CITY', 'EXOS', 'IMPL', 'RUTA', 'STRAT', 'XDS', 'XLR', 'X42', 'X1', 'XRC', 'HOMECOIN'] + chain: ['MULTI', 'AMS', 'BTC', 'CITY', 'EXOS', 'IMPL', 'RUTA', 'STRAT', 'XDS', 'XLR', 'X42', 'X1', 'XRC', 'HOMECOIN', 'SERF'] include: - chain: MULTI name: "MULTI" @@ -72,6 +72,10 @@ jobs: name: "HOMECOIN" solution: "HOME/HomeCoin.sln" project: "HOME/src/HomeCoin.Node/HomeCoin.Node.csproj" + - chain: SERF + name: "SERF" + solution: "SERF/SERF.sln" + project: "SERF/src/SERF.Node/SERF.Node.csproj" - os: windows-latest extension: ".zip" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c408c91..6f570a8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: os: [ ubuntu-latest ] - chain: ['MULTI', 'AMS', 'BTC', 'CITY', 'EXOS', 'IMPL', 'RUTA', 'STRAT', 'XDS', 'XLR', 'X42', 'X1', 'XRC', 'HOMECOIN'] + chain: ['MULTI', 'AMS', 'BTC', 'CITY', 'EXOS', 'IMPL', 'RUTA', 'STRAT', 'XDS', 'XLR', 'X42', 'X1', 'XRC', 'HOMECOIN', 'SERF'] include: - chain: MULTI name: "multi" @@ -70,6 +70,10 @@ jobs: name: "homecoin" assembly: "HomeCoin.Node.dll" ports: "33331 33332 33333" + - chain: SERF + name: "serf" + assembly: "SERF.Node.dll" + ports: "15111 15112 15113" fail-fast: false diff --git a/Blockcore.Reference.Nodes.sln b/Blockcore.Reference.Nodes.sln index fe89ef0..bc8bfe7 100644 --- a/Blockcore.Reference.Nodes.sln +++ b/Blockcore.Reference.Nodes.sln @@ -40,6 +40,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Directory.Build.props = Directory.Build.props EndProjectSection EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SERF.Node", "SERF\src\SERF.Node\SERF.Node.csproj", "{706EDF09-4A2D-4DDE-B7D4-7705F16E732D}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -110,6 +112,10 @@ Global {A7D27276-A402-43D1-8799-4D08895AA12B}.Debug|Any CPU.Build.0 = Debug|Any CPU {A7D27276-A402-43D1-8799-4D08895AA12B}.Release|Any CPU.ActiveCfg = Release|Any CPU {A7D27276-A402-43D1-8799-4D08895AA12B}.Release|Any CPU.Build.0 = Release|Any CPU + {706EDF09-4A2D-4DDE-B7D4-7705F16E732D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {706EDF09-4A2D-4DDE-B7D4-7705F16E732D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {706EDF09-4A2D-4DDE-B7D4-7705F16E732D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {706EDF09-4A2D-4DDE-B7D4-7705F16E732D}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/CITY/src/City.Node/Properties/launchSettings.json b/CITY/src/City.Node/Properties/launchSettings.json index 243f4df..0b1deb7 100644 --- a/CITY/src/City.Node/Properties/launchSettings.json +++ b/CITY/src/City.Node/Properties/launchSettings.json @@ -3,6 +3,10 @@ "CITY (MAIN)": { "commandName": "Project" }, + "CITY (MAIN/ROCKSDB)": { + "commandName": "Project", + "commandLineArgs": "-dbtype=rocksdb" + }, "CITY (TEST)": { "commandName": "Project", "commandLineArgs": "-testnet" diff --git a/Directory.Build.props b/Directory.Build.props index bb41b07..380a48a 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@ - 1.0.23 + 1.0.24 3.1.11 netcoreapp3.1 false diff --git a/LICENSE b/LICENSE index 2d5b5bf..4cb9983 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020 Blockcore +Copyright (c) 2020-2021 Blockcore Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/SERF/SERF.sln b/SERF/SERF.sln new file mode 100644 index 0000000..a8c442e --- /dev/null +++ b/SERF/SERF.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31205.134 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SERF.Node", "src\SERF.Node\SERF.Node.csproj", "{C851E18F-D508-4CC1-A9B5-FB8C5DBE2D51}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C851E18F-D508-4CC1-A9B5-FB8C5DBE2D51}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C851E18F-D508-4CC1-A9B5-FB8C5DBE2D51}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C851E18F-D508-4CC1-A9B5-FB8C5DBE2D51}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C851E18F-D508-4CC1-A9B5-FB8C5DBE2D51}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {4C0C09E9-A7E7-4F43-81A5-1FE5686BA11F} + EndGlobalSection +EndGlobal diff --git a/SERF/src/SERF.Node/Program.cs b/SERF/src/SERF.Node/Program.cs new file mode 100644 index 0000000..fbd1166 --- /dev/null +++ b/SERF/src/SERF.Node/Program.cs @@ -0,0 +1,49 @@ +using System; +using System.Threading.Tasks; +using Blockcore; +using Blockcore.Builder; +using Blockcore.Configuration; +using Blockcore.Features.BlockStore; +using Blockcore.Features.ColdStaking; +using Blockcore.Features.Consensus; +using Blockcore.Features.Diagnostic; +using Blockcore.Features.MemoryPool; +using Blockcore.Features.Miner; +using Blockcore.Features.NodeHost; +using Blockcore.Features.RPC; +using Blockcore.Networks.SERF; +using Blockcore.Utilities; + +namespace SERF.Daemon +{ + public class Program + { + public static async Task Main(string[] args) + { + try + { + var nodeSettings = new NodeSettings(networksSelector: Networks.SERF, args: args); + + IFullNodeBuilder nodeBuilder = new FullNodeBuilder() + .UseNodeSettings(nodeSettings) + .UseBlockStore() + .UsePosConsensus() + .UseMempool() + .UseColdStakingWallet() + .AddPowPosMining() + .UseNodeHost() + .AddRPC() + .UseDiagnosticFeature(); + + IFullNode node = nodeBuilder.Build(); + + if (node != null) + await node.RunAsync(); + } + catch (Exception ex) + { + Console.WriteLine("There was a problem initializing the node. Details: '{0}'", ex); + } + } + } +} diff --git a/SERF/src/SERF.Node/Properties/launchSettings.json b/SERF/src/SERF.Node/Properties/launchSettings.json new file mode 100644 index 0000000..b9dce65 --- /dev/null +++ b/SERF/src/SERF.Node/Properties/launchSettings.json @@ -0,0 +1,39 @@ +{ + "profiles": { + "SERF (MAIN)": { + "commandName": "Project" + }, + "SERF (TEST)": { + "commandName": "Project", + "commandLineArgs": "-testnet" + }, + "SERF (MAIN/RPC)": { + "commandName": "Project", + "commandLineArgs": "-server -rpcallowip=127.0.0.1 -rpcbind=127.0.0.1 -rpcpassword=rpcpassword -rpcuser=rpcuser" + }, + "SERF (TEST/RPC)": { + "commandName": "Project", + "commandLineArgs": "-server -rpcallowip=127.0.0.1 -rpcbind=127.0.0.1 -rpcpassword=rpcpassword -rpcuser=rpcuser -testnet" + }, + "SERF (MAIN/LOCAL/RPC)": { + "commandName": "Project", + "commandLineArgs": "-server -rpcallowip=127.0.0.1 -rpcbind=127.0.0.1 -rpcpassword=rpcpassword -rpcuser=rpcuser -datadir=nodedata" + }, + "SERF (TEST/LOCAL/RPC)": { + "commandName": "Project", + "commandLineArgs": "-server -rpcallowip=127.0.0.1 -rpcbind=127.0.0.1 -rpcpassword=rpcpassword -rpcuser=rpcuser -datadir=nodedata -testnet" + }, + "SERF (MAIN/LOCAL/RPC/DEFAULT)": { + "commandName": "Project", + "commandLineArgs": "-server -rpcallowip=127.0.0.1 -rpcbind=127.0.0.1 -rpcpassword=rpcpassword -rpcuser=rpcuser -datadir=nodedata -defaultwalletname=default -defaultwalletpassword=default -unlockdefaultwallet -server" + }, + "SERF (TEST/LOCAL/RPC/DEFAULT)": { + "commandName": "Project", + "commandLineArgs": "-server -rpcallowip=127.0.0.1 -rpcbind=127.0.0.1 -rpcpassword=rpcpassword -rpcuser=rpcuser -datadir=nodedata -defaultwalletname=default -defaultwalletpassword=default -unlockdefaultwallet -server -testnet" + }, + "SERF (TEST/NO ASSUME VALID)": { + "commandName": "Project", + "commandLineArgs": "-testnet -assumevalid=0 -checkpoints=false" + } + } +} diff --git a/SERF/src/SERF.Node/SERF.Node.csproj b/SERF/src/SERF.Node/SERF.Node.csproj new file mode 100644 index 0000000..a115aff --- /dev/null +++ b/SERF/src/SERF.Node/SERF.Node.csproj @@ -0,0 +1,30 @@ + + + + SERF.Node + Exe + + + + latest + false + false + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/package.json b/package.json index f47e5bb..10ceb58 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "blockcorenodes", - "version": "1.0.23", + "version": "1.0.24", "license": "MIT", "author": { "name": "Blockcore",