Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config clarification #245

Closed
mahnunchik opened this issue Aug 5, 2016 · 7 comments
Closed

Config clarification #245

mahnunchik opened this issue Aug 5, 2016 · 7 comments

Comments

@mahnunchik
Copy link

Hi, could you please clarify some cases:

  • What will happen if I specify multiple witness = some-witness in the config file?
  • What will happen if I specify multiple private-key = some-key in the config file?

Could you please provide a valid configuration for mining on multiple machines.

Thank you!

@mahnunchik
Copy link
Author

  • What will happen if I don't specify witness = * and private-key = * at all ?
  • What will happen if I specify only miner = ["account","WIF PRIVATE KEY"] ?

@abitmore
Copy link
Contributor

abitmore commented Aug 6, 2016

You need to know that

  • witness is for producing blocks (enable block producing for an account or not)
  • private-key and WIF_KEY in miner are for signing the block when it's a configured witness's turn to produce a block
  • miner is for mining POW tickets to produce a block. When a ticket is mined out, the account is put in to the mining queue; the node (a running steemd process) will produce a block when the account reaches the top of queue.

So,

What will happen if I specify multiple witness = some-witness in the config file?

You're monitoring multiple accounts, when any one of them is in turn, the node tries to produce a block with that account.

What will happen if I specify multiple private-key = some-key in the config file?

It depends on how did you configure your witness accounts. Every witness's signing key should be specified here once, otherwise it will fail to produce a block when in turn. Check with command get_witness account_name. You can have multiple witnesses with same key, in this case only need to specify the key once.

What will happen if I don't specify witness = * and private-key = * at all ?

If no witness configured you'll miss the block when it's your turn to produce, thus no block producing reward.
If no private-key configured, and if no miner configured, you'll miss the block as well.
If no private-key configured but have miner configured, and if the witness's signing key is same to the key configured with miner (or witness is not created already), you'll be able to produce blocks when in turn.

What will happen if I specify only miner = ["account","WIF PRIVATE KEY"] ?

With miner configured you'll be able to mine tickets. There was a bug which causes the node to not start mining when no witness configured, but I'm not sure if it's fixed.
If you have only one node and specify only miner, you won't produce blocks thus no block producing reward.
If you have multiple nodes with same account(s) configured as miner(s), you only need (and SHOULD) to add witness to one of them, or even to a new node (for block producing only). If you set same pair of (witness, private-key) in multiple nodes, you'll produce multiple blocks at same time (one block by one node) which will probably lead to network forking, and you'll be punished when the punishment code is enabled (now disabled).

@abitmore
Copy link
Contributor

abitmore commented Aug 6, 2016

@mahnunchik last comment is updated. It was published when I accidentally pressed ctrl+enter but not finished writing.

@mahnunchik
Copy link
Author

@abitmore Thank you!

It's great explanation of the configuration!

Do I understand correctly the following cases:

1) Single node (Single steemd process) - Witness and Miner

miner = ["account", "ACTIVE PRIVATE KEY"]
# The same as in miner
witness = "account"
# The same as in miner
private-key = "ACTIVE PRIVATE KEY"

2) Multiple node configuration (Multiple steemd processes) - Witness + Some Miners

Witness - only one node

witness = "account"
private-key = "ACTIVE PRIVATE KEY"

Miner - one or more nodes

# The same as in witness
miner = ["account", "ACTIVE PRIVATE KEY"]
# Should be specified due to the bug
witness = "account"

Do I understand correctly that it is enough to specify active private key in both cases?

@abitmore
Copy link
Contributor

abitmore commented Aug 8, 2016

@mahnunchik:

  1. With single node, you don't need to specify private-key unless your active key and signing key are different.
  2. With multiple nodes,
  • in the witness node, you should use signing key for private-key (if a signing key is created already and not same as active key)
  • in miner nodes, if your account's active key is same as signing key, please don't set the account as witness. You can set a dummy account as witness, e.g. witness = "dummy".

@mahnunchik
Copy link
Author

@abitmore Thank you again!

@theoreticalbts
Copy link
Contributor

Closing, I don't think there's any actual bug here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants