Author

Topic: [GUIDE] Setup your own ZEC stratum pool (Read 6770 times)

newbie
Activity: 32
Merit: 0
July 23, 2018, 01:14:59 AM
#18
This works up to this point during the build.sh step:
"checking whether segmentation violations can be caught when using the C compiler"
at which point it hangs and does nothing.
sr. member
Activity: 291
Merit: 250
November 05, 2017, 06:38:20 AM
#17
so looking this over it is all good till you get to this step

then build zcash

Code:
cd zcash
./zcutil/fetch-params.sh
./zcutil/build.sh -j$(nproc)



It times out trying to attache to a

HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://s3.amazonaws.com/zcashfinalmpc/sprout-proving.key [following]
--2017-11-03 21:06:50--  https://s3.amazonaws.com/zcashfinalmpc/sprout-proving.key
Resolving s3.amazonaws.com (s3.amazonaws.com)... 52.216.100.53
Connecting to s3.amazonaws.com (s3.amazonaws.com)|52.216.100.53|:443... connected.


The server drops all traffic to it. right there. The server Hard locks has to be rebooted.......

this is a very old guide ... i suggest that you look into z-nomp (https://github.com/z-classic/z-nomp) for a more stable equihash pool !
newbie
Activity: 3
Merit: 0
November 03, 2017, 10:10:30 PM
#16
so looking this over it is all good till you get to this step

then build zcash

Code:
cd zcash
./zcutil/fetch-params.sh
./zcutil/build.sh -j$(nproc)



It times out trying to attache to a

HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://s3.amazonaws.com/zcashfinalmpc/sprout-proving.key [following]
--2017-11-03 21:06:50--  https://s3.amazonaws.com/zcashfinalmpc/sprout-proving.key
Resolving s3.amazonaws.com (s3.amazonaws.com)... 52.216.100.53
Connecting to s3.amazonaws.com (s3.amazonaws.com)|52.216.100.53|:443... connected.


The server drops all traffic to it. right there. The server Hard locks has to be rebooted.......
newbie
Activity: 1
Merit: 0
January 06, 2017, 09:10:31 AM
#15
Great guide, thanks!!

I have setup a server and can open an http page to my server http://ip address/#!/coin/ZEC Smiley

What are next steps? - how do i add workers?, i.e use nheqminer to add workers

Thanks
sr. member
Activity: 487
Merit: 266
December 02, 2016, 04:16:57 PM
#14
its very simple, especially if you have somehow high hashing power....when you mine a pool you get almost a constant return (little), but when you mine solo, if you catch a block, you get the full reward (in case of zec, that's minus the dev's fee) ... right now and for the next few years it will be net 10 zec / block ...

in my case i have just 2 gpu's that produce around 400 Sol/s and make me around 0.025 - 0.03 zec a day ... lets say 0.03 / day x 30 ... thats 0.9 zec a month ... so to get 10 zec, i will need to mine pools for around 10 months !!

whereas if i leave my gpu's trying for a block (solo mining) .. they might catch a block before that Cheesy

besides ... its a nice learning exercise Smiley))

Yes, if you have free juice it's better to solo mine...otherwise, it's kind of a gamble Smiley
legendary
Activity: 1084
Merit: 1003
≡v≡
December 01, 2016, 03:54:38 PM
#13
I get some errors during the nginx commands i'll post them tommorow. It's not as simple I think
sr. member
Activity: 291
Merit: 250
December 01, 2016, 03:52:07 PM
#12
With zero knowledge can anyone build one and torrent it?

It's not that I haven't been trying just that it reach mid installation and said some dependencies weren't install and it getting me very frustrated. Can anyone help?

sorry ... but can you provide more info?
sr. member
Activity: 291
Merit: 250
December 01, 2016, 03:50:55 PM
#11
its very simple, especially if you have somehow high hashing power....when you mine a pool you get almost a constant return (little), but when you mine solo, if you catch a block, you get the full reward (in case of zec, that's minus the dev's fee) ... right now and for the next few years it will be net 10 zec / block ...

in my case i have just 2 gpu's that produce around 400 Sol/s and make me around 0.025 - 0.03 zec a day ... lets say 0.03 / day x 30 ... thats 0.9 zec a month ... so to get 10 zec, i will need to mine pools for around 10 months !!

whereas if i leave my gpu's trying for a block (solo mining) .. they might catch a block before that Cheesy

besides ... its a nice learning exercise Smiley))
legendary
Activity: 1084
Merit: 1003
≡v≡
December 01, 2016, 12:00:24 PM
#10
what do you think is it a good idea to mine on my own pool with a total of 40,000h/s power ?
sr. member
Activity: 487
Merit: 266
December 01, 2016, 10:45:29 AM
#9
This is very interesting!

Question though, what are the plus sides and caveats of setting up your own pool? Will you mine less or more? Do you need a good amount of GPUs or can you just use say 10 cards and mine as much as you would mine on a pool like flypool?
sr. member
Activity: 353
Merit: 250
December 01, 2016, 10:26:46 AM
#8
With zero knowledge can anyone build one and torrent it?

It's not that I haven't been trying just that it reach mid installation and said some dependencies weren't install and it getting me very frustrated. Can anyone help?
sr. member
Activity: 291
Merit: 250
December 01, 2016, 09:06:12 AM
#7
Wich port i use to connect my workers, using your config?

default port is 3357, but you can change that following this here
https://forum.z.cash/t/set-up-your-own-private-stratum-pool/9043/30
full member
Activity: 254
Merit: 100
December 01, 2016, 08:57:55 AM
#6
Wich port i use to connect my workers, using your config?
sr. member
Activity: 291
Merit: 250
November 30, 2016, 09:35:36 AM
#5
i have read this somewhere else .. does it work with the other model than Ubuntu Server?

yes Smiley)) i have it posted since a few days in the zcash forum Smiley)) https://forum.z.cash/t/set-up-your-own-private-stratum-pool/9043

and, unfortunately i wouldn't know if it works on other servers ... i haven't even tried it on other versions of ubuntu aside the 16.04 server edition, so i really wouldn't know ... but you can always try it Smiley
sr. member
Activity: 353
Merit: 250
November 30, 2016, 08:31:51 AM
#4
i have read this somewhere else .. does it work with the other model than Ubuntu Server?
sr. member
Activity: 291
Merit: 250
November 30, 2016, 07:01:18 AM
#3
hopefully more pools will rise instead of having two or three giant pools Cheesy
member
Activity: 73
Merit: 10
Betbase.io It's never been easier to run a casino
November 30, 2016, 03:50:41 AM
#2
Great piece of information. This should help someone new to the entire pool setting up thing. Thanks for sharing!
sr. member
Activity: 291
Merit: 250
November 29, 2016, 04:52:29 PM
#1
This originally was posted on zcash forum and the thread there has more Q&A's, so check out ... maybe you can find an answer to already asked questions
https://forum.z.cash/t/set-up-your-own-private-stratum-pool/9043

I thought I'd share with you all what I have learned in building a privet (or if you want public) zec pool. I pursued this in hope that maybe if can build my own farm, I will have it work on my own private pool, instead of using a public pool.

The core of the pool (and 90% of what I will write) is from eXtremal-ik7 work https://github.com/eXtremal-ik7/pool_frontend_zcash, but I had a lot of help from the zog team, who helped me to get it to work (and I'm waiting for my first block to show my appreciation Smiley )

I used ubuntu 16.04 server edition to set it up, and it has 4GB ram right now, and that's it.

If you think this was useful for you, you can always send a few to my ZEC addr: t1eYeHJKV6Ku9VzadpS8p1LDBeYXqQtRjvw Smiley)))

So, here it goes:

- install ubuntu server and get it updated:

Code:
sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade

- install a few dependencies (mainly Zcash's)  

Code:
sudo apt-get install cmake libssl-dev libsodium-dev libpcre3-dev libleveldb-dev libboost-all-dev libgmp-dev libprotobuf-dev protobuf-compiler libjansson-dev screen build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python zlib1g-dev wget bsdmainutils automake

- create a dir for your installation, and lets assume you are in your home folder named , so you should be now in /home/user, and you will create ZEC as your installation folder

Code:
mkdir ZEC
cd ZEC

now start with eXtremal-ik7 guide

Code:
git clone https://github.com/zcash/zcash
git clone https://github.com/config4star/config4cpp
git clone https://github.com/google/flatbuffers
git clone https://github.com/eXtremal-ik7/libp2p -b version/0.3
git clone https://github.com/eXtremal-ik7/poolcore
git clone https://github.com/eXtremal-ik7/pool_frontend_zcash
git clone https://github.com/eXtremal-ik7/poolrestapi
git clone https://github.com/eXtremal-ik7/ngxrest
git clone https://github.com/eXtremal-ik7/pooljs
wget https://nginx.org/download/nginx-1.11.5.tar.gz
tar -xzf nginx-1.11.5.tar.gz

- although it doesn't say so in the steps, but it seems that you need to compile zcash first before going forward, so you that :

- create zcash.conf file (put your rpcuser name instead of "user")

Code:
mkdir -p ~/.zcash
echo "addnode=mainnet.z.cash" >~/.zcash/zcash.conf
echo "rpcuser=user" >>~/.zcash/zcash.conf
echo "rpcpassword=head -c 32 /dev/urandom | base64" >>~/.zcash/zcash.conf

- then build zcash

Code:
cd zcash
./zcutil/fetch-params.sh
./zcutil/build.sh -j$(nproc)

- now move back and start configuring the rest of the parts (make sure you replace with your user's home dir name):

Code:
cd ..
cd config4cpp
make -j4
cd ..

cd flatbuffers
mkdir build
cd build
cmake ..
make -j4
sudo make install
cd ../..

cd libp2p
mkdir x86_64-Linux
cd x86_64-Linux
cmake ../src
make -j4
cd ../..

cd poolcore
mkdir x86_64-Linux
cd x86_64-Linux
cmake ../src -DROOT_SOURCE_DIR=/home/user/ZEC -DZCASH_ENABLED=1
make -j4
cd ../..

cd pool_frontend_zcash
mkdir x86_64-Linux
cd x86_64-Linux
cmake ../src -DROOT_SOURCE_DIR=/home/user/ZEC
make -j4
cd ../..

cd poolrestapi
mkdir x86_64-Linux
cd x86_64-Linux
cmake ../src -DROOT_SOURCE_DIR=/home/user/ZEC
make -j4
cd ../..

- now you are back at /home/user, lets create the nginx folder and compile it

Code:
mkdir nginx
cd ZEC/nginx-1.11.5
./configure --prefix=/home/user/nginx --add-module=/home/user/ZEC/ngxrest
make -j4
make install
cd ..

- next you need to patch zcash and recompile it

Code:
cd zcash
patch -p0 < /home/user/ZEC/pool_frontend_zcash/pool.diff

- next you need to edit the Makefile in both zcash root folder & in zcash/src folder (i use nano to edit it)
- open each file and search (in nano its ctrl+w) for

Code:
LIBZCASH_LIBS =

- and replace it (or append to the end of the line) and save it (ctrl-x then y)

Code:
LIBZCASH_LIBS = -lsnark -lgmp -lgmpxx -lboost_system-mt -lcrypto -lsodium -fopenmp -L/home/user/ZEC/poolcore/x86_64-Linux/zcash -lpoolrpczcash -L/home/user/ZEC/libp2p/x86_64-Linux/p2p -lp2p -L/home/user/ZEC/libp2p/x86_64-Linux/asyncio -lasyncio-0.3 -lrt

- then build zcash again

Code:
make -j4

- now comes the tricky parts Smiley
- you need to move some files into the right locations and to make things easy I put mine in the ./zcash folder
- so move into that folder and create the following:

Code:
cd /home/user/.zcash
nano poolrestapi.cfg

- add the following:

Code:
poolrestapi {
   listenAddress = "cxxrestapi://127.0.0.1:19999";
   coins = ["zec"];
}


zec {
   frontends = ["p2p://127.0.0.1:13301"];
   poolAppName = "pool_frontend_zcash";
}

- next file

Code:
nano zcash.cfg

- add the following: (add your own created z & t addr) i added 2 different t-addr for poolFeeAddr & pool_taddr

Code:
pool_frontend_zcash {
isMaster = "true";
poolFee = "1";
poolFeeAddr = "t1Lbnzr5Jtykyjvm8JRDAnUTxxxxxxxxxxxx";
walletAddrs = ["p2p://127.0.0.1:12201"];
localAddress = "p2p://127.0.0.1:13301";
walletAppName = "pool_rpc";
poolAppName = "pool_frontend_zcash";
requiredConfirmations = "10";
defaultMinimalPayout = "0.01";
dbPath = "/home/user/pool.zcash";
keepRoundTime = "3";
keepStatsTime = "2";
confirmationsCheckInterval = "7";
payoutInterval = "30";
balanceCheckInterval = "3";
statisticCheckInterval = "1";

zmqclientHost = "192.168.1.120";
zmqclientListenPort = "6668";
zmqclientWorkPort = "60200";

pool_zaddr = "zcG47QGy8g2md2uUg6dtQBKgT75hz4bJ1974rmdxxxxxxxxxxxxxxxxxxxxx";
pool_taddr = "t1UrNsXAQjrDKpwovMs5xxxxxxxxxxxx";
}


- also change the zmqclientHost to your local

- next file is the nginx config file so move to the nginx folder:

Code:
cd /home/user/nginx/conf
nano nginx.conf

- if the file exists, back it up and create a new one:

Code:
mv nginx.conf nginx.conf.back
nano nginx.conf

- add the following

Code:
worker_processes 4;

events {
worker_connections 10240;
multi_accept on;
}

http {
include mime.types;
default_type application/octet-stream;

sendfile        on;
tcp_nopush      on;
tcp_nodelay     on;

keepalive_timeout  65;

upstream api_backend {
    server     127.0.0.1:19999;
    keepalive  32;
}

server {
    listen       *:80 reuseport;
    server_name  pool;

    location / {
        root   html;
        index  index.html index.htm;
        expires 5s;
    }

    location /api {
        cxxrest_pass api_backend;
    }

    location ~* ^.+\.(jpg|jpeg|gif|png|ico)$ {
      expires 3d; # 3 days
    }
}
}

- now copy the actual frontend to its location in nginx

Code:
cd /home/user/ZEC/pooljs/coins-for-all/webapp
cp -r /home/user/ZEC/pooljs/coins-for-all/webapp/* /home/user/nginx/html

- edit the coins.json file

Code:
cd
nano /home/user/nginx/html/static/f/coins.json

- make it the following:

Code:
[
{
"title": "Z-Cash",
"code": "ZEC",
"desc": "Z-Cash Private Mining",
"icon_url": "static/i/zcash.png",
"block_url": "https://explorer.zcha.in/blocks/:hash",
"transaction_url": "https://explorer.zcha.in/transactions/:txid",
"power": {
"type": "SOLS",
"name": "sols/s",
"rate": "sols rate"
}
}
]

- rename or copy a few files to match the "ZEC" changes

Code:
mv /home/user/nginx/html/static/s/templates/zcash-description.html /home/user/nginx/html/static/s/templates/zec-description.html
mv /home/user/nginx/html/static/s/templates/zcash-mining.html /home/user/nginx/html/static/s/templates/zec-mining.html
mv /home/user/nginx/html/static/s/templates/zcash-servers.html /home/user/nginx/html/static/s/templates/zec-servers.html

- time to build the frontend

Code:
cd ZEC/pool_frontend_zcash
cd x86_64-Linux
make clean
cmake ../src -DROOT_SOURCE_DIR=/home/user/ZEC
make -j4
cd ../..

- and all you have to do is run it Cheesy

- first run, you have to get zcash to sync all blocks, so do that


Code:
/usr/bin/screen -dmS "zecnode" ./ZEC/zcash/src/zcashd

- once updated and all synced ... stop zcashd and re-run everything

Code:
screen -r zecnode
ctrl+c

- i made a script to run all parts:

Code:
cd
nano zec.pool.sh

- add the following:(there was an error here because of the editor uses '#' as char for bold ... sorry )

Code:
#!/bin/bash

echo "starting up ZEC Pool"

echo "Starting ZEC node"
/usr/bin/screen -dmS "zecnode" ./ZEC/zcash/src/zcashd -p2pport=12201

echo "Starting Frontend"
/usr/bin/screen -dmS "zecpool" ./ZEC/pool_frontend_zcash/x86_64-Linux/pool_frontend_zcash ~/.zcash/zcash.cfg

echo "Starting Rest API"
/usr/bin/screen -dmS "zecapi" ./ZEC/poolrestapi/x86_64-Linux/poolrestapi ~/.zcash/poolrestapi.cfg

echo "Starting Nginx"
sudo nginx/sbin/nginx

and voila  ... you should have a running zec stratum pool !!!

so if you find this all insightful and helpful, you can always show that to:

eXtremal:[by mining on his pool http://coinsforall.io (i was trying to locate his zec addr !! or btc for that matter)

zogteam: also by mining their pool http://zogpool.org/ or their newly luck / solo pool http://luckpool.org
 or directly to t1PGgRgVQ14utsD7mp2dzGdykTDFUCKzPQ5
also they released a fork of eXtremal's  - ZogPool Source https://github.com/Zogpool

or  Smiley

myself: t1eYeHJKV6Ku9VzadpS8p1LDBeYXqQtRjvw

in all cases, if i get anything off this guide, i will make sure to pass third & third to them Smiley))

also, this thread has been going on for a few days on zcash forum https://forum.z.cash/t/set-up-your-own-private-stratum-pool/9043 and you find more info there!!
Jump to: