Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
31054d0
try to add redis auth
webworker01 Nov 29, 2020
49ad3f9
new merkle dependency
webworker01 Dec 12, 2020
39ce38b
Merge branch 'redis-auth' of https://github.com/webworker01/knomp int…
webworker01 Dec 12, 2020
6b4c70c
Merge pull request #25 from webworker01/new-merkle
webworker01 Feb 19, 2021
6117438
Dockerize
webworker01 Feb 20, 2021
b0eaef1
readme
webworker01 Feb 20, 2021
d44b663
readem
webworker01 Feb 20, 2021
410bc66
readem
webworker01 Feb 20, 2021
5b710e7
add solo wsb pool_config example
webworker01 Feb 20, 2021
535700f
add solo wsb pool_config example
webworker01 Feb 20, 2021
2500635
toc
webworker01 Feb 20, 2021
352dc73
readem
webworker01 Feb 20, 2021
cc8f84d
Add port to default theme list page
webworker01 Feb 20, 2021
d38d81a
Add port to minerpond theme list page
webworker01 Feb 20, 2021
76a1174
comment out port mapping for network_mode: host
webworker01 Mar 7, 2021
a001ca5
add pm2 config
webworker01 Mar 7, 2021
7133ad5
readme
webworker01 Mar 8, 2021
1d8f574
hardcode pirate total supply for now
webworker01 Mar 28, 2021
a246765
Update issue templates
webworker01 Jun 4, 2022
dd618e9
Update issue templates
webworker01 Jun 5, 2022
cca3d69
dependency updates
webworker01 Jun 5, 2022
ee4b0a2
Merge pull request #33 from webworker01/2022
webworker01 Jun 5, 2022
43ef140
redis 3.1.1
webworker01 Jun 5, 2022
44c3751
Only node version 10 supported
webworker01 Jul 18, 2022
48cbb01
update deps
smk762 May 7, 2023
6db53e3
Update README.md
smk762 May 7, 2023
f157e21
Update README.md
smk762 May 7, 2023
500f27e
First pass at dockerhub image
webworker01 Jul 3, 2023
1431f09
Bash block notify
webworker01 Jul 4, 2023
1d94432
Merge pull request #34 from smk762/patch-1
webworker01 Oct 13, 2024
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
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
redis-data
Old
.vscode
.github
.gitignore
39 changes: 39 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: Bug report
about: Please only submit bug reports to this issues tracker, all other submissions
will be considered spam.
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
69 changes: 69 additions & 0 deletions .github/workflows/build-knomp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: build-knomp

on:
workflow_dispatch:
push:
branches:
- 'master'
paths:
- '**'
- '!README.md'
- '!docker-compose.yml'
- '!.gitignore'

env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
buildkitd-flags: --debug
-
name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ hashFiles('**/Dockerfile') }}
restore-keys: |
${{ runner.os }}-buildx-
-
name: Build Docker Image
uses: docker/build-push-action@v4
with:
context: .
# push: true
tags: webworker01/knomp:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
-
name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Push Docker Image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: webworker01/knomp:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
-
# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
name: Cleanup Cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ node_modules/
.idea/
config.json
pool_configs/
!pool_configs/zclassic_example.json
!pool_configs/komodo.json
!pool_configs/solo-wsb.json
coins/
!coins/komodo.json
!coins/wsb.json
website/piratepool.io/static/*.txt
redis-data/
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM ubuntu:18.04
LABEL maintainer="webworker01"

RUN apt-get update -y && \
apt-get install -y gcc g++ make libboost-dev libboost-system-dev libsodium-dev sudo curl git iputils-ping

RUN curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - && \
apt-get install -y nodejs

RUN useradd knomp
COPY . /home/knomp/knomp

RUN echo "knomp ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/user && \
chmod 0440 /etc/sudoers.d/user && \
chown -R knomp:knomp /home/knomp

USER knomp

RUN cd /home/knomp/knomp && npm install

WORKDIR /home/knomp/knomp

EXPOSE 8080

CMD npm start
112 changes: 76 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,61 @@
## Mining stratum for Komodo and Komodo assetchains.
# Mining stratum for Komodo and Komodo assetchains.

Requirements
------------
* node v10+
* libsodium
* boost
* Redis (see https://redis.io/topics/quickstart for details)
## Table of Contents
* [Differences between this and Z-NOMP](#differences-between-this-and-z-nomp)
* [Using Docker (easy)](#using-docker-easy)
* [Bare metal installation](#bare-metal-installation)
* [More Config Information](#more-config-information)
* [License](#license)

Differences between this and Z-NOMP
------------
## Differences between this and Z-NOMP
* This is meant for Komodo mining
* Founders, Treasury, and other ZEC/ZEN specific stuff is removed

Upgrade
-------------
## Using Docker (easy)

This method sets up 2 docker containers, one with knomp and one with redis.

It will directly use your host system's network so you can connect to the coin daemon without opening up RPC beyond 127.0.0.1.

The ports it listens on must not be in use, this includes 8080 for the website, 6379 for redis and any ports you open for stratums (default is 3333).

### Requirements
[Install Docker](https://docs.docker.com/engine/install/) and [docker-compose](https://docs.docker.com/compose/install/)

### Docker Install
```
git clone https://github.com/webworker01/knomp.git
cd ./knomp
cp config_example.json config.json
```

Setup your [config.json](./config_example.json), `./coins/` and `./pool_configs/` in here, then:

```
docker-compose up &
```

### Docker stop
```
docker-compose down
```

### Docker rebuild and update
```
docker-compose down
docker rmi knomp_knomp
git pull
docker-compose up &
```

## Bare metal installation
### Requirements
* node v10
* libsodium
* boost
* Redis (see https://redis.io/topics/quickstart for details)

### Upgrade
Please be sure to backup your `./coins` and `./pool_configs` directory before upgrading

Kill your running pool (CTRL-C)
Expand All @@ -24,13 +66,12 @@ npm install
npm start
```

Install Daemon
-------------
### Install Daemon
Some initial setup
```shell
# The following packages are needed to build both Komodo and this stratum:
sudo apt-get update
sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python python-zmq zlib1g-dev wget libcurl4-openssl-dev bsdmainutils automake curl libboost-dev libboost-system-dev libsodium-dev jq redis-server nano -y
sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python python3-zmq zlib1g-dev wget libcurl4-openssl-dev bsdmainutils automake curl libboost-dev libboost-system-dev libsodium-dev jq redis-server nano -y
```
Now, let's build Komodo
```shell
Expand All @@ -50,15 +91,20 @@ cd ~/komodo/src
./assetchains
```

Install Pool
-------------
### Install Pool
Once all the chains you want on your pool have synced up we can configure the stratum.

We need node and npm installed

```shell
cd ~
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
# Install NVM
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash

# Install node 14
nvm install 14

# Use node 14
nvm use 14
```

Now, let's build our stratum and run it. This will install the pool and configure it for all the assetchains on your system automatically. It must be run from the same user as the coin deamons were launched, as it pulls the rpcuser/pass from the conf file in the home directory.
Expand All @@ -84,16 +130,15 @@ npm start

If all went well the program should start without error and you should be able to browse to your pool website on your server via port 8080.

Disable Coinbase Mode
-------------
This mode uses -pubkey to tell the daemon where the coinbase should be sent, and uses the daemons coinbase transaction rather then having the pool create the coinabse transaction. This enables special coinbase transactions, such as ac_founders and ac_script or new modes with CC vouts in the coinbase not yet created, it will work with all coins, except Full Z support described below.
## More Config Information
### Disable Coinbase Mode
This mode uses -pubkey to tell the daemon where the coinbase should be sent, and uses the daemons coinbase transaction rather then having the pool create the coinabse transaction. This enables special coinbase transactions, such as ac_founders and ac_script or new modes with CC vouts in the coinbase not yet created, it will work with all coins, except Full Z support described below.

To enable it, change the value in the `./coins/*.json` to `"disablecb" : true`

The pool fee is taken in the payment processor using this mode, and might not be 100% accurate down to the single satoshi, so the pool address may end up with some small amount of coins over time.

Payment Processing
-------------
### Payment Processing
Please note that the default configs generated are for solo mining. If you wish to create a public pool please modify the configs like in this [example config](https://github.com/z-classic/z-nomp/blob/master/pool_configs/komodo_example.json)

There is now a config option you can add to your pool_configs/coin.json to toggle making an attempt at a payment upon pool startup.
Expand All @@ -105,32 +150,29 @@ There is now a config option you can add to your pool_configs/coin.json to toggl
}
```

Invalid Worker Addresses
-------------
### Invalid Worker Addresses
You can add an option to your pool_config to have any miners that mine with an invalid address (if they somehow get through) to pay out to an address of your choosing
```
"invalidAddress":"zsValidAddressOfYourChoosingThatsNotThePoolZAddress"
```

Full Z Transaction Support (Sprout)
-------------
### Full Z Transaction Support (Sprout)
This is an option to force miners to use a Z address as their username for payouts

In your coins file add:
In your coins file add:
```
"privateChain": true,
"burnFees": true
```

Sapling and Sapling Payment Support
-------------
### Sapling and Sapling Payment Support
In coins/pirate.json file:
```
"privateChain": true,
"burnFees": true,
"sapling": 152855
```
Please note, PIRATE sapling became active around 2018-12-15 01:15UTC at block 152855 Now that this has passed this can just be set to `"sapling":true`
Please note, PIRATE sapling became active around 2018-12-15 01:15UTC at block 152855 Now that this has passed this can just be set to `"sapling":true`

In pool_config:
```
Expand All @@ -143,15 +185,13 @@ In pool_config:
"maxBlocksPerPayment": 20,
```

More Resources
-------------
### More Resources
[Further info on config](https://github.com/zone117x/node-open-mining-portal#2-configuration) and some [sample configs](https://github.com/z-classic/z-nomp)

License
-------------
## License
Forked from ComputerGenie repo (deleted)

Released under the GNU General Public License v2
http://www.gnu.org/licenses/gpl-2.0.html

_Forked from [z-classic/z-nomp](https://github.com/z-classic/z-nomp) which is incorrectly licensed under MIT License - see [zone117x/node-open-mining-portal](https://github.com/zone117x/node-open-mining-portal)_
_Forked from [z-classic/z-nomp](https://github.com/z-classic/z-nomp) which is incorrectly licensed under MIT License - see [zone117x/node-open-mining-portal](https://github.com/zone117x/node-open-mining-portal)_
8 changes: 8 additions & 0 deletions coins/komodo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "komodo",
"symbol": "kmd",
"algorithm": "equihash",
"txfee": 0.00005,
"peerMagic": "f9eee48d",
"sapling": true
}
9 changes: 9 additions & 0 deletions coins/wsb.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "WSB",
"symbol": "WSB",
"algorithm": "equihash",
"txfee": 0.0001,
"peerMagic": "faa04bca",
"sapling": true,
"disablecb": true
}
31 changes: 31 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
version: '3'

services:
knomp:
container_name: knomp
network_mode: host
build:
context: .
dockerfile: Dockerfile
volumes:
- ./config.json:/home/knomp/knomp/config.json
- ./coins:/home/knomp/knomp/coins
- ./libs:/home/knomp/knomp/libs
- ./pool_configs:/home/knomp/knomp/pool_configs
- ./website:/home/knomp/knomp/website
# ports:
# - 8080:8080
# - 3333:3333
depends_on:
- redis

redis:
image: redis:6.0.10-alpine
container_name: redis
network_mode: host
command: ["redis-server", "--appendonly", "yes"]
volumes:
- ./redis-data:/data
# ports:
# - 6379:6379
restart: always
Loading