当前位置: 首页 > 软件库 > Web3 > 开源货币/比特币 >

aeon-pool

授权协议 View license
开发语言 Python
所属分类 Web3、 开源货币/比特币
软件类型 开源软件
地区 不详
投 递 者 辛星宇
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Pool Design/Theory

The nodejs-pool is built around a small series of core daemons that share access to a single LMDB table for tracking of shares, with MySQL being used to centralize configurations and ensure simple access from local/remote nodes. The core daemons follow:

api - Main API for the frontend to use and pull data from.  Expects to be hosted at  /
remoteShare - Main API for consuming shares from remote/local pools.  Expects to be hosted at /leafApi
pool - Where the miners connect to.
longRunner - Database share cleanup.
payments - Handles all payments to workers.
blockManager - Unlocks blocks and distributes payments into MySQL
worker - Does regular processing of statistics and sends status e-mails for non-active miners.

API listens on port 8001, remoteShare listens on 8000

moneroocean.stream (The reference implementation) uses the following setup:

Sample Caddyfile for API:

https://api.moneroocean.stream {
    proxy /leafApi 127.0.0.1:8000
    proxy / 127.0.0.1:8001
    cors
    gzip
}

It is critically important that your webserver does not truncate the /leafApi portion of the URL for the remoteShare daemon, or it will not function! Local pool servers DO use the remoteShare daemon, as this provides a buffer in case of an error with LMDB or another bug within the system, allowing shares and blocks to queue for submission as soon as the leafApi/remoteShare daemons are back up and responding with 200's.

Setup Instructions

Server Requirements

  • 4 Gb Ram
  • 2 CPU Cores (with AES_NI)
  • 60 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 24Gb 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!
  • Notably, this happens to be approximately the size of a 4Gb linode instance, which is where the majority of automated deployment testing happened!

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!
  • 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!
  • 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: <USER> ALL=(ALL) NOPASSWD:ALL. Our sample builds use: pooldaemon ALL=(ALL) NOPASSWD:ALL
  2. Run the deploy script 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.
  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)://<your server FQDN>/api unless you tweak caddy!
  5. The default database directory /home/<username>/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.
  6. Hop into the web interface (Should be at http://<your server IP>/admin.html), then login with Administrator/Password123, MAKE SURE TO CHANGE THIS PASSWORD ONCE YOU LOGIN. <- This step is currently not active, we're waiting for the frontend to catch up! Head down to the Manual SQL Configuration to take a look at what needs to be done by hand for now.
  7. From the admin panel, you can configure all of your pool's settings for addresses, payment thresholds, etc.
  8. Once you're happy with the settings, go ahead and start all the pool daemons, commands follow.
cd ~/nodejs-pool/
pm2 start init.js --name=blockManager --log-date-format="YYYY-MM-DD HH����ss:SSS Z"  -- --module=blockManager
pm2 start init.js --name=worker --log-date-format="YYYY-MM-DD HH����ss:SSS Z" -- --module=worker
pm2 start init.js --name=payments --log-date-format="YYYY-MM-DD HH����ss:SSS Z" --no-autorestart -- --module=payments
pm2 start init.js --name=remoteShare --log-date-format="YYYY-MM-DD HH����ss:SSS Z" -- --module=remoteShare
pm2 start init.js --name=longRunner --log-date-format="YYYY-MM-DD HH����ss:SSS Z" -- --module=longRunner
pm2 start init.js --name=pool --log-date-format="YYYY-MM-DD HH����ss:SSS Z" -- --module=pool
pm2 start init.js --name=api --log-date-format="YYYY-MM-DD HH����ss:SSS Z" -- --module=api
pm2 restart api

Install Script:

curl -L https://raw.githubusercontent.com/MoneroOcean/nodejs-pool/master/deployment/deploy.bash | bash

Assumptions for the installer

The installer assumes that you will be running a single-node instance and using a clean Ubuntu 16.04 server install. The following system defaults are set:

  • MySQL Username: pool
  • MySQL Password: 98erhfiuehw987fh23d
  • MySQL Host: 127.0.0.1
  • MySQL root access is only permitted as the root user, the password is in /root/.my.cnf
  • SSL Certificate is generated, self-signed, but is valid for Claymore Miners.
  • The server installs and deploys Caddy as it's choice of web server!

The following raw binaries MUST BE AVAILABLE FOR IT TO BOOTSTRAP:

  • sudo

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 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!

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!
  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 <Your wallet name here> --disable-rpc-login --trusted-daemon
  6. If you don't use PM2, then throw the wallet into a screen and have fun.

Manual Setup

Pretty 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.

Manual SQL Configuration

Until 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.

Critical/Must be done:
pool/address
pool/feeAddress
general/shareHost

Nice to have:
general/mailgunKey
general/mailgunURL
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 moneroocean.stream, we use https://api.moneroocean.stream/leafApi. If you're using the automated setup script, you can use: http://<your IP>/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

Final Manual Steps

Until the main frontend is done, we suggest running the following SQL line:

DELETE FROM pool.users WHERE username = 'Administrator';

This will remove the administrator user until there's an easier way to change the password. Alternatively, you can change the password to something not known by the public:

UPDATE pool.users SET email='your new password here' WHERE username='Administrator';

The email field is used as the default password field until the password is changed, at which point, it's hashed and dumped into the password field instead, and using the email field as a password is disabled.

You should take a look at the wiki for specific configuration settings in the system.

Pool Update Procedures

If upgrading the pool, please do a git pull to get the latest code within the pool's directory.

Once complete, please cd into sql_sync, then run node sql_sync.js

This will update your pool with the latest config options with any defaults that the pools may set.

Pool Troubleshooting

API stopped updating!

This 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.The first step is to run:

mdb_stat -fear ~/pool_db/

This should give you output like:

Environment Info
  Map address: (nil)
  Map size: 51539607552
  Page size: 4096
  Max pages: 12582912
  Number of pages used: 12582904
  Last transaction ID: 74988258
  Max readers: 512
  Number of readers used: 24
Reader Table Status
    pid     thread     txnid
     25763 7f4f0937b740 74988258
Freelist Status
  Tree depth: 3
  Branch pages: 135
  Leaf pages: 29917
  Overflow pages: 35
  Entries: 591284
  Free pages: 12234698
Status of Main DB
  Tree depth: 1
  Branch pages: 0
  Leaf pages: 1
  Overflow pages: 0
  Entries: 3
Status of blocks
  Tree depth: 1
  Branch pages: 0
  Leaf pages: 1
  Overflow pages: 0
  Entries: 23
Status of cache
  Tree depth: 3
  Branch pages: 16
  Leaf pages: 178
  Overflow pages: 2013
  Entries: 556
Status of shares
  Tree depth: 2
  Branch pages: 1
  Leaf pages: 31
  Overflow pages: 0
  Entries: 4379344

The 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". If this is the case, them look at the "Reader Table Status" and look for the PID listed. Run:

ps fuax | grep <THE PID FROM ABOVE>

ex:
ps fuax | grep 25763

If 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.

The second step is to run:

pm2 stop blockManager worker payments remoteShare longRunner api
pm2 start blockManager worker payments remoteShare longRunner api

This will restart all of your related daemons, and will clear any open reader connections, allowing LMDB to get back to a normal state.

If 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. You need to verify the cleaner is working. For reference, 4.3 million shares are stored within approximately 2-3 Gb of space, so if you're vastly exceeding this, then your cleaner (longRunner) is likely broken.

PPS Fee Thoughts

If you're considering PPS, I've spoken with 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

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:
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 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!

Developer Donations

Here you can Donate

Monero: 44Dx3bVEarKNGciPJSsD9BXFZASyooXpjCBCzhw3D8cANMzyyJn6PcyWbwaVe4vUMveKAzAiA4j8xgUi29TpKXpm3wUvH8Z

Bitcoin: 3Joc3kRGC233AHh3BQuUGxptggK8ScyUrZ

Aeon: Wmswvbsac7eZ7pZEbey9nmgoZPjtwBAwRh7Qgm1xHVwF6hcnH43r2vX3hLTKARSrvtH8g4wJtEXS9V3Axz1Y2m8P2uqXEZi51

Dash: XtKTCad86mpGmALqKhGqzqFTBkcb1ZzXrn

ZCash: t1Zum9bh2U6gWwbNyDeEFCSWUPAAbjvdNnJ

Tether: 1LVfoqGqoi8NSckgDgxR9WhqKEjVEHdts3

NXT: NXT-TPPJ-5QVY-LQWF-HXRQD

NEO: APgGg8kuWzzwcLBB3xR5NC3cmYg5dLrgjT

Litecoin: LdmyNUKE7dxuQLxBSDLe2hsUkGXrqwrin3

Lisk: 17746879737169256464L

Ignis: ARDOR-VX3A-UAFT-MVLK-HAE4M

Fantom Coin: 6qCZgyFKUY5RfGhZtJSUH95UN3EZaXTmTWen5CUBb9YZZowx1dV9VoZbyftABRVPdXbYRyBKfHd72H3XvUTr8Ht2Jry2BZU

Eth: 0x411f92b8e7cc11002919a02eb03fbe5e450ba50c

Dogecoin: DTQAjFTcV9ap96hoQsFEWwTpEXS13y55LX

Digitalnote: ddchiP79MK6UHe15Qaf7Q45bmF6r1HLtBeY2EXURC98R83aNg3Bc815QRrdbUBaLyQ9h4wtvggAcY3Way3t4cGoX1AUC9vS6v

Bitcoingold: GeMDC2kYzrBN245psHCWvfLnCbBRwXAjgK

Bancor: 0xb12b07140f5c6eab2c9a59b215bad46b72bf840a

Bytecoin: 23z7sC1bZ1DdNZ9gLPk4miUuB6x3YnSPvhVnypP1f5SRVXovvX72ydGKA32X5SrJuDPBgXTsSmQRoAbCzcDvM2d2PfYsxbY

Credits

Zone117x - Original node-cryptonote-pool from which, the stratum implementation has been borrowed.

Snipa - Original nodejs-pool from which, the original implementation has been borrowed.

Mesh00 - Frontend build in Angular JS XMRPoolUI

Wolf0/OhGodAGirl - Rebuild of node-multi-hashing with AES-NI node-multi-hashing

  • Advanced Tuning ofthe Shared Pool Perhaps one of theleast-understood aspects of Oracle Shared Global Area tuning is tuning theshared pool. The generally accepted tuning methodology involves throwing m

  • 1.发现问题 生产环境发现有一些redis报错日志 connection pool exhausted。如果redis中没有数据 就直接回源 查DB。暂时不会有什么大问题。中文意思是连接池耗尽。 2.追踪问题 查看源码 我们用的redis客户端类似于redigo 按照错误提示搜索到了一段代码(基于最新的redigo 源码版本分析) // Handle limit for p.Wait ==

  •  It is the new features in IIS 6.0. An Application Pool can contain one or more applications and allows us to configure a level of isolation between different Web applications. For example, if you wan

  •  DBCP连接池可以缓存PreparedStatement,本质上就是缓存游标。     一个SQL语句,无论是Insert,Update,Delete还是Select都是游标操作,只不过Select游标指向查询结果,而其余的指向修改的目标。     除了连接可以缓存,游标也是可以缓存的,主要是避免游标的反复创建。虽然Oracle对完全相同的SQL可以共享执行计划,但是也需要去共享池查询这个SQL

  • 定义: 共享池( shared pool )是位于SGA中的一块内存区域,主要用于缓存SQL的执行计划。之所以叫共享,是由于该块内存区域可以被多个会话共享同一个执行计划。即,如果有一个会话执行了SQL之后,会在shared pool 中生成一条该语句的执行计划,如果第二个会话使用了同样的或者类似的语句,就可以重复利用该条执行计划,从而实现执行计划共享。 特点: 1 共享池是位于SGA中的一块重要的

  •      Document上说,对于访问频率不高的大表,可以将其放入 recycle pool ,以防止将 热点表挤出 default pool ,带来的性能损失。 不过 我 对此 有疑问,既然有了 keep pool 可以将 热点表 cache 到 keep  pool 中,另外由于大表的访问频率不高,我们 为某个大表设置了 recycle pool ,那么岂不是 浪费了 很大的 内存空间在SG

  • 【pool drain】和【pool release】区别 在引用计数方式下,二者没有什么不同,你通常要使用drain 在GC(garbage-collected)环境下,drain会在必要时引起GC作用,然而release是个空操作。 http://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/C

  •   [ 2004-9-14 15:23:00 | By: 会飞的狗 ]   Tomcat5的数据库连接池配置 本文主要介绍Tomcat5.0.25这个版本下数据库连接池的配置,及程序对连接池的JNDI查找,并提供相应测试代码。最后指出配置及应用过程中的常见问题及解决方法。 1 .该文的配置环境:Tomcat5.0.25 + jdk1.4+ Sql Server 2000+Win2000 2.配置步

  • Using Hibernate built-in connection pool (not for production use!)错误,是因为连接数据库,但是没有导入数据库包

  • 应该程序池 什么是应用程序池呢?这是微软的一个全新概念:应用程序池是将一个或多个应用程序链接到一个或多个工作进程集合的配置。因为应用程序池中的应用程序与其他应用程序被工作进程边界分隔,所以某个应用程序池中的应用程序不会受到其他应用程序池中应用程序所产生的问题的影响。 Windows 2003同时支持两种工作模式,默认为ISS 6.0工作进程隔离模式。工作进程隔离模式防止一个应用程序或站点停止了而影

  • 搞笑mempool   class aa { public:  aa()  {   x = 577;   y = 66;   z = 5666.54;  }  virtual void haha(){}  int x;  int y;  double z; }; class bb : public aa { public:  void haha()  {   x = 555555;  } };  

  •   /*  * Copyright (c) 1998 by Gefion software.  *  * Permission to use, copy, and distribute this software for  * NON-COMMERCIAL purposes and without fee is hereby granted  * provided that this copyri

  • 池Pool和泳道Swimlane有什么区别? “泳道”是一个通用的行业术语,用于描述将流程图中的常见活动分组为矩形区域。 流程图的两个更常见的标准是UML活动图和BPMN业务流程图。 在UML中,通用“泳道”由称为活动分区的概念表示;UML 2.0规范将活动分区描述为“用于标识具有某些共同特征的动作的活动组类型。”活动分区可以进一步划分为活动子分区。除了基于一组公共特征的组活动的级别之外,活动分区

  • 数据库连接池 1、什么是数据库连接池 数据库连接池是程序在启动时创建足够多的数据库连接,将这些连接放入一个池子里。由程序动态地进行申请,使用和关闭。 2、连接池的作用 频繁的创建和关闭连接是非常消耗资源的。 作用:负责分配,管理和释放数据库连接。允许程序重复使用现有的同一个数据库连接,而不是重现创建一个,避免了资源的消耗。 3、node中使用数据库连接池 3.1 安装引入mysql模块 cnpm

 相关资料
  • cryptonote-xmr-pool High performance Node.js (with native C addons) mining pool for CryptoNote based coins such as Bytecoin, DuckNote, Monero, QuazarCoin, Boolberry, Dashcoin, etc..Comes with lightwei

  • 问题内容: 我目前正在尝试使用进行多个请求。 我用谷歌搜索了如何做到这一点,答案是使用。 至此,我得到了: 然后我尝试了一个请求,并且一切正常。 然后,我通过cmd创建了一个信任库,并导入了目标网站的证书,使用我的信任库设置并设置的of : 如果我尝试执行Https,则会出现异常。 如果我做同样的事情,但一切正常。 谁能告诉我如何使它起作用?(不用担心,我不会创建任何ddos工具) 提前致谢! P

  • 问题内容: Java具有字符串池,这是由于字符串类的对象是不可变的。 但我的问题仍然存在- 制作String POOL有什么需要? 为什么字符串类没有像其他类那样保留其自己的值? JVM内部是需要一些字符串还是这是性能优势。如果是,怎么办? 问题答案: 因为字符串是不可变的,所以可能有一个池。但是String的不可变性并不是仅由于此池而决定的。不变性还有许多其他好处。顺便说一句,a 也是不可变的,

  • 问题内容: 我想知道是否有人可以指向我简单地等效于java中python的多处理模块。 我有一个简单的并行处理场景(其中没有2个进程交互):取一个数据集并将其分成12个,然后将Java方法应用于12个数据集,收集结果并将它们按相同的顺序加入到某种列表中。 作为“专业”语言的Java似乎具有多个库和方法-谁能帮助这个Java新手入门? 我想用最少的编码做到这一点-正如我说的那样,我的要求非常简单。

  • 问题内容: 我的程序包含以下行,并且此时就挂起了,我不太确定为什么。 在Eclipse中进行调试时,如果我尝试在“显示”视图中评估“ new PoolingHttpClientConnectionManager()”,则会出现以下错误: 我正在使用org.apache.httpcomponents中的httpclient.jar版本4.3.1。 还有其他人遇到这个问题吗?有什么办法吗?还是我在做傻

  • 问题内容: org.apache.commons.dbcp BasicDatasource和PoolingDataSoure有什么区别?两者都支持连接池吗?什么时候使用它们? 问题答案: *正如 Javadoc所说, *BasicDataSource 是满足基本需求的一站式服务。它具有所有必要的条件。它在内部创建一个PoolableDataSource和一个ObjectPool。 PoolingD