Skip to content

Commit

Permalink
split usage of "masternode" command: "start" for local Hot and "start…
Browse files Browse the repository at this point in the history
…-<mode>" for remote"

Closed #605
  • Loading branch information
UdjinM6 authored and schinzelh committed Sep 12, 2015
1 parent f68a5d8 commit 02dfe6b
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 47 deletions.
90 changes: 56 additions & 34 deletions doc/guide-startmany.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
There are many ways to setup a wallet to support start-many. This guide will walk through two of them.

1. [Importing an existing wallet (recommended if you are consolidating wallets).](#option1)
2. [Sending 1,000 DASH to new wallet addresses.](#option2)
2. [Sending 1000 DASH to new wallet addresses.](#option2)

## <a name="option1"></a>Option 1. Importing an existing wallet

This is the way to go if you are consolidating multiple wallets into one that supports start-many.

### From your single-instance MasterNode Wallet
### From your single-instance Masternode Wallet

Open your QT Wallet and go to console (from the menu select Tools => Debug Console)
Open your QT Wallet and go to console (from the menu select `Tools` => `Debug Console`)

Dump the private key from your MasterNode's pulic key.

Expand All @@ -23,9 +23,9 @@ dumpprivkey [mn_public_key]

Copy the resulting priviate key. You'll use it in the next step.

### From your multi-instance MasterNode Wallet
### From your multi-instance Masternode Wallet

Open your QT Wallet and go to console (from the menu select Tools => Debug Console)
Open your QT Wallet and go to console (from the menu select `Tools` => `Debug Console`)

Import the private key from the step above.

Expand All @@ -49,109 +49,131 @@ The wallet will re-scan and you will see your available balance increase by the
3. Fill in the form to request a payment.
* Label: mn01
* Amount: 1000 (optional)
* Click *Request payment*
* Click *Request payment* button
5. Click the *Copy Address* button

Create a new wallet address for each MasterNode.
Create a new wallet address for each Masternode.

Close your QT Wallet.

### Send 1,000 DASH to New Addresses
### Send 1000 DASH to New Addresses

Just like setting up a standard MN. Send exactly 1,000 DASH to each new address created above.
Just like setting up a standard MN. Send exactly 1000 DASH to each new address created above.

### Create New Masternode Private Keys

Open your QT Wallet and go to console (from the menu select Tools => Debug Console)
Open your QT Wallet and go to console (from the menu select `Tools` => `Debug Console`)

Issue the following:

```masternode genkey```

*Note: A masternode private key will need to be created for each MasterNode you run. You should not use the same masternode private key for multiple MasterNodes.*
*Note: A masternode private key will need to be created for each Masternode you run. You should not use the same masternode private key for multiple Masternodes.*

Close your QT Wallet.

## <a name="masternodeconf"></a>Create masternode.conf file

Remember... this is local. Make sure your QT is not running.

Create the masternode.conf file in the same directory as your wallet.dat.
Create the `masternode.conf` file in the same directory as your `wallet.dat`.

Copy the masternode private key and correspondig collateral output transaction that holds the 1K DASH.
Copy the masternode private key and correspondig collateral output transaction that holds the 1000 DASH.

The masternode private key may be an existing key from [Option 1](#option1), or a newly generated key from [Option 2](#option2).

*Please note, the masternode priviate key is not the same as a wallet private key. Never put your wallet private key in the masternode.conf file. That is equivalent to putting your 1,000 DASH on the remote server and defeats the purpose of a hot/cold setup.*
*Note: The masternode priviate key is **not** the same as a wallet private key. **Never** put your wallet private key in the masternode.conf file. That is almost equivalent to putting your 1000 DASH on the remote server and defeats the purpose of a hot/cold setup.*

### Get the collateral output

Open your QT Wallet and go to console (from the menu select Tools => Debug Console)
Open your QT Wallet and go to console (from the menu select `Tools` => `Debug Console`)

Issue the following:

```masternode outputs```

Make note of the hash (which is your collaterla_output) and index.
Make note of the hash (which is your collateral_output) and index.

### Enter your MasterNode details into your masternode.conf file
### Enter your Masternode details into your masternode.conf file
[From the dash github repo](https://github.com/darkcoin/darkcoin/blob/master/doc/masternode_conf.md)

The new masternode.conf format consists of a space seperated text file. Each line consisting of an alias, IP address followed by port, masternode private key, collateral output transaction id and collateral output index, donation address and donation percentage (the latter two are optional and should be in format "address:percentage").
`masternode.conf` format is a space seperated text file. Each line consisting of an alias, IP address followed by port, masternode private key, collateral output transaction id and collateral output index.

```
alias ipaddress:port masternode_private_key collateral_output collateral_output_index donationin_address:donation_percentage
alias ipaddress:port masternode_private_key collateral_output collateral_output_index
```



Example:

```
mn01 127.0.0.1:9999 93HaYBVUCYjEMeeH1Y4sBGLALQZE1Yc1K64xiqgX37tGBDQL8Xg 2bcd3c84c84f87eaa86e4e56834c92927a07f9e18718810b92e0d0324456a67c 0
mn02 127.0.0.2:9999 93WaAb3htPJEV8E9aQcN23Jt97bPex7YvWfgMDTUdWJvzmrMqey aa9f1034d973377a5e733272c3d0eced1de22555ad45d6b24abadff8087948d4 0 7gnwGHt17heGpG9Crfeh4KGpYNFugPhJdh:25
mn02 127.0.0.2:9999 93WaAb3htPJEV8E9aQcN23Jt97bPex7YvWfgMDTUdWJvzmrMqey aa9f1034d973377a5e733272c3d0eced1de22555ad45d6b24abadff8087948d4 0
```

## What about the dash.conf file?

If you are using a masternode.conf file you no longer need the dash.conf file. The exception is if you need custom settings (thanks oblox).
If you are using a `masternode.conf` file you no longer need the `dash.conf` file. The exception is if you need custom settings (_thanks oblox_). In that case you **must** remove `masternode=1` from local `dash.conf` file. This option should be used only to start local Hot masternode now.

## Update dash.conf on server

If you generated a new masternode private key, you will need to update the remote dash.conf files.
If you generated a new masternode private key, you will need to update the remote `dash.conf` files.

Shut down the daemon and then edit the file.

```sudo nano .dash/dash.conf```
```nano .dash/dash.conf```

### Edit the masternodeprivkey
If you generated a new masternode private key, you will need to update the masternodeprivkey value in your remote dash.conf file.
If you generated a new masternode private key, you will need to update the `masternodeprivkey` value in your remote `dash.conf` file.

## Start your MasterNodes
## Start your Masternodes

### Remote

If your remote server is not running, start your remote daemon as you normally would.

I usually confirm that remote is on the correct block by issuing:
You can confirm that remote server is on the correct block by issuing

```dashd getinfo```

And compare with the official explorer at http://explorer.dashpay.io/chain/Dash
and comparing with the official explorer at http://explorer.dashpay.io/chain/Dash

### Local

Finally... time to start from local.

#### Open up your QT Wallet

From the menu select Tools => Debug Console
From the menu select `Tools` => `Debug Console`

If you want to review your masternode.conf setting before starting the MasterNodes, issue the following in the Debug Console:
If you want to review your `masternode.conf` setting before starting Masternodes, issue the following in the Debug Console:

```masternode list-conf```

Give it the eye-ball test. If satisfied, you can start your nodes one of two ways.
Give it the eye-ball test. If satisfied, you can start your Masternodes one of two ways.

1. `masternode start-alias [alias_from_masternode.conf]`
Example ```masternode start-alias mn01```
2. `masternode start-many`

## Verify that Masternodes actually started

### Remote

Issue command `masternode status`
It should return you something like that:
```
dash-cli masternode status
{
"vin" : "CTxIn(COutPoint(<collateral_output>, <collateral_output_index>), scriptSig=)",
"service" : "<ipaddress>:<port>",
"pubkey" : "<1000 DASH address>",
"status" : "Masternode successfully started"
}
```
Command output should have "_Masternode successfully started_" in its `status` field now. If it says "_not capable_" instead, you should check your config again.

### Local

Search your Masternodes on https://dashninja.pl/masternodes.html

1. masternode start-alias [alias_from_masternode.conf]. Example ```masternode start-alias mn01```
2. masternode start-many
_Hint: Bookmark it, you definitely will be using this site a lot._
18 changes: 8 additions & 10 deletions doc/masternode_conf.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
Multi masternode config
=======================

The multi masternode config allows to control multiple masternodes from a single wallet. The wallet needs to have a valid collaral output of 1000 coins for each masternode. To use this, place a file named masternode.conf in the data directory of your install:
The multi masternode config allows to control multiple masternodes from a single wallet. The wallet needs to have a valid collaral output of 1000 coins for each masternode. To use this, place a file named `masternode.conf` in the data directory of your install:
* Windows: %APPDATA%\Dash\
* Mac OS: ~/Library/Application Support/Dash/
* Unix/Linux: ~/.dash/

The new masternode.conf format consists of a space seperated text file. Each line consisting of an alias, IP address followed by port, masternode private key, collateral output transaction id, collateral output index, donation address and donation percentage (the latter two are optional and should be in format "address:percentage").
`masternode.conf` format is a space seperated text file. Each line consisting of an alias, IP address followed by port, masternode private key, collateral output transaction id and collateral output index.

Example:
```
mn1 127.0.0.2:19999 93HaYBVUCYjEMeeH1Y4sBGLALQZE1Yc1K64xiqgX37tGBDQL8Xg 2bcd3c84c84f87eaa86e4e56834c92927a07f9e18718810b92e0d0324456a67c 0
mn2 127.0.0.3:19999 93WaAb3htPJEV8E9aQcN23Jt97bPex7YvWfgMDTUdWJvzmrMqey aa9f1034d973377a5e733272c3d0eced1de22555ad45d6b24abadff8087948d4 0 7gnwGHt17heGpG9Crfeh4KGpYNFugPhJdh:33
mn3 127.0.0.4:19999 92Da1aYg6sbenP6uwskJgEY2XWB5LwJ7bXRqc3UPeShtHWJDjDv db478e78e3aefaa8c12d12ddd0aeace48c3b451a8b41c570d0ee375e2a02dfd9 1 7gnwGHt17heGpG9Crfeh4KGpYNFugPhJdh
mn2 127.0.0.3:19999 93WaAb3htPJEV8E9aQcN23Jt97bPex7YvWfgMDTUdWJvzmrMqey aa9f1034d973377a5e733272c3d0eced1de22555ad45d6b24abadff8087948d4 0
mn3 127.0.0.4:19999 92Da1aYg6sbenP6uwskJgEY2XWB5LwJ7bXRqc3UPeShtHWJDjDv db478e78e3aefaa8c12d12ddd0aeace48c3b451a8b41c570d0ee375e2a02dfd9 1
```

In the example above:
* the collateral for mn1 consists of transaction http://test.explorer.dash.fr/tx/2bcd3c84c84f87eaa86e4e56834c92927a07f9e18718810b92e0d0324456a67c, output index 0 has amount 1000
* masternode 2 will donate 33% of its income
* masternode 3 will donate 100% of its income
* the collateral for `mn1` is output `0` of transaction http://test.explorer.dash.fr/tx/2bcd3c84c84f87eaa86e4e56834c92927a07f9e18718810b92e0d0324456a67c and it has amount of 1000 DASH


The following new RPC commands are supported:
* list-conf: shows the parsed masternode.conf
* start-alias \<alias\>
* stop-alias \<alias\>
* start-missing
* start-disabled
* start-many
* stop-many
* outputs: list available collateral output transaction ids and corresponding collateral output indexes

When using the multi masternode setup, it is advised to run the wallet with 'masternode=0' as it is not needed anymore.
When using remote masternode setup, you **must** remove `masternode=1` from local `dash.conf` file if you had it there in previous versions. This option should be used only to start local Hot masternode now.
6 changes: 3 additions & 3 deletions src/rpcmasternode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ Value masternode(const Array& params, bool fHelp)
" genkey - Generate new masternodeprivkey\n"
" enforce - Enforce masternode payments\n"
" outputs - Print masternode compatible outputs\n"
" start - Start masternode configured in dash.conf\n"
" start-alias - Start single masternode by assigned alias configured in masternode.conf\n"
" start-<mode> - Start masternodes configured in masternode.conf (<mode>: 'all', 'missing', 'disabled')\n"
" start - Start local Hot masternode configured in dash.conf\n"
" start-alias - Start single remote masternode by assigned alias configured in masternode.conf\n"
" start-<mode> - Start remote masternodes configured in masternode.conf (<mode>: 'all', 'missing', 'disabled')\n"
" status - Print masternode status information\n"
" list - Print list of all known masternodes (see masternodelist for more info)\n"
" list-conf - Print masternode.conf in JSON format\n"
Expand Down

0 comments on commit 02dfe6b

Please sign in to comment.