From 89dfb144eb6538cf42b039bef083defdffa43c42 Mon Sep 17 00:00:00 2001 From: iquidus Date: Fri, 8 Jan 2021 13:53:20 +0100 Subject: [PATCH] open-etc-pool -> core-pool --- README.md | 63 ++++++---------------------------------- api/server.go | 4 +-- build/env.sh | 8 ++--- docs/PAYOUTS.md | 2 +- main.go | 8 ++--- misc/upstart.conf | 8 ++--- payouts/payer.go | 6 ++-- payouts/unlocker.go | 6 ++-- payouts/unlocker_test.go | 4 +-- policy/policy.go | 4 +-- proxy/blocks.go | 4 +-- proxy/config.go | 8 ++--- proxy/handlers.go | 4 +-- proxy/proxy.go | 8 ++--- proxy/stratum.go | 2 +- rpc/rpc.go | 2 +- storage/redis.go | 2 +- www/app/index.html | 8 ++--- www/package-lock.json | 2 +- www/package.json | 2 +- 20 files changed, 55 insertions(+), 100 deletions(-) diff --git a/README.md b/README.md index 0681ec8..0cc87fa 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,14 @@ -## Open Source Ethereum Classic Mining Pool - -### WARNING: This code is currently configured for the Ethereum Classic main network +## core-pool ### Features -**This pool is being further developed to provide an easy to use pool for Ethereum Classic miners. This software is functional however an optimised release of the pool is expected soon. Testing and bug submissions are welcome!** - * Support for HTTP and Stratum mining * Detailed block stats with luck percentage and full reward * Failover geth instances: geth high availability built in -* Modern beautiful Ember.js frontend * Separate stats for workers: can highlight timed-out workers so miners can perform maintenance of rigs * JSON-API for stats +* New vue based UI +* Supports Ethereum Classic, Mordor, Ethereum, Ropsten & Ubiq. ### Building on Linux @@ -30,44 +27,18 @@ First install [core-geth](https://github.com/etclabscore/core-geth/releases). Clone & compile: git config --global http.https://gopkg.in.followRedirects true - git clone https://github.com/etclabscore/open-etc-pool.git - cd open-etc-pool + git clone https://github.com/etclabscore/core-pool.git + cd core-pool make Install redis-server. ### Running Pool - ./build/bin/open-etc-pool config.json + ./build/bin/core-pool config.json You can use Ubuntu upstart - check for sample config in upstart.conf. -### Building Frontend - -Install nodejs. I suggest using LTS version >= 4.x from https://github.com/nodesource/distributions or from your Linux distribution or simply install nodejs on Ubuntu Xenial 16.04. - -> NOTE: at this point keep your nodejs version <= 10.x. - -The frontend is a single-page Ember.js application that polls the pool API to render miner stats. - - cd www - -Change ApiUrl: '//example.net/' in www/config/environment.js to match your domain name. Also don't forget to adjust other options. - -Install deps - - npm install -g ember-cli@2.9.1 - npm install -g bower - npm install - bower install - -Build. - - ./build.sh - -Configure nginx to serve API on /api subdirectory. -Configure nginx to serve www/dist as static website. - #### Serving API using nginx Create an upstream for API: @@ -82,17 +53,6 @@ and add this setting after location /: proxy_pass http://api; } -#### Customization - -You can customize the layout using built-in web server with live reload: - - ember server --port 8082 --environment development - -**Don't use built-in web server in production**. - -Check out www/app/templates directory and edit these templates -in order to customise the frontend. - ### Configuration Configuration is actually simple, just read it twice and think twice before changing defaults. @@ -108,7 +68,7 @@ otherwise you will get errors on start because of JSON comments.** "coin": "etc", // Give unique name to each instance "name": "main", - // mordor OR classic + // mordor, classic, ethereum, ropsten or ubiq "network": "classic", "proxy": { "enabled": true, @@ -304,11 +264,6 @@ I recommend this deployment strategy: * Don't run payouts and unlocker modules as part of mining node. Create separate configs for both, launch independently and make sure you have a single instance of each module running. * If `poolFeeAddress` is not specified all pool profit will remain on coinbase address. If it specified, make sure to periodically send some dust back required for payments. -### Mordor - -To use this pool on the mordor testnet two settings require changing to "mordor" - -network in your config.json (this sets backend (validation,unlocker) to mordor paramaters) -APP.Network in your www/config/environment.js (this sets the frontend to mordor paramaters) -rerun ./build.sh +### frontend +See https://github.com/etclabscore/core-pool-interface diff --git a/api/server.go b/api/server.go index e1c3a33..bcf9acf 100644 --- a/api/server.go +++ b/api/server.go @@ -12,8 +12,8 @@ import ( "github.com/gorilla/mux" - "github.com/etclabscore/open-etc-pool/storage" - "github.com/etclabscore/open-etc-pool/util" + "github.com/etclabscore/core-pool/storage" + "github.com/etclabscore/core-pool/util" ) type ApiConfig struct { diff --git a/build/env.sh b/build/env.sh index 98b8fb0..7fecde0 100755 --- a/build/env.sh +++ b/build/env.sh @@ -12,10 +12,10 @@ fi # root="$PWD" # ethdir="$workspace/src/github.com/etclabscore" -# if [ ! -L "$ethdir/open-etc-pool" ]; then +# if [ ! -L "$ethdir/core-pool" ]; then # mkdir -p "$ethdir" # cd "$ethdir" -# ln -s ../../../../../. open-etc-pool +# ln -s ../../../../../. core-pool # cd "$root" # fi @@ -27,8 +27,8 @@ GOBIN="$PWD/build/bin" export GOBIN # Run the command inside the workspace. -# cd "$ethdir/open-etc-pool" -# PWD="$ethdir/open-etc-pool" +# cd "$ethdir/core-pool" +# PWD="$ethdir/core-pool" # Launch the arguments with the configured environment. exec "$@" diff --git a/docs/PAYOUTS.md b/docs/PAYOUTS.md index cd52aef..be8e805 100644 --- a/docs/PAYOUTS.md +++ b/docs/PAYOUTS.md @@ -38,7 +38,7 @@ After payout session, payment module will perform `BGSAVE` (background saving) o If your payout is not logged and not confirmed by Ethereum network you can resolve it automatically. You need to payouts in maintenance mode by setting up `RESOLVE_PAYOUT=1` or `RESOLVE_PAYOUT=True` environment variable: -`RESOLVE_PAYOUT=1 ./build/bin/open-etc-pool payouts.json`. +`RESOLVE_PAYOUT=1 ./build/bin/core-pool payouts.json`. Payout module will fetch all rows from Redis with key `eth:payments:pending` and credit balance back to miners. Usually you will have only single entry there. diff --git a/main.go b/main.go index 4d3775a..b717cdc 100644 --- a/main.go +++ b/main.go @@ -13,10 +13,10 @@ import ( "github.com/yvasiyarov/gorelic" - "github.com/etclabscore/open-etc-pool/api" - "github.com/etclabscore/open-etc-pool/payouts" - "github.com/etclabscore/open-etc-pool/proxy" - "github.com/etclabscore/open-etc-pool/storage" + "github.com/etclabscore/core-pool/api" + "github.com/etclabscore/core-pool/payouts" + "github.com/etclabscore/core-pool/proxy" + "github.com/etclabscore/core-pool/storage" ) var cfg proxy.Config diff --git a/misc/upstart.conf b/misc/upstart.conf index 15a6704..ae92e82 100644 --- a/misc/upstart.conf +++ b/misc/upstart.conf @@ -1,8 +1,8 @@ -# open-etc-pool -description "open-etc-pool" +# core-pool +description "core-pool" -env DAEMON=/home/main/src/open-etc-pool/build/bin/open-etc-pool -env CONFIG=/home/main/src/open-etc-pool/config.json +env DAEMON=/home/main/src/core-pool/build/bin/core-pool +env CONFIG=/home/main/src/core-pool/config.json start on filesystem or runlevel [2345] stop on runlevel [!2345] diff --git a/payouts/payer.go b/payouts/payer.go index f99daa7..145d138 100644 --- a/payouts/payer.go +++ b/payouts/payer.go @@ -10,9 +10,9 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/etclabscore/open-etc-pool/rpc" - "github.com/etclabscore/open-etc-pool/storage" - "github.com/etclabscore/open-etc-pool/util" + "github.com/etclabscore/core-pool/rpc" + "github.com/etclabscore/core-pool/storage" + "github.com/etclabscore/core-pool/util" ) const txCheckInterval = 5 * time.Second diff --git a/payouts/unlocker.go b/payouts/unlocker.go index b1ee46b..3f12585 100644 --- a/payouts/unlocker.go +++ b/payouts/unlocker.go @@ -10,9 +10,9 @@ import ( "github.com/ethereum/go-ethereum/common/math" - "github.com/etclabscore/open-etc-pool/rpc" - "github.com/etclabscore/open-etc-pool/storage" - "github.com/etclabscore/open-etc-pool/util" + "github.com/etclabscore/core-pool/rpc" + "github.com/etclabscore/core-pool/storage" + "github.com/etclabscore/core-pool/util" ) type UnlockerConfig struct { diff --git a/payouts/unlocker_test.go b/payouts/unlocker_test.go index 284b508..50662fd 100644 --- a/payouts/unlocker_test.go +++ b/payouts/unlocker_test.go @@ -1,8 +1,8 @@ package payouts import ( - "github.com/etclabscore/open-etc-pool/rpc" - "github.com/etclabscore/open-etc-pool/storage" + "github.com/etclabscore/core-pool/rpc" + "github.com/etclabscore/core-pool/storage" "math/big" "os" "testing" diff --git a/policy/policy.go b/policy/policy.go index b2b94ad..1e5a185 100644 --- a/policy/policy.go +++ b/policy/policy.go @@ -9,8 +9,8 @@ import ( "sync/atomic" "time" - "github.com/etclabscore/open-etc-pool/storage" - "github.com/etclabscore/open-etc-pool/util" + "github.com/etclabscore/core-pool/storage" + "github.com/etclabscore/core-pool/util" ) type Config struct { diff --git a/proxy/blocks.go b/proxy/blocks.go index 9bcfc13..f40db1f 100644 --- a/proxy/blocks.go +++ b/proxy/blocks.go @@ -9,8 +9,8 @@ import ( "github.com/ethereum/go-ethereum/common" - "github.com/etclabscore/open-etc-pool/rpc" - "github.com/etclabscore/open-etc-pool/util" + "github.com/etclabscore/core-pool/rpc" + "github.com/etclabscore/core-pool/util" ) const maxBacklog = 3 diff --git a/proxy/config.go b/proxy/config.go index e631e9c..5509867 100644 --- a/proxy/config.go +++ b/proxy/config.go @@ -1,10 +1,10 @@ package proxy import ( - "github.com/etclabscore/open-etc-pool/api" - "github.com/etclabscore/open-etc-pool/payouts" - "github.com/etclabscore/open-etc-pool/policy" - "github.com/etclabscore/open-etc-pool/storage" + "github.com/etclabscore/core-pool/api" + "github.com/etclabscore/core-pool/payouts" + "github.com/etclabscore/core-pool/policy" + "github.com/etclabscore/core-pool/storage" ) type Config struct { diff --git a/proxy/handlers.go b/proxy/handlers.go index d35eb16..7d9bccc 100644 --- a/proxy/handlers.go +++ b/proxy/handlers.go @@ -5,8 +5,8 @@ import ( "regexp" "strings" - "github.com/etclabscore/open-etc-pool/rpc" - "github.com/etclabscore/open-etc-pool/util" + "github.com/etclabscore/core-pool/rpc" + "github.com/etclabscore/core-pool/util" ) // Allow only lowercase hexadecimal with 0x prefix diff --git a/proxy/proxy.go b/proxy/proxy.go index c27fc7a..7415711 100644 --- a/proxy/proxy.go +++ b/proxy/proxy.go @@ -13,10 +13,10 @@ import ( "github.com/gorilla/mux" - "github.com/etclabscore/open-etc-pool/policy" - "github.com/etclabscore/open-etc-pool/rpc" - "github.com/etclabscore/open-etc-pool/storage" - "github.com/etclabscore/open-etc-pool/util" + "github.com/etclabscore/core-pool/policy" + "github.com/etclabscore/core-pool/rpc" + "github.com/etclabscore/core-pool/storage" + "github.com/etclabscore/core-pool/util" ) type ProxyServer struct { diff --git a/proxy/stratum.go b/proxy/stratum.go index 3b81e00..f660e02 100644 --- a/proxy/stratum.go +++ b/proxy/stratum.go @@ -9,7 +9,7 @@ import ( "net" "time" - "github.com/etclabscore/open-etc-pool/util" + "github.com/etclabscore/core-pool/util" ) const ( diff --git a/rpc/rpc.go b/rpc/rpc.go index ce53eac..a05714b 100644 --- a/rpc/rpc.go +++ b/rpc/rpc.go @@ -14,7 +14,7 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/etclabscore/open-etc-pool/util" + "github.com/etclabscore/core-pool/util" ) type RPCClient struct { diff --git a/storage/redis.go b/storage/redis.go index 342d9bc..5d23458 100644 --- a/storage/redis.go +++ b/storage/redis.go @@ -9,7 +9,7 @@ import ( "gopkg.in/redis.v3" - "github.com/etclabscore/open-etc-pool/util" + "github.com/etclabscore/core-pool/util" ) type Config struct { diff --git a/www/app/index.html b/www/app/index.html index 9ec2756..9b691e0 100644 --- a/www/app/index.html +++ b/www/app/index.html @@ -5,12 +5,12 @@ ETC Mining Pool - + {{content-for "head"}} - + {{content-for "head-footer"}} @@ -18,7 +18,7 @@ {{content-for "body"}} - + {{content-for "body-footer"}} @@ -28,7 +28,7 @@

© | - Powered by open-etc-pool + Powered by core-pool

diff --git a/www/package-lock.json b/www/package-lock.json index 2d81f2c..da7e5f3 100644 --- a/www/package-lock.json +++ b/www/package-lock.json @@ -1,5 +1,5 @@ { - "name": "open-etc-pool", + "name": "core-pool", "version": "0.0.0", "lockfileVersion": 1, "requires": true, diff --git a/www/package.json b/www/package.json index c1a8226..c0a87bb 100644 --- a/www/package.json +++ b/www/package.json @@ -1,5 +1,5 @@ { - "name": "open-etc-pool", + "name": "core-pool", "version": "0.0.0", "description": "Open ETC Pool", "private": true,