Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/music #349

Open
wants to merge 45 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
b833851
Init musicoin
deacix May 4, 2017
20d2ffc
cleanup
deacix May 4, 2017
20e8684
Fix config
deacix May 4, 2017
965d3d4
cleanup
deacix May 4, 2017
a0938f9
Fix
deacix May 4, 2017
2f510bf
fixes
deacix May 4, 2017
8ea4395
Fix
deacix May 4, 2017
6e2c186
fix
deacix May 4, 2017
89a44e6
Update config.json
deacix May 5, 2017
318fd48
Create payouts.json
deacix May 5, 2017
e5dbf30
Update supervisord.conf
deacix May 5, 2017
7e8b37e
Delete run.sh
deacix May 5, 2017
2046646
Update block.hbs
deacix May 5, 2017
1c7faf8
Update pending.hbs
deacix May 5, 2017
a60b663
Update Dockerfile
deacix May 5, 2017
f5be973
Update payouts.json
deacix May 5, 2017
616d52b
Update payouts.json
deacix May 5, 2017
9e074f4
Update payouts.json
deacix May 5, 2017
4170eb0
Update supervisord.conf
deacix May 5, 2017
605486f
Update Dockerfile
deacix May 5, 2017
217abd4
Create payouts.sh
deacix May 5, 2017
2086dfe
Create pool.sh
deacix May 5, 2017
44e90a0
Update supervisord.conf
deacix May 5, 2017
664ad74
Update Dockerfile
deacix May 5, 2017
2e5a1d0
Update Dockerfile
deacix May 5, 2017
3399740
Update payouts.json
deacix May 5, 2017
a9732b0
Update supervisord.conf
deacix May 5, 2017
066388a
Update docker-compose.yml
deacix May 5, 2017
d4debb9
Update docker-compose.yml
deacix May 5, 2017
b43ebda
Update supervisord.conf
deacix May 5, 2017
12ddbed
Create gmc.sh
deacix May 5, 2017
5c1b8d0
Update Dockerfile
deacix May 5, 2017
278d9f2
Update docker-compose.yml
deacix May 5, 2017
daf4b0b
Update gmc.sh
deacix May 5, 2017
6a73f4b
Update gmc.sh
deacix May 5, 2017
7efe769
Update pool.sh
deacix May 5, 2017
9577cd4
Update payouts.sh
deacix May 5, 2017
4380925
fix
deacix May 5, 2017
e876f01
fixes
deacix May 5, 2017
b411824
fix
deacix May 5, 2017
796963f
Fixes
deacix May 5, 2017
25a142f
set difficulty
deacix May 5, 2017
e6cdde4
fix
deacix May 7, 2017
677983d
Update payouts.json
deacix May 9, 2017
e00a578
Update unlocker.go
deacix May 9, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.DS_Store
config.json
testnet.json

/build/_workspace/
/build/bin/
.idea
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

![Miner's stats page](https://15254b2dcaab7f5478ab-24461f391e20b7336331d5789078af53.ssl.cf1.rackcdn.com/ethereum.vanillaforums.com/editor/pe/cf77cki0pjpt.png)

[![Join the chat at https://gitter.im/sammy007/open-ethereum-pool](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/sammy007/open-ethereum-pool?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Build Status](https://travis-ci.org/sammy007/open-ethereum-pool.svg?branch=develop)](https://travis-ci.org/sammy007/open-ethereum-pool) [![Go Report Card](https://goreportcard.com/badge/github.com/sammy007/open-ethereum-pool)](https://goreportcard.com/report/github.com/sammy007/open-ethereum-pool)
[![Join the chat at https://gitter.im/bulktrade/open-ethereum-pool](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/bulktrade/open-ethereum-pool?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Build Status](https://travis-ci.org/bulktrade/open-ethereum-pool.svg?branch=develop)](https://travis-ci.org/bulktrade/open-ethereum-pool) [![Go Report Card](https://goreportcard.com/badge/github.com/bulktrade/open-ethereum-pool)](https://goreportcard.com/report/github.com/bulktrade/open-ethereum-pool)

[List Of Open Ethereum Pools](https://github.com/sammy007/open-ethereum-pool/wiki/List-Of-Open-Pools)
[List Of Open Ethereum Pools](https://github.com/bulktrade/open-ethereum-pool/wiki/List-Of-Open-Pools)

### Features

Expand All @@ -19,7 +19,7 @@

#### Proxies

* [Ether-Proxy](https://github.com/sammy007/ether-proxy) HTTP proxy with web interface
* [Ether-Proxy](https://github.com/bulktrade/ether-proxy) HTTP proxy with web interface
* [Stratum Proxy](https://github.com/Atrides/eth-proxy) for Ethereum

### Building on Linux
Expand All @@ -39,7 +39,7 @@ First install [go-ethereum](https://github.com/ethereum/go-ethereum/wiki/Instal
Clone & compile:

git config --global http.https://gopkg.in.followRedirects true
git clone https://github.com/sammy007/open-ethereum-pool.git
git clone https://github.com/bulktrade/open-ethereum-pool.git
cd open-ethereum-pool
make

Expand Down Expand Up @@ -319,4 +319,4 @@ Made by sammy007. Licensed under GPLv3.

### Donations

ETH/ETC: 0xb85150eb365e7df0941f0cf08235f987ba91506a
ETH/ETC: 0x60c9b2aa721127b5775146aa96078703549408e1
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/sammy007/open-ethereum-pool/storage"
"github.com/sammy007/open-ethereum-pool/util"
"github.com/bulktrade/open-ethereum-pool/storage"
"github.com/bulktrade/open-ethereum-pool/util"
)

type ApiConfig struct {
Expand Down
2 changes: 1 addition & 1 deletion build/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fi
# Create fake Go workspace if it doesn't exist yet.
workspace="$PWD/build/_workspace"
root="$PWD"
ethdir="$workspace/src/github.com/sammy007"
ethdir="$workspace/src/github.com/bulktrade"
if [ ! -L "$ethdir/open-ethereum-pool" ]; then
mkdir -p "$ethdir"
cd "$ethdir"
Expand Down
114 changes: 114 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
{
"threads": 8,
"coin": "music",
"name": "main",

"proxy": {
"enabled": true,
"listen": "0.0.0.0:8888",
"limitHeadersSize": 1024,
"limitBodySize": 256,
"behindReverseProxy": true,
"blockRefreshInterval": "120ms",
"stateUpdateInterval": "3s",
"difficulty": 500000000,
"hashrateExpiration": "3h",

"healthCheck": true,
"maxFails": 100,

"stratum": {
"enabled": true,
"listen": "0.0.0.0:8008",
"timeout": "120s",
"maxConn": 8192
},

"policy": {
"workers": 8,
"resetInterval": "60m",
"refreshInterval": "1m",

"banning": {
"enabled": false,
"ipset": "blacklist",
"timeout": 1800,
"invalidPercent": 30,
"checkThreshold": 30,
"malformedLimit": 5
},
"limits": {
"enabled": false,
"limit": 30,
"grace": "5m",
"limitJump": 10
}
}
},

"api": {
"enabled": true,
"purgeOnly": false,
"purgeInterval": "10m",
"listen": "0.0.0.0:8080",
"statsCollectInterval": "5s",
"hashrateWindow": "30m",
"hashrateLargeWindow": "3h",
"luckWindow": [64, 128, 256],
"payments": 30,
"blocks": 50
},

"upstreamCheckInterval": "5s",
"upstream": [
{
"name": "main",
"url": "http://127.0.0.1:8545",
"timeout": "10s"
},
{
"name": "backup",
"url": "http://127.0.0.2:8545",
"timeout": "10s"
}
],

"redis": {
"endpoint": "redis:6379",
"poolSize": 10,
"database": 0,
"password": ""
},

"unlocker": {
"enabled": false,
"poolFee": 0.5,
"poolFeeAddress": "0x60c9b2aa721127b5775146aa96078703549408e1",
"donate": false,
"depth": 120,
"immatureDepth": 20,
"keepTxFees": false,
"interval": "10m",
"daemon": "http://127.0.0.1:8545",
"timeout": "10s"
},

"payouts": {
"enabled": false,
"requirePeers": 25,
"interval": "5m",
"daemon": "http://127.0.0.1:8545",
"timeout": "10s",
"address": "0x328b9cfd311c9c9e60b6826fc5311be812355168",
"gas": "21000",
"gasPrice": "20000000000",
"autoGas": true,
"threshold": 500000000,
"bgsave": false
},

"newrelicEnabled": false,
"newrelicName": "MyEtherProxy",
"newrelicKey": "SECRET_KEY",
"newrelicVerbose": false
}
52 changes: 52 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
FROM ubuntu:16.04
RUN apt-get update && apt-get -y install curl && curl -sL https://deb.nodesource.com/setup_6.x | bash -
RUN apt-get update && apt-get -y install build-essential golang nodejs git

RUN git config --global http.https://gopkg.in.followRedirects true

WORKDIR /opt

RUN git clone https://github.com/Musicoin/go-musicoin.git

WORKDIR /opt/go-musicoin

RUN make gmc

RUN chmod a+x /opt/go-musicoin/build/bin/gmc
RUN ln -s /opt/go-musicoin/build/bin/gmc /usr/bin/geth
RUN ln -s /opt/go-musicoin/build/bin/gmc /usr/bin/gmc

WORKDIR /opt

RUN git config --global http.https://gopkg.in.followRedirects true
RUN git clone --branch release/music --single-branch https://github.com/bulktrade/open-ethereum-pool.git

WORKDIR /opt/open-ethereum-pool

RUN make

WORKDIR /opt/open-ethereum-pool/www

RUN npm install -g [email protected] bower && npm install && bower --allow-root install && ./build.sh

WORKDIR /

RUN apt-get update && apt-get -y install nginx
RUN apt-get update && apt-get -y install supervisor python-pip net-tools && pip install supervisor-stdout

ENV DEBIAN_FRONTEND noninteractive

COPY nginx.conf /etc/nginx/sites-enabled/default
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY pool.conf /etc/security/limits.d/pool.conf
COPY payouts.sh /payouts.sh
COPY pool.sh /pool.sh
COPY gmc.sh /gmc.sh

RUN chmod a+x /payouts.sh && chmod a+x /pool.sh && chmod a+x /gmc.sh

CMD ["/usr/bin/supervisord"]

VOLUME ["/root/.musicoin"]

EXPOSE 8008 80
28 changes: 28 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: "2"
services:
pool:
build: .
ports:
- 8008:8008
volumes:
- ./musicoin:/root/.musicoin
environment:
- VIRTUAL_HOST=music.pool.claims
- VIRTUAL_PORT=80
- WALLET_PASSWORD_FILE_PATH=/root/.musicoin/password
networks:
- pool
- rproxy

redis:
image: redis
volumes:
- ./redis:/data
networks:
- pool

networks:
pool:
rproxy:
external:
name: rproxy
2 changes: 2 additions & 0 deletions docker/gmc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
gmc --fast --unlock "0x328b9cfd311c9c9e60b6826fc5311be812355168" --rpc --rpcaddr "127.0.0.1" --rpcport 8545 --password $WALLET_PASSWORD_FILE_PATH
59 changes: 59 additions & 0 deletions docker/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
upstream api {
server 127.0.0.1:8080;
}

server {
listen 80 default_server;
listen [::]:80 default_server;

# SSL configuration
#
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
#
# Note: You should disable gzip for SSL traffic.
# See: https://bugs.debian.org/773332
#
# Read up on ssl_ciphers to ensure a secure configuration.
# See: https://bugs.debian.org/765782
#
# Self signed certs generated by the ssl-cert package
# Don't use them in a production server!
#
# include snippets/snakeoil.conf;

root /opt/open-ethereum-pool/www/dist;

# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;

server_name _;

location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ index.html =404;
}

location /api {
proxy_pass http://api;
}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# include snippets/fastcgi-php.conf;
#
# # With php7.0-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# # With php7.0-fpm:
# fastcgi_pass unix:/run/php/php7.0-fpm.sock;
#}

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
13 changes: 13 additions & 0 deletions docker/payouts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

# Wait until PostgreSQL started and listens on port 5432.
while [ -z "`netstat -tln | grep 8545`" ]; do
echo 'Waiting for gmc to start ...'
sleep 1
done
echo 'gmc started.'
sleep 5

# Start server.
echo 'Starting payouts...'
/opt/open-ethereum-pool/build/bin/open-ethereum-pool /opt/open-ethereum-pool/payouts.json
2 changes: 2 additions & 0 deletions docker/pool.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pool soft nofile 512000
pool hard nofile 512000
13 changes: 13 additions & 0 deletions docker/pool.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

# Wait until PostgreSQL started and listens on port 5432.
while [ -z "`netstat -tln | grep 8545`" ]; do
echo 'Waiting for gmc to start ...'
sleep 1
done
echo 'gmc started.'
sleep 5

# Start server.
echo 'Starting pool...'
/opt/open-ethereum-pool/build/bin/open-ethereum-pool /opt/open-ethereum-pool/config.json
Loading