Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Masternode Guide
- 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
- ## Required
- * 500.000 force as collateral for the Masternode.
- * Remote computer to run the Masternode, this is usually a VPS.
- * A secure computer to run the cold wallet that holds collateral.
- * Optionally a third computer that runs a hot wallet to receive rewards.
- ## Setup
- ### Stage 01
- On the cold wallet
- 1) Generate a Masternode key
- In the wallet menu go to:
- Help > Debug Window > Console
- A new window opens up with the console in here type:
- ~~~
- masternode genkey
- ~~~
- 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.
- 2) Create a collateral address
- In the wallet menu go to:
- Help > Debug Window > Console
- A new window opens up with the console in here type:
- ~~~
- getaccountaddress masternode
- ~~~
- 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.
- 3) Setup the collateral
- 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)
- To use the collateral one needs to get the transaction id (txid) and the index of the output value (vin) in that transaction.
- a) Use the debug console
- Open the console as before, type in the command:
- ~~~
- masternode outputs
- ~~~
- 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.
- ~~~
- {
- "<letters and numbers>":"<0 or 1>",
- "<letters and numbers>":"<0 or 1>",
- ...
- }
- ~~~
- b) Use the explorer
- 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.
- 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.
- ### Stage 02
- On the remote server.
- 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.
- 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).
- Providers:
- https://www.vultr.com/
- https://www.digitalocean.com/
- a) Using setup script
- ~~~
- wget https://raw.githubusercontent.com/forceunited/force-masternode-setup-ubuntu/master/16-04-setup.sh
- ~~~
- Next make the script executable and then execute it.
- ~~~
- chmod +x 16-04-setup.sh
- ./16-04-setup.sh
- ~~~
- 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.
- Info Required:
- ~~~
- Password: used to secure the RPC interface of the node.
- Masternode Key: Masternode key generated on the cold wallet.
- The IP Address: public address of VPS server the node runs on.
- ~~~
- 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)
- No matter what port you use it needs to be the same on the VPS and the cold wallet!
- b) Manual setup
- In case the script fails or you are using a different OS, a manual install might be required.
- Update and install deps:
- ~~~
- sudo apt-get update -y
- sudo apt-get dist-upgrade -y
- sudo apt-get -y update
- 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
- ~~~
- Add ppa and install required db
- ~~~
- sudo add-apt-repository ppa:bitcoin/bitcoin
- sudo apt-get update
- sudo apt-get install -y libdb4.8-dev libdb4.8++-dev
- ~~~
- Get source (adjust for last version)
- ~~~
- wget https://github.com/forceunited/force/archive/v3.7.0.0.tar.gz
- tar xvf v3.7.0.0.tar.gz
- rm v3.7.0.0.tar.gz
- cd force-3.7.0.0/
- ~~~
- Build and copy the executable
- (the make command will take a while)
- ~~~
- cd src
- make -f makefile.unix
- cp ./Forced ~/Forced
- cd ~/
- ~~~
- Setup the configuration
- ~~~
- mkdir ~/.Force
- nano ~/.Force/Force.conf
- ~~~
- Put the info below in the configuration file and replace '<...>' with your info.
- ~~~
- rpcuser=<my-random-unused-name>
- rpcpassword=<my-random-unused-pass>
- rpcallowip=127.0.0.1
- listen=1
- server=1
- daemon=1
- staking=0
- masternodeaddr=<vps ip>:37246
- masternode=1
- masternodeprivkey=<masternode key>
- ~~~
- Start the node (enter to go back)
- ~~~
- ./Forced -daemon
- ~~~
- Make sure it is running
- ~~~
- ./Forced getinfo
- ~~~
- 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.
- ### Stage 03
- Back on the cold wallet.
- In the wallet go to:
- Supernodes > My Master Nodes > Create ...
- A new window pops up asking you for node info.
- ~~~
- Alias: <a name for the node>
- Address: <vps ip>:<37245 or 37246>
- PrivKey: <masternode key>
- TxHash: <txid>
- Output Index: <vin>
- Reward Address: <optional other address to recieve rewards>
- Reward %: <optional percentage of coins to send to other address>
- ~~~
- 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)
- Note: To start a node the wallet needs to be unlocked, if it is encrypted and locked the wallet is unable to allocate the vin for the masternode. (aka it is unable to sign the start message)
- ## Done
- That is all there is to it, enjoy the returns and hold.
- ## Thoughts
- 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.
- ## Updating
- If new updates come out it is not required to repeat all steps mentioned above. You just update the cold wallet as you would any other wallet and then you have to update the remote Masternode on the VPS before starting the master node again from the cold wallet.
- a) Using setup script
- Simply remove the old script, download the new one and run it again. Note that this will require the info you used the first time again.
- ~~~
- rm ./16-04-setup.sh
- wget https://raw.githubusercontent.com/forceunited/force-masternode-setup-ubuntu/master/16-04-setup.sh
- chmod +x 16-04-setup.sh
- ./16-04-setup.sh
- ~~~
- b) Manual setup
- When using the manual setup the source needs to be compiled again but configuration stayed in place.
- Remove old app (adjust for old version)
- ~~~
- rm -r ./force-3.6.0.0
- rm ./Forced
- ~~~
- Before building the updated node it is good to make sure your vps is up-to-date as well
- ~~~
- sudo apt-get update -y
- sudo apt-get dist-upgrade -y
- sudo apt-get -y update
- ~~~
- Reboot (and reconnect)
- ~~~
- sudo shutdown -r now
- ~~~
- Get source (adjust for last version)
- ~~~
- wget https://github.com/forceunited/force/archive/v3.7.0.0.tar.gz
- tar xvf v3.7.0.0.tar.gz
- rm v3.7.0.0.tar.gz
- cd force-3.7.0.0/
- ~~~
- Build and copy the executable
- (the make command will take a while)
- ~~~
- cd src
- make -f makefile.unix
- cp ./Forced ~/Forced
- cd ~/
- ~~~
- Reboot (and reconnect)
- ~~~
- sudo shutdown -r now
- ~~~
- Start the node and check it.
- ~~~
- ./Forced -daemon
- ./Forced getinfo
- ~~~
- Once this is done it might be required to go to the cold wallet and execute the start command again from the 'Supernodes' -> 'My Master Nodes' window.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement