Skip to content

Commit

Permalink
open-etc-pool -> core-pool
Browse files Browse the repository at this point in the history
  • Loading branch information
iquidus committed Jan 8, 2021
1 parent 9c9cf40 commit 89dfb14
Show file tree
Hide file tree
Showing 20 changed files with 55 additions and 100 deletions.
63 changes: 9 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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 <code>upstart.conf</code>.

### 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 <code>ApiUrl: '//example.net/'</code> in <code>www/config/environment.js</code> to match your domain name. Also don't forget to adjust other options.

Install deps

npm install -g [email protected]
npm install -g bower
npm install
bower install

Build.

./build.sh

Configure nginx to serve API on <code>/api</code> subdirectory.
Configure nginx to serve <code>www/dist</code> as static website.

#### Serving API using nginx

Create an upstream for API:
Expand All @@ -82,17 +53,6 @@ and add this setting after <code>location /</code>:
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 <code>www/app/templates</code> 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.
Expand All @@ -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,
Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions api/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions build/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 "$@"
2 changes: 1 addition & 1 deletion docs/PAYOUTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
8 changes: 4 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions misc/upstart.conf
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
6 changes: 3 additions & 3 deletions payouts/payer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions payouts/unlocker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions payouts/unlocker_test.go
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
4 changes: 2 additions & 2 deletions policy/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions proxy/blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions proxy/config.go
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions proxy/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion proxy/stratum.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"net"
"time"

"github.com/etclabscore/open-etc-pool/util"
"github.com/etclabscore/core-pool/util"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion rpc/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion storage/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions www/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>ETC Mining Pool</title>
<meta name="description" content="High profitability ETC mining pool"/>
<meta name="description" content="High profitability mining pool"/>
<meta name="keywords" content="Ethereum, ethereum, Classic, classic, ETC, etc, pool, mining, cryptocurrency"/>
<script src="https://cdn.polyfill.io/v1/polyfill.min.js?features=Intl.~locale.en"></script>
{{content-for "head"}}
<link rel="stylesheet" href="{{rootURL}}assets/vendor.css">
<link rel="stylesheet" href="{{rootURL}}assets/open-etc-pool.css">
<link rel="stylesheet" href="{{rootURL}}assets/core-pool.css">
<link rel="shortcut icon" type="image/x-icon" href="{{rootURL}}favicon.png" />
{{content-for "head-footer"}}
</head>
<body>
{{content-for "body"}}

<script src="{{rootURL}}assets/vendor.js"></script>
<script src="{{rootURL}}assets/open-etc-pool.js"></script>
<script src="{{rootURL}}assets/core-pool.js"></script>

{{content-for "body-footer"}}

Expand All @@ -28,7 +28,7 @@
<div class="row">
<div class="col-md-12" style="text-align: center;">
<p class="text-muted" style="margin:20px 0">&copy; |
Powered by <a href="https://github.com/etclabscore/open-etc-pool" target="_blank">open-etc-pool</a>
Powered by <a href="https://github.com/etclabscore/core-pool" target="_blank">core-pool</a>
</p>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion www/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion www/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "open-etc-pool",
"name": "core-pool",
"version": "0.0.0",
"description": "Open ETC Pool",
"private": true,
Expand Down

0 comments on commit 89dfb14

Please sign in to comment.