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

Introduce SDK node #4022

Merged
merged 64 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
c437f8d
exp: node
riemannulus Jul 25, 2024
da377dc
refactor: Refactor to minimal, executable version
s2quake Jul 26, 2024
d1149b7
feat: solo propose mode
riemannulus Jul 29, 2024
841bd06
bump: Bump dotnet sdk version to net8.0
s2quake Aug 2, 2024
8a6079f
feat: Add Seed service
s2quake Aug 5, 2024
6fcdac5
test: Add test for seed
s2quake Aug 6, 2024
6aebc02
ci: Add sdk path to collect tests
s2quake Aug 6, 2024
f4fc2f3
ci: Install dotnet for sdk
s2quake Aug 8, 2024
ef4143e
feat: Add Assembly and AggregateTyped Action Loaders
s2quake Aug 12, 2024
9e85e35
feat: Add attribute classes to validate options
s2quake Aug 12, 2024
f44fbd4
feat: Add features to make DependencyInjection easier to use
s2quake Aug 12, 2024
fb525b8
refactor: Refactor the code to define Option and make it easier to use
s2quake Aug 12, 2024
6699661
feat: Add Node and NodeService
s2quake Aug 12, 2024
e3eb27f
feat: Add grpc service for node and seed
s2quake Aug 12, 2024
ff49a90
refactor: Add a feature to collect services from assemblies and regis…
s2quake Aug 12, 2024
d1430cb
test: Add test code
s2quake Aug 12, 2024
a9f9bed
feat: Add json schema builder for appsettings.json
s2quake Aug 12, 2024
39882af
feat: Geneate and add schema file
s2quake Aug 12, 2024
fd5da36
feat: Add a schema Grpc service to get schema text
s2quake Aug 12, 2024
3c02c0d
fix: Fix docker build error
s2quake Aug 22, 2024
89adce5
refactor: Rename Node to Swarm and add ValidatorService
s2quake Aug 21, 2024
c4df67c
refactor: Remove reflection for dynamic load service
s2quake Aug 22, 2024
4738f1e
feat: Determining whether to run services based on option settings
s2quake Aug 22, 2024
9ee6cdf
refactor: Add OptionsSchemaGenerator and export enum member as string
s2quake Aug 27, 2024
f9c4cab
refactor: Remote BoundPeerUtility
s2quake Aug 23, 2024
4a42129
feat: Add swagger and explorer(GQL)
s2quake Aug 28, 2024
f51fb59
feat: Add AppProtocolVersion property to SwarmOptions
s2quake Aug 23, 2024
3917fd0
feat: Add GenesisBlockPath option to GenesisOptions
s2quake Aug 23, 2024
479ec27
test: Fix failed tests
s2quake Aug 28, 2024
9528efb
feat: Add AppProtocolOptionsBase for common properties like PrivateKe…
s2quake Aug 30, 2024
6047a39
fix: Fix an issue where the SwarmService instance was created twice.
s2quake Aug 30, 2024
8338c15
refactor: Rename StoreType's member
s2quake Aug 30, 2024
93e50dd
refactor: Change C to c in BlockChain in BlockChainGrpcServiceV1
s2quake Sep 2, 2024
6cb9b3b
chore: Rename file
s2quake Sep 2, 2024
16c6703
feat: Add IStoreService
s2quake Sep 2, 2024
18e164c
test: Fix test failures
s2quake Sep 2, 2024
ffdbdfc
refactor: Refactor swarm service to work better with validator service
s2quake Sep 5, 2024
8fbcb11
test: Add utilties for test
s2quake Sep 5, 2024
c4f3603
test: Add test for SwarmService
s2quake Sep 5, 2024
bcff4ca
test: Add BlockChainServiceTest
s2quake Sep 5, 2024
85c92ed
test: Add ValidatorServiceTest
s2quake Sep 5, 2024
bd1d1b6
test: Add StoreServiceTest
s2quake Sep 5, 2024
4111478
feat: Add IPolicyActionsRegistry interface
s2quake Aug 26, 2024
f13702b
feat: Add IActionService to load action loader from external assembly
s2quake Aug 27, 2024
d21a8ea
test: Add test code for ActionService
s2quake Sep 6, 2024
2766302
introduce: IRenderObservables
riemannulus Aug 17, 2024
d6c04e6
chore: Remove unused code and clean code
s2quake Sep 13, 2024
ac661f6
fix: Fix an issue with assembly reload
s2quake Sep 13, 2024
39ab85e
feat: Add IRendererService, and change event pattern to objervable pa…
s2quake Sep 13, 2024
b48b1d9
test: Add test code for observable patterns of IRendererService and I…
s2quake Sep 13, 2024
9464ab1
chore: remove personal plugin
limebell Dec 26, 2024
6216819
bump: System.Text.Json to 9.0
limebell Dec 26, 2024
c47bc01
feat: provide genesis config option
limebell Dec 26, 2024
a4a7539
test: add unit test for newly added feature
limebell Dec 30, 2024
59ac078
chore: apply suggestions from the code review
limebell Dec 31, 2024
afaf4bb
chore: apply API changes
limebell Jan 14, 2025
d392c69
bump: use .NET 8.0 as TargetFramework for libplanet
limebell Jan 14, 2025
4e0c4bd
chore: fix build
limebell Jan 14, 2025
bc71fbd
chore: remove deprecated serialization for exceptions
limebell Jan 14, 2025
f88025a
chore: update github workflows
limebell Jan 14, 2025
99de429
docs: update CHANGES.md
limebell Jan 15, 2025
f239bf8
remove support for BinaryFormatter
limebell Jan 15, 2025
a8dcd5a
chore: add NoWarn property for build props
limebell Jan 15, 2025
feddfae
docs: update CHANGES.md
limebell Jan 15, 2025
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
35 changes: 21 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,18 @@ commands:
steps:
- checkout
- concat_files:
glob: "{src,test,tools}/*/*.csproj"
glob: "{src,test,tools,sdk/*}/*/*.csproj"
to: .combined-package-files.txt
- restore_cache:
keys:
- v1-deps-{{ arch }}-{{ checksum ".combined-package-files.txt" }}
- v1-deps-{{ arch }}
- run:
name: Install .NET 8.0 SDK for Libplanet-SDK
shell: bash
command: |
curl -sSL https://dot.net/v1/dotnet-install.sh | \
bash /dev/stdin --channel 8.0 --install-dir /usr/share/dotnet
- run: dotnet restore
- save_cache:
key: v1-deps-{{ arch }}-{{ checksum ".combined-package-files.txt" }}
Expand Down Expand Up @@ -111,6 +117,8 @@ commands:
- "test/*/obj/"
- "tools/*/bin/"
- "tools/*/obj/"
- "sdk/node/*/bin/"
- "sdk/node/*/obj/"

netcore_test_base:
parameters:
Expand Down Expand Up @@ -243,6 +251,12 @@ commands:
name: Install lib6c-dev (for RocksDBSharp)
shell: bash
command: apt update -y && apt install -y libc6-dev liblz4-dev zlib1g-dev libsnappy-dev libzstd-dev
- run:
name: Install .NET 8.0 SDK for Libplanet-SDK
shell: bash
command: |
curl -sSL https://dot.net/v1/dotnet-install.sh | \
bash /dev/stdin --channel 8.0 --install-dir /usr/share/dotnet
- netcore_test_base:
collect_tests_from: "<<parameters.collect_tests_from>>"
locale: "<<parameters.locale>>"
Expand Down Expand Up @@ -276,19 +290,12 @@ commands:
name: Install .NET 6.0 SDK
shell: bash
command: |
set -evx
echo $PATH > /dev/stderr
if ! command -v dotnet && [[ ! -f "$HOME/.dotnet/dotnet" ]]; then
curl \
-L \
-o /tmp/dotnet-install.sh \
https://dot.net/v1/dotnet-install.sh
chmod +x /tmp/dotnet-install.sh
/tmp/dotnet-install.sh \
--verbose \
--channel 6.0
fi
command -v dotnet
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel 6.0
- run:
name: Install .NET 8.0 SDK for Libplanet-SDK
shell: bash
command: |
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel 8.0
- save_cache:
key: v1-macos-dotnet-sdk-6.0
paths:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/benchmarks-merged.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
dotnet-version: 8.0.x
- name: Run benchmark
run: dotnet run --project tools/Libplanet.Benchmarks -c Release -- --exporters json --filter '*'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/benchmarks-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
ref: ${{ github.pull_request.head.sha }}
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
dotnet-version: 8.0.x
- name: Run benchmark
run: dotnet run --project tools/Libplanet.Benchmarks -c Release -- --exporters json --filter '*'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
WEB_FLOW_KEY_URL: https://github.com/web-flow.gpg
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
dotnet-version: 8.0.x
- uses: actions/setup-node@v3
with:
registry-url: 'https://registry.npmjs.org'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ jobs:
ref: ${{ github.pull_request.head.sha }}
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
dotnet-version: 8.0.x
- run: 'hooks/pre-commit'
- run: 'dotnet pack -p:SkipSonar=false -p:_IsPacking=true'
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
dotnet-version: 8.0.x
- run: dotnet build -p:SkipSonar=true
- run: mkdir -p Docs/obj/
- run: Docs/build.ps1
Expand All @@ -48,4 +48,4 @@ jobs:
description: Libplanet docs generated by DocFX
state: 'success'
target_url: ${{ steps.docs-url.outputs.url }}
if: github.event_name != 'pull_request'
if: github.event_name != 'pull_request'
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,6 @@ yarn-error.log*
Thumbs.db
Desktop.ini
.DS_Store

# sdk
.db
21 changes: 21 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "C#: Libplanet Node",
"type": "coreclr",
"request": "launch",
"program": "${workspaceFolder}/sdk/node/Libplanet.Node.Executable/bin/Debug/net8.0/Libplanet.Node.Executable.dll",
"console": "integratedTerminal",
"args": [
],
"env": {
"ASPNETCORE_ENVIRONMENT": "Development",
},
"cwd": "${workspaceFolder}/sdk/node/Libplanet.Node.Executable"
},
]
}
13 changes: 12 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,18 @@
],
"search.exclude": {
"**/.yarn": true,
"**/.pnp.*": true
"**/.pnp.*": true,
"**/bin": true,
"**/obj": true
},
"files.exclude": {
"**/obj": true,
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/Thumbs.db": true
},
"csharp.semanticHighlighting.enabled": true,
"cSpell.words": [
Expand Down
18 changes: 18 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,23 @@ Version 6.0.0

To be released.

From this version Libplanet projects use .NET 8.0 as target framework.
Therefore `BinaryFormatter` related methods are removed
since it has been deprecated. See also: [.NET Document]

Added new projects:
- Libplanet.Node
- Libplanet.Node.Executable
- Libplanet.Node.Extensions
- Libplanet.Node.Tests

Libplanet.Node is a project that helps users easily configure
Libplanet-based nodes.

### Deprecated APIs

- All classes became not to inherit `ISerializable` anymore.

### Backward-incompatible API changes

### Backward-incompatible network protocol changes
Expand All @@ -25,6 +40,9 @@ To be released.
### CLI tools


[.NET Document]: https://learn.microsoft.com/en-us/dotnet/core/compatibility/serialization/8.0/binaryformatter-disabled


Previous version changes
------------------------

Expand Down
5 changes: 3 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project>

<PropertyGroup>
<TargetFrameworks Condition="'$(_IsPacking)'=='true'">net6.0</TargetFrameworks>
<TargetFramework Condition="'$(_IsPacking)'!='true'">net6.0</TargetFramework>
<TargetFrameworks Condition="'$(_IsPacking)'=='true'">net8.0</TargetFrameworks>
<TargetFramework Condition="'$(_IsPacking)'!='true'">net8.0</TargetFramework>
<LangVersion>10</LangVersion>
<VersionPrefix>6.0.0</VersionPrefix>
<!-- Note: don't be confused by the word "prefix" here. It's merely a
Expand All @@ -26,6 +26,7 @@
<RequireLicenseAcceptance>true</RequireLicenseAcceptance>
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)Libplanet.ruleset</CodeAnalysisRuleSet>
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
<NoWarn>$(NoWarn);S4035;CS1591;NU5104;MEN001;NU1902</NoWarn>

<PackageReleaseNotes>https://github.com/planetarium/libplanet/blob/main/CHANGES.md</PackageReleaseNotes>
<PackageTags>multiplayer online game;game;blockchain</PackageTags>
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.explorer
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
WORKDIR /app

# Copy csproj and restore as distinct layers
Expand Down
Loading
Loading