Advertisement
Guest User

Masternode Setup v1.0

a guest
Dec 9th, 2017
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.09 KB | None | 0 0
  1. # Masternode Guide
  2.  
  3. Steps below set up a cold storage node, this means the collateral remains in your cold wallet that you can take offline to keep the funds secure. In an ideal world, a 'cold wallet' is a cheap computer you use only to manage crypto wallets and you unplug it when you are not using it. At the end of the guide, there is an option to receive the rewards from the Masternode in a hot wallet that is online for staking
  4.  
  5. ## Required
  6.  
  7. * 500.000 force as collateral for the Masternode.
  8. * Remote computer to run the Masternode, this is usually a VPS.
  9. * A secure computer to run the cold wallet that holds collateral.
  10. * Optionally a third computer that runs a hot wallet to receive rewards.
  11.  
  12. ## Setup
  13.  
  14. ### Stage 01
  15.  
  16. On the cold wallet
  17.  
  18. 1) Generate a Masternode key
  19.  
  20. In the wallet menu go to:
  21. Help > Debug Window > Console
  22.  
  23. A new window opens up with the console in here type:
  24. ~~~
  25. masternode genkey
  26. ~~~
  27.  
  28. The return value of this command is your Masternodes key, this key is used to prove you own the collateral for the node without having to share the private key that is able to spend the coins.
  29.  
  30. 2) Create a collateral address
  31.  
  32. In the wallet menu go to:
  33. Help > Debug Window > Console
  34.  
  35. A new window opens up with the console in here type:
  36. ~~~
  37. getaccountaddress masternode
  38. ~~~
  39.  
  40. This command will return an address you send the fund to. Note: 'masternode' is the label of the address in the wallet, if you have multiple Masternodes it is best to create a unique address and label per node.
  41.  
  42. 3) Setup the collateral
  43.  
  44. Send the 500k force to the address generated in the previous step, this needs to be done in one transaction. (if multiple transactions are used it is not possible to get the correct txid with vin to identify the collateral)
  45.  
  46. To use the collateral one needs to get the transaction id (txid) and the index of the output value (vin) in that transaction.
  47.  
  48. a) Use the debug console
  49.  
  50. Open the console as before, type in the command:
  51. ~~~
  52. masternode outputs
  53. ~~~
  54.  
  55. This returns a list of key-value pairs (or just one value pair) that holds the info needed. One of the key value pairs is new txid and vin for the Masternode.
  56.  
  57. ~~~
  58. {
  59. "<letters and numbers>":"<0 or 1>",
  60. "<letters and numbers>":"<0 or 1>",
  61. ...
  62. }
  63. ~~~
  64.  
  65. b) Use the explorer
  66.  
  67. Look up the address on the explorer http://for.explorerz.top:3027, sins it is a new address and only one transaction should be sent to it you can see the transaction id.
  68.  
  69. By clicking on the transaction id you can see the outputs, assuming that the transaction has a remainder you will see two Recipients. One is the collateral the other is the change; if the collateral is above the change or there is no change your vin is 0 else it is 1.
  70.  
  71. ### Stage 02
  72.  
  73. On the remote server.
  74.  
  75. Note: Setting up a secure and stable server is a whole topic of its own. Sins this guide only looks at a cold wallet setup your funds are never at risk because they remain on the cold wallet and the server has no info to spend them.
  76.  
  77. Note: The guide assumes you are able to set up a VPS and connect to it using putty or some other secure shell. The second assumption is that you are using Ubuntu 16.04 as Operating System (OS) on the virtual private server (VPS).
  78.  
  79. Providers:
  80. https://www.vultr.com/
  81. https://www.digitalocean.com/
  82.  
  83. a) Using setup script
  84.  
  85. ~~~
  86. wget https://raw.githubusercontent.com/forceunited/force-masternode-setup-ubuntu/master/16-04-setup.sh
  87. ~~~
  88.  
  89. Next make the script executable and then execute it.
  90. ~~~
  91. chmod +x 16-04-setup.sh
  92. ./16-04-setup.sh
  93. ~~~
  94.  
  95. The script will install the force daemon and ask you for info required to configure the Masternode. After the script is done it will exit and the master node will remain active waiting for it's start command from the cold wallet. Once it is done you can exit the VPS and continue with 'Stage 3'; when the script fails try a manual setup or ask for help.
  96.  
  97. Info Required:
  98. ~~~
  99. Password: used to secure the RPC interface of the node.
  100. Masternode Key: Masternode key generated on the cold wallet.
  101. The IP Address: public address of VPS server the node runs on.
  102. ~~~
  103.  
  104. Note: The script says to use port '37245' but further down this guide uses port '37246' both ports will work but if you ever need to interact with the RPC interface of the node using port '37245' will require you to do some extra configuration. (some monitoring tools require RPC access to the node to check it's status)
  105.  
  106. No matter what port you use it needs to be the same on the VPS and the cold wallet!
  107.  
  108. b) Manual setup
  109.  
  110. In case the script fails or you are using a different OS, a manual install might be required.
  111.  
  112. Update and install deps:
  113. ~~~
  114. sudo apt-get update -y
  115. sudo apt-get dist-upgrade -y
  116. sudo apt-get -y update
  117. sudo apt-get -y install build-essential libssl-dev libdb+-dev libboost-all-dev libcrypto++-dev libqrencode-dev libminiupnpc-dev libgmp-dev libgmp3-dev autoconf autogen automake libtool unzip
  118. ~~~
  119.  
  120. Get source (adjust for last version)
  121. ~~~
  122. wget https://github.com/forceunited/force/archive/v3.6.0.0.tar.gz
  123. tar xvf v3.6.0.0.tar.gz
  124. rm v3.6.0.0.tar.gz
  125. cd force-3.6.0.0/
  126. ~~~
  127.  
  128. Build and copy the executable
  129. (the make command will take a while)
  130. ~~~
  131. cd src
  132. make -f makefile.unix
  133. cp ./Forced ~/Forced
  134. cd ~/
  135. ~~~
  136.  
  137. Setup the configuration
  138. ~~~
  139. mkdir ~/.Force
  140. nano ~/.Force/Force.conf
  141. ~~~
  142.  
  143. Put the info below in the configuration file and replace '<...>' with your info.
  144. ~~~
  145. rpcuser=<my-random-unused-name>
  146. rpcpassword=<my-random-unused-pass>
  147. rpcallowip=127.0.0.1
  148. listen=1
  149. server=1
  150. daemon=1
  151. staking=0
  152. masternodeaddr=<vps ip>:37246
  153. masternode=1
  154. masternodeprivkey=<masternode key>
  155. ~~~
  156.  
  157. Start the node (enter to go back)
  158. ~~~
  159. ./Forced -daemon
  160. ~~~
  161.  
  162. Make sure it is running
  163. ~~~
  164. ./Forced getinfo
  165. ~~~
  166.  
  167. At this point, your node is ready for the start command to be sent from the cold wallet. Log out of the VPS and make sure it keeps running.
  168.  
  169. ### Stage 03
  170.  
  171. Back on the cold wallet.
  172.  
  173. In the wallet go to:
  174. Supernodes > My Master Nodes > Create ...
  175.  
  176. A new window pops up asking you for node info.
  177.  
  178. ~~~
  179. Alias: <a name for the node>
  180. Address: <vps ip>:<37245 or 37246>
  181. PrivKey: <masternode key>
  182. TxHash: <txid>
  183. Output Index: <vin>
  184. Reward Address: <optional other address to recieve rewards>
  185. Reward %: <optional percentage of coins to send to other address>
  186. ~~~
  187.  
  188. Press 'ok' and then 'update' in the main window. The node should now be visible in the list and you can select it followed by the 'start' button to get the node running. Leave the cold wallet open for a while so it can send the command out to other nodes and shortly after you should see rewards coming in. (How long till the first reward depends on network state)
  189.  
  190. ## Done
  191.  
  192. That is all there is to it, enjoy the returns and hold.
  193.  
  194. ## Thoughts
  195.  
  196. How is the Masternode key linked to the collateral? When starting the node from your cold wallet the cold wallet will use the private key of the collateral to sign the Masternode key. Other nodes on the network can then verify this signature as proof that the Masternode key is owned by the holder of the collateral. The Masternode key is then used by the Masternode to sign Masternode operations.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement