Masternode setup on Windows with 2 wallets
In the article https://docs.win.win/twins/english-documentation/twins-masternodes-1/masternode-setup-on-windows-with-1-wallet we describe how to set up a masternode on Windows with 1 wallet. In this manual we will use two TWINS wallets to set up a masternode on Windows.
In this guide we will refer to the two wallets as a remote wallet and a local wallet. We call a wallet local if we store our TWINS coins in it, use it to send and receive payments, and stake. We call a wallet a remote wallet if it is empty, blank and only has one purpose – to be always online with a static IP address and store the masternode private key.
First of all, we need to explain the downsides and limitations of using one wallet for both purposes, instead of two wallets as per this guide. When we use just one wallet, this poses a security risk because your wallet is always online with a known masternode IP address. Somebody can use this information to gain access to your TWINS wallet and coins. The single IP address in use is also a limitation factor because you will only be able to start one copy of the same wallet. If you know that you don't have additional hardware and won’t plan to start more than one masternode, that option makes sense. However, if you like to separate your coins and masternode, please continue below.
The masternode requires the remote wallet to be on a VPS server or a computer with a static IP address, always on and stay connected. We first start with the local wallet, which contains your coins that are used for staking as well as sending the masternode payment. We won’t cover the TWINS wallet setup process because it is described in the following article: https://docs.win.win/twins/english-documentation/twins-wallet/windows. We presume that you already have a TWINS wallet installed on your PC or laptop.
- To start, we need a masternode private key. We have to generate it. Let’s open our local wallet and go to Tools > Debug console. In the console type the text
- Copy the result somewhere - in Notepad for example. It will look something like 93HaYBVUCYjEMeeH1Y4sBGLALQZE1Yc1K64xiqgX37tGBDQL8Xg (Image 1).
- Now you have to enter the lines below Image 2 into the configuration file twins.conf on your remote wallet (on your VPS server or second computer). You can access it directly in the folder where your wallet is installed, or click Tools > Open Wallet Configuration Files (Image 2). If you see a system request regarding which program you want to open it with, you can choose Notepad again.
You have to write (or paste) the following information inside:
rpcuser=LongRandomUsername rpcpassword=LongerRandomPassword rpcallowip=127.0.0.1 server=1 daemon=1 logtimestamps=1 maxconnections=256 masternode=1 externalip=18.104.22.168 port=37817 masternodeprivkey=93HaYBVUCYjEMeeH1Y4sBGLALQZE1Yc1K64xiqgX37tGBDQL8Xg
- After you have finished editing the twins.conf file and saved it, close the remote wallet and start it again. All necessary changes will have been integrated.
- We will now go to the local wallet. You need to send exactly 1 million TWINS (1,000,000) to any of your wallet addresses. For better clarity you can name this address during the creation process. How to do this is described in the manual Using the wallet - https://docs.win.win/twins/english-documentation/twins-wallet/using-your-wallet, or just run the following command via Tools > Debug Console to create a new adress with a suitable name (e.g. MN)
- Now that you have the address ready you can send the 1,000,000 TWINS collateral to it.
- Wait until the first confirmation for the transaction output to be visible in the console. Go to Tools > Debug Console to find out the TXID. Type the command:
- Two fields similar to Image 3 will come up - txhash and outputidx. The results from those will be entered into the masternode.conf file.
- Open the masternode.conf file directly in the wallet folder or via Tools > Open the Masternode Configuration File and fill it in like in the example below:
<MN alias> <unique IP address>:37817 <your MN private key> <transaction ID (txhash)> <output index 0 or 1 (outputidx)>. Also see the example of Image 4.
#Example as per above format:
MN 22.214.171.124:37817 93HaYBVUCYjEMeeH1Y4sBGLALQZE1Yc1K64xiqgX37tGBDQL8Xg 81cd3c84c84f87eaa86e4e56834c92927a07f9e18718810b92e0d0324456a67c 1
- Save and close the conf file and restart your wallet. Wait for the MN collateral transaction to receive 16 confirmations before starting the masternode.
- Go to the Masternodes tab. The new MN should be present with an alias, IP address and the MISSING status, which indicates the masternode has not been started yet.
- In the Transactions tab you can check whether the MN transaction has received at least 16 confirmations. If it has, go back to the Masternodes tab to start the masternode. Right-click on the MN and do Start alias (Image 5). The MISSING status will have changed to ENABLED and your masternode has started. Good job!
- Now you want to double-check the MN status in the remote wallet. Open the console via Tools > Debug console and type
- The latest status will come up with the message Masternode successfully started, similar to Image 6.
"message": "Masternode successfully started"
- For good practice it is best to also check the status on the TWINS explorer website - https://explorer.win.win/masternodes - and find your masternode via the search bar. Your MN status here will be set as Active.