prdatur / phpminer

PHPMiner is a web interface for cgminer on linux machines
Other
34 stars 15 forks source link

RIG based usernames / workers #2

Closed DanielNagy closed 10 years ago

DanielNagy commented 10 years ago

Love your frontend, its nice clean and simple. I'll be sure to leave donation option enabled

It would be good if when adding pools, to have a option to allow "RIG BASED" usernames/worker. So when you switch a rig to a pool, it switches and uses its own workername defined per rig

I'm open to conversation on how you think this should be best implemented.

This is particularly important when multiple rigs are connected to pools with VARDIF

DanielNagy commented 10 years ago

Further to this, I understand that each RIG auto imports its own group..

My suggestion was more, when you do "ADD POOL", to add the pool to all groups, but be able to specify the username / password for each rig there. Rather than have to manually add a pool into each group individually

nicoschtein commented 10 years ago

Maybe the worker username could be formed by mixing some account username and the rig name like this:

Adding a pool to any group will be like this:

Add pool
Server: stratum+tcp://www.com:3333
Worker Username: user
Worker Password: xxxxx

And if you had 3 rigs, Rig01, Rig02 and Rig03, each rig will auto append its name to the Worker Username configured for the pool when setting cgminer config.

So each rig has unique worker, user.Rig01, user.Rig02, user.Rig03 You will only have to setup the pool workers matching the name of the rigs.

What do you think?

DanielNagy commented 10 years ago

That sounds good.. However, I would suggest putting a "checkbox" to enable/disable Rig based workernames

So with it disabled, its just user with it enabled its user.Rig01

DanielNagy commented 10 years ago

I guess based on the concept of each miner rig runs per group.. suggest we keep is like that. but for the suggested requirement above, of having rig based usernames. Let this come into play if you do "Add Pool" as a global button, ie, up the top. which will add it to all groups, and a option to add rig based usernames there.

I think it should still maintain a add pools button per group, which would work as per it does now. no extra magic.

prdatur commented 10 years ago

So if I understand it correctly, my idea is the following. After clicking "Add Pool" the normal dialog will open. There a new checkbox will appear which is called "Add pool to all groups". When activating this option, the normal username/password fields will be replaced with a username/password field for each group.

One problem is, when you want to modify this pool you have to go through each group and change the pool there.

Solution from nicoschtein could be a bit better. It would be like: click on "Add pool" Enable checkbox "Rig based pool"

After this there are 2 possible ways what could be developed.

1. Nothing happens but when selecting the pool within the rig it uses the format: "provided username"."rigname without special chars and without spaces" Before saving I can check if all required worker usernames exist.

PRO: new rig's are auto configurated, deleted rig's don't need changes. CON: you rely on the given format.

2. A list with all current configurated rig's appear. Each with input text field where you can provide the username suffix which will be mapped to the rig.

PRO: Individual username suffix per rig CON: You have to always modify the pool when adding rig's

Currently I prefer solution from nicoschtein and first way for username one. With that i can pre show the required usernames, so the user can see how the usernames must exist on the pool.

DanielNagy commented 10 years ago

I'll leave it upto you guys, but i'm sure you could have a section for global pools, so any changes would be done at that point. rather than individually later.

Maybe this might be a new "feature request". But i'd like some sort of pool switching between scrypt and keccak coins. There is cgminer build of keccak available, and i do understand that cgminer will need to quit, and restarted with the --keccak switch instead

nicoschtein commented 10 years ago

I like what chris said, i can help with that too.

Daniel, I will be implementing that for myself too so please put that in a new Issue so it is better to track and i can submit a PR with that.

2014-02-08 22:37 GMT-03:00 Daniel N notifications@github.com:

I'll leave it upto you guys, but i'm sure you could have a section for global pools, so any changes would be done at that point. rather than individually later.

Maybe this might be a new "feature request". But i'd like some sort of pool switching between scrypt and keccak coins. There is cgminer build of keccak available, and i do understand that cgminer will need to quit, and restarted with the --keccak switch instead

Reply to this email directly or view it on GitHubhttps://github.com/prdatur/phpminer/issues/2#issuecomment-34562606 .

prdatur commented 10 years ago

I have already started and mostly finished this pool checkbox "rig based" so don't investigate too much time :) But the keccak request is still open so if you want, do the stuff :)

DanielNagy commented 10 years ago

the naming for rig based is a little too funky in my own opinion ...

I think you should drop the " rb " prefix..

ie MPOS has username.workername

here is an example of what mines resulted with

For rig "miner01" the required usernames is: "username._rb_miner01"
For rig "miner02" the required usernames is: "username._rb_miner02"
For rig "miner03" the required usernames is: "username._rb_miner03"
---8<---

considering i already have workernames based miner01, miner02, miner03, etc, kinda makes a little more sense.

if there's a valid reason for rb prefix, i may have missed it.. But for now i will modified my code so its straight rigname, so my username is "username."

For rig "miner01" the required usernames is: "username.miner01"
For rig "miner02" the required usernames is: "username.miner02"
For rig "miner03" the required usernames is: "username.miner03"

Ok update.. had a look at the code, and i can see why you have a prefix now. couldnt you check if the pool is a rig based username based on a variable associated with the pool, rather than a reg check of the username containing rb?

nicoschtein commented 10 years ago

What rb prefix are you talking about?? Where did that come from?

DanielNagy commented 10 years ago

Pull latest git, prdatur has implemented rig based usernames, when you add a pool it will give you an example of username for each rig when enabled. It had a "rb" prefix to the rig name

prdatur commented 10 years ago

No I can't remove that. Let me explain. To find out the current active pool group i have to setup a uniq identifier. For this i can only take url + username, this will give me a uniq identity for that pool. When you now enable rig based pool you have configurated for example username "user.miner01" but within the miner the user is added as "user.miner01_rig01". Now phpminer can not find the correct pool because within the miner the username is different. I added the rb string to always remove "rb" and the rest of the username so i have the "original" clean username which is als configurated, so they match again. Hope i explained it good enough :)

The format .rb{rigname} could be good enough. The only bad thing is that nobody can have a username with the substring .rb else I would get false positives when removing the "rig based"-appends.

DanielNagy commented 10 years ago

ok, there's a bug..

Switched my miners to a new pool created with rig based usernames

I restarted one of my rigs, and it never came back. upon investigation, cgminer could not start due to username error on stratum.

looking at cgminer.conf, it has "username." ie, the worker name was not parsed in.

So, you can change a miner group. But unfortunately, if cgminer needs to restart, it fails because the rig based username is not present in cgminer.conf

prdatur commented 10 years ago

fixed it, please test :)

DanielNagy commented 10 years ago

Yep looks good :)

DanielNagy commented 10 years ago

ok, i've found a bug.

So, a pool group has 2 pools in it.

first pool - wallet address second pool - rb username

I deleted the first pool. and created a new pool in this group. so it was to look like this

first pool - _rb_username secondpool - wallet address

However, when i looked at the "P" details on cgminer, it showed the second pool had the wallet addressrb

So it seemed to basically lost sync

After get config ran, new pool groups were created "auto created groups for miner xx"

And there was 3 pools.. the 1st, the 2nd, and the new 3rd one with a rb added to the wallet address

prdatur commented 10 years ago

I will reopen this issue, and will check it if it still exists after the new database structure has been fully developed.

prdatur commented 10 years ago

I followed exactly the steps as you told: Created group ISSUE added 2 Pools. first normal, second rig based. Switched to that group so it is the active one. Removed pool 1. Looked at cgminer console => switch pool to second pool => ok, pool 1 removed => ok. Now I added another different pool without rig based and cgminer P output was correct. First pool now is rb and second is normal.

Please verify with the latest version.

prdatur commented 10 years ago

Due to no answer, i think it is resolved now.