Skip to content
This repository has been archived by the owner on Oct 20, 2023. It is now read-only.

Commit

Permalink
Merge pull request #992 from coinfoundry/oliverw
Browse files Browse the repository at this point in the history
Oliverw
  • Loading branch information
Oliver Weichhold authored Nov 19, 2021
2 parents 653de88 + 63718e6 commit d6fb8a5
Show file tree
Hide file tree
Showing 16 changed files with 257 additions and 258 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,29 @@ name: .NET

on:
push:
branches: [ master ]
branches: [ master, oliverw ]
pull_request:
branches: [ master ]
branches: [ master, oliverw ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install Build dependencies
run: sudo apt-get install -y cmake build-essential libssl-dev pkg-config libboost-all-dev libsodium-dev libzmq5
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore
run: dotnet restore src
- name: Build
run: dotnet build --no-restore
run: dotnet build --no-restore src
- name: Test
run: dotnet test --no-build --verbosity normal
run: dotnet test --no-build --verbosity normal src
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ For general questions visit the [Discussions Area](https://github.com/coinfoundr

### Linux: pre-built binaries

- Install [.NET 5 Runtime](https://dotnet.microsoft.com/download/dotnet/5.0)
- Install [.NET 6 Runtime](https://dotnet.microsoft.com/download/dotnet/6.0)
- For Debian/Ubuntu, install these packages
- `postgresql-11` (or higher, the higher the better)
- `libzmq5`
Expand All @@ -42,7 +42,7 @@ For general questions visit the [Discussions Area](https://github.com/coinfoundr

### Windows: pre-built binaries

- Install [.NET 5 Runtime](https://dotnet.microsoft.com/download/dotnet/5.0)
- Install [.NET 6 Runtime](https://dotnet.microsoft.com/download/dotnet/6.0)
- Install [PostgreSQL Database](https://www.postgresql.org/)
- Download `miningcore-win-x64.zip` from the latest [Release](https://github.com/coinfoundry/miningcore/releases)
- Extract the Archive
Expand Down Expand Up @@ -111,25 +111,25 @@ $ sudo dpkg -i packages-microsoft-prod.deb
$ sudo apt-get update
$ sudo apt-get install -y apt-transport-https
$ sudo apt-get update
$ sudo apt-get -y install dotnet-sdk-5.0 git cmake build-essential libssl-dev pkg-config libboost-all-dev libsodium-dev libzmq5
$ sudo apt-get -y install dotnet-sdk-6.0 git cmake build-essential libssl-dev pkg-config libboost-all-dev libsodium-dev libzmq5
$ git clone https://github.com/coinfoundry/miningcore
$ cd miningcore/src/Miningcore
$ dotnet publish -c Release --framework net5.0 -o ../../build
$ dotnet publish -c Release --framework net6.0 -o ../../build
```

### Building on Windows

Download and install the [.NET 5 SDK](https://dotnet.microsoft.com/download/dotnet/5.0)
Download and install the [.NET 6 SDK](https://dotnet.microsoft.com/download/dotnet/6.0)

```dosbatch
> git clone https://github.com/coinfoundry/miningcore
> cd miningcore/src/Miningcore
> dotnet publish -c Release --framework net5.0 -o ..\..\build
> dotnet publish -c Release --framework net6.0 -o ..\..\build
```

### Building on Windows - Visual Studio

- Install [Visual Studio 2019](https://www.visualstudio.com/vs/). Visual Studio Community Edition is fine.
- Install [Visual Studio 2022](https://www.visualstudio.com/vs/). Visual Studio Community Edition is fine.
- Open `Miningcore.sln` in Visual Studio


Expand Down
12 changes: 6 additions & 6 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# Build worker image (VM template)
image:
- Visual Studio 2019
- Visual Studio 2022
- Ubuntu2004

#---------------------------------#
Expand All @@ -21,13 +21,13 @@ build_script:
- sh: sudo apt-get update -y && sudo apt-get -y install cmake build-essential libssl-dev pkg-config libboost-all-dev libsodium-dev libzmq5
- # Publish
- cd Miningcore
- dotnet publish -c Release --framework net5.0
- dotnet publish -c Release --framework net6.0
- # Publish Artifacts
- sh: (cd bin/Release/net5.0 && mkdir miningcore && cp -r publish/* miningcore && tar cf miningcore-linux-ubuntu-x64.tar.gz miningcore && appveyor PushArtifact miningcore-linux-ubuntu-x64.tar.gz)
- cmd: cd bin\Release\net5.0 && mkdir miningcore && xcopy publish\* miningcore /S && 7z a miningcore-win-x64.zip miningcore && appveyor PushArtifact miningcore-win-x64.zip && cd ..\..\..
- sh: (cd bin/Release/net6.0 && mkdir miningcore && cp -r publish/* miningcore && tar cf miningcore-linux-ubuntu-x64.tar.gz miningcore && appveyor PushArtifact miningcore-linux-ubuntu-x64.tar.gz)
- cmd: cd bin\Release\net6.0 && mkdir miningcore && xcopy publish\* miningcore /S && 7z a miningcore-win-x64.zip miningcore && appveyor PushArtifact miningcore-win-x64.zip && cd ..\..\..
- # Build Tests
- cd ../Miningcore.Tests
- dotnet build -c Release --framework net5.0
- dotnet build -c Release --framework net6.0

#---------------------------------#
# tests configuration #
Expand All @@ -38,7 +38,7 @@ test_script:
- dotnet test -c Release --no-build

before_test:
- sh: cp -v $APPVEYOR_BUILD_FOLDER/src/Miningcore/bin/Release/net5.0/publish/*.so $APPVEYOR_BUILD_FOLDER/src/Miningcore.Tests/bin/Release/net5.0/
- sh: cp -v $APPVEYOR_BUILD_FOLDER/src/Miningcore/bin/Release/net6.0/publish/*.so $APPVEYOR_BUILD_FOLDER/src/Miningcore.Tests/bin/Release/net6.0/

#---------------------------------#
# notifications #
Expand Down
4 changes: 2 additions & 2 deletions src/Miningcore.Tests/Miningcore.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
<Platforms>AnyCPU</Platforms>
<AssemblyName>Miningcore.Tests</AssemblyName>
Expand All @@ -33,7 +33,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="Microsoft.Reactive.Testing" Version="5.0.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
Expand Down
2 changes: 1 addition & 1 deletion src/Miningcore/Blockchain/Bitcoin/BitcoinJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ public void Init(BlockTemplate blockTemplate, string jobId,

scriptSigFinalBytes = new Script(Op.GetPushOp(Encoding.UTF8.GetBytes(coinbaseString))).ToBytes();

//Difficulty = new Target(new NBitcoin.BouncyCastle.Math.BigInteger(BlockTemplate.Target, 16)).Difficulty;
//Difficulty = new Target(new Org.BouncyCastle.Math.BigInteger(BlockTemplate.Target, 16)).Difficulty;
Difficulty = new Target(System.Numerics.BigInteger.Parse(BlockTemplate.Target, NumberStyles.HexNumber)).Difficulty;

extraNoncePlaceHolderLength = BitcoinConstants.ExtranoncePlaceHolderLength;
Expand Down
2 changes: 1 addition & 1 deletion src/Miningcore/Blockchain/CoinMetaData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static class DevDonation
{ "ZEC", "t1YEgm6ovXFseeFxXgFY2zXxwsScD4BbfhT" },
{ "BTG", "GRao6KHQ8a4GUjAZRVbeCLfRbSkJQQaeMg" },
{ "XVG", "D5xPoHLM6HPkwWSqAweECTSQirJBmRjS8i" },
{ "ERG", "9foYU8JkoqWBSDA3ba8VHfduPXV2NaVNPPAFkdYoR9t9cPQGMv4 "},
{ "ERG", "9foYU8JkoqWBSDA3ba8VHfduPXV2NaVNPPAFkdYoR9t9cPQGMv4"},
{ "XMR", "46S2AEwYmD9fnmZkxCpXf1T3U3DyEq3Ekb8Lg9kgUMGABn9Fp9q5nE2fBcXebrjrXfZHy5uC5HfLE6X4WLtSm35wUr9Mh46" },
{ "RVN", "RF8wbxb3jeAcrH2z71NxccmyZmufk1D5m5" },
{ "TUBE", "bxdAFKYA5sJYKM3zcn3SLaLRjsFF582VE1Uv5NChrVLm6o6UF4SdbZBZLrTBD6yEFZDzuTQGBCa8FLpX8charjxH2G3iMRX6R" },
Expand Down
6 changes: 1 addition & 5 deletions src/Miningcore/Blockchain/Cryptonote/CryptonoteConstants.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text.RegularExpressions;
using Miningcore.Configuration;
using Miningcore.Extensions;
using NBitcoin.BouncyCastle.Math;
using Org.BouncyCastle.Math;

namespace Miningcore.Blockchain.Cryptonote
{
Expand Down
Loading

0 comments on commit d6fb8a5

Please sign in to comment.