Skip to content

Commit

Permalink
Merge pull request #1 from remcoros/update-0.2
Browse files Browse the repository at this point in the history
update public-pool
  • Loading branch information
remcoros authored Sep 29, 2024
2 parents 05ae106 + 79502aa commit c07ba40
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 10 deletions.
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM node:18.20.4-bookworm-slim AS build
FROM node:20-bookworm-slim AS build

# Public Pool repo does not use versions/tags yet, point directly to commit sha
ARG PUBLIC_POOL_SHA=0917911eb0edeba35e1cbe8de0c01d8a4e502cfb
ARG PUBLIC_POOL_SHA=4282233d2f11ceecbd0d142e8292ccc9c37ea999
ARG PUBLIC_POOL_UI_SHA=80081e337d3af829b0edf3990ad97ea430bd73d4

# these are specified in Makefile
Expand Down Expand Up @@ -29,6 +29,7 @@ RUN \
cd public-pool && \
git checkout ${PUBLIC_POOL_SHA}

# apply patch for rpc-bitcoin (see: https://github.com/vansergen/rpc-bitcoin/pull/65)
COPY patches/rpc-bitcoin+2.0.0.patch /build/public-pool/patches/rpc-bitcoin+2.0.0.patch

RUN \
Expand All @@ -53,7 +54,7 @@ RUN \
npm run build

# main container
FROM node:18.20.4-bookworm-slim
FROM node:20-bookworm-slim

ENV NODE_ENV=production

Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
PKG_ID := $(shell yq e ".id" manifest.yaml)
PKG_VERSION := $(shell yq e ".version" manifest.yaml)
TS_FILES := $(shell find ./ -name \*.ts)
PATCH_FILES := $(shell find ./patches -name \*.\*)

# sha256 hashes can be found in https://github.com/mikefarah/yq/releases/download/v4.40.7/checksums-bsd
YQ_VERSION := 4.40.7
Expand Down Expand Up @@ -38,7 +39,7 @@ clean:
scripts/embassy.js: $(TS_FILES)
deno bundle scripts/embassy.ts scripts/embassy.js

docker-images/aarch64.tar: manifest.yaml Dockerfile docker_entrypoint.sh assets/nginx.conf
docker-images/aarch64.tar: manifest.yaml Dockerfile docker_entrypoint.sh assets/nginx.conf $(PATCH_FILES)
ifeq ($(ARCH),x86_64)
else
mkdir -p docker-images
Expand All @@ -49,7 +50,7 @@ else
--platform=linux/arm64 -o type=docker,dest=docker-images/aarch64.tar .
endif

docker-images/x86_64.tar: manifest.yaml Dockerfile docker_entrypoint.sh assets/nginx.conf
docker-images/x86_64.tar: manifest.yaml Dockerfile docker_entrypoint.sh assets/nginx.conf $(PATCH_FILES)
ifeq ($(ARCH),aarch64)
else
mkdir -p docker-images
Expand Down
3 changes: 3 additions & 0 deletions docker_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ case "$(yq e '.bitcoind.type' /public-pool-data/start9/config.yaml)" in
;;
esac

export POOL_IDENTIFIER=$(yq e '.pool-identifier' /public-pool-data/start9/config.yaml)
echo "Set POOL_IDENTIFIER to '$POOL_IDENTIFIER'"

cd /public-pool
/usr/local/bin/node dist/main.js &
app_process=$!
Expand Down
5 changes: 3 additions & 2 deletions instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Run the following command to switch to the "chrooted" environment, any system ch

Install "socat":

apt install socat -y
apt update && apt install socat -y

Paste the following, this will create a new systemd service responsible for port forwarding 3333 (Stratum):

Expand All @@ -39,6 +39,7 @@ Enable the new systemd service:

systemctl enable socat.stratum

Now exit the chroot environment. Note: this will reboot StartOS!
Now exit the chroot environment. this will reboot StartOS!
**Do NOT close the SSH window manually, actually type `exit` and let it reboot.**

exit
5 changes: 3 additions & 2 deletions manifest.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
id: public-pool
title: "Public Pool"
version: 0.1.0
version: 0.2.0
release-notes: |
* Initial release of Public Pool for StartOS
* Update to latest master branch of public-pool
* Ability to set 'Pool Identifier' (included in coinbase transaction)
license: GPL
wrapper-repo: "https://github.com/remcoros/public-pool-startos"
upstream-repo: "https://github.com/benjamin-wilson/public-pool"
Expand Down
12 changes: 12 additions & 0 deletions scripts/procedures/getConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,16 @@ export const getConfig: T.ExpectedExports.getConfig = compat.getConfig({
},
},
},
"pool-identifier": {
"type": "string",
"name": "Pool Identifier",
"description":
"The pool identifier to include in the Coinbase transactions",
"copyable": true,
"default": "Public-Pool",
"placeholder": "Public-Pool",
"pattern": ".*",
"pattern-description": "any string",
"nullable": true,
},
});
2 changes: 1 addition & 1 deletion scripts/procedures/migrations.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { compat, types as T } from "../deps.ts";

export const migration: T.ExpectedExports.migration = compat.migrations
.fromMapping({}, "0.1.0" );
.fromMapping({}, "0.2.0" );

0 comments on commit c07ba40

Please sign in to comment.