{"id":15146896,"url":"https://github.com/moneroocean/nodejs-pool","last_synced_at":"2025-09-29T15:31:49.736Z","repository":{"id":41883604,"uuid":"112011329","full_name":"MoneroOcean/nodejs-pool","owner":"MoneroOcean","description":"Official repository of MoneroOcean (XMR) mining pool","archived":false,"fork":true,"pushed_at":"2024-12-19T03:49:13.000Z","size":2624,"stargazers_count":118,"open_issues_count":23,"forks_count":74,"subscribers_count":21,"default_branch":"master","last_synced_at":"2024-12-19T04:36:11.527Z","etag":null,"topics":["mining-pool","monero","monero-pool","xmr"],"latest_commit_sha":null,"homepage":"https://moneroocean.stream","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"Snipa22/nodejs-pool","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MoneroOcean.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-11-25T14:50:43.000Z","updated_at":"2024-12-19T03:49:17.000Z","dependencies_parsed_at":"2023-10-01T15:57:44.443Z","dependency_job_id":null,"html_url":"https://github.com/MoneroOcean/nodejs-pool","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoneroOcean%2Fnodejs-pool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoneroOcean%2Fnodejs-pool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoneroOcean%2Fnodejs-pool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoneroOcean%2Fnodejs-pool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MoneroOcean","download_url":"https://codeload.github.com/MoneroOcean/nodejs-pool/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234635408,"owners_count":18864077,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mining-pool","monero","monero-pool","xmr"],"created_at":"2024-09-26T12:20:27.914Z","updated_at":"2025-09-29T15:31:49.723Z","avatar_url":"https://github.com/MoneroOcean.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Pool Design/Theory\n==================\nThe nodejs-pool is built around a small series of core daemons that share access to a single LMDB table for tracking of shares,\nwith MySQL being used to centralize configurations and ensure simple access from local/remote nodes.  The core daemons follow:\n\n```text\napi - Main API for the frontend to use and pull data from.  Expects to be hosted at  /\nremoteShare - Main API for consuming shares from remote/local pools.  Expects to be hosted at /leafApi\npool - Where the miners connect to.\nlongRunner - Database share cleanup.\npayments - Handles all payments to workers.\nblockManager - Unlocks blocks and distributes payments into MySQL\nworker - Does regular processing of statistics and sends status e-mails for non-active miners.\n```\n\nAPI listens on port 8001, remoteShare listens on 8000.\n\nmoneroocean.stream (The reference implementation) uses the following setup:\n* https://moneroocean.stream is hosted on its own server, as the main website is a static frontend\n* https://api.moneroocean.stream hosts api, remoteShare, longRunner, payments, blockManager, worker, as these must all be hosted with access to the same LMDB database.\n\nSetup Instructions\n==================\n\nServer Requirements\n-------------------\n* Ubuntu 24.04 (confirmed working)\n* 8 Gb Ram\n* 2 CPU Cores\n* 150 Gb SSD-Backed Storage - If you're doing a multi-server install, the leaf nodes do not need this much storage. They just need enough storage to hold the blockchain for your node. The pool comes configured to use up to 60Gb of storage for LMDB. Assuming you have the longRunner worker running, it should never get near this size, but be aware that it /can/ bloat readily if things error, so be ready for this!\n* Notably, this happens to be approximately the size of a 4Gb linode instance, which is where the majority of automated deployment testing happened!\n\nPre-Deploy\n----------\n* 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!\n* 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.\n* Run installer from root user and it will make new \"user\" for pool usage later.\n\nDeployment via Installer\n------------------------\n\n2. Run the [deploy script](https://raw.githubusercontent.com/MoneroOcean/nodejs-pool/master/deployment/deploy.bash) as a **ROOT USER**. This is very important! This script will install the pool to new user \"user\"! Also. Go get a coffee, this sucker bootstraps the monero installation.\n3. 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.\n4. You'll need to change the API endpoint for the frontend code in the `moneroocean-gui/script.js` -- This will usually be `http(s)://api.\u003cyour server FQDN\u003e` unless you tweak nginx!\n5. The default database directory `/home/user/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.\n8. Once you're happy with the settings, go ahead and add pool daemon on main/leaf pool node:\n\n```shell\ncd ~/nodejs-pool/\npm2 start init.js --name=pool --kill-timeout 10000 --log-date-format=\"YYYY-MM-DD HH:mm:ss:SSS Z\" -- --module=pool\npm2 save\npm2 startup\n```\n\nInstall Script that assumes you have free Cloudflare DNS setup for your web (moneroocean.stream) and API (api.moneroocean.stream) endpoints, CLoudflare API Token from\nfrom https://dash.cloudflare.com/profile/api-tokens with \"Zone.Zone (Read), Zone.DNS (Edit)\" permissions and email for certbot updates:\n\n```bash\ncurl -L https://raw.githubusercontent.com/MoneroOcean/nodejs-pool/master/deployment/deploy.bash | bash -s -- -s moneroocean.stream api.moneroocean.stream \"Cloudflare API Token\" support@moneroocean.stream\n```\n\nLeaf server install script (only for pool module that you need to add/start as shown above after install and updating config.json to connect to your main pool DB server):\n```bash\ncurl -L https://raw.githubusercontent.com/MoneroOcean/nodejs-pool/master/deployment/leaf.bash | bash\n```\n\nAssumptions for the installer\n-----------------------------\nThe installer assumes that you will be running a single-node instance and using a clean Ubuntu 24.04 server install. The following system defaults are set:\n* MySQL Username: pool\n* MySQL Password: 98erhfiuehw987fh23d\n* MySQL Host: 127.0.0.1\n* MySQL root access is only permitted as the root user, the password is in `/root/mysql_pass`\n* SSL Certificate is generated, self-signed, but is valid for Claymore Miners.\n* The server installs and deploys Caddy as it's choice of web server!\n\nThe pool comes pre-configured with values for Monero (XMR), these may need to be changed depending on the exact requirements of your coin.\nOther 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.\n\nWallet Setup\n------------\nThe pool is designed to have a dual-wallet design, one which is a fee wallet, one which is the live pool wallet.\nThe 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.\n\nManual Setup\n------------\nPretty similar to the above, you may wish to dig through a few other things for sanity sake, but the installer scripts should give you a good idea of what to expect from the ground up.\n\nManual SQL Configuration\n------------------------\nUntil the full frontend is released, the following SQL information needs to be updated by hand in order to bring your pool online, in module/item format. You can also edit the values in sample_config.sql, then import them into SQL directly via an update.\n```\nNice to have:\ngeneral/mailgunKey\ngeneral/mailgunURL\ngeneral/emailFrom\n\nSQL import command: ```mysql -u root --password=$(sudo cat /root/mysql_pass)```\n```\n\nThe shareHost configuration is designed to be pointed at wherever the leafApi endpoint exists. For moneroocean.stream, we use https://api.moneroocean.stream/leafApi.\nIf you're using the automated setup script, you can use: `http://\u003cyour IP\u003e/leafApi`, as Caddy will proxy it. If you're just using localhost and a local pool server,\nhttp://localhost:8000/leafApi will do you quite nicely.\n\nAdditional 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,\nI highly suggest MySQL Workbench or a similar piece of software (I use datagrip!). Your root MySQL password can be found in `/root/mysql_pass`\n\nPool Update Procedures\n======================\nIf upgrading the pool, please do a git pull to get the latest code within the pool's directory.\n\nPool Troubleshooting\n====================\n\nAPI stopped updating!\n---------------------\nThis is likely due to LMDB's MDB_SIZE being hit, or due to LMDB locking up due to a reader staying open too long, possibly due to a software crash.\nThe first step is to run:\n```\nmdb_stat -fear ~/pool_db/\n```\nThis should give you output like:\n```\nEnvironment Info\n  Map address: (nil)\n  Map size: 51539607552\n  Page size: 4096\n  Max pages: 12582912\n  Number of pages used: 12582904\n  Last transaction ID: 74988258\n  Max readers: 512\n  Number of readers used: 24\nReader Table Status\n    pid     thread     txnid\n     25763 7f4f0937b740 74988258\nFreelist Status\n  Tree depth: 3\n  Branch pages: 135\n  Leaf pages: 29917\n  Overflow pages: 35\n  Entries: 591284\n  Free pages: 12234698\nStatus of Main DB\n  Tree depth: 1\n  Branch pages: 0\n  Leaf pages: 1\n  Overflow pages: 0\n  Entries: 3\nStatus of blocks\n  Tree depth: 1\n  Branch pages: 0\n  Leaf pages: 1\n  Overflow pages: 0\n  Entries: 23\nStatus of cache\n  Tree depth: 3\n  Branch pages: 16\n  Leaf pages: 178\n  Overflow pages: 2013\n  Entries: 556\nStatus of shares\n  Tree depth: 2\n  Branch pages: 1\n  Leaf pages: 31\n  Overflow pages: 0\n  Entries: 4379344\n```\nThe important thing to verify here is that the \"Number of pages used\" value is less than the \"Max Pages\" value, and that there are \"Free pages\" under \"Freelist Status\".\nIf this is the case, them look at the \"Reader Table Status\" and look for the PID listed. Run:\n```shell\nps fuax | grep \u003cTHE PID FROM ABOVE\u003e\n\nex:\nps fuax | grep 25763\n```\n\nIf the output is not blank, then one of your node processes is reading, this is fine. If there is no output given on one of them, then proceed forwards.\n\nThe second step is to run:\n```shell\npm2 restart blockManager worker payments remoteShare longRunner api\n```\nThis will restart all of your related daemons, and will clear any open reader connections, allowing LMDB to get back to a normal state.\n\nIf on the other hand, you have no \"Free pages\" and your Pages used is equal to the Max Pages, then you've run out of disk space for LMDB.\nYou need to verify the cleaner is working. For reference, 4.3 million shares are stored within approximately 2-3 Gb of space,\nso if you're vastly exceeding this, then your cleaner (longRunner) is likely broken.\n\nInstallation/Configuration Assistance\n=====================================\nIf 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.\nThese need to be x86_64 boxes with AES-NI Available.\n\nInstallation assistance is 3 XMR, with a 1 XMR deposit, with remainder to be paid on completion.\nConfiguration assistance is 2 XMR with a 1 XMR deposit, and includes debugging your pool configurations, ensuring that everything is running, and tuning for your uses/needs.\naltblockManager module source (that determines the most profitable coin to mine and trades them to main coin on exchanges, in particular Tradeogre, Xeggex, Binance, Coinex, Gate, Livecoin, Okex, Sevenseas)\nprice is 20 XMR.\n\nSSH access with a sudo-enabled user will be needed, preferably the user that is slated to run the pool.\n\nAssistance is not available for frontend customization at this time.\n\nFor assistance, please contact MoneroOcean at support@moneroocean.stream.\n\nDeveloper Donations\n===================\nIf you'd like to make a one time donation, the addresses are as follows:\n* XMR - ```89TxfrUmqJJcb1V124WsUzA78Xa3UYHt7Bg8RGMhXVeZYPN8cE5CZEk58Y1m23ZMLHN7wYeJ9da5n5MXharEjrm41hSnWHL```\n* AEON - ```WmsEg3RuUKCcEvFBtXcqRnGYfiqGJLP1FGBYiNMgrcdUjZ8iMcUn2tdcz59T89inWr9Vae4APBNf7Bg2DReFP5jr23SQqaDMT```\n* ETN - ```etnkQMp3Hmsay2p7uxokuHRKANrMDNASwQjDUgFb5L2sDM3jqUkYQPKBkooQFHVWBzEaZVzfzrXoETX6RbMEvg4R4csxfRHLo1```\n* SUMO - ```Sumoo1DGS7c9LEKZNipsiDEqRzaUB3ws7YHfUiiZpx9SQDhdYGEEbZjRET26ewuYEWAZ8uKrz6vpUZkEVY7mDCZyGnQhkLpxKmy```\n* GRFT - ```GACadqdXj5eNLnyNxvQ56wcmsmVCFLkHQKgtaQXNEE5zjMDJkWcMVju2aYtxbTnZgBboWYmHovuiH1Ahm4g2N5a7LuMQrpT```\n* MSR - ```5hnMXUKArLDRue5tWsNpbmGLsLQibt23MEsV3VGwY6MGStYwfTqHkff4BgvziprTitbcDYYpFXw2rEgXeipsABTtEmcmnCK```\n* LTHN - ```iz53aMEaKJ25zB8xku3FQK5VVvmu2v6DENnbGHRmn659jfrGWBH1beqAzEVYaKhTyMZcxLJAdaCW3Kof1DwTiTbp1DSqLae3e```\n* WOW - ```Wo3yjV8UkwvbJDCB1Jy7vvXv3aaQu3K8YMG6tbY3Jo2KApfyf5RByZiBXy95bzmoR3AvPgNq6rHzm98LoHTkzjiA2dY7sqQMJ```\n* XMV - ```XvyVfpAYp3zSuvdtoHgnDzMUf7GAeiumeUgVC7RTq6SfgtzGEzy4dUgfEEfD5adk1kN4dfVZdT3zZdgSD2xmVBs627Vwt2C3Ey```\n* RYO - ```RYoLsi22qnoKYhnv1DwHBXcGe9QK6P9zmekwQnHdUAak7adFBK4i32wFTszivQ9wEPeugbXr2UD7tMd6ogf1dbHh76G5UszE7k1```\n* XLA - ```SvkpUizij25ZGRHGb1c8ZTAHp3VyNFU3NQuQR1PtMyCqdpoZpaYAGMfG99z5guuoktY13nrhEerqYNKXvoxD7cUM1xA6Z5rRY```\n* XHV - ```hvxyEmtbqs5TEk9U2tCxyfGx2dyGD1g8EBspdr3GivhPchkvnMHtpCR2fGLc5oEY42UGHVBMBANPge5QJ7BDXSMu1Ga2KFspQR```\n* TUBE - ```TubedBNkgkTbd2CBmLQSwW58baJNghD9xdmctiRXjrW3dE8xpUcoXimY4J5UMrnUBrUDmfQrbxRYRX9s5tQe7pWYNF2QiAdH1Fh```\n* LOKI - ```L6XqN6JDedz5Ub8KxpMYRCUoQCuyEA8EegEmeQsdP5FCNuXJavcrxPvLhpqY6emphGTYVrmAUVECsE9drafvY2hXUTJz6rW```\n* TRTL - ```TRTLv2x2bac17cngo1r2wt3CaxN8ckoWHe2TX7dc8zW8Fc9dpmxAvhVX4u4zPjpv9WeALm2koBLF36REVvsLmeufZZ1Yx6uWkYG```\n* XTNC - ```XtazhSxz1bbJLpT2JuiD2UWFUJYSFty5SVWuF6sy2w9v8pn69smkUxkTVCQc8NKCd6CBMNDGzgdPRYBKaHdbgZ5SNptVH1yPCTQ```\n* IRD - ```ir3DHyB8Ub1aAHEewMeUxQ7b7tQdWa7VL8M5oXDPohS3Me4nhwvALXM4mym2kWg9VsceT75dm6XWiWF1K4zu8RVQ1HJD8Z3R9```\n* ARQ - ```ar4Ha6ZQCkKRhkKQLfexv7VZQM2MhUmMmU9hmzswCPK4T3o2rbPKZM1GxEoYg4AFQsh57PsEets7sbpU958FAvxo2RkkTQ1gE```\n* XWP - ```fh4MCJrakhWGoS6Meqp6UxGE1GNfAjKaRdPjW36rTffDiqvEq2HWEKZhrbYRw7XJb3CXxkjL3tcYGTT39m5qgjvk1ap4bVu1R```\n* XEQ - ```Tvzp9tTmdGP9X8hCEw1Qzn18divQajJYTjR5HuUzHPKyLK5fzRt2X73FKBDzcnHMDJKdgsPhUDVrKHVcDJQVmLBg33NbkdjQb```\n* XTA - ```ipN5cNhm7RXAGACP4ZXki4afT3iJ1A6Ka5U4cswE6fBPDcv8JpivurBj3vu1bXwPyb8KZEGsFUYMmToFG4N9V9G72X4WpAQ8L```\n* DERO - ```dero1qygrgnz9gea2rqgwhdtpfpa3mvagt5uyq0g92nurwrpk6wnn7hdnzqgudsv6t```\n* CCX - ```ccx7dmnBBoRPuVcpKJSAVZKdSDo9rc7HVijFbhG34jsXL3qiqfRwu7A5ecem44s2rngDd8y8N4QnYK6WR3mXAcAZ5iXun9BQBx```\n* BLOC - ```abLoc5iUG4a6oAb2dqygxkS5M2uHWx16zHb9fUWMzpSEDwm6T7PSq2MLdHonWZ16CGfnJKRomq75aZyviTo6ZjHeYQMzNAEkjMg```\n* ZEPH - ```ZEPHYR2nic7ULkkmgZNX8a9i2tMbkxuCqjgWZYuee3awX7RhtmhoT98CwGEGrruWZVSKtA7Z7JC8m7oeYHtBD9cBEZzdEh9BSdq4q```\n* SAL - ```SaLvdWKnkz6MvVgxXr2TWSDSvESz6EBcz3wmMFch2sQuMYz2sUQGVNDYhkYaSuvkDr9GSYp5h6BeQHnGK8HzKhqGeZCZzG3AHS3```\n* XTM - ```12FrDe5cUauXdMeCiG1DU3XQZdShjFd9A4p9agxsddVyAwpmz73x4b2Qdy5cPYaGmKNZ6g1fbCASJpPxnjubqjvHDa5```\n* RVN - ```RLVJv9rQNHzXS3Zn4JH8hfAHmm1LfECMxy```\n* XNA - ```Nb931jkFtFN7QWpu4FqSThaoKajYjS5iFZ```\n* CLORE - ```AdXPHtV8yb86a8QKsbs8gmUpRpcxufRn8n```\n* RTM - ```RUCyaEZxQu3Eure73XPQ57si813RYAMQKC```\n* KCN - ```kc1qchtxq2gw9dc4r58hcegd6n4jspew6j9mu3yz8q```\n* BTRM - ```Bfhtr2g56tg73TNZBRCu6fJUD39Kur6SGG```\n* ERG - ```9fe533kUzAE57YfPP6o3nzsYMKN2W2uCxvg8KG8Vn5DDeJGetRw```\n* BTC - ```3HRbMgcvbqHVW7P34MNGvF2Gh3DE26iHdw```\n* BCH - ```18sKoDSjLCFW9kZrXuza1qzEERnKi7bx8S```\n* ETH - ```0xfE23a61548FCCE159a541FAe9e16cEB92Da650ed```\n* ETC - ```0x4480Ad73a113BEFf05B2079E38D90c9757Ecb063```\n* LTC - ```MGj8PU1PpTNDDqRHmuEqfDpH3gxp6cJrUU```\n\nCredits\n=======\n\n[Zone117x](https://github.com/zone117x) - Original [node-cryptonote-pool](https://github.com/zone117x/node-cryptonote-pool) from which, the stratum implementation has been borrowed.\n\n[Snipa](https://github.com/Snipa22) - Original [nodejs-pool](https://github.com/Snipa22/nodejs-pool) from which, the original implementation has been borrowed.\n\n[Mesh00](https://github.com/mesh0000) - Frontend build in Angular JS [XMRPoolUI](https://github.com/mesh0000/poolui)\n\n[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)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoneroocean%2Fnodejs-pool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoneroocean%2Fnodejs-pool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoneroocean%2Fnodejs-pool/lists"}