Skip to content
This repository has been archived by the owner on Dec 2, 2020. It is now read-only.

Mac OS X installation instructions, Explorers on stats.html, Nginx ssl-proxy example, votecoin added, block notify compiling error fix #337

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
86 changes: 86 additions & 0 deletions INSTALL_MAC.md
Original file line number Diff line number Diff line change
@@ -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!
10 changes: 10 additions & 0 deletions coins/votecoin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "votecoin",
"symbol": "VOT",
"algorithm": "equihash",
"requireShielding": true,
"peerMagic": "24e92764",
"percentFoundersReward": 0,
"payFoundersReward": false,
"txfee": 0.0000
}
33 changes: 33 additions & 0 deletions endian-for-mac.h
Original file line number Diff line number Diff line change
@@ -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 <libkern/OSByteOrder.h>

#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__ */
82 changes: 82 additions & 0 deletions examples/letsencrypt-nginx.conf.example
Original file line number Diff line number Diff line change
@@ -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;
89 changes: 89 additions & 0 deletions pool_configs/votecoin_example.json
Original file line number Diff line number Diff line change
@@ -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
}

}
3 changes: 2 additions & 1 deletion scripts/blocknotify.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <arpa/inet.h>

/*

Expand All @@ -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"



Expand Down
16 changes: 15 additions & 1 deletion website/pages/stats.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@
<a href="https://classic.zcha.in/blocks/{{=block[0]}}" target="_blank">{{=block[2]}}</a>
{{ } else if (String(it.stats.pools[pool].name).startsWith("hush")) { }}
<a href="https://explorer.myhush.org/block/{{=block[0]}}" target="_blank">{{=block[2]}}</a>
{{ } else if (String(it.stats.pools[pool].name).startsWith("komodo")) { }}
<a href="https://kmd.explorer.supernet.org/block/{{=block[0]}}" target="_blank">{{=block[2]}}</a>
{{ } else if (String(it.stats.pools[pool].name).startsWith("zen")) { }}
<a href="https://explorer.zen-solutions.io/block/{{=block[0]}}" target="_blank">{{=block[2]}}</a>
{{ } else if (String(it.stats.pools[pool].name).startsWith("votecoin")) { }}
<a href="http://explorer.votecoin.site/block/{{=block[0]}}" target="_blank">{{=block[2]}}</a>
{{ } else { }}
{{=block[2]}}
{{ } }}
Expand Down Expand Up @@ -177,7 +183,15 @@
<a href="https://explorer.zcha.in/blocks/{{=block[0]}}" target="_blank">{{=block[2]}}</a>
{{ } else if (String(it.stats.pools[pool].name).startsWith("zclassic")) { }}
<a href="https://classic.zcha.in/blocks/{{=block[0]}}" target="_blank">{{=block[2]}}</a>
{{ } else { }}
{{ } else if (String(it.stats.pools[pool].name).startsWith("hush")) { }}
<a href="https://explorer.myhush.org/block/{{=block[0]}}" target="_blank">{{=block[2]}}</a>
{{ } else if (String(it.stats.pools[pool].name).startsWith("komodo")) { }}
<a href="https://kmd.explorer.supernet.org/block/{{=block[0]}}" target="_blank">{{=block[2]}}</a>
{{ } else if (String(it.stats.pools[pool].name).startsWith("zen")) { }}
<a href="https://explorer.zen-solutions.io/block/{{=block[0]}}" target="_blank">{{=block[2]}}</a>
{{ } else if (String(it.stats.pools[pool].name).startsWith("votecoin")) { }}
<a href="http://explorer.votecoin.site/block/{{=block[0]}}" target="_blank">{{=block[2]}}</a>
{{ } else { }}
{{=block[2]}}
{{ } }}
{{if (block[4] != null) { }}
Expand Down