From 38c4148f4cc33ed56ceb5f103bfd191fd7b226f7 Mon Sep 17 00:00:00 2001 From: Peter Salanki Date: Sat, 3 Nov 2018 07:22:00 -0400 Subject: [PATCH 1/3] Properly catch error on http.NewRequest --- rpc/rpc.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rpc/rpc.go b/rpc/rpc.go index e637b0550..01cb6dd0a 100644 --- a/rpc/rpc.go +++ b/rpc/rpc.go @@ -239,6 +239,12 @@ func (r *RPCClient) doPost(url string, method string, params interface{}) (*JSON data, _ := json.Marshal(jsonReq) req, err := http.NewRequest("POST", url, bytes.NewBuffer(data)) + + if err != nil { + r.markSick() + return nil, err + } + req.Header.Set("Content-Length", (string)(len(data))) req.Header.Set("Content-Type", "application/json") req.Header.Set("Accept", "application/json") From ab54eac1435f016f68785e6ced14bf3ee23b4c54 Mon Sep 17 00:00:00 2001 From: Peter Salanki Date: Thu, 8 Nov 2018 12:24:22 -0500 Subject: [PATCH 2/3] Add Docker support Pool and frontend can be built and run as docker containers. An example docker-compose.yml is included. --- Dockerfile | 10 +++++++++ docker-compose.yml | 54 ++++++++++++++++++++++++++++++++++++++++++++++ www/Dockerfile | 17 +++++++++++++++ www/build.sh | 2 +- 4 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100644 www/Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..5f2a51acb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM golang:1.11 + +RUN mkdir -p /app +WORKDIR /app + +COPY ./ /app + +RUN make + +CMD ./build/bin/open-ethereum-pool ./config.json diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..6c917fe64 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,54 @@ +version: '2' +services: + proxy: + build: pool/open-ethereum-pool/ + restart: always + ports: + - 3333:3333 + volumes: + - ./proxy.json:/app/config.json + links: + - redis + + api: + build: ./ + restart: always + ports: + - 8181:8181 + volumes: + - ./api.json:/app/config.json + + unlocker: + build: pool/open-ethereum-pool/ + restart: always + volumes: + - ./unlocker.json:/app/config.json + + payouts: + build: pool/open-ethereum-pool/ + restart: always + volumes: + - ./payouts.json:/app/config.json + + web-builder: + build: www/ + volumes: + - ./www-dist:/app/dist + + web-development: + build: www/ + volumes: + - ./www:/app + command: ember server --port 8082 --environment development + + redis: + image: redis:latest + restart: always + ports: + - 6379:6379 + volumes: + - redis:/data + command: redis-server --appendonly yes + +volumes: + redis: diff --git a/www/Dockerfile b/www/Dockerfile new file mode 100644 index 000000000..6aa35da53 --- /dev/null +++ b/www/Dockerfile @@ -0,0 +1,17 @@ +FROM node:11.1.0-alpine + +RUN apk add git + +RUN mkdir -p /app +WORKDIR /app + +COPY ./ /app + +VOLUME /app/www/dist + +RUN npm install -g ember-cli@2.9.1 +RUN npm install -g bower +RUN npm install +RUN bower --allow-root install + +CMD ./build.sh diff --git a/www/build.sh b/www/build.sh index 32d575c10..bf35a6030 100755 --- a/www/build.sh +++ b/www/build.sh @@ -1,3 +1,3 @@ -#!/bin/bash +#!/bin/sh ./node_modules/.bin/ember build --environment production From d293ee86b6ee0a5c39675bf05857c1cf2174f376 Mon Sep 17 00:00:00 2001 From: Sammy Libre <7374093+sammy007@users.noreply.github.com> Date: Thu, 10 Jan 2019 07:40:02 +0500 Subject: [PATCH 3/3] Update for Constantinople hard fork --- payouts/unlocker.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/payouts/unlocker.go b/payouts/unlocker.go index 1f0f05949..50d358797 100644 --- a/payouts/unlocker.go +++ b/payouts/unlocker.go @@ -30,9 +30,11 @@ type UnlockerConfig struct { const minDepth = 16 const byzantiumHardForkHeight = 4370000 +const constantinopleHardForkHeight = 7280000 var homesteadReward = math.MustParseBig256("5000000000000000000") var byzantiumReward = math.MustParseBig256("3000000000000000000") +var constantinopleReward = math.MustParseBig256("2000000000000000000") // Donate 10% from pool fees to developers const donationFee = 10.0 @@ -502,6 +504,9 @@ func weiToShannonInt64(wei *big.Rat) int64 { } func getConstReward(height int64) *big.Int { + if height >= constantinopleHardForkHeight { + return new(big.Int).Set(constantinopleReward) + } if height >= byzantiumHardForkHeight { return new(big.Int).Set(byzantiumReward) }