Bitcoin Forum
March 29, 2024, 08:17:42 AM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 3 [4] 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 »  All
  Print  
Author Topic: CKPOOL - Open source pool/proxy/passthrough/redirector/library in c for Linux  (Read 123908 times)
ArchitektoR
Full Member
***
Offline Offline

Activity: 215
Merit: 102


View Profile
February 23, 2015, 09:28:22 PM
 #61

You need to set up the rpc username and password on your bitcoind and set the same auth and password in your ckpool.conf file.

Looks like it was illegal characters in rpcpassword, sorry!
Each block is stacked on top of the previous one. Adding another block to the top makes all lower blocks more difficult to remove: there is more "weight" above each block. A transaction in a block 6 blocks deep (6 confirmations) will be very difficult to remove.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1711700262
Hero Member
*
Offline Offline

Posts: 1711700262

View Profile Personal Message (Offline)

Ignore
1711700262
Reply with quote  #2

1711700262
Report to moderator
1711700262
Hero Member
*
Offline Offline

Posts: 1711700262

View Profile Personal Message (Offline)

Ignore
1711700262
Reply with quote  #2

1711700262
Report to moderator
ArchitektoR
Full Member
***
Offline Offline

Activity: 215
Merit: 102


View Profile
February 23, 2015, 11:04:03 PM
 #62

Now it runs fine, no errors.

But pool.status shows no hashrate:

Code:
{"runtime": 241, "lastupdate": 1424732527, "Users": 2, "Workers": 2, "Idle": 2, "Disconnected": 0}
{"hashrate1m": "0", "hashrate5m": "0", "hashrate15m": "0", "hashrate1hr": "0", "hashrate6hr": "0", "hashrate1d": "0", "hashrate7d": "0"}
{"SPS1m": 0.0, "SPS5m": 0.0, "SPS15m": 0.0, "SPS1h": 0.0}

And the test AntMiner shows all shares as rejected, zero accepted. Running on testnet.
ArchitektoR
Full Member
***
Offline Offline

Activity: 215
Merit: 102


View Profile
February 24, 2015, 06:09:14 PM
Last edit: February 24, 2015, 06:27:50 PM by ArchitektoR
 #63

And when doing ./configure --without-ckdb

it gives this:

Code:
checking linux/un.h usability... no
checking linux/un.h presence... yes
configure: WARNING: linux/un.h: present but cannot be compiled
configure: WARNING: linux/un.h:     check for missing prerequisite headers?
configure: WARNING: linux/un.h: see the Autoconf documentation
configure: WARNING: linux/un.h:     section "Present But Cannot Be Compiled"
configure: WARNING: linux/un.h: proceeding with the compiler's result
configure: WARNING:     ## --------------------------------- ##
configure: WARNING:     ## Report this to kernel@kolivas.org ##
configure: WARNING:     ## --------------------------------- ##
checking for linux/un.h... no

And when cat config.log | grep linux

Code:
configure:12878: checking linux/un.h usability
/usr/include/linux/un.h:7:2: error: unknown type name 'sa_family_t'
| #include <linux/un.h>
configure:12878: checking linux/un.h presence
configure:12878: WARNING: linux/un.h: present but cannot be compiled
configure:12878: WARNING: linux/un.h:     check for missing prerequisite headers?
configure:12878: WARNING: linux/un.h: see the Autoconf documentation
configure:12878: WARNING: linux/un.h:     section "Present But Cannot Be Compiled"
configure:12878: WARNING: linux/un.h: proceeding with the compiler's result
configure:12878: checking for linux/un.h
ac_cv_build=i686-pc-linux-gnu
ac_cv_header_linux_un_h=no
ac_cv_host=i686-pc-linux-gnu
ac_cv_target=i686-pc-linux-gnu
lt_cv_path_LD=/usr/i686-pc-linux-gnu/bin/ld

Looks like something is missing, but what?

But it compiles and runs without any errors thrown.
-ck (OP)
Legendary
*
Offline Offline

Activity: 4060
Merit: 1622


Ruu \o/


View Profile WWW
February 24, 2015, 08:32:56 PM
 #64

Code:
configure:12878: checking linux/un.h usability
ac_cv_build=i686-pc-linux-gnu

Looks like something is missing, but what?

But it compiles and runs without any errors thrown.
Please, it's 2015. This is 64 bit code only, but if it's working ignore the error as it's just something to do with your distribution.

Developer/maintainer for cgminer, ckpool/ckproxy, and the -ck kernel
2% Fee Solo mining at solo.ckpool.org
-ck
ArchitektoR
Full Member
***
Offline Offline

Activity: 215
Merit: 102


View Profile
February 24, 2015, 09:00:04 PM
 #65

Please, it's 2015. This is 64 bit code only, but if it's working ignore the error as it's just something to do with your distribution.

Compiled on another system (32-bit too - so the bitness doesn't meter) - now works like a charm :-)
ArchitektoR
Full Member
***
Offline Offline

Activity: 215
Merit: 102


View Profile
February 24, 2015, 11:53:16 PM
 #66

Everything is UP and working on testnet - thanks once again for great software.

But when the block was found - all the reward (except the 0.5% fee) was sent to btcaddress of the ckpool.conf, not the worker/miner address. Even there is no data in logs about what worker found a block. What should I do (config or some extra software) to make it send the reward to miner address as solo.ckpool.org does?
-ck (OP)
Legendary
*
Offline Offline

Activity: 4060
Merit: 1622


Ruu \o/


View Profile WWW
February 25, 2015, 01:07:18 AM
 #67

Everything is UP and working on testnet - thanks once again for great software.

But when the block was found - all the reward (except the 0.5% fee) was sent to btcaddress of the ckpool.conf, not the worker/miner address. Even there is no data in logs about what worker found a block. What should I do (config or some extra software) to make it send the reward to miner address as solo.ckpool.org does?
You can only mine to the ckpool.conf address. Solo.ckpool.org is special.

Developer/maintainer for cgminer, ckpool/ckproxy, and the -ck kernel
2% Fee Solo mining at solo.ckpool.org
-ck
ArchitektoR
Full Member
***
Offline Offline

Activity: 215
Merit: 102


View Profile
February 25, 2015, 09:53:23 AM
 #68

And what kind of modification or add-on must be done to achieve the solo.ckpool functionality? We want to setup one here in Russia to get better pings.
-ck (OP)
Legendary
*
Offline Offline

Activity: 4060
Merit: 1622


Ruu \o/


View Profile WWW
February 25, 2015, 10:00:07 AM
 #69

And what kind of modification or add-on must be done to achieve the solo.ckpool functionality? We want to setup one here in Russia to get better pings.
Custom code which is not part of the ckpool code. Like I said solo.ckpool.org is special and I'm not really interested in helping others set up a competing pool with the same unique feature.

Developer/maintainer for cgminer, ckpool/ckproxy, and the -ck kernel
2% Fee Solo mining at solo.ckpool.org
-ck
ArchitektoR
Full Member
***
Offline Offline

Activity: 215
Merit: 102


View Profile
February 25, 2015, 01:38:36 PM
 #70

Custom code which is not part of the ckpool code. Like I said solo.ckpool.org is special and I'm not really interested in helping others set up a competing pool with the same unique feature.

OK, I understand your reasons Smiley - will try "dreadful Russian hackers" our community help. Thanks again for your work!
kano
Legendary
*
Offline Offline

Activity: 4452
Merit: 1798


Linux since 1997 RedHat 4


View Profile
February 26, 2015, 12:04:40 AM
 #71

Custom code which is not part of the ckpool code. Like I said solo.ckpool.org is special and I'm not really interested in helping others set up a competing pool with the same unique feature.

OK, I understand your reasons Smiley - will try "dreadful Russian hackers" our community help. Thanks again for your work!
In my opinion, the main issue is that people who want to run pools should have software development experience and be able to modify the pool code.
Not be some point and click ipad user who has to call apple if Candy Crush stops working Tongue

Otherwise if something goes wrong, everyone on the pool is stuck until ... "Hey can someone fix my pool" gets solved by who-knows-who Tongue

With CKDB I am of course open to answer questions about anyone who's brave enough to use it, but I'm not a developer training school for noobs, there's plenty of places you can go to learn about computers ...
You need to know what you are doing and then I'll help with questions that show you do know what you are doing.

Of course if you aren't trying to run a pool, or are just solo mining, from a standard user point of view, the proxy/pool code is well documented and well usable.

Pool: https://kano.is - low 0.5% fee PPLNS 3 Days - Most reliable Solo with ONLY 0.5% fee   Bitcointalk thread: Forum
Discord support invite at https://kano.is/ Majority developer of the ckpool code - k for kano
The ONLY active original developer of cgminer. Original master git: https://github.com/kanoi/cgminer
ArchitektoR
Full Member
***
Offline Offline

Activity: 215
Merit: 102


View Profile
February 26, 2015, 12:31:05 AM
 #72

In my opinion, the main issue is that people who want to run pools should have software development experience and be able to modify the pool code.
Not be some point and click ipad user who has to call apple if Candy Crush stops working Tongue

Otherwise if something goes wrong, everyone on the pool is stuck until ... "Hey can someone fix my pool" gets solved by who-knows-who Tongue

It looks like the task to modify the code is not very difficult for a programmer/developer, but I am not a programmer myself Smiley Rig and farm building, server and router setup from scratch, vmware virtualization and web mastering - but not a tr00 c0der, impossible to do everything. Community is for that - one can setup and configure a server, another - write some code, the third - adopt software.

Quote
With CKDB I am of course open to answer questions about anyone who's brave enough to use it, but I'm not a developer training school for noobs, there's plenty of places you can go to learn about computers ...
You need to know what you are doing and then I'll help with questions that show you do know what you are doing.

As you can see, there were NO questions about "give me the working solo.ckpool alternative", just the info about the "public solo pool functionality" is not implemented (or was removed Smiley ) from github version. Why was such a question - just because there IS solo.ckpool alternatives on the net and they are too based on ckpool code.

Quote
Of course if you aren't trying to run a pool, or are just solo mining, from a standard user point of view, the proxy/pool code is well documented and well usable.

For single-user purposes everything is better, then OK Smiley
-ck (OP)
Legendary
*
Offline Offline

Activity: 4060
Merit: 1622


Ruu \o/


View Profile WWW
March 21, 2015, 06:17:54 AM
 #73

Someone calling themselves HASHPOOL found a block using the existing code Smiley

https://blockchain.info/tx/4eb1d6e38d5953155c6b5ca7950405c578937a42fcc37080996931a0b864bb68

Developer/maintainer for cgminer, ckpool/ckproxy, and the -ck kernel
2% Fee Solo mining at solo.ckpool.org
-ck
zefir
Donator
Hero Member
*
Offline Offline

Activity: 919
Merit: 1000



View Profile
March 23, 2015, 08:48:02 AM
 #74

With the latest builds of bitcoind and ckpool, I am stuck with the following problem:
Code:
[2015-03-23 09:34:58] ckpool generator starting
[2015-03-23 09:34:58] ckpool stratifier starting
[2015-03-23 09:34:58] ckpool connector starting
[2015-03-23 09:34:58] Failed to recv in read_socket_line
[2015-03-23 09:34:58] Failed to read socket line in json_rpc_call
[2015-03-23 09:34:58] Reopening socket to localhost:8332
[2015-03-23 09:34:58] Failed to get valid json response to validate_address with errno 115: Operation now in progress
[2015-03-23 09:34:58] Invalid btcaddress: 14BMjogz69qe8hk9thyzbmR5pg34mVKB1e !
[2015-03-23 09:34:58] CRITICAL: No bitcoinds active!

What puzzles me is that I had ckpool running some time ago, i.e. the configuration files used should be correct. Still, it seems it is not a common problem.

I double checked that configurations should match by doing the rpc commands manually:
Code:
zefir@PC:~/work/bitcoin/src$ ./bitcoin-cli -rpcconnect=localhost -rpcport=8332 -rpcuser=rpc -rpcpassword=pass validateaddress 14BMjogz69qe8hk9thyzbmR5pg34mVKB1e
{
    "isvalid" : true,
    "address" : "14BMjogz69qe8hk9thyzbmR5pg34mVKB1e",
    "scriptPubKey" : "76a91422ddd9233f44ac2e9f183ec755adf134c12cdbf188ac"
}

which should mimic what ckpool should be doing with the configuration of
Code:
{
"btcd" :  [
{
"url" : "localhost:8332",
"auth" : "rpc",
"pass" : "pass",
"notify" : false
}
],
"logdir" : "/home/zefir/tmp/ckpool-log"
}

Anything obviously wrong? I'll debug and report back if not, just to be sure it is not some silly mistake at my side.

-ck (OP)
Legendary
*
Offline Offline

Activity: 4060
Merit: 1622


Ruu \o/


View Profile WWW
March 23, 2015, 08:51:26 AM
 #75

With the latest builds of bitcoind

Anything obviously wrong? I'll debug and report back if not, just to be sure it is not some silly mistake at my side.
bitcoind rpc allow command changed

Developer/maintainer for cgminer, ckpool/ckproxy, and the -ck kernel
2% Fee Solo mining at solo.ckpool.org
-ck
zefir
Donator
Hero Member
*
Offline Offline

Activity: 919
Merit: 1000



View Profile
March 23, 2015, 09:26:46 AM
 #76

With the latest builds of bitcoind

Anything obviously wrong? I'll debug and report back if not, just to be sure it is not some silly mistake at my side.
bitcoind rpc allow command changed

Ouch, so a running bitcoin-cli on localhost does not necessarily mean bitcoind is configured properly for every client on localhost?

Thanks for the hint, will check later today.

-ck (OP)
Legendary
*
Offline Offline

Activity: 4060
Merit: 1622


Ruu \o/


View Profile WWW
March 24, 2015, 12:22:44 AM
 #77

I updated the version number to 0.8.7 and tagged M14 after a number of substantial updates and fixing a long standing crash bug that has been eluding me till now.

Developer/maintainer for cgminer, ckpool/ckproxy, and the -ck kernel
2% Fee Solo mining at solo.ckpool.org
-ck
zefir
Donator
Hero Member
*
Offline Offline

Activity: 919
Merit: 1000



View Profile
March 24, 2015, 10:48:58 PM
 #78

With the latest builds of bitcoind

Anything obviously wrong? I'll debug and report back if not, just to be sure it is not some silly mistake at my side.
bitcoind rpc allow command changed

Ok, did some tracing to narrow down the issue. First off, it is not a bitcoind misconfiguration problem, since localhost always works (double checked using RPC interface over curl).

I observe that in function read_socket_line() in line ckpool.c:455 the recv() function returns 0 when 'validateaddress' is called after 'getblocktemplate' returned a very large response over the socket.

Following manpage, a return value of 0 for recv() has to be interpreted as 'peer has performed an orderly shutdown' which is not handled in read_socket_line(). Question remains why bitcoind is closing the socket, but at least this has to be handled accordingly by ckpool.

This is my debug log:
Code:
[2015-03-24 23:40:56] Opening /tmp/ckpool/generator
[2015-03-24 23:40:56] Unlinked /tmp/ckpool/generator to recreate socket
[2015-03-24 23:40:56] Opened server path /tmp/ckpool/generator successfully on socket 5
[2015-03-24 23:40:56] File /tmp/ckpool/generator.pid exists
[2015-03-24 23:40:56] Opening /tmp/ckpool/stratifier
[2015-03-24 23:40:56] Unlinked /tmp/ckpool/stratifier to recreate socket
[2015-03-24 23:40:56] Opened server path /tmp/ckpool/stratifier successfully on socket 7
[2015-03-24 23:40:56] File /tmp/ckpool/stratifier.pid exists
[2015-03-24 23:40:56] Opening /tmp/ckpool/connector
[2015-03-24 23:40:56] Unlinked /tmp/ckpool/connector to recreate socket
[2015-03-24 23:40:56] Opened server path /tmp/ckpool/connector successfully on socket 8
[2015-03-24 23:40:56] File /tmp/ckpool/connector.pid exists
[2015-03-24 23:40:56] ckpool stratifier starting
[2015-03-24 23:40:56] Opened client path /tmp/ckpool/listener successfully on socket 6
[2015-03-24 23:40:56] Listener received ping request
[2015-03-24 23:40:56] ckpool generator starting
[2015-03-24 23:40:56] Closing file handle 6
[2015-03-24 23:40:56] Attempting to connect to bitcoind
[2015-03-24 23:40:56] Listener received ping request
[2015-03-24 23:40:56] Opened client path /tmp/ckpool/listener successfully on socket 6
[2015-03-24 23:40:56] Closing file handle 6
[2015-03-24 23:40:56] Closing file handle 6
[2015-03-24 23:40:56] Opened client path /tmp/ckpool/generator successfully on socket 6
[2015-03-24 23:40:56] Closing file handle 6
[2015-03-24 23:40:56] ckpool connector starting
[2015-03-24 23:40:56] Succeeded delayed connect
[2015-03-24 23:40:56] json_rpc_call: REQ: {"method": "getblocktemplate", "params": [{"capabilities": ["coinbasetxn", "workid", "coinbase/append"]}]}

[2015-03-24 23:40:57] json_rpc_call: RESP: OK
[2015-03-24 23:40:57] Discarding:
[2015-03-24 23:40:57] MH0 dba90ae1e4c98ae65e07baa18c5735015a3850ea2db3771a71f193647966e278
[2015-03-24 23:40:57] MH1 928e668d417d547bbfc3237e727abdb5f81ff5a1d9a587afa7500697720f5917
[2015-03-24 23:40:57] MH2 23f8815bcb4b8275b0242b6cca6d844daa2e2398cbfb8c2fa721ac23197846ec
[2015-03-24 23:40:57] MH3 357c2632b29c0a71845aa3aed3c74f907a797095b1229957dbce378753c8db5c
[2015-03-24 23:40:57] MH4 d962fe3ba85ef5b919c90ceb9c5fb898e78f1f5df025ed280666dedd6c03f94f
[2015-03-24 23:40:57] MH5 0f3b07341144ef4290d0bbe8170fa45cc975a091a2816fa9fdb30367dd25634f
[2015-03-24 23:40:57] MH6 116582e86cae9fbf0df80bf929bce816743f05a9984389d8908eb2ca71e6f7f5
[2015-03-24 23:40:57] MH7 1a25a3929cdab41e9be026884027dec5835bbe4780f61810073d7fdacf8a9cf2
[2015-03-24 23:40:57] MH8 3175f8961f699a1f160497568cb86960d6d3ea30c346b777da9506b48cbdc0d9
[2015-03-24 23:40:57] MH9 5ea864a0f2a6752e545e05388ebd63664a592a770455340b0264905dd35635c2
[2015-03-24 23:40:57] Stored 540 transactions
[2015-03-24 23:40:57] json_rpc_call: REQ: {"method": "validateaddress", "params": ["14BMjogz69qe8hk9thyzbmR5pg34mVKB1e"]}

[2015-03-24 23:40:57] Failed to recv in read_socket_line: 0/0/Success
[2015-03-24 23:40:57] Closing file handle 6
[2015-03-24 23:40:57] Failed to read socket line in json_rpc_call
[2015-03-24 23:40:57] Reopening socket to 192.168.0.14:8332
[2015-03-24 23:40:57] Succeeded delayed connect
[2015-03-24 23:40:57] Failed to get valid json response to validate_address with errno 115: Operation now in progress
[2015-03-24 23:40:57] Invalid btcaddress: 14BMjogz69qe8hk9thyzbmR5pg34mVKB1e !
[2015-03-24 23:40:57] Closing file handle 6
[2015-03-24 23:40:57] CRITICAL: No bitcoinds active!

The modified error message gives ret/errno/strerror(errno), added with
Code:
diff --git a/src/ckpool.c b/src/ckpool.c
index 1ffe45f..4df333a 100644
--- a/src/ckpool.c
+++ b/src/ckpool.c
@@ -457,7 +457,7 @@ int read_socket_line(connsock_t *cs, const int timeout)
                        /* Closed socket after valid message */
                        if (eom)
                                break;
-                       LOGERR("Failed to recv in read_socket_line");
+                       LOGERR("Failed to recv in read_socket_line: %d/%d/%s", ret, errno, strerror(errno));
                        ret = -1;
                        goto out;
                }
@@ -678,6 +678,7 @@ json_t *json_rpc_call(connsock_t *cs, const char *rpc_req)
        json_t *val = NULL;
        int len, ret;
 
+       LOGDEBUG("json_rpc_call: REQ: %s", rpc_req);
        if (unlikely(cs->fd < 0)) {
                LOGWARNING("FD %d invalid in json_rpc_call", cs->fd);
                goto out;
@@ -738,6 +739,9 @@ json_t *json_rpc_call(connsock_t *cs, const char *rpc_req)
        val = json_loads(cs->buf, 0, &err_val);
        if (!val)
                LOGWARNING("JSON decode failed(%d): %s", err_val.line, err_val.text);
+       else
+               LOGDEBUG("json_rpc_call: RESP: OK");
+
 out_empty:
        empty_socket(cs->fd);
        empty_buffer(cs);

Will dig deeper tomorrow, just to leave here as probable bug report.

-ck (OP)
Legendary
*
Offline Offline

Activity: 4060
Merit: 1622


Ruu \o/


View Profile WWW
March 25, 2015, 12:10:10 AM
 #79

I observe that in function read_socket_line() in line ckpool.c:455 the recv() function returns 0 when 'validateaddress' is called after 'getblocktemplate' returned a very large response over the socket.

Following manpage, a return value of 0 for recv() has to be interpreted as 'peer has performed an orderly shutdown' which is not handled in read_socket_line(). Question remains why bitcoind is closing the socket, but at least this has to be handled accordingly by ckpool.

This was changed post M13. Grab the latest milestone.

Developer/maintainer for cgminer, ckpool/ckproxy, and the -ck kernel
2% Fee Solo mining at solo.ckpool.org
-ck
bgibso01
Legendary
*
Offline Offline

Activity: 1218
Merit: 1001



View Profile
April 19, 2015, 04:23:50 AM
Last edit: April 22, 2015, 03:11:29 AM by bgibso01
 #80

CK/Kano,

Obviously I love the software! I mine on Ck and solo as a backup.  I am going to finally have some time to try and set this up here at the house and wondered if the pool server has a front end or is that something that will need to be created?  It's just a tinkering thing on my part.  Last year I setup an Eliopool and MPOS but have since wiped them.

Nevermind, read through the thread again.  Definitely like  the concept of two parts.  I understand keeping the CK solo pool handling of payouts not part of this code, but it sure would be handy for those that have different miners using different wallet addresses.
Pages: « 1 2 3 [4] 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!