diff --git a/INSTALL_MAC.md b/INSTALL_MAC.md new file mode 100644 index 00000000..4a595001 --- /dev/null +++ b/INSTALL_MAC.md @@ -0,0 +1,86 @@ +### Mac OS X Installation instructions + +First of all you need Apple's Xcode and the Xcode Command Line Tools to be installed: + +[https://itunes.apple.com/us/app/xcode](https://itunes.apple.com/us/app/xcode/id497799835?mt=12) + +And Homebrew: + +[http://brew.sh](http://brew.sh) + + +Than we need to install all the dependencies via brew: +```shell +brew tap discoteq/discoteq; brew install flock +brew install autoconf autogen automake +brew install gcc5 +brew install binutils +brew install protobuf +brew install coreutils +brew install boost +brew install wget +brew install git +brew install redis +brew install nvm +brew install libsodium +``` + +Note nvm installation instructions which `brew install nvm` gives you. +```shell +mkdir ~/.nvm +echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.bash_profile +echo ' . "/usr/local/opt/nvm/nvm.sh"' >> ~/.bash_profile +source ~/.bash_profile +``` + +After that let's install Node.js +```shell +nvm install v8.11.1 +``` + +To be able to to build Z-NOMP we also need BSD/Linux-like `endian.h` to be in our Mac's `/usr/local/include/` directory +```shell +sudo curl https://raw.githubusercontent.com/igorvoltaic/z-nomp/master/endian-for-mac.h > /usr/local/include/endian.h +``` + +And we need our compiler to catch the exceptions as Linux does it. To do that edit `~/.node-gyp/8.11.1/include/node/common.gypi`. Find following and change it like this: +```shell + ['OS=="mac"', { + 'xcode_settings': { + 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES' + } + }] +``` + +At this point we are ready to install Z-NOMP +```shell +git clone https://github.com/z-classic/z-nomp +cd z-nomp +git checkout master +npm update +npm install +npm install stratum-pool +npm install bignum +``` + +and optionally +```shell +npm install pm2 +``` + +to run Z-NOMP you need to have your daemon running and redis-server started: +```shell +zend --daemon +redis-server& +``` + +also check out `.json` cofig files before starting the server: +```shell +coins/ +pool_configs/ +config_example.json +``` + +finally `npm start` (or optionally `pm2 start init.js`, check pm2 documentation for usage) + +That's it! Happy mining, folks! diff --git a/coins/votecoin.json b/coins/votecoin.json new file mode 100644 index 00000000..dac62d3c --- /dev/null +++ b/coins/votecoin.json @@ -0,0 +1,10 @@ +{ + "name": "votecoin", + "symbol": "VOT", + "algorithm": "equihash", + "requireShielding": true, + "peerMagic": "24e92764", + "percentFoundersReward": 0, + "payFoundersReward": false, + "txfee": 0.0000 +} diff --git a/endian-for-mac.h b/endian-for-mac.h new file mode 100644 index 00000000..06a06632 --- /dev/null +++ b/endian-for-mac.h @@ -0,0 +1,33 @@ +#ifndef __FINK_ENDIANDEV_PKG_ENDIAN_H__ +#define __FINK_ENDIANDEV_PKG_ENDIAN_H__ 1 + +/** compatibility header for endian.h + * This is a simple compatibility shim to convert + * BSD/Linux endian macros to the Mac OS X equivalents. + * It is public domain. + * */ + +#ifndef __APPLE__ + #warning "This header file (endian.h) is MacOS X specific.\n" +#endif /* __APPLE__ */ + + +#include + +#define htobe16(x) OSSwapHostToBigInt16(x) +#define htole16(x) OSSwapHostToLittleInt16(x) +#define be16toh(x) OSSwapBigToHostInt16(x) +#define le16toh(x) OSSwapLittleToHostInt16(x) + +#define htobe32(x) OSSwapHostToBigInt32(x) +#define htole32(x) OSSwapHostToLittleInt32(x) +#define be32toh(x) OSSwapBigToHostInt32(x) +#define le32toh(x) OSSwapLittleToHostInt32(x) + +#define htobe64(x) OSSwapHostToBigInt64(x) +#define htole64(x) OSSwapHostToLittleInt64(x) +#define be64toh(x) OSSwapBigToHostInt64(x) +#define le64toh(x) OSSwapLittleToHostInt64(x) + + +#endif /* __FINK_ENDIANDEV_PKG_ENDIAN_H__ */ diff --git a/examples/letsencrypt-nginx.conf.example b/examples/letsencrypt-nginx.conf.example new file mode 100644 index 00000000..abcfec36 --- /dev/null +++ b/examples/letsencrypt-nginx.conf.example @@ -0,0 +1,82 @@ + +worker_processes 1; + +events { + worker_connections 1024; +} + + +http { + include mime.types; + default_type application/octet-stream; + + sendfile on; + + keepalive_timeout 65; + + server { + listen 80 default_server; + listen [::]:80 default_server; + server_name _; + location ^~ /.well-known/acme-challenge/ { + allow all; + default_type text/plain; + } + + location / { + return 301 https://$host$request_uri; + } + } + + + # HTTPS server + # + server { + listen 443 ssl; + server_name example.ru www.example.ru; + + ssl_certificate /etc/letsencrypt/live/example.ru/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/example.ru/privkey.pem; + + ssl_session_cache shared:SSL:1m; + ssl_session_timeout 5m; + ssl_protocols TLSv1.2 TLSv1.1 TLSv1; + + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + location / { + try_files $uri $uri/ =404; + } + + location ~ .$ { + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header Host $host; + proxy_pass http://127.0.0.1:8080; + } + } + include servers/*; +} + + +# Securing TCP Traffic to Upstream Pools +# +stream { + upstream vot_pool { + server 192.168.1.34:5555; + } + + server { + listen 5556 ssl; + proxy_pass vot_pool; + + ssl_protocols SSLv2 SSLv3 TLSv1 TLSv1.1 TLSv1.2; + ssl_ciphers HIGH:!aNULL:!MD5; + + ssl_certificate /etc/letsencrypt/live/example.ru/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/example.ru/privkey.pem; + } +} + +#include /usr/local/etc/nginx/passthrough.conf; diff --git a/pool_configs/votecoin_example.json b/pool_configs/votecoin_example.json new file mode 100644 index 00000000..b50e755c --- /dev/null +++ b/pool_configs/votecoin_example.json @@ -0,0 +1,89 @@ +{ + "enabled": false, + "coin": "votecoin.json", + + "address": "t1NBkZ3R43HvmaasHeNzmGDLGe2cg4vH3tT", + "_comment_address": "pools address", + + "zAddress": "zcSPWitFfQrtzsVtEWXBCpGSRfAEqr3JSRRN5aWzohQPnYvsrSnuggxPp13Q1vxAyLp6NhUVRa1PGq", + "_comment_zAddress": "shielding address", + + "tAddress": "t1NBkZ3R43HvmaasHeNzmGDLGe2cg4vH3tT", + "_comment_tAddress": "set to same as pools address", + + "walletInterval": 2.5, + "_comment_walletInterval": "Used to cache coin stats, shielding not performed.", + + "invalidAddress": "t1NBkZ3R43HvmaasHeNzmGDLGe2cg4vH3tT", + "_comment_invalidAddress": "Invalid addresses will be converted to the above", + + "rewardRecipients": { + "t1NBkZ3R43HvmaasHeNzmGDLGe2cg4vH3tT": 1.0 + }, + + "tlsOptions": { + "enabled": false, + "serverKey":"", + "serverCert":"", + "ca":"" + }, + + "paymentProcessing": { + "minConf": 10, + "enabled": true, + "paymentMode": "prop", + "_comment_paymentMode":"prop, pplnt", + "paymentInterval": 57, + "_comment_paymentInterval": "Interval in seconds to check and perform payments.", + "minimumPayment": 1, + "maxBlocksPerPayment": 3, + "daemon": { + "host": "127.0.0.1", + "port": 5550, + "user": "rpcuser", + "password": "rpcpassword" + } + }, + + "ports": { + "5555": { + "tls":false, + "diff": 0.8, + "varDiff": { + "minDiff": 0.8, + "maxDiff": 0.8, + "targetTime": 15, + "retargetTime": 60, + "variancePercent": 30 + } + } + }, + + "daemons": [ + { + "host": "127.0.0.1", + "port": 5550, + "user": "rpcuser", + "password": "rpcpassword" + } + ], + + "p2p": { + "enabled": false, + "host": "127.0.0.1", + "port": 19333, + "disableTransactions": true + }, + + "mposMode": { + "enabled": false, + "host": "127.0.0.1", + "port": 3306, + "user": "me", + "password": "mypass", + "database": "vot", + "checkPassword": true, + "autoCreateWorker": false + } + +} diff --git a/scripts/blocknotify.c b/scripts/blocknotify.c index a1190960..e79acafe 100644 --- a/scripts/blocknotify.c +++ b/scripts/blocknotify.c @@ -5,6 +5,7 @@ #include #include #include +#include /* @@ -23,7 +24,7 @@ Build with: Example usage in daemon coin.conf using default NOMP CLI port of 17117 - blocknotify="/bin/blocknotify 127.0.0.1:17117 dogecoin %s" + blocknotify=sh -c "/bin/blocknotify 127.0.0.1:17117 dogecoin %s" diff --git a/website/pages/stats.html b/website/pages/stats.html index 30ed6785..875d342d 100644 --- a/website/pages/stats.html +++ b/website/pages/stats.html @@ -149,6 +149,12 @@ {{=block[2]}} {{ } else if (String(it.stats.pools[pool].name).startsWith("hush")) { }} {{=block[2]}} + {{ } else if (String(it.stats.pools[pool].name).startsWith("komodo")) { }} + {{=block[2]}} + {{ } else if (String(it.stats.pools[pool].name).startsWith("zen")) { }} + {{=block[2]}} + {{ } else if (String(it.stats.pools[pool].name).startsWith("votecoin")) { }} + {{=block[2]}} {{ } else { }} {{=block[2]}} {{ } }} @@ -177,7 +183,15 @@ {{=block[2]}} {{ } else if (String(it.stats.pools[pool].name).startsWith("zclassic")) { }} {{=block[2]}} - {{ } else { }} + {{ } else if (String(it.stats.pools[pool].name).startsWith("hush")) { }} + {{=block[2]}} + {{ } else if (String(it.stats.pools[pool].name).startsWith("komodo")) { }} + {{=block[2]}} + {{ } else if (String(it.stats.pools[pool].name).startsWith("zen")) { }} + {{=block[2]}} + {{ } else if (String(it.stats.pools[pool].name).startsWith("votecoin")) { }} + {{=block[2]}} + {{ } else { }} {{=block[2]}} {{ } }} {{if (block[4] != null) { }}