Giter Site home page Giter Site logo

zxuemy / miningcore Goto Github PK

View Code? Open in Web Editor NEW

This project forked from minernl/miningcore

0.0 0.0 0.0 37.12 MB

Miningcore a the multi-currency stratum-engine

Home Page: https://miningcore.com

License: MIT License

Shell 0.02% JavaScript 2.19% C++ 22.09% C 55.48% C# 13.88% Assembly 3.44% CSS 2.43% Makefile 0.05% HTML 0.38% CMake 0.06% Batchfile 0.01%

miningcore's Introduction

Build status license

MinerNL - Miningcore 2.0 Stratum Pool

Miningcore running ubuntu

Changes in this Miningcore release

Upgrading to this version

If you already running a build with postgres database. You need to update you database.

In this release we use a new column "connectedworkers" in table "poolstats"

sudo wget https://raw.githubusercontent.com/minernl/miningcore/master/src/Miningcore/DataStore/Postgres/Scripts/db_change_20210225.sql

sudo -u postgres -i
psql -d miningcore -f db_change_20210225.sql
exit

Features

  • Supports clusters of pools each running individual currencies
  • Ultra-low-latency, multi-threaded Stratum implementation using asynchronous I/O
  • Adaptive share difficulty ("vardiff")
  • PoW validation (hashing) using native code for maximum performance
  • Session management for purging DDoS/flood initiated zombie workers
  • Payment processing
  • Banning System
  • Live Stats API on Port 4000
  • WebSocket streaming of notable events like Blocks found, Blocks unlocked, Payments and more
  • POW (proof-of-work) & POS (proof-of-stake) support
  • Detailed per-pool logging to console & filesystem
  • Runs on Linux and Windows
  • Discord Channel preferred
  • Gitter Channel

Supported Coins

In our wiki we have a complete list of supported coins.

Checkout the coins list here

Donations

This software comes with a built-in donation of 0.1% per block-reward to support the ongoing development of this project. You can also send donations directly to the developemers using the following accounts:

  • BTC: 3QT2WreQtanPHcMneg9LT2aH3s5nrSZsxr
  • LTC: LTVnLEv8Xj6emGbf981nTyN54Mnyjbfgrg
  • DASH: Xc2vm9SfRn8t1hyQgqi8Zrt3oFeGcQtw
  • ETH: 0xBfD360CDd9014Bc5B348B65cBf79F78381694f4E
  • ETC: 0xF4BFFC324bbeB63348F137B84f8d1Ade17B507E4
  • XMR: 44riGcQcDp4EsboDJP284CFCnJ2qP7y8DAqGC4D9WtVbEqzxQ3qYXAUST57u5FkrVF7CXhsEc63QNWazJ5b9ygwBJBtB2kT
  • ZEC: t1JtJtxTdgXCaYm1wzRfMRkGTJM4qLcm4FQ

Running Miningcore on Windows

Running pre-built Release Binaries on Windows

  • Download miningcore-win-x64.zip from the latest Release
  • Extract the Archive
  • Setup the database as outlined below
  • Create a configuration file config.json as described here
  • Run dotnet Miningcore.dll -c config.json

Running Miningcore on Linux

wget https://packages.microsoft.com/config/ubuntu/20.10/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
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 install -y dotnet-sdk-3.1
# Create the file repository configuration:
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'

# Import the repository signing key:
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -

# Update the package lists:
sudo apt-get update

# Install the latest version of PostgreSQL.
# If you want a specific version, use 'postgresql-12' or similar instead of 'postgresql':
sudo apt-get -y install postgresql-12
  • Create the database config:
# login as postgres user
sudo -i -u postgres
psql
CREATE USER miningcore WITH ENCRYPTED PASSWORD 'some-secure-password';
CREATE DATABASE miningcore;
ALTER DATABASE miningcore OWNER TO miningcore;
ALTER USER postgres WITH PASSWORD 'new_password';
GRANT ALL privileges ON DATABASE miningcore TO miningcore;

list shows the databases and privileges like below:

\list
                               List of databases
    Name    |  Owner   | Encoding | Collate |  Ctype  |     Access privileges
------------+----------+----------+---------+---------+---------------------------
 miningcore | postgres | UTF8     | C.UTF-8 | C.UTF-8 | =Tc/miningcore           +
            |          |          |         |         | miningcore=CTc/miningcore
 postgres   | postgres | UTF8     | C.UTF-8 | C.UTF-8 |
 template0  | postgres | UTF8     | C.UTF-8 | C.UTF-8 | =c/postgres              +
            |          |          |         |         | postgres=CTc/postgres
 template1  | postgres | UTF8     | C.UTF-8 | C.UTF-8 | =c/postgres              +
            |          |          |         |         | postgres=CTc/postgres
(4 rows)

# exit PostgresDB
\quit

# exit user postgres
$ exit					
  • Import Miningcore database tables
sudo wget https://raw.githubusercontent.com/minernl/miningcore/master/src/Miningcore/DataStore/Postgres/Scripts/createdb.sql

sudo -u postgres -i
psql -d miningcore -f createdb.sql
exit
  • Advanced PostgreSQL Database setup

The following step needs to performed once for every new coin you add to your server or cluster. Be sure to replace all occurences of pools_id in the statement below with the id of your pool from your config.json file:

sudo -u postgres -i
psql -d miningcore
CREATE TABLE shares_pools_id PARTITION OF shares FOR VALUES IN ('pools_id');

!!! Do this for every Coin you add to you server. If you have multiple server, add it on every server !!!

EXAMPLE:

lookup for the pools id in you config.json file. In this example pools id is VerusCoin

  CREATE TABLE shares_VerusCoin PARTITION OF shares FOR VALUES IN ('VerusCoin');
  
  config.json:
  "pools": [
      {
        "id": "VerusCoin",
        "enabled": true,
        "coin": "VerusCoin",
        "address": "RE9v8tCKiALVmkWbirTKc5cZpSJtuXswJ8",
  • Coin Daemon (per pool)

  • Miningcore needs to be built from source on Linux.

    Example Ubuntu 20.04:

sudo apt-get update -y
sudo apt-get install git cmake build-essential libssl-dev pkg-config libboost-all-dev libsodium-dev libzmq5
sudo git clone https://github.com/minernl/miningcore
cd miningcore/src/Miningcore
dotnet publish -c Release --framework netcoreapp3.1  -o ../../build
  • Running Miningcore

    Create a configuration file config.json as described here

cd ../../build
dotnet Miningcore.dll -c config.json

Building on Windows

Download and install the .Net Core 3.1 SDK

git clone https://github.com/minernl/miningcore
cd miningcore/src/Miningcore
dotnet publish -c Release --framework netcoreapp3.1  -o ..\..\build

Building on Windows - VISUAL STUDIO

Running a production pool

Running Miningcore

Create a configuration file config.json as described here

cd ../../build
dotnet Miningcore.dll -c config.json

A public production pool requires a web-frontend for your users to check their hashrate, earnings etc. You can use the web frontend that come with this fork Miningcore.Web

ShareRelay (ZeroMQ) needs .NET core 2.1 runtime

ZeroMQ is not supported in .NET core 3.1 and ShareRelay will fail

If you need ShareRelay support:

Install dotnet-sdk-2.1

sudo apt-get update; \
  sudo apt-get install -y apt-transport-https && \
  sudo apt-get update && \
  sudo apt-get install -y dotnet-sdk-2.1

Build pool in core2.1 framework

BUILDIR=${1:-../../build}
echo "Building into $BUILDIR"
dotnet publish -c Release --framework netcoreapp2.1 --runtime linux-x64 --self-contained true -o $BUILDIR

Feel free to discuss ideas/issues with fellow pool operators using our channels:
Discord Channel preferred
Gitter Channel

miningcore's People

Contributors

minernl avatar dependabot[bot] avatar calvintam236 avatar konstantin35 avatar shtse8 avatar ergot avatar bitspill avatar felixonmars avatar jeong760 avatar konstiantyn avatar jgillich avatar acidtib avatar belmix avatar kukks avatar 21void avatar endogen avatar denismatveev avatar interbiznw avatar martin-key avatar rterbush avatar vkynchev avatar jpb18 avatar konqueror1 avatar seperatis avatar ucyildirim avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.