-
Notifications
You must be signed in to change notification settings - Fork 494
Configuration
Do not create issue reports over our project page if you can't get it working. Please only use issues page for actual bugs & feature requests.
This guide will help you get through configuring CoiniumServ server and getting it working. If you have still not installed it on your system, start by reading our getting started guide. This guide assumes you already completed the steps related to getting the project & compiling.
Once you got the project compiled, you have to first arrange configuration files.
Let's assume that you have downloaded CoiniumServ to
/home/user/CoiniumServ
Your config files will exist in one of the following locations based on the mode you compiled the project;
/home/user/CoiniumServ/bin/Debug/config
/home/user/CoiniumServ/bin/Release/config
Global configuration file hosts common settings (stack, website and logging). First we have copy config-example.json as config.json
cd /home/user/CoiniumServ/bin/Debug/config
cp config-example.json config.json
Then we have to open config.json with your favorite text editor (gedit, vim, pico etc..) and change it according to our needs.
As configuration files host their own documentation for all sections & parameters, it's pretty self explanatory.
As CoiniumServ can host multiple pools together, you have to also create per-pool configuration files. You need to create per-pool configuration files in;
/home/user/CoiniumServ/bin/Debug/config/pools
By default, you'll see the following per-pool example files;
As CoiniumServ uses a very flexible configuration sub-system you have two different methods to configure pools.
You can use advanced-example.json as a starting point and configure every specific bits;
cd /home/user/CoiniumServ/bin/Debug/config/pools
cp advanced-example.json your-pool.json
advanced-example.json hosts every available configuration option and you can fine them based on your needs. Yet again per-pool configuration files also host their own documentation for all sections & parameters and it's pretty self explanatory.
While loading per-pool configuration files, CoiniumServ will merge them with the default.json if it does exist, basically allowing you to put your common settings and then only change the required parameters in your per-pool configuration files.
Copy default-example.json as default.json and put in common settings for all your pools.
cd /home/user/CoiniumServ/bin/Debug/config/pools
cp default-example.json default.json
Once we have default.json in-place, we can create per-pool configuration files based on example.json.
cd /home/user/CoiniumServ/bin/Debug/config/pools
cp example.json your-pool.json
This allow us easier configuration of multiple pools. As an example, we can configure the common stratum parameters in default.json which will apply to all per-pool configuration files;
"stratum": {
"bind": "0.0.0.0",
"diff": 16,
"vardiff": {
"minDiff": 8,
"maxDiff": 512,
"targetTime": 15,
"retargetTime": 90,
"variancePercent": 30
}
}
Now we can simply setup a few more parameters in our per-pool configuration file;
"stratum": {
"enabled": true,
"port": 3333,
"vardiff": {
"enabled": true
}
}
Which will be simply merged by as;
"stratum": {
"enabled": true,
"bind": "0.0.0.0",
"port": 3333,
"diff": 16,
"vardiff": {
"enabled": true,
"minDiff": 8,
"maxDiff": 512,
"targetTime": 15,
"retargetTime": 90,
"variancePercent": 30
}
}
- Coin daemon (find the coin's repo and build latest version from source)
- For hybrid storage moge redis v2.6+ & mysql
- For MPOS compatibility mode: MPOS & mysql
Follow the build instructions for your coin daemon. Through out the guide we'll be using litecoin as our sample coin.
Grab the coin daemon sources & compile;
git clone https://github.com/litecoin-project/litecoin.git
cd litecoin\src
make -f makefile.unix USE_UPNP=0
strip litecoind
Create configuration file for the coin (litecoin.conf) in coin's data folder;
daemon=1
rpcuser=user
rpcpassword=password
rpcport=9333
By default it should be in these locations;
- Windows, appdata/roaming/Litecoin/litecoin.conf
- Linux, ~/.litecoin/litecoin.conf
- MacOS, ~/Library/Application Support/Litecoin/litecoin.conf
Run the coin daemon & let it sync with network. For more information check this guide.
Make sure a corresponding coin.json file exist in;
cd /home/user/CoiniumServ/bin/Debug/config/coins
Here is the example litecoin.json file;
{
"name": "Litecoin",
"symbol": "LTC",
"algorithm": "scrypt",
"blockExplorer": "http://block-explorer.com",
"peerMagic": "fbc0b6db",
"peerMagicTestnet": "fcc1b7dc"
}
Create litecoin.json and edit required parameters;
cd /home/user/CoiniumServ/bin/Debug/config/pools
cp example.json litecoin.json
Coin section should point to our coin configuration file;
"coin": "litecoin.json",
Configure daemon rpc connection settings;
"daemon": {
"host": "127.0.0.1",
"port": 9333,
"username": "user",
"password": "password"
},
You have to create a central wallet address for your pool which mined coins will arrive and then paid to miners from.
litecoind getaccountaddres ""
Then you have to put the generated address in your per-pool configuration file;
"wallet" : {
"address": "n3Mvrshbf4fMoHzWZkDVbhhx4BLZCcU9oY"
},
Rewards section allows you to configure operational fees for the pool. Basically you can define an unlimited amount of recipients and percentage.
In the following example, myxWybbhUkGzGF7yaf2QVNx3hh3HWTya5t address will recieve %1 of the all coins mined by our pool as operational fee.
"rewards": [
{"myxWybbhUkGzGF7yaf2QVNx3hh3HWTya5t": 1}
],
You can also setup a tiny percentage here to donate the CoiniumServ project automatically. For instructions check here.
CoiniumServ implements it's own payment-processor though it's optional. If you are using mpos compatibility layer, you would like to disable payments and let MPOS handle it. Otherwise it's a good idea to enable payment-processor in order to pay the miners.
"payments": {
"enabled": true,
"interval": 60,
"minimum": 0.01
},
You have to configure the stratum service to let CoiniumServ listen for stratum-protocol based miners and assign a unique port for your all pools. You can also enable or disable variable-difficulty (vardiff) support here.
"stratum": {
"enabled": true,
"bind": "0.0.0.0",
"port": 3333,
"diff": 16,
"vardiff": {
"enabled": true,
"minDiff": 8,
"maxDiff": 512,
"targetTime": 15,
"retargetTime": 90,
"variancePercent": 30
}
},
CoiniumServ supports multiple-storage layers; hybrid (redis+mysql), MPOS (mysql-only). You have to put in connection settings for the storage layer you selected here and enable it;
"storage": {
"hybrid": {
"enabled": false,
"redis": {
"host": "127.0.0.1",
"port": 6379,
"password": "",
"databaseId": 0
},
"mysql": {
"host": "127.0.0.1",
"port": 3306,
"user": "username",
"password": "password",
"database": "db-name"
}
},
"mpos": {
"enabled": false,
"mysql": {
"host": "127.0.0.1",
"port": 3306,
"user": "username",
"password": "password",
"database": "db-name"
}
}
},
Note that per-pool configuration files host few more sections & settings which are already documented within the sample file itself.
Once you have changed the settings for your needs, you are basically ready to run the server.
cd /home/user/CoiniumServ/bin/Debug/
./CoiniumServ
If your configuration files are all okay, the CoiniumServ should be running and start serving the miners. If any problems exist with your configuration file, it'll be complaining about them and require you to fix them.
If you want to run CoiniumServ as service on Linux, which means it will be run in background and even you close terminal, use mono-service
(from package mono-4.0-service
) command:
mono-service CoiniumServ.exe
In case of any problems & errors, first make sure that your json configuration files are valid. If you still can't fix the problem, you can get support by methods listed here.
You are more then welcome to help the project by donating.