Skip to content

Commit

Permalink
Merge neo/master Into this
Browse files Browse the repository at this point in the history
  • Loading branch information
cschuchardt88 committed Feb 13, 2025
2 parents 6ae07a7 + c806c8d commit 344e050
Show file tree
Hide file tree
Showing 270 changed files with 1,098 additions and 1,142 deletions.
15 changes: 8 additions & 7 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
# Set default behavior to automatically normalize line endings.
###############################################################################
* text eol=lf
*.cs eol=lf
*.csproj eol=lf
*.props eol=lf
*.json eol=lf
*.cs text eol=lf
*.csproj text eol=lf
*.props text eol=lf
*.json text eol=lf
*.targets text eol=lf

###############################################################################
# Set default behavior for command prompt diff.
Expand All @@ -21,7 +22,7 @@
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
Expand Down Expand Up @@ -52,9 +53,9 @@

###############################################################################
# diff behavior for common document formats
#
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
Expand Down
27 changes: 21 additions & 6 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,15 @@ jobs:
-p:PublishSingleFile=true \
-p:PublishReadyToRun=true \
-p:EnableCompressionInSingleFile=true \
-p:DebugType=embedded \
-p:ServerGarbageCollection=true
-p:DebugSymbols=false \
-p:DebugType=none \
-p:ServerGarbageCollection=true \
-p:TieredCompilation=true \
-p:TieredCompilationQuickJitForLoops=false \
-p:TieredPGO=true \
-p:GenerateDocumentationFile=false \
-p:PublishDocumentationFiles=false \
-p:PublishReferencesDocumentationFiles=false
- name: Build (LevelDbStore)
run: |
Expand All @@ -53,14 +60,21 @@ jobs:
--configuration Release \
--output ${{ env.DIST_DIR }}/Plugins/LevelDBStore \
--verbosity normal \
-p:VersionPrefix=${{ env.APP_VERSION }}
-p:VersionPrefix=${{ env.APP_VERSION }} \
-p:DebugSymbols=false \
-p:DebugType=none \
-p:ServerGarbageCollection=true \
-p:TieredCompilation=true \
-p:TieredCompilationQuickJitForLoops=false \
-p:TieredPGO=true \
-p:GenerateDocumentationFile=false \
-p:PublishDocumentationFiles=false \
-p:PublishReferencesDocumentationFiles=false
- name: Remove (junk)
run: |
rm -v -R ${{ env.DIST_DIR }}/Plugins/LevelDBStore/runtimes
rm -v ${{ env.DIST_DIR }}/Plugins/LevelDBStore/Neo*
rm -v ${{ env.DIST_DIR }}/Plugins/LevelDBStore/*.pdb
rm -v ${{ env.DIST_DIR }}/Plugins/LevelDBStore/*.xml
rm -v ${{ env.DIST_DIR }}/*.xml
- name: Docker Login
run: |
Expand All @@ -73,5 +87,6 @@ jobs:
docker build . \
--file ./.neo/docker/neo-cli/Dockerfile \
--tag ghcr.io/${{ github.repository_owner }}/neo-cli:latest \
--tag ghcr.io/${{ github.repository_owner }}/neo-cli:mainnet \
--tag ghcr.io/${{ github.repository_owner }}/neo-cli:${{ env.APP_VERSION }} \
--push
3 changes: 1 addition & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,13 @@ jobs:
if: matrix.os == 'macos-latest'
run: |
brew install leveldb
brew install gperftools
dotnet build
cp -vp /opt/homebrew/Cellar/leveldb/1.23_2/lib/libleveldb.dylib ./tests/Neo.Plugins.Storage.Tests/bin/Debug/net9.0/
dotnet test --no-build
- name: Test (windows)
if: matrix.os == 'windows-latest'
run: |
dotnet sln neo.sln remove ./tests/Neo.Plugins.Storage.Tests/Neo.Plugins.Storage.Tests.csproj
dotnet build
dotnet test --no-build
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,13 @@ jobs:
--configuration Release \
--output ./sbin \
--verbosity normal \
-p:VersionPrefix=${{ env.APP_VERSION }}
-p:VersionPrefix=${{ env.APP_VERSION }} \
-p:DebugSymbols=false \
-p:DebugType=none \
-p:ServerGarbageCollection=true \
-p:TieredCompilation=true \
-p:TieredCompilationQuickJitForLoops=false \
-p:TieredPGO=true
- name: Publish to NuGet.org
run: |
Expand Down
120 changes: 24 additions & 96 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,69 +13,7 @@ env:
OUTPUT_PATH: /tmp/out

jobs:
build-leveldb:
name: Build leveldb win-${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
arch: [x64, arm64]

steps:
# Step to lookup cache for the LevelDB build distribution
- name: Lookup Cache Distribution
id: cache-leveldb
uses: actions/cache@v4
with:
path: ./leveldb/build/Release/*
key: leveldb-${{ matrix.os }}-${{ matrix.arch }}
enableCrossOsArchive: true
lookup-only: true

# Conditionally checkout LevelDB repository if cache is not found
- if: ${{ steps.cache-leveldb.outputs.cache-hit != 'true' }}
name: Checkout Repository Code (leveldb)
uses: actions/checkout@v4
with:
repository: google/leveldb
path: leveldb
submodules: true
fetch-depth: 0

# Conditionally setup MSBuild if cache is not found
- if: ${{ matrix.os == 'windows-latest' && steps.cache-leveldb.outputs.cache-hit != 'true' }}
name: Setup MSBuild
uses: microsoft/setup-msbuild@v2

# Conditionally setup LevelDB build directory if cache is not found
- if: ${{ steps.cache-leveldb.outputs.cache-hit != 'true' }}
name: Setup LevelDb
working-directory: ./leveldb
run: mkdir -p ./build/Release

# Conditionally create build files for LevelDB if cache is not found
- if: ${{ steps.cache-leveldb.outputs.cache-hit != 'true' }}
name: Create Build Files (win-${{ matrix.arch }})
working-directory: ./leveldb/build
run: cmake -DBUILD_SHARED_LIBS=ON -A ${{ matrix.arch }} ..

# Conditionally build LevelDB using MSBuild if cache is not found
- if: ${{ matrix.os == 'windows-latest' && steps.cache-leveldb.outputs.cache-hit != 'true' }}
name: Build (MSBuild)
working-directory: ./leveldb/build
run: msbuild ./leveldb.sln /p:Configuration=Release

# Conditionally cache the LevelDB distribution if it was built
- if: ${{ steps.cache-leveldb.outputs.cache-hit != 'true' }}
name: Cache Distribution
uses: actions/cache/save@v4
with:
path: ./leveldb/build/Release/*
key: leveldb-${{ matrix.os }}-${{ matrix.arch }}
enableCrossOsArchive: true

build-neo-cli:
needs: [build-leveldb]
name: ${{ matrix.runtime }}
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -120,8 +58,22 @@ jobs:
-p:PublishSingleFile=true \
-p:PublishReadyToRun=true \
-p:EnableCompressionInSingleFile=true \
-p:DebugType=embedded \
-p:ServerGarbageCollection=true
-p:DebugSymbols=false \
-p:DebugType=none \
-p:ServerGarbageCollection=true \
-p:TieredCompilation=true \
-p:TieredCompilationQuickJitForLoops=false \
-p:TieredPGO=true \
-p:GenerateDocumentationFile=false \
-p:PublishDocumentationFiles=false \
-p:PublishReferencesDocumentationFiles=false
# Copy 'libleveldb' library file
- name: Native Content (neo-cli)
working-directory: ${{ env.OUTPUT_PATH }}/${{ matrix.runtime }}
run: |
mv -v ./runtimes/${{ matrix.runtime }}/native/* .
rm -v -R runtimes
# Build the LevelDBStore plugin
- name: .NET Build (LevelDBStore)
Expand All @@ -132,43 +84,19 @@ jobs:
--configuration ${{ env.CONFIGURATION }} \
--output ${{ env.OUTPUT_PATH }}/${{ matrix.runtime }}/Plugins/LevelDBStore \
--verbosity normal \
-p:VersionPrefix=${{ env.APP_VERSION }}
-p:VersionPrefix=${{ env.APP_VERSION }} \
-p:DebugSymbols=false \
-p:DebugType=none \
-p:ServerGarbageCollection=true \
-p:TieredCompilation=true \
-p:TieredCompilationQuickJitForLoops=false \
-p:TieredPGO=true \
-p:GenerateDocumentationFile=false
# Remove unnecessary files from the LevelDBStore plugin output
- name: Remove files (junk)
working-directory: ${{ env.OUTPUT_PATH }}/${{ matrix.runtime }}/Plugins/LevelDBStore
run: |
rm -v *.pdb
# Remove XML comment files from the neo-cli output
- name: Remove Xml Comment Files
working-directory: ${{ env.OUTPUT_PATH }}/${{ matrix.runtime }}
run: rm -v *.xml

# Get cached LevelDB distribution for Windows x64 if applicable
- if: ${{ startsWith(matrix.runtime, 'win-x64') }}
name: Get Distribution Caches (win-x64)
uses: actions/cache@v4
with:
path: ./leveldb/build/Release/*
key: leveldb-windows-latest-x64
enableCrossOsArchive: true
fail-on-cache-miss: true

# Get cached LevelDB distribution for Windows arm64 if applicable
- if: ${{ startsWith(matrix.runtime, 'win-arm64') }}
name: Get Distribution Caches (win-arm64)
uses: actions/cache@v4
with:
path: ./leveldb/build/Release/*
key: leveldb-windows-latest-arm64
enableCrossOsArchive: true
fail-on-cache-miss: true

# Copy LevelDB files to the output directory for Windows
- if: ${{ startsWith(matrix.runtime, 'win') }}
name: Copy Files (leveldb) (win)
run: cp -v ./leveldb/build/Release/leveldb.dll ${{ env.OUTPUT_PATH }}/${{ matrix.runtime }}/libleveldb.dll
# Create the distribution directory
- name: Create Distribution Directory
Expand Down
6 changes: 5 additions & 1 deletion .neo/docker/neo-cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
FROM debian:stable-slim

LABEL org.opencontainers.image.description "neo-cli -- full node, no plugins"

# Install the apt-get packages
RUN apt-get update
RUN apt-get install -y libicu-dev libleveldb-dev screen
RUN apt-get install -y libicu-dev libleveldb-dev screen sqlite3

COPY ./dist /opt/neo-cli
RUN ln -s /opt/neo-cli/neo-cli /usr/bin

CMD ["neo-cli"]
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</a>
</p>

<h3 align="center">Neo Blockchain</h3>
<h3 align="center">CSharp implementation of the neo blockchain protocol.</h3>

<p align="center">
A modern distributed network for the Smart Economy.
Expand Down Expand Up @@ -38,7 +38,7 @@
src=".github/images/nnt-logo.jpg"
width="23px">
</a>
&nbsp;
&nbsp;
<a href="https://t.me/NEO_EN">
<img
src=".github/images/telegram-logo.png"
Expand Down Expand Up @@ -99,13 +99,12 @@
1. [Overview](#overview)
2. [Project structure](#project-structure)
3. [Related projects](#related-projects)
4. [Opening a new issue](#opening-a-new-issue)
4. [Opening a new issue](#opening-a-new-issue)
5. [Bounty program](#bounty-program)
6. [License](#license)

## Overview
This repository contain main classes of the
[Neo](https://neo.org) blockchain.
This repository is a csharp implementation of the [neo](https://neo.org) blockchain. It is jointly maintained by the neo core developers and neo global development community.
Visit the [tutorials](https://docs.neo.org) to get started.


Expand All @@ -131,7 +130,7 @@ An overview of the project folders can be seen below.
|[/tests/](https://github.com/neo-project/neo/tree/master/tests)|All unit tests.|

## Related projects
Code references are provided for all platform building blocks. That includes the base library, the VM, a command line application and the compiler.
Code references are provided for all platform building blocks. That includes the base library, the VM, a command line application and the compiler.

* [neo:](https://github.com/neo-project/neo/) Included libraries are Neo, Neo-CLI, Neo-GUI, Neo-VM, test and plugin modules.
* [neo-express:](https://github.com/neo-project/neo-express/) A private net optimized for development scenarios.
Expand Down
3 changes: 1 addition & 2 deletions benchmarks/Neo.Benchmarks/Persistence/Bechmarks_LevelDB.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
using Neo.Persistence;
using Neo.Plugins.Storage;
using Neo.SmartContract;
using System.Diagnostics;

namespace Neo.Benchmarks.Persistence.Benchmarks
{
Expand All @@ -26,7 +25,7 @@ public class Bechmarks_LevelDB
private const string PathLevelDB = "Data_LevelDB_Benchmarks";

private static readonly LevelDBStore levelDb = new();
private static ISnapshot snapshot;
private static IStoreSnapshot snapshot;

[GlobalSetup]
public void Setup()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void Cleanup()
[Benchmark]
public void ReadOnlyStoreView_LevelDB()
{
var view = new ReadOnlyStoreView(levelDbStore);
var view = (IReadOnlyStore)levelDbStore;
var ok = view.TryGet(key1, out var _);
Debug.Assert(ok);

Expand All @@ -61,7 +61,7 @@ public void ReadOnlyStoreView_LevelDB()
[Benchmark]
public void SnapshotCache_LevelDB()
{
var snapshot = new SnapshotCache(levelDbStore);
var snapshot = new StoreCache(levelDbStore);
var ok = snapshot.TryGet(key1, out var _);
Debug.Assert(ok);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>Neo.Extensions</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>Neo.Extensions</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Neo.Extensions\Neo.Extensions.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ private JToken[] ConvertToJTokenArray(JToken? token)
result.Add(token);
}

return [.. result]; // Converting a List to an Array of JTokens
return [.. result!]; // Converting a List to an Array of JTokens
}
}
}
Expand Down
Loading

0 comments on commit 344e050

Please sign in to comment.