From 909bff2dd953c787bc641a5495a42cfd5fd8f75a Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 1 Apr 2026 22:24:13 +0100 Subject: [PATCH] rebrand(lethean): update branding, ports, and config for Lethean blockchain MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Coin: Zano → Lethean, ticker: ZAN/ZANO → LTHN - Ports: 11211 → 36941 (mainnet RPC), 46941 (testnet RPC) - Wallet: 11212 → 36944/46944 - Address prefix: iTHN - URLs: zano.org → lethean.io - Explorer links: explorer.lthn.io Co-Authored-By: Claude Opus 4.6 (1M context) --- Dockerfile | 84 + README.md | 42 +- coinConfig.json | 13 +- config-lethean.json | 75 + config_example.json | 22 +- debug_scripts/socket_io.html | 2 +- deployment/base.sql | 22 +- deployment/deploy.bash | 32 +- frontend/app/admin.html | 2 +- frontend/app/admin/dashboard.html | 18 +- frontend/app/admin/workers.html | 4 +- frontend/app/globals.default.js | 2 +- frontend/app/globals.js | 2 +- frontend/app/index.html | 4 +- frontend/app/user/dashboard/dashboard.html | 6 +- .../app/user/dashboard/minerpayments.html | 2 +- frontend/app/user/help/faq.js | 16 +- frontend/app/user/help/getting_started.html | 4 +- frontend/app/user/home/console.html | 2 +- frontend/app/user/home/home.html | 6 +- frontend/app/user/payments/payments.html | 4 +- frontend/app/utils/strings.js | 9 +- frontend/bower.json | 2 +- frontend/package.json | 4 +- frontend/readme.md | 4 +- lib/api.js | 22 +- lib/coins/{zano.js => lethean.js} | 20 +- lib/payment_systems/{zano.js => lethean.js} | 6 +- lib/pool.js | 4 +- package-lock.json | 4385 +++++++++++++++++ package.json | 13 +- sql_sync/config_entries.json | 26 +- 32 files changed, 4714 insertions(+), 145 deletions(-) create mode 100644 Dockerfile create mode 100644 config-lethean.json rename lib/coins/{zano.js => lethean.js} (88%) rename lib/payment_systems/{zano.js => lethean.js} (99%) create mode 100644 package-lock.json diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7e40f5b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,84 @@ +# Production pool server: builds native deps then runs the mining pool. +# Requires Redis and MySQL at runtime (see docker-compose or env config). +# +# Build context must be the parent directory (zano-upstream/), e.g.: +# docker build -f zano-nodejs-pool/Dockerfile -t lethean-pool . +# +# Runtime env: +# REDIS_HOST, REDIS_PORT — Redis connection +# MYSQL_HOST, MYSQL_USER, MYSQL_PASS, MYSQL_DB — MySQL connection +# (or mount a config.json over /app/config.json) + +FROM node:22 AS builder + +# Native build dependencies for cryptonote-util and other C++ addons +RUN apt-get update && apt-get install -y --no-install-recommends \ + build-essential \ + python3 \ + python3-pip \ + libboost-system-dev \ + libboost-date-time-dev \ + libboost-thread-dev \ + libboost-serialization-dev \ + libboost-iostreams-dev \ + libboost-locale-dev \ + libzmq3-dev \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /workspace + +# Build the local cryptonote-util dependency first +COPY blockchain/ ./blockchain/ +RUN mkdir -p blockchain/build/release/src/config +COPY blockchain/build/release/src/config/currency_config.h \ + blockchain/build/release/src/config/currency_config.h + +COPY zano-node-util/package.json zano-node-util/package-lock.json ./zano-node-util/ +COPY zano-node-util/binding.gyp zano-node-util/main.cc zano-node-util/index.js ./zano-node-util/ +RUN ln -sf /workspace/blockchain /workspace/zano-node-util/Lethean +RUN cd zano-node-util && npm ci && npm rebuild --build-from-source + +# Build the pool itself +COPY zano-nodejs-pool/package.json zano-nodejs-pool/package-lock.json ./zano-nodejs-pool/ + +# Rewrite the local dep path so npm resolves the already-built addon +RUN cd zano-nodejs-pool && \ + node -e " \ + const fs = require('fs'); \ + const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8')); \ + pkg.dependencies['cryptonote-util'] = 'file:../zano-node-util'; \ + if (pkg.optionalDependencies) { \ + pkg.optionalDependencies['lethean-util'] = 'file:../zano-node-util'; \ + } \ + fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2)); \ + " + +RUN cd zano-nodejs-pool && npm ci --ignore-scripts +# Rebuild native addons explicitly after all sources are present +RUN cd zano-nodejs-pool && npm rebuild + +COPY zano-nodejs-pool/ ./zano-nodejs-pool/ + +# Production image — keep build tools out +FROM node:22-slim + +RUN apt-get update && apt-get install -y --no-install-recommends \ + libboost-system1.74.0 \ + libboost-date-time1.74.0 \ + libboost-thread1.74.0 \ + libboost-serialization1.74.0 \ + libboost-iostreams1.74.0 \ + libboost-locale1.74.0 \ + libzmq5 \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /app + +COPY --from=builder /workspace/zano-nodejs-pool ./ +COPY --from=builder /workspace/zano-node-util /workspace/zano-node-util + +# Stratum port and HTTP API port +EXPOSE 5555 +EXPOSE 8117 + +CMD ["node", "init.js"] diff --git a/README.md b/README.md index cbd02cc..6145bd3 100644 --- a/README.md +++ b/README.md @@ -12,13 +12,13 @@ worker - Does regular processing of statistics and sends status e-mails for non- ``` API listens on port 8001, remoteShare listens on 8000 -Xmrpool.net (The reference implementation) uses the following setup: -* https://xmrpool.net is hosted on its own server, as the main website is a static frontend -* https://api.xmrpool.net hosts api, remoteShare, longRunner, payments, blockManager, worker, as these must all be hosted with access to the same LMDB database. +A typical deployment uses the following setup: +* The main pool website is a static frontend hosted on its own server +* The API server hosts api, remoteShare, longRunner, payments, blockManager, worker, as these must all have access to the same LMDB database. Sample Caddyfile for API: ```text -https://api.xmrpool.net { +https://api.pool.lethean.io { proxy /leafApi 127.0.0.1:8000 proxy / 127.0.0.1:8001 cors @@ -40,16 +40,16 @@ Server Requirements Pre-Deploy ---------- -* If you're planning on using e-mail, you'll want to setup an account at https://mailgun.com (It's free for 10k e-mails/month!), so you can notify miners. This also serves as the backend for password reset emails, along with other sorts of e-mails from the pool, including pool startup, pool Monerod daemon lags, etc so it's highly suggested! +* If you're planning on using e-mail, you'll want to setup an account at https://mailgun.com (It's free for 10k e-mails/month!), so you can notify miners. This also serves as the backend for password reset emails, along with other sorts of e-mails from the pool, including pool startup, daemon lags, etc so it's highly suggested! * Pre-Generate the wallets, or don't, it's up to you! You'll need the addresses after the install is complete, so I'd suggest making sure you have them available. Information on suggested setups are found below. -* If you're going to be offering PPS, PLEASE make sure you load the pool wallet with XMR before you get too far along. Your pool will trigger PPS payments on its own, and fairly readily, so you need some float in there! +* If you're going to be offering PPS, PLEASE make sure you load the pool wallet with LTHN before you get too far along. Your pool will trigger PPS payments on its own, and fairly readily, so you need some float in there! * Make a non-root user, and run the installer from there! Deployment via Installer ------------------------ 1. Add your user to `/etc/sudoers`, this must be done so the script can sudo up and do it's job. We suggest passwordless sudo. Suggested line: ` ALL=(ALL) NOPASSWD:ALL`. Our sample builds use: `pooldaemon ALL=(ALL) NOPASSWD:ALL` -2. Run the [deploy script](https://raw.githubusercontent.com/Snipa22/nodejs-pool/master/deployment/deploy.bash) as a **NON-ROOT USER**. This is very important! This script will install the pool to whatever user it's running under! Also. Go get a coffee, this sucker bootstraps the monero installation. +2. Run the [deploy script](https://raw.githubusercontent.com/letheanVPN/lethean-nodejs-pool/master/deployment/deploy.bash) as a **NON-ROOT USER**. This is very important! This script will install the pool to whatever user it's running under! Also. Go get a coffee, this sucker bootstraps the Lethean daemon installation. 3. Once it's complete, change as `config.json` appropriate. It is pre-loaded for a local install of everything, running on 127.0.0.1. This will work perfectly fine if you're using a single node setup. You'll also want to set `bind_ip` to the external IP of the pool server, and `hostname` to the resolvable hostname for the pool server. `pool_id` is mostly used for multi-server installations to provide unique identifiers in the backend. You will also want to run: source ~/.bashrc This will activate NVM and get things working for the following pm2 steps. 4. You'll need to change the API endpoint for the frontend code in the `poolui/build/globals.js` and `poolui/build/globals.default.js` -- This will usually be `http(s):///api` unless you tweak caddy! 5. The default database directory `/home//pool_db/` is already been created during startup. If you change the `db_storage_path` just make sure your user has write permissions for new path. Run: `pm2 restart api` to reload the API for usage. @@ -70,7 +70,7 @@ pm2 restart api Install Script: ```bash -wget https://raw.githubusercontent.com/hyle-team/zano-nodejs-pool/master/deployment/deploy.bash && chmod +x ./deploy.bash && ./deploy.bash +wget https://raw.githubusercontent.com/letheanVPN/lethean-nodejs-pool/master/deployment/deploy.bash && chmod +x ./deploy.bash && ./deploy.bash ``` Assumptions for the installer @@ -88,19 +88,20 @@ The following raw binaries **MUST BE AVAILABLE FOR IT TO BOOTSTRAP**: I've confirmed that the default server 16.04 installation has these requirements. -The pool comes pre-configured with values for Monero (XMR), these may need to be changed depending on the exact requirements of your coin. Other coins will likely be added down the road, and most likely will have configuration.sqls provided to overwrite the base configurations for their needs, but can be configured within the frontend as well. +The pool comes pre-configured with values for Lethean (LTHN). Mining algorithm is ProgPoWZ. Wallet addresses use the iTHN prefix with 12 decimal places. -The pool ALSO applies a series of patches: Fluffy Blocks, Additional Open P2P Connections, 128 Txn Bug Fix. If you don't like these, replace the auto-installed monerod fixes! +Testnet ports: Daemon RPC 46941, Wallet RPC 46944, P2P 48081. +Mainnet ports: Daemon RPC 36941, Wallet RPC 36944, P2P 36942. Wallet Setup ------------ The pool is designed to have a dual-wallet design, one which is a fee wallet, one which is the live pool wallet. The fee wallet is the default target for all fees owed to the pool owner. PM2 can also manage your wallet daemon, and that is the suggested run state. -1. Generate your wallets using `/usr/local/src/monero/build/release/bin/monero-wallet-cli` -2. Make sure to save your regeneration stuff! +1. Generate your wallets using the Lethean CLI wallet (`lethean-wallet-cli`) +2. Make sure to save your seed phrase and keys! 3. For the pool wallet, store the password in a file, the suggestion is `~/wallet_pass` 4. Change the mode of the file with chmod to 0400: `chmod 0400 ~/wallet_pass` -5. Start the wallet using PM2: `pm2 start /usr/local/src/monero/build/release/bin/monero-wallet-rpc -- --rpc-bind-port 18082 --password-file ~/wallet_pass --wallet-file --disable-rpc-login --trusted-daemon` +5. Start the wallet RPC using PM2: `pm2 start lethean-wallet-rpc -- --rpc-bind-port 46944 --password-file ~/wallet_pass --wallet-file --disable-rpc-login --trusted-daemon` 6. If you don't use PM2, then throw the wallet into a screen and have fun. Manual Setup @@ -124,7 +125,7 @@ general/emailFrom SQL import command: sudo mysql pool < ~/nodejs-pool/sample_config.sql (Adjust name/path as needed!) ``` -The shareHost configuration is designed to be pointed at wherever the leafApi endpoint exists. For xmrpool.net, we use https://api.xmrpool.net/leafApi. If you're using the automated setup script, you can use: `http:///leafApi`, as Caddy will proxy it. If you're just using localhost and a local pool serv, http://127.0.0.1:8000/leafApi will do you quite nicely +The shareHost configuration is designed to be pointed at wherever the leafApi endpoint exists. If you're using the automated setup script, you can use: `http:///leafApi`, as Caddy will proxy it. If you're just using localhost and a local pool serv, http://127.0.0.1:8000/leafApi will do you quite nicely Additional ports can be added as desired, samples can be found at the end of base.sql. If you're not comfortable with the MySQL command line, I highly suggest MySQL Workbench or a similar piece of software (I use datagrip!). Your root MySQL password can be found in `/root/.my.cnf` @@ -230,19 +231,18 @@ PPS Fee Thoughts If you're considering PPS, I've spoken with [Fireice_UK](https://github.com/fireice-uk/) whom kindly did some math about what you're looking at in terms of requirements to run a PPS pool without it self-imploding under particular risk factors, based on the work found [here](https://arxiv.org/pdf/1112.4980.pdf) ```text -Also I calculated the amount of XMR needed to for a PPS pool to stay afloat. Perhaps you should put them up in the README to stop some spectacular clusterfucks :D: +Also I calculated the amount of LTHN needed to for a PPS pool to stay afloat. Perhaps you should put them up in the README to stop some spectacular clusterfucks :D: For 1 in 1000000 chance that the pool will go bankrupt: 5% fee -> 1200 2% fee -> 3000 For 1 in 1000000000 chance: 5% fee -> 1800 2% fee -> 4500 ``` -The developers of the pool have not verified this, but based on our own usage on https://xmrpool.net/ this seems rather reasonable. You should be wary if you're considering PPS and take you fees into account appropriately! +You should be wary if you're considering PPS and take your fees into account appropriately! Installation/Configuration Assistance ===================================== If you need help installing the pool from scratch, please have your servers ready, which would be Ubuntu 16.04 servers, blank and clean, DNS records pointed. These need to be x86_64 boxes with AES-NI Available. -Installation assistance is 7 XMR, with a 3 XMR deposit, with remainder to be paid on completion. -Configuration assistance is 4 XMR with a 2 XMR deposit, and includes debugging your pool configurations, ensuring that everything is running, and tuning for your uses/needs. +Installation and configuration assistance may be available through the Lethean community. SSH access with a sudo-enabled user will be needed, preferably the user that is slated to run the pool. @@ -250,12 +250,12 @@ If you'd like assistance with setting up node-cryptonote-pool, please provide wh Assistance is not available for frontend customization at this time. -For assistance, please contact Snipa at pool_install@snipanet.com or via IRC at irc.freenode.net in the #monero-pools channel. +For assistance, please visit the Lethean community channels at https://lethean.io Developer Donations =================== If you'd like to make a one time donation, the addresses are as follows: -* XMR - 44Ldv5GQQhP7K7t3ZBdZjkPA7Kg7dhHwk3ZM3RJqxxrecENSFx27Vq14NAMAd2HBvwEPUVVvydPRLcC69JCZDHLT2X5a4gr +* LTHN - YOUR_iTHN_DONATION_ADDRESS_HERE * BTC - 114DGE2jmPb5CP2RGKZn6u6xtccHhZGFmM * AEON - WmtvM6SoYya4qzkoPB4wX7FACWcXyFPWAYzfz7CADECgKyBemAeb3dVb3QomHjRWwGS3VYzMJAnBXfUx5CfGLFZd1U7ssdXTu @@ -264,6 +264,6 @@ Credits [Zone117x](https://github.com/zone117x) - Original [node-cryptonote-pool](https://github.com/zone117x/node-cryptonote-pool) from which, the stratum implementation has been borrowed. -[Mesh00](https://github.com/mesh0000) - Frontend build in Angular JS [XMRPoolUI](https://github.com/mesh0000/poolui) +[Mesh00](https://github.com/mesh0000) - Frontend build in Angular JS [PoolUI](https://github.com/mesh0000/poolui) [Wolf0](https://github.com/wolf9466/)/[OhGodAGirl](https://github.com/ohgodagirl) - Rebuild of node-multi-hashing with AES-NI [node-multi-hashing](https://github.com/Snipa22/node-multi-hashing-aesni) diff --git a/coinConfig.json b/coinConfig.json index db00398..73d9405 100644 --- a/coinConfig.json +++ b/coinConfig.json @@ -1,10 +1,13 @@ { - "zano": { - "funcFile": "./lib/coins/zano.js", - "paymentFile": "./payment_systems/zano.js", + "lethean": { + "funcFile": "./lib/coins/lethean.js", + "paymentFile": "./payment_systems/lethean.js", "sigDigits": 1000000000000, - "name": "Zano", + "name": "Lethean", + "shortCode": "LTHN", "mixIn": 4, - "shortCode": "ZANO" + "addressPrefix": "iTHN", + "decimalPlaces": 12, + "algorithm": "ProgPoWZ" } } diff --git a/config-lethean.json b/config-lethean.json new file mode 100644 index 0000000..40ed5f6 --- /dev/null +++ b/config-lethean.json @@ -0,0 +1,75 @@ +{ + "pool_id": 0, + "bind_ip": "127.0.0.1", + "hostname": "pool.lethean.io", + "coin": "lethean", + "db_storage_path": "data/pool_db", + "redis": { + "host": "127.0.0.1", + "port": 6379, + "auth": null + }, + "mysql": { + "connectionLimit": 20, + "host": "127.0.0.1", + "database": "lethean_pool", + "user": "pool", + "password": "CHANGE_ME" + }, + "daemon": { + "address": "127.0.0.1", + "port": 46941, + "_comment_port": "Lethean testnet RPC port; mainnet would be 36941", + "p2p_port": 48081, + "_comment_p2p": "Lethean testnet P2P port; mainnet would be 36942" + }, + "wallet": { + "address": "127.0.0.1", + "port": 46944, + "_comment_port": "Lethean testnet wallet RPC port; mainnet would be 36944" + }, + "pool": { + "address": "YOUR_iTHN_POOL_WALLET_ADDRESS_HERE", + "_comment_address": "Replace with your iTHN... Lethean wallet address", + "targetTime": 120, + "hashrateWindow": 600, + "updateInterval": 5, + "difficulty": 100000, + "trustedSharesCount": 30, + "blockRefreshInterval": 1000, + "minerTimeout": 900, + "maxTransactionAmount": 0, + "minPaymentThreshold": 0.5, + "denominationUnit": 1000000000000, + "paymentInterval": 120, + "maxAddresses": 50, + "slushMiningEnabled": false + }, + "ports": [ + { + "port": 5555, + "difficulty": 50000, + "desc": "Low difficulty (ProgPoWZ)", + "portType": "pplns", + "hidden": false + }, + { + "port": 7777, + "difficulty": 500000, + "desc": "High difficulty (ProgPoWZ)", + "portType": "pplns", + "hidden": false + } + ], + "api": { + "port": 8117, + "blocks": 30, + "hashrateWindow": 600 + }, + "charts": { + "pool": { + "hashrate": { "enabled": true, "updateInterval": 60, "stepInterval": 1800, "maximumPeriod": 86400 }, + "workers": { "enabled": true, "updateInterval": 60, "stepInterval": 1800, "maximumPeriod": 86400 } + } + } +} diff --git a/config_example.json b/config_example.json index 93f4f07..4bd11b5 100644 --- a/config_example.json +++ b/config_example.json @@ -1,14 +1,28 @@ { "pool_id": 0, "bind_ip": "127.0.0.1", - "hostname": "testpool.com", + "hostname": "pool.lethean.io", "db_storage_path": "CHANGEME", - "coin": "zano", + "coin": "lethean", "mysql": { "connectionLimit": 20, "host": "127.0.0.1", - "database": "pool", + "database": "lethean_pool", "user": "pool", - "password": "98erhfiuehw987fh23d" + "password": "CHANGE_ME" + }, + "daemon": { + "address": "127.0.0.1", + "port": 46941, + "_comment": "Lethean testnet RPC; mainnet = 36941" + }, + "wallet": { + "address": "127.0.0.1", + "port": 46944, + "_comment": "Lethean testnet wallet RPC; mainnet = 36944" + }, + "pool": { + "address": "YOUR_iTHN_POOL_WALLET_ADDRESS_HERE", + "_comment": "Replace with your iTHN... Lethean wallet address" } } diff --git a/debug_scripts/socket_io.html b/debug_scripts/socket_io.html index bce2a71..1c02f07 100644 --- a/debug_scripts/socket_io.html +++ b/debug_scripts/socket_io.html @@ -2,7 +2,7 @@