Bitcoin Forum
June 23, 2024, 05:58:45 PM *
News: Voting for pizza day contest
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Alternate cryptocurrencies / Altcoin Discussion / Open-source payment gateway for an altcoin? on: March 17, 2022, 02:41:57 PM
Hi everyone,

Does anyone know of any open source crypto payment processors that would allow adding support for an altcoin?

I tried googling but BTCPay is the only one I could find that would meet these criteria (https://docs.btcpayserver.org/Development/Altcoins/#how-can-i-add-an-altcoin-to-btcpayserver). GoUrl doesn't seem to allow adding the altcoins by yourself. I've also found finch (https://github.com/finch-tech/finch) but it's clearly not supported at all anymore and their website (which included setup/installation instructions and documentation) is dead.

Thank you all in advance for any reccomendations/leads! Smiley

Sincerely,
newlymintedcryptolover
2  Alternate cryptocurrencies / Pools (Altcoins) / Re: [POOL] NiceHash.com Z.CASH/Scrypt/X11/PASCAL/etc. profit switch Bitcoin payout on: March 11, 2022, 02:17:25 PM
Hi everyone, I hope it's okay to re-up an old thread? I wasn't sure my question warranted its own topic Cheesy

I'm running my own mining pool and I'm trying to mine a coin with sha256d as its algo. I've set the pool difficulty for sha256 in the coin/algo configuration files in my pool to 500000 (the minimum required by NiceHash for sha256 - https://www.nicehash.com/pool-operators). I can get solo miners to connect and mine blocks and they parse the difficulty as being 500000 - https://imgbox.com/E2fIYofp. However, NiceHash pool verificator returns the "pool difficulty too low (provided=16, minimum=500000)" error (https://imgbox.com/uWopLwOz) and miners from NiceHash orders fail to connect to the pool. What could the issue be and how do I fix this?

Thanks in advance! Smiley

Sincerely,
newlymintedcryptolover

EDIT 14/03/2022: I've managed to solve this - turns out, all I needed to do was add the line nicehash = 750000 to the stratum part of the algo configuration file. Here's what the configuration file looks like now: https://imgbox.com/6WmPHK9U . It took me almost a week to solve this! It'd be great to have more documentation for issues like this.
3  Alternate cryptocurrencies / Pools (Altcoins) / sha256d algorithm on a YIIMP pool? on: March 01, 2022, 02:12:44 PM
Hi everyone,

I'm running a YIIMP pool by cryptopool-builders (https://github.com/cryptopool-builders/Multi-Pool-Installer). I want to run a coin that uses sha256d algo but this algorithm is not on the pool by default, the pool only has sha256, sha256q and sha256t.

Does anyone know how I could add the sha256d algo to my pool?

Thanks in advance! Smiley

Sincerely,
newlymintedcryptolover
4  Alternate cryptocurrencies / Pools (Altcoins) / Re: Adding new Algo to Yiimp based pool on: February 28, 2022, 12:50:58 PM
Hi everyone,

after several hours of installing I finally got the really great yiimp pool software from the crypto builders guys running, and I am very happy and thankful about this piece of work!

Did anyone figured out how to add new algos like KAWPOW or ETHASH ?

There was a Topic of the software developers but the last post was about 120 days old and forum told me to start a new topic.

best regards

P.S. if anyone likes to test a new set up pool, help is welcome, please PM me

Hi there, sorry for rehashing an old thread but did you ever find out how to add new algorithms to YIIMP pools? I'd like to add sha256d to my pool (the default install only has sha256, sha256q and sha256t).

Thanks! Smiley
5  Alternate cryptocurrencies / Pools (Altcoins) / Re: [my own pool] 'CDbConnection failed to open the DB connection.' error on: February 18, 2022, 02:59:22 PM
Okay, it seems like I've fixed it with the help of some people at a Discord server. I'm sharing the solution here in case someone runs into the same problem and locking this thread. Sorry for the (unintentional) spam! Cheesy

What I needed to do was install php7.3-memcache and php7.3-memcached:

Code:
sudo apt install php7.3-memcache php7.3-memcached memcached

and then change the default php version from 8.1 to 7.3:

Code:
sudo update-alternatives --config php

Finally, then I restarted nginx and php fpm:

Code:
sudo service nginx restart

sudo service php7.3-fpm restart

That fixed it! Smiley

6  Alternate cryptocurrencies / Pools (Altcoins) / Re: [my own pool/cgminer] Help! All work is discarded, nothing accepted or rejected on: February 18, 2022, 02:35:52 PM
I have downloaded and tried out pooler cpuminer (from https://sourceforge.net/projects/cpuminer/) to see how mining on CPU would turn out, and it seems I'm still getting the same "stratum requested work restart" message...

That message means the pool is working. You haven't been able to mine sha256d with a CPU or GPU for 10 years.
Only high powered ASICS are suitable for sha256d.

You need to do more research. 

You're right. I'm still very new to this. Thanks for all your help! Smiley
7  Alternate cryptocurrencies / Pools (Altcoins) / [my own pool] 'CDbConnection failed to open the DB connection.' error on: February 18, 2022, 02:24:59 PM
Hi everyone,

I've set up my own mining pool using the installer at https://github.com/cryptopool-builders/Multi-Pool-Installer. It seems to be working fine for the most part but I'm seeing the  'CDbConnection failed to open the DB connection.' error in my debug.log file. Here's what the log entries look like in full:

Code:
[2022-02-17 13:26:14] CDbException#1
(
    [*:message] => 'CDbConnection failed to open the DB connection.'
    [Exception:string] => ''
    [*:code] => 0
    [*:file] => '/home/crypto-data/yiimp/site/web/framework/db/CDbConnection.php'
    [*:line] => 405
    [Exception:trace] => array
    (
        0 => array
        (
            'file' => '/home/crypto-data/yiimp/site/web/framework/db/CDbConnection.php'
            'line' => 347
            'function' => 'open'
            'class' => 'CDbConnection'
            'type' => '->'
        )
        1 => array
        (
            'file' => '/home/crypto-data/yiimp/site/web/framework/db/CDbConnection.php'
            'line' => 325
            'function' => 'setActive'
            'class' => 'CDbConnection'
            'type' => '->'
        )
        2 => array
        (
            'file' => '/home/crypto-data/yiimp/site/web/framework/base/CModule.php'
            'line' => 394
            'function' => 'init'
            'class' => 'CDbConnection'
            'type' => '->'
        )
        3 => array
        (
            'file' => '/home/crypto-data/yiimp/site/web/framework/base/CModule.php'
            'line' => 103
            'function' => 'getComponent'
            'class' => 'CModule'
            'type' => '->'
        )
        4 => array
        (
            'file' => '/home/crypto-data/yiimp/site/web/yaamp/core/common/libdbo.php'
            'line' => 38
            'function' => '__get'
            'class' => 'CModule'
            'type' => '->'
        )
        5 => array
        (
            'file' => '/home/crypto-data/yiimp/site/web/yaamp/modules/thread/CronjobController.php'
            'line' => 51
            'function' => 'dborun'
        )
        6 => array
        (
            'file' => '/home/crypto-data/yiimp/site/web/framework/web/actions/CInlineAction.php'
            'line' => 49
            'function' => 'actionRunBlocks'
            'class' => 'CronjobController'
            'type' => '->'
        )
        7 => array
        (
            'file' => '/home/crypto-data/yiimp/site/web/framework/web/CController.php'
            'line' => 308
            'function' => 'runWithParams'
            'class' => 'CInlineAction'
            'type' => '->'
        )
        8 => array
        (
            'file' => '/home/crypto-data/yiimp/site/web/framework/web/CController.php'
            'line' => 286
            'function' => 'runAction'
            'class' => 'CController'
            'type' => '->'
        )
        9 => array
        (
            'file' => '/home/crypto-data/yiimp/site/web/framework/web/CController.php'
            'line' => 265
            'function' => 'runActionWithFilters'
            'class' => 'CController'
            'type' => '->'
        )
        10 => array
        (
            'file' => '/home/crypto-data/yiimp/site/web/yaamp/components/CYiimpConsoleApp.php'
            'line' => 125
            'function' => 'run'
            'class' => 'CController'
            'type' => '->'
        )
        11 => array
        (
            'file' => '/home/crypto-data/yiimp/site/web/runconsole.php'
            'line' => 20
            'function' => 'runController'
            'class' => 'CYiimpConsoleApp'
            'type' => '->'
        )
    )
    [Exception:previous] => null
    [errorInfo] => null
)

I'm not seeing any MySQL errors in the mysql.log file, nginx logs don't seem to show anything either, same with client.log and reject.log. application.log  in /home/crypto-data/yiimp/site/web/yaamp/runtime only has this:

Code:
2022/02/18 11:24:43 [error] [php] memcache_connect(): Server 127.0.0.1 (tcp 11211, udp 0) failed with: Connection failed: Connection refused (111) (/home/crypto-data/yiimp/site/web/yaamp/core/functions/memcache.php:10)
Stack trace:
#0 /home/crypto-data/yiimp/site/web/framework/base/CApplication.php(170): CYiimpConsoleApp->init()
#1 /home/crypto-data/yiimp/site/web/framework/YiiBase.php(127): CYiimpConsoleApp->__construct()
#2 /home/crypto-data/yiimp/site/web/runconsole.php(14): createApplication()

but this is from hours ago and my problem still persists.

The coin log in stratum/config only has this:

Code:
12:44:11: connecting to coind TLC
12:44:11: Techcoin wallet is using getaddressinfo.
12:44:11: Warning: unable to decode TLC tc1qhnfad09vg78a4whxjjdydqy00gjx64wqsrc8um script pubkey
12:44:11: TLC tc1qhnfad09vg78a4whxjjdydqy00gjx64wqsrc8um extracted script pubkey is d3d6bcac478fdabae6949a46808f7a246d

syslog doesn't show any MySQL errors either. MySQL/MariaDB seem to be running okay and I can connect to the database manually.

What other log files should I check? What could be the problem, if the database connection seems okay?

Thanks in advance! Smiley
8  Alternate cryptocurrencies / Pools (Altcoins) / Re: [my own pool/cgminer] Help! All work is discarded, nothing accepted or rejected on: February 17, 2022, 10:11:41 AM
I have downloaded and tried out pooler cpuminer (from https://sourceforge.net/projects/cpuminer/) to see how mining on CPU would turn out, and it seems I'm still getting the same "stratum requested work restart" message...

Code:
C:\Users\user\Downloads\pooler-cpuminer-2.5.1-win64>minerd --algo=sha256d --url=stratum+tcp://141.95.105.118:5973 --user=tc1qvrfu892afqskldtnl99n96c2ps7mj7ynutgtf5 --pass=c=TLC
[2022-02-17 12:06:31] Starting Stratum on stratum+tcp://141.95.105.118:5973
[2022-02-17 12:06:31] 8 miner threads started, using 'sha256d' algorithm.
[2022-02-17 12:06:31] Binding thread 3 to cpu 3
[2022-02-17 12:06:31] Binding thread 4 to cpu 4
[2022-02-17 12:06:31] Binding thread 6 to cpu 6
[2022-02-17 12:06:31] Binding thread 0 to cpu 0
[2022-02-17 12:06:31] Binding thread 2 to cpu 2
[2022-02-17 12:06:31] Binding thread 7 to cpu 7
[2022-02-17 12:06:31] Binding thread 5 to cpu 5
[2022-02-17 12:06:31] Binding thread 1 to cpu 1
[2022-02-17 12:06:31] Stratum requested work restart
[2022-02-17 12:06:32] thread 3: 2097152 hashes, 5519 khash/s
[2022-02-17 12:06:32] thread 4: 2097152 hashes, 5519 khash/s
[2022-02-17 12:06:32] thread 6: 2097152 hashes, 5323 khash/s
[2022-02-17 12:06:32] thread 7: 2097152 hashes, 5491 khash/s
[2022-02-17 12:06:32] thread 2: 2097152 hashes, 5365 khash/s
[2022-02-17 12:06:32] thread 0: 2097152 hashes, 5338 khash/s
[2022-02-17 12:06:32] thread 1: 2097152 hashes, 5311 khash/s
[2022-02-17 12:06:32] thread 5: 2097152 hashes, 4925 khash/s
[2022-02-17 12:06:50] Stratum requested work restart
[2022-02-17 12:06:50] thread 1: 81863520 hashes, 4639 khash/s
[2022-02-17 12:06:50] thread 7: 93683568 hashes, 5305 khash/s
[2022-02-17 12:06:50] thread 0: 93030784 hashes, 5271 khash/s
[2022-02-17 12:06:50] thread 6: 82344448 hashes, 4662 khash/s
[2022-02-17 12:06:50] thread 5: 81582312 hashes, 4631 khash/s
[2022-02-17 12:06:50] thread 3: 93460024 hashes, 5287 khash/s
[2022-02-17 12:06:50] thread 2: 81392144 hashes, 4611 khash/s
[2022-02-17 12:06:50] thread 4: 93837032 hashes, 5309 khash/s
[2022-02-17 12:07:11] Stratum requested work restart
[2022-02-17 12:07:11] thread 5: 79442392 hashes, 3762 khash/s
[2022-02-17 12:07:11] thread 1: 79582040 hashes, 3769 khash/s
[2022-02-17 12:07:11] thread 4: 88454024 hashes, 4190 khash/s
[2022-02-17 12:07:11] thread 6: 81980368 hashes, 3882 khash/s
[2022-02-17 12:07:11] thread 2: 77862920 hashes, 3688 khash/s
[2022-02-17 12:07:11] thread 3: 88607184 hashes, 4197 khash/s
[2022-02-17 12:07:11] thread 0: 88863448 hashes, 4208 khash/s
[2022-02-17 12:07:11] thread 7: 86143784 hashes, 4079 khash/s
[2022-02-17 12:07:32] Stratum requested work restart
[2022-02-17 12:07:32] thread 4: 93401312 hashes, 4430 khash/s
[2022-02-17 12:07:32] thread 0: 87391584 hashes, 4145 khash/s
[2022-02-17 12:07:32] thread 3: 93331808 hashes, 4427 khash/s
[2022-02-17 12:07:32] thread 6: 88300768 hashes, 4188 khash/s
[2022-02-17 12:07:32] thread 2: 86389704 hashes, 4097 khash/s
[2022-02-17 12:07:32] thread 5: 84374400 hashes, 4001 khash/s
[2022-02-17 12:07:32] thread 1: 83927312 hashes, 3980 khash/s
[2022-02-17 12:07:32] thread 7: 93129536 hashes, 4418 khash/s
9  Alternate cryptocurrencies / Pools (Altcoins) / Re: [my own pool/cgminer] Help! All work is discarded, nothing accepted or rejected on: February 17, 2022, 09:45:36 AM
This sub forum is usually for pool issues, your pool seems to be working fine. The problem you're having
might be better discussed in the mining section.

The problem is no devices. You need  something to mine with, a GPU, an ASIC, even a CPU depending
on the algorithm. Cgminer is usually used for ASICs. If you have one connected is isn't being detected.

Code:
 
[2022-02-16 14:03:51] Started cgminer 4.9.0                                                                             
[2022-02-16 14:03:53] No devices detected!                                                                             
[2022-02-16 14:03:53] Waiting for USB hotplug devices or press q to quit                                               

You also need to post more info like your hardware setup and the coin, algorithm you're trying to mine, and of course
the device you are intending to mine with.

Thank you so much for your reply!  Smiley

I'm trying to mine Techcoin (https://techcoin.info), which uses sha256d algo. I'm not using ASIC, only my own laptop (GeForce GTX 1050 GPU + Intel Core i7-8550U CPU). I tried mining with minerd (as it's described in the Techcoin website, just with my pool's URL as the 'url' value in the minerd.json config file) but it would give me the 'HTTP request failed: Received HTTP/0.9 when not allowed' error:

Code:
[2022-02-17 11:43:11] 2 miner threads started, using 'sha256d' algorithm.
[2022-02-17 11:43:11] HTTP request failed: Received HTTP/0.9 when not allowed
[2022-02-17 11:43:11] json_rpc_call failed, retry after 30 seconds
10  Alternate cryptocurrencies / Pools (Altcoins) / [my own pool/cgminer] Help! All work is discarded, nothing accepted or rejected on: February 16, 2022, 12:15:44 PM
Hi everyone,

I'm new to crypto and I've just set up my own mining pool and installed + configured the daemon. Now when I'm trying to mine on my mining pool using cgminer 4.9.0, I keep getting the "Stratum from pool 0 requested work restart" message:

Code:
 
cgminer version 4.9.0 - Started: [2022-02-16 14:03:54]
--------------------------------------------------------------------------------
(5s):0.000 (1m):0.000 (5m):0.000 (15m):0.000 (avg):0.000h/s
A:0  R:0  HW:0  WU:0.0/m
Connected to 141.95.105.118 diff 512 with stratum as user tc1qvrfu892afqskldtnl99n96c2ps7mj7ynutgtf5
Block: 9abcd6ae...  Diff:3.35M  Started: [14:03:54]  Best share: 0                                                   
 --------------------------------------------------------------------------------                                       
[U]SB management [P]ool management [S]ettings [D]isplay options [Q]uit                                               
 --------------------------------------------------------------------------------                                       
[2022-02-16 14:03:51] Started cgminer 4.9.0                                                                             
[2022-02-16 14:03:53] No devices detected!                                                                             
[2022-02-16 14:03:53] Waiting for USB hotplug devices or press q to quit                                               
[2022-02-16 14:03:53] Probing for an alive pool                                                                         
[2022-02-16 14:03:54] Pool 0 difficulty changed to 512
[2022-02-16 14:03:54] Network diff set to 3.35M
[2022-02-16 14:04:05] Stratum from pool 0 requested work restart
[2022-02-16 14:04:26] Stratum from pool 0 requested work restart
[2022-02-16 14:04:47] Stratum from pool 0 requested work restart
[2022-02-16 14:05:08] Stratum from pool 0 requested work restart
[2022-02-16 14:05:29] Stratum from pool 0 requested work restart
[2022-02-16 14:05:50] Stratum from pool 0 requested work restart
[2022-02-16 14:06:12] Stratum from pool 0 requested work restart

When I stop mining, I get the runtime statistics, which look like this:

Code:
Summary of runtime statistics:

 [2022-02-16 14:09:22] Started at [2022-02-16 14:03:54]
 [2022-02-16 14:09:22] Pool: stratum+tcp://141.95.105.118:5973
 [2022-02-16 14:09:22] Runtime: 0 hrs : 5 mins : 27 secs
 [2022-02-16 14:09:22] Average hashrate: 0.0 Mhash/s
 [2022-02-16 14:09:22] Solved blocks: 0
 [2022-02-16 14:09:22] Best share difficulty: 0
 [2022-02-16 14:09:22] Share submissions: 0
 [2022-02-16 14:09:22] Accepted shares: 0
 [2022-02-16 14:09:22] Rejected shares: 0
 [2022-02-16 14:09:22] Accepted difficulty shares: 0
 [2022-02-16 14:09:22] Rejected difficulty shares: 0
 [2022-02-16 14:09:22] Hardware errors: 0
 [2022-02-16 14:09:22] Utility (accepted shares / min): 0.00/min
 [2022-02-16 14:09:22] Work Utility (diff1 shares solved / min): 0.00/min

 [2022-02-16 14:09:22] Stale submissions discarded due to new blocks: 0
 [2022-02-16 14:09:22] Unable to get work from server occasions: 0
 [2022-02-16 14:09:22] Work items generated locally: 212
 [2022-02-16 14:09:22] Submitting work remotely delay occasions: 0
 [2022-02-16 14:09:22] New blocks detected on network: 1

 [2022-02-16 14:09:22] Summary of per device statistics:

 [2022-02-16 14:09:22]
 [2022-02-16 14:09:22] Stratum connection to pool 0 interrupted
 [2022-02-16 14:09:22] Pool 0 stratum+tcp://141.95.105.118:5973 not responding!

I tried googling around but it I didn't seem to find anything helpful. Most answers I found are about reducing the number of rejected/discarded shares but don't address the cases where no shares are accepted at all, which is the problem I'm facing. Is this a problem with the mining pool or the miner? How do I fix this?

Thanks a ton in advance! Smiley

Sincerely,
newlymintedcryptolover
11  Alternate cryptocurrencies / Mining (Altcoins) / YIIMP: How to fix "Parse error" error? ("code":-32700,"message":"Parse error") on: February 09, 2022, 01:37:00 PM
Hi everyone,

I'm new to crypto and I'm building my own mining pool for an altcoin.

I've run into the ("code":-32700,"message":"Parse error") error when trying to get the altcoin set up for mining.  I tried googling around and all the solutions seemed to point to the command syntax/parameters not being formatted correctly but I'm pretty sure my formatting is correct, as the validateaddress returns the expected result when ran manually. Also, echojson (a daemon cli command which parses the given string to JSON) seems to parse the parameters correctly as well. I've been stuck on this for days and I'm not sure what else to do. What could I do to fix this?

Huge thanks in advance!!!

Sincerely,
newlymintedcryptolover

An excerpt from stratum.log (including my own debug messages):

Code:
12:13:34: [rpc_send_raw] res to be returned is:
12:13:34: 168
12:13:34: [rpc_send_raw] start, buffer is:
12:13:34: '{"method":"validateaddress","params":"tc1qv90nlgjc8rtseygndxghxuk60038aaeff3c6nh","id":"1"}'
12:13:34: [rpc_send_raw] sending >'{"method":"validateaddress","params":"tc1qv90nlgjc8rtseygndxghxuk60038aaeff3c6nh","id":"1"}'<
12:13:34: [rpc_send_raw] res to be returned is:
12:13:34: 93
12:13:34: [rpc_do_call] p is:
12:13:34:  500 Internal Server Error
Content-Type: application/json
Date: Wed, 09 Feb 2022 12:13:34 GMT
Content-Length: 74

{"result":null,"error":{"code":-32700,"message":"Parse error"},"id":null}
12:13:34: [rpc_do_call] databuf to be returned is:
12:13:34: {"result":null,"error":{"code":-32700,"message":"Parse error"},"id":null}

coind_validate_address method from coind.cpp:

Code:
bool coind_validate_address(YAAMP_COIND *coind)
{
stratumlog("coind_validate_address begin");

if(!coind->wallet[0]) return false;

stratumlog("return false passed by");

char params[YAAMP_SMALLBUFSIZE];
sprintf(params, "\"%s\"", coind->wallet); //[]
stratumlog("params is: ");
stratumlog(params);

json_value *json;
bool getaddressinfo = ((strcmp(coind->symbol,"DGB") == 0) || (strcmp(coind->symbol2, "DGB") == 0));
if(getaddressinfo) {
stratumlog("getaddressinfo true");
json = rpc_call(&coind->rpc, "getaddressinfo", params);
}
else {
stratumlog("getaddressinfo false");
json = rpc_call(&coind->rpc, "validateaddress", params);
}
if(!json) return false;

json_value *json_result = json_get_object(json, "result");
stratumlog("json_get_object");
if(!json_result)
{
stratumlog("json_result false");
json_value_free(json);
return false;
}

bool isvalid = getaddressinfo || json_get_bool(json_result, "isvalid");
if(!isvalid) stratumlog("%s wallet %s is not valid.\n", coind->name, coind->wallet);

bool ismine = json_get_bool(json_result, "ismine");
if(!ismine) stratumlog("%s wallet %s is not mine.\n", coind->name, coind->wallet);
else isvalid = ismine;

const char *p = json_get_string(json_result, "pubkey");
strcpy(coind->pubkey, p ? p : "");
stratumlog("pubkey done");

const char *acc = json_get_string(json_result, "account");
if (acc) strcpy(coind->account, acc);
stratumlog("account done");

if (!base58_decode(coind->wallet, coind->script_pubkey))
stratumlog("Warning: unable to decode %s %s script pubkey\n", coind->symbol, coind->wallet);

coind->p2sh_address = json_get_bool(json_result, "isscript");
stratumlog("isscript done");

// if base58 decode fails
if (!strlen(coind->script_pubkey)) {
const char *pk = json_get_string(json_result, "scriptPubKey");
if (pk && strlen(pk) > 10) {
strcpy(coind->script_pubkey, &pk[6]);
coind->script_pubkey[strlen(pk)-6-4] = '\0';
stratumlog("%s %s extracted script pubkey is %s\n", coind->symbol, coind->wallet, coind->script_pubkey);
} else {
stratumlog("%s wallet addr '%s' seems incorrect!'", coind->symbol, coind->wallet);
}
}
json_value_free(json);

stratumlog("coind_validate_address end");

return isvalid; //&& ismine;
}

rpc_send_raw method from rpc.cpp:

Code:
int rpc_send_raw(YAAMP_RPC *rpc, const char *buffer, int bytes)
{
stratumlog("[rpc_send_raw] start, buffer is:");
stratumlog(buffer);
if(!rpc_connected(rpc)) return -1;

int res = send(rpc->sock, buffer, bytes, MSG_NOSIGNAL);
if(res <= 0) return res;

if (g_debuglog_rpc) {
debuglog("sending >%s<\n", buffer);
}

stratumlog("[rpc_send_raw] sending >%s<\n", buffer);

std::string s = std::to_string(res);
char const *pchar = s.c_str();  //use char const* as target type
stratumlog("[rpc_send_raw] res to be returned is:");
stratumlog(pchar);

return res;
}

int rpc_flush_soft(YAAMP_RPC *rpc)
{
if(!rpc_connected(rpc)) return -1;

int res = send(rpc->sock, rpc->buffer, rpc->bufpos, MSG_MORE);
rpc->bufpos = 0;

return res;
}

int rpc_flush(YAAMP_RPC *rpc)
{
if(!rpc_connected(rpc)) return -1;

int res = rpc_send_raw(rpc, rpc->buffer, rpc->bufpos);
rpc->bufpos = 0;

return res;
}

int rpc_send(YAAMP_RPC *rpc, const char *format, ...)
{
if(!rpc_connected(rpc)) return -1;

char buffer[YAAMP_SMALLBUFSIZE] = { 0 };
va_list args;

va_start(args, format);
vsprintf(buffer, format, args);
va_end(args);

int bytes = strlen(buffer);
if(bytes + rpc->bufpos > YAAMP_SMALLBUFSIZE)
return -1;

memcpy(rpc->buffer + rpc->bufpos, buffer, bytes);
rpc->bufpos += bytes;

return bytes;
}

rpc_do_call from rpc.cpp:

Code:
char *rpc_do_call(YAAMP_RPC *rpc, char const *data)
{
CommonLock(&rpc->mutex);

// HTTP 1.1 accepts chunked data, and keep the connection
rpc_send(rpc, "POST / HTTP/1.1\r\n");
rpc_send(rpc, "Authorization: Basic %s\r\n", rpc->credential);
rpc_send(rpc, "Host: %s:%d\n", rpc->host, rpc->port);
rpc_send(rpc, "Accept: */*\r\n");
rpc_send(rpc, "Content-Type: application/json\r\n");
rpc_send(rpc, "Content-Length: %d\r\n\r\n", strlen(data));

int res = rpc_flush(rpc);
if(res <= 0)
{
CommonUnlock(&rpc->mutex);
return NULL;
}

res = rpc_send_raw(rpc, data, strlen(data));
if(res <= 0)
{
CommonUnlock(&rpc->mutex);
return NULL;
}

int bufpos = 0;
char buffer[YAAMP_SMALLBUFSIZE] = { 0 };

while(!g_exiting)
{
int bytes = recv(rpc->sock, buffer+bufpos, YAAMP_SMALLBUFSIZE-bufpos-1, 0);
if (g_debuglog_rpc) {
debuglog("got %s\n", buffer+bufpos);
}
if(bytes <= 0)
{
debuglog("ERROR: recv1, %d, %d, %s, %s\n", bytes, errno, data, buffer);
CommonUnlock(&rpc->mutex);
return NULL;
}

bufpos += bytes;
buffer[bufpos] = 0;

if(strstr(buffer, "\r\n\r\n")) break;
}

///////////////////////////////////////////////////

const char *p = strchr(buffer, ' ');
if(!p)
{
CommonUnlock(&rpc->mutex);
return NULL;
} else {
stratumlog("[rpc_do_call] p is: ");
stratumlog(p);
}

int status = atoi(p+1);
if(status != 200)
debuglog("ERROR: rpc_do_call: %s:%d %d\n", rpc->host, rpc->port, status);

char tmp[1024];

header_value(buffer, "Transfer-Encoding:", tmp);
if (!strcmp(tmp, "chunked")) {
#ifdef HAVE_CURL
if (!rpc->curl) debuglog("%s chunked transfer detected, switching to curl!\n",
rpc->coind->symbol);
rpc->curl = 1;
#endif
CommonUnlock(&rpc->mutex);
rpc_connect(rpc);
return NULL;
}

int datalen = atoi(header_value(buffer, "Content-Length:", tmp));
if(!datalen)
{
debuglog("ERROR: rpc No Content-Length header!\n");
CommonUnlock(&rpc->mutex);
return NULL;
}

p = strstr(buffer, "\r\n\r\n");
bufpos = strlen(p+4);

char *databuf = (char *)malloc(datalen+1);
if(!databuf)
{
CommonUnlock(&rpc->mutex);
return NULL;
}

memcpy(databuf, p+4, bufpos+1);

while(bufpos < datalen)
{
int bytes = recv(rpc->sock, databuf+bufpos, datalen-bufpos, 0);
if(bytes <= 0)
{
debuglog("ERROR: recv2, %d, %d, %s\n", bytes, errno, data);
rpc_connect(rpc);

free(databuf);
CommonUnlock(&rpc->mutex);
return NULL;
}

bufpos += bytes;
databuf[bufpos] = 0;
}

CommonUnlock(&rpc->mutex);

header_value(buffer, "Connection:", tmp);
if(strcmp(tmp, "close") == 0)
{
// debuglog("closing connection from %s:%d\n", rpc->host, rpc->port);
rpc_connect(rpc);
}

stratumlog("[rpc_do_call] databuf to be returned is:");
stratumlog(databuf);

return databuf;
}

Results of validateaddress and echojson commands when ran manually on the server that hosts the pool and the altcoin daemon:

Code:
./techcoin-cli validateaddress "tc1qv90nlgjc8rtseygndxghxuk60038aaeff3c6nh"
{
  "isvalid": true,
  "address": "tc1qv90nlgjc8rtseygndxghxuk60038aaeff3c6nh",
  "scriptPubKey": "0014615f3fa25838d70c911369917372da7be27ef729",
  "isscript": false,
  "iswitness": true,
  "witness_version": 0,
  "witness_program": "615f3fa25838d70c911369917372da7be27ef729"
}

pool@b2-7-uk1:~/daemons/tech$ ./techcoin-cli echojson '{"method":"validateaddress","params":"tc1qv90nlgjc8rtseygndxghxuk60038aaeff3c6nh","id":"1"}'
[
  {
    "method": "validateaddress",
    "params": "tc1qv90nlgjc8rtseygndxghxuk60038aaeff3c6nh",
    "id": "1"
  }
]






12  Alternate cryptocurrencies / Pools (Altcoins) / Re: Mining my own coin... help needed on: February 03, 2022, 10:45:31 AM
Sorry for rehashing a thread from years ago but I'm facing a very similar problem. Did you ever find the solution? If yes, do you remember it and would you be willing to share it?

Thanks in advance! Smiley
13  Alternate cryptocurrencies / Altcoin Discussion / Login widget that uses a altcoin wallet (Metamask-like login functionality) on: February 02, 2022, 11:18:16 AM
Hi everyone,

I'm trying to figure out if it's possible to create a login widget that would use an altcoin wallet. It'd work somewhat similarly to how logging in with Metamask works - a user would authenticate with their altcoin wallet, confirm the nonce and get logged in to the website.

Any ideas on how to do that?

Thanks in advance!  Smiley

Sincerely,
14  Alternate cryptocurrencies / Mining (Altcoins) / Re: [Awesome Miner] - Powerful Windows GUI to manage and monitor up to 200000 miners on: January 25, 2022, 01:17:42 AM
Hi everyone,

I'm trying to test if the mining pool works using Awesome Miner and I'm getting the `..retry after 30 seconds` error in the console. I've tried googling but didn't find anything helpful. As far as I understand, it connects to the pool successfully but fails to mine. I've tried running Awesome Miner as admin as well as with disabled antivirus and firewall but that didn't seem to help.



In the Awesome Miner logs, the only error I found was this one:



24/01/2022 17:42:27.830 [057] [E]Failed to download string from: https://api2.nicehash.com/main/api/v2/public/stats/global/current/

System.Net.WebException: The remote server returned an error: (500) Internal Server Error.



Which is strange because this doesn't seem like something that would prevent mining. Mining pool port is open and telnet connects to it successfully. If anyone could help me figure out what's wrong, I'd appreciate it. Thanks in advance!




Full AwesomeMiner.txt:



https://pastebin.com/37xTDfPU


Console output:

https://imgur.com/a/Mp3YzeI

Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!