Step 2 – Prepare the MN wallet and its configYou have a choice when preparing the MN wallet. You can either download the pre-compiled binary that was created in an identical environment or compile the binary yourself. If you use the pre-compiled binary, you can skip the A - Compile section and its 10 commands and you do not have to prepare the 2GB VPS and you can continue at the B - Using the pre-compiled binary section. If you decide to compile yourself, then do section A, skip B and do C.
A - Compile section:You now need to deploy another VPS with 2GB of memory. Select everything the same as above except the choose the server with 2GB of memory. Execute the same commands above up to command 11.
Command 1: “cd ~/opt” (This takes you to the directory where you will be compiling the wallet)
Command 2: “git clone https://github.com/warofcoins/WOC2” (This pulls the source code from the git repository into the WOC2 folder in the ~/opt directory)
Command 3: “cd ~/opt/WOC2/src/leveldb” (You must make sure that a specific build file has the correct permissions)
Command 4: “sudo chmod 755 build_detect_platform”
Command 5: “cd ~/opt/WOC2/src”
Command 6: “mkdir ~/opt/WOC2/src/obj/crypto (the dev forgot to add in this empty directory. These things happen from time to time and normally when a compile crashes it is because the directory does not exist where the compiler needs to place some files)
Command 7: “sudo nano makefile.unix” (we need to change a parameter in the unix makefile) Look for the line close to the top that says USE_UPNP:=0 and change the 0 to a 1. (I prefer to have U_PNP enabled at the startup of the wallet.). press ctrl-x to save, say yes and press enter.
Command 8: “sudo make –f makefile.unix” (This starts the compile process to create a headless daemon wallet).
Command 9: When the compile has successfully finished, execute “strip WOC2d” (this command makes the binary smaller by removing all non-essential content from the file.)
Command 10: “scp ~/opt/WOC2/src/WOC2d user@yourMNIPaddress:/home/user/opt” (This command copies the compiled binary from the 2GB VPS to the 768MB VPS. You will be asked to add the destination server locally and just type yes. Also remember to replace yourMNIPaddress with the IP address of the 768MB VPS you created earlier. Also change “user” in user@yourMNIPaddress and also “user” in /home/user/opt with the username you created when you created the 768MB VPS)” You are now done with the 2GB VPS, but before we destroy it, lets first make sure that everything is OK on the 768MB MN VPS.
B - Using the pre-compiled binary section:In your Vultr management console, go to your 768MB VPS and view the console.
Command 1: “cd ~/opt” (go to the directory where the binary will be placed.)
Command 2: "wget
https://bitbucket.org/jc12345/woc2mn/downloads/WOC2d (click
here for Virustotal scan and
here for checksum and
here to download the headless daemon wallet onto a PC)
Command 3: When the file has downloaded execute "sudo chmod 755 WOC2d"
C - Preparing the MN .conf file section:In your Vultr management console, go to your 768MB VPS and view the console.
Command 1: “cd ~/opt”
Command 2: “ls –la” (make sure that the WOC2d binary is there)
Command 3: “./WOC2d” (This creates the file structure in the correct place, but for illustration purposes it also shows you that it could not find a .conf file)
Command 4: “cd ~/WOC2” (Lets go to the folder where the wallet is stored)
Command 5: “ls –la” (just checking that we are in the correct place)
Command 6: “sudo nano WOC2.conf” (Creating the .conf file for the remote masternode)
Type the following into this file:
rpcuser=salkdfhadskljfh
rpcpassword=oasdjfosdajf
rpcallowip=127.0.0.1
rpcport=9988
server=1
listen=1
daemon=1
port=9999
addnode=85.25.214.175
addnode=45.55.165.71
addnode=173.76.30.194
addnode=45.63.122.61
addnode=107.170.57.24
addnode=185.92.222.31
addnode=45.63.1.27
(In the above example the rpc section is not really used, but the wallet wants it to be there. Also note that the rpcport can be anything, as long as it is not already used by another process. The port above can also be anything. The fact that the wallet on the client machine later on suggests port 9999 is just a remnant from the DASH implementation way back that picked port 9999.)
Press ctrl-x to save, type yes and press enter.
Command 7: “sudo ufw deny 22” (shutting down the ability to SSH to the server)
Command 8: “sudo ufw allow 9999” (Allow incoming connections on port 9999)
Command 9: “cd ~/opt”
Command 10: “./WOC2d” (you now start the remote masternode and it will start to sync the blockchain)
Command 9: “./WOC2d” getinfo (like in Windows, the wallet commands in the debug window can be run on the Linux VPS by adding it to the back of ./WOC2d. If you execute this command from time to time you can see that the blocks are increasing as the chain is synced. At this point the Linux remote Masternode is setup and waiting for a connection from the client machine. If the WOC2d daemon is running fine on the VPS and synced up, you can go back to the Vultr control panel and destroy the 2GB VPS. Make sure that you do not destroy the wrong VPS!