Author

Topic: Need help for setting btc.com backend (Read 181 times)

legendary
Activity: 2170
Merit: 6279
be constructive or S.T.F.U
March 17, 2021, 06:31:53 PM
#11
ِAbonded is for the whole project, it simply means they are no longer maintaining the project, ignore that. but judging from the code on issue #16 I see no reason why it shouldn't work, your code, however, which you posted here > https://imgur.com/v7hu2lm is missing a for loop and doesn't seem to be passing the worked id, is the screenshot outdated or you modified the code?
member
Activity: 405
Merit: 10
www.teslawatt.com
March 17, 2021, 10:48:11 AM
#10
Error is miner status "dead". No accepted works and no accepted hashing. I don't get any specific err-msg.

I am unable to paste php code here in forum but you can see it on the following link:  https://github.com/btccom/btcpool-ABANDONED/issues/16. This is the original post that we found as solution to user list problem and used the exact code SwimmingTiger posted. But I can see here for the first time "ABANDONED" inserted in link on github (it was not there before 7 days).

Please be free to add some php code to existing one in case that you think that you might solve the issue we have.
legendary
Activity: 2170
Merit: 6279
be constructive or S.T.F.U
March 17, 2021, 02:36:05 AM
#9
What error does it through? do you get err-msg?

I think your userlist code is incomplete, the count function in php only returns the elements count of an array and not their assigned values, I am not sure how are you passing the user id in the code you posted the screenshot for, could you paste it here so I can have a better look.?

I believe you need to use a for loop to go through workers, can you just use the exact code that SwimmingTiger posted here > https://github.com/btccom/btcpool-ABANDONED/issues/16d
member
Activity: 405
Merit: 10
www.teslawatt.com
March 09, 2021, 09:57:40 AM
#8
Thanks for the responding! I created file name "userlist.php" please check my screenshots.

https://imgur.com/v7hu2lm
https://imgur.com/xqdutVf

Code:
root@ubnt:/work/btcpool/build/run_sserver# cat sserver.cfg
#
# stratum server cfg
#
# @since 2016-06
# @copyright btc.com
#

# is using testnet3
testnet = true;

kafka = {
  brokers = "127.0.0.1:9092"
};

sserver = {
  ip = "0.0.0.0";
  port = 3333;
##added
  type = "BTC";
  default_difficulty = "4000";
  max_difficulty = "4000000000000000";
  min_difficulty = "40";
 # topics
  job_topic = "BtcJob";
  share_topic = "BtcShare";
  solved_share_topic = "BtcSolvedShare";
  auxpow_solved_share_topic = "AuxSolvedShare"; # auxpow (eg. Namecoin) solved share topic
  rsk_solved_share_topic = "RskSolvedShare";
  common_events_topic = "BtcCommonEvents";

  # should be global unique, range: [1, 255]
  id = 1;

  # write last mining notify job send time to file, for monitor
  file_last_notify_time = "/work/btcpool/build/run_sserver/sserver_lastnotifytime.txt";

  # how many seconds between two share submit
  share_avg_seconds = 10;

  ########################## dev options #########################

  # if enable simulator, all share will be accepted. for testing
  enable_simulator = true;

  # if enable it, all share will make block and submit. for testing
  enable_submit_invalid_block = false;

  # if enable, difficulty sent to miners is always miner_difficulty. for development
  enable_dev_mode = false;

  # difficulty to send to miners. for development
  miner_difficulty = 0.005;

  ###################### end of dev options ######################
};

users = {
  #
  # https://example.com/get_user_id_list?last_id=0
  # {"err_no":0,"err_msg":null,"data":{"jack":1,"terry":2}}
  #
  # There is a demo: https://github.com/btccom/btcpool/issues/16#issuecomment-278245381
  #
  list_id_api_url = "http://localhost:8000/userlist.php";
};

##added
management = {
  enabled = true; # default: true

  kafka_brokers = "127.0.0.1:9092"; # "10.0.0.1:9092,10.0.0.2:9092,..."
  controller_topic = "BtcManController";
  processor_topic = "BtcManProcessor";

  auto_switch_chain = false;
};
root@ubnt:/work/btcpool/build/run_sserver#

Also you can see we have PHP started on the server. Also I added the same file in the stratum. Please check output. sserver.cfg has only 77 line of code. (I am using Linux OS for the server).

Yes we made. This assumes you saved the get-user-list.php file directly in htdocs (I don't have htdocs on the Linux server). I started PHP with -s lightweight server.
legendary
Activity: 2170
Merit: 6279
be constructive or S.T.F.U
March 05, 2021, 05:35:29 PM
#7
What do you mean it does not work? did you actually make a text file with the name get-user-list.php and saved it in (C:\xampp\htdocs), also is your Apache Server running? I think there is a mistake in the document, file sserver is in this path > btcpool-master\docker\btcpool\test\btc\cfg. So you need to open sserver.cfg with a notepad and go to line 107.

Code:
list_id_api_url = "http://userlist/userlist.php";

change the path to:

Code:
list_id_api_url = "http://get-user-list.php";

This assumes you saved the get-user-list.php file directly in htdocs without a sub-folder, I think the explanation by SwimmingTiger on GitHub is straightforward, he skipped a few things based on the assumption that anyone who gets this far should at least have a basic idea about what they are doing.

*If you don't want to touch the sserver.cgf you can simply create a new folder with the name 'userlist' inside C:\xampp\htdoc and then create the userlist.php inside, this leads to the same result but with a shortcut.

Let me know how it goes.
member
Activity: 405
Merit: 10
www.teslawatt.com
March 05, 2021, 02:25:45 PM
#6
Can you please tell me how to add user in the db? I found this issue how to insert user in db for testing backend, you can check here: https://github.com/btccom/btcpool/issues/16. And still doesn't work. I don't know how to insert username in db on the another way?
legendary
Activity: 2170
Merit: 6279
be constructive or S.T.F.U
February 20, 2021, 01:35:47 PM
#5
Given who they are my guess is host their own pool at their datacenters for their customers.

Makes sense, I didn't even bother reading their username, anyway I just wanted to confirm they actually do know what setting up your own pool means, I know some newbies would want to do that to evade mining pool fees.

Yes the post was deleted. I don't know why. I am testing different open source softwares. Thanks for your answer I will check db record and will get back to you.

Probably the admin thought it was spam or something, I hope they won't delete this one too, anyway, check and let me know, if you didn't find it I'll take another look into the backend code on Github.
member
Activity: 405
Merit: 10
www.teslawatt.com
February 20, 2021, 05:36:12 AM
#4
Was your other post deleted? I answered your question on that topic, not sure what happened!!

You need to use a username and not a wallet address, that user name needs to be in your db, I looked into the table name and I forgot it, but there will be user/worker database table, the worker name needs to match with one of the rows in there, only then it will show alive.

As far as connecting that to your wallet, you have to know that you are now running your own pool, so you need to find a block to get any rewards, search the code and you will find "genesis transaction" that's where your wallet address goes to.

May I ask what are you trying to achieve by running your own copy of btc.com?

Yes the post was deleted. I don't know why. I am testing different open source softwares. Thanks for your answer I will check db record and will get back to you.
legendary
Activity: 3220
Merit: 1220
February 20, 2021, 05:05:06 AM
#3
May I ask what are you trying to achieve by running your own copy of btc.com?

Given who they are my guess is host their own pool at their datacenters for their customers.
legendary
Activity: 2170
Merit: 6279
be constructive or S.T.F.U
February 19, 2021, 06:53:29 PM
#2
Was your other post deleted? I answered your question on that topic, not sure what happened!!

You need to use a username and not a wallet address, that user name needs to be in your db, I looked into the table name and I forgot it, but there will be user/worker database table, the worker name needs to match with one of the rows in there, only then it will show alive.

As far as connecting that to your wallet, you have to know that you are now running your own pool, so you need to find a block to get any rewards, search the code and you will find "genesis transaction" that's where your wallet address goes to.

May I ask what are you trying to achieve by running your own copy of btc.com?
member
Activity: 405
Merit: 10
www.teslawatt.com
February 19, 2021, 02:51:02 PM
#1
I installed backend from https://github.com/btccom/btcpool

After configuration of all btc.com components and downloaded BTC blockchain I still have miner status '"dead':

https://imgur.com/egnFw7V
https://imgur.com/qSTsp70

Regarding miner pool configuration what shall I enter as username parameter (user or wallet) and how to set link between user and wallet inside backend?
Jump to: