Skip to content
Hüseyin Uslu edited this page Dec 17, 2016 · 32 revisions

"Error while reading the json response: The request timed out."

Make sure you have properly configured your coin daemon to accept json-rpc connections.

Depending on your operating system, you have to create a coin configuration file. Given that we are configuring Litecoin;

  • Windows: C:\Users\user\AppData\Roaming\Litecoin.conf
  • Linux / MacOS: ~/.litecoin/litecoin.conf
server=1
rpcuser=user
rpcpassword=password
rpctimeout=30
rpcallowip=127.0.0.1
rpcport=9333

Then in your litecoin.json that should exists in /config/pools/litecoin.json, you should set corresponding values;

"daemon": {
        "host": "127.0.0.1",
        "port": 9333,
        "username": "user",
        "password": "password",
        "timeout": 5
    },

If you have configured properly, it should be working now. If you are running CoiniumServ over Linux and still get the error above, you may need to fix your settings to get around limits.

"Error while reading the json response: The request timed out."

If you are sure that both your coin.conf and pool.json file is properly set, you are probably hitting limits on Linux. Please take the following steps to increase the limits;

sudo echo 1200000 > /proc/sys/fs/file-max

Edit /etc/sysctl.conf and change;

fs.file-max = 1200000

Edit /etc/security/limits.conf and add;

* soft nofile 120000
* hard nofile 120000
root soft nofile 120000
root hard nofile 120000

Increase allowed number of tcp connections

The last step is increasing maximum number of allowed tcp connections on your system;

sudo echo "net.ipv4.ip_local_port_range = 20000 65535" >> /etc/sysctl.conf && echo 20000 65535 > /proc/sys/net/ipv4/ip_local_port_range && echo "net.ipv4.tcp_tw_reuse = 1" >> /etc/sysctl.conf && echo "net.core.somaxconn=65535" >> /etc/sysctl.conf && sysctl -p /etc/sysctl.conf

You should then reboot your system to get changes applied.

more

How to monitor CoiniumServ process

For Linux, you can use supervisor to monitor CoiniumServ.

Installation

Using your distro's packaging tools install supervisor. For ubuntu you could use the following command to install it;

sudo apt-get install supervisor 

Configuration

Given that CoiniumServ exist in /home/user/CoiniumServ/bin/Release, we have to create a new config file; /etc/supervisor/conf.d/coiniumserv.conf

[program:coiniumserv]
command=/home/user/CoiniumServ/bin/Release/CoiniumServ.exe
autostart=true
autorestart=true

Running supervisord

Run supervisor controller;

supervisorctl

Make it reload the new configuration files;

reread

Let it to run CoiniumServ process;

update

You can check the status of the process with;

status

How to override default settings in per-pool configuration files?

When loading a pool configuration file (ie pool.json), CoiniumServ will be also loading default.json file and merging the values from both - by overriding the values within default.json using the values from the actual pool configuration file.

In order to be more brief, we'll show below to override the stratum difficulty setting.

In default.json, diff setting exists under the stratum section;

"stratum": {
        "enabled": true,
        "bind": "0.0.0.0",
        "diff": 16,
        "vardiff": {
            "enabled": true,
            "minDiff": 8,
            "maxDiff": 512,
            "targetTime": 15,
            "retargetTime": 90,
            "variancePercent": 30
        }
    }

The above json snippet will set miner difficulty to 16 when they are first connected to the server. We can simply override any setting in per-pool configuration files by including it in the correct section.

  "stratum": {
        "port": 3337,
        diff: 32
    }

The above snippet will be overriding the default difficulty of 16 and set it to 32 for the specific pool instance configured. Basically CoiniumServ will merge the per-pool configuration file by overriding the settings in default.json. Finally the merged configuration will be like;

"stratum": {
        "enabled": true,
        "port": 3337,
        "bind": "0.0.0.0",
        "diff": 32,
        "vardiff": {
            "enabled": true,
            "minDiff": 8,
            "maxDiff": 512,
            "targetTime": 15,
            "retargetTime": 90,
            "variancePercent": 30
        }
    }

Overriding difficulty setting for X11 and similar coins

Coins that uses algorithms like X11 require low-difficulty settings. You can just override the difficulty for them as described above. A sample configuration for an X11 coin would be;

"stratum": {
        "port": 3346,
        "diff": 0.001,
        "vardiff": {
            "enabled": false
        }        
    },

I can't get embedded web-server working

There is a known bug with mono 3.2.x series which prevents CoinumServ's embedded front-end to listen on port 80. You can find the possible workarounds below;

Run on another port & proxy In this case either run embedded web-server on port 81 and use apache / nginx proxy support.

Upgrade to mono 3.8 series