Author Topic: Masternodes: About, Installation, and FAQ (ATTENTION: only for Testnet so far)  (Read 6563 times)

MyFarm

  • Sr. Member
  • ****
  • Posts: 259
    • View Profile
Mr. Spread, the developer behind Spreadcoin has created a masternode network.  Masternodes are nodes which have a certain amount of Spreadcoin locked within them and add additional functionality to the Spreadcoin network.  In return for this functionality, Spreadcoin masternode owners receive a percentage of Spreadcoin mined in each block (currently 30% on testnet).  The concept was originally developed by Evan Duffield of Darkcoin fame but Spreadcoin masternodes have been rewritten from scratch.

To learn more about masternodes, please proceed to the next post or click here.

To learn how to install a masternode on your home computer, proceed to the third post in this thread or click here.

To learn how to install a masternode on your VPS, proceed to the fourth post in this thread or click here.

To read the masternode FAQ, proceed to the fifth post in this thread or click here.

MyFarm

  • Sr. Member
  • ****
  • Posts: 259
    • View Profile
Re: Masternodes: About, Installation, and FAQ
« Reply #1 on: February 11, 2015, 09:39:15 pm »
About Masternodes

At present, masternodes are in testing on testnet.  You can see the first round of testing here and the second round of testing here.

All the numbers in this post describe testnet, they can change when we introduce masternodes to mainnet.

Is SpreadCoin implementation based on DarkCoin code?
No, this is original implementation.

How is it different from DarkCoin?
In SpreadCoin there are no centralized reference nodes to decide which masternodes should receive payments, it is decided by the network in decentralized manner. In DarkCoin the messages which select masternodes are separate from the blockchain and are distributed independently. This way it is possible that nodes will have different opinion on what masternode should receive next payment. In SpreadCoin all votes for masternodes will be stored in blocks and the payee will be uniquely determined from the previous blocks. Just like you can check that any transaction included in the block is correct by comparing its inputs with outputs in previous blocks you will be able to check that masternode payment is correct by checking previous blocks. Why bitcoin is so reliable? Because all nodes have exactly the same rules how to determine which blockchains are correct and which one is better (required more work) than others, these rules are only depended on blocks themselves, not on the order in which they were received them nor on any other messages which you may or may not receive in time. The network can be unstable in the case of some major event which will break connectivity between nodes but once connectivity between nodes is reestablished all nodes will stick to the same blockchain. The same will apply to SpreadCoin.

How masternodes are elected?
Each node monitor the network and assign scores to each masternode. This scores depend on how well masternodes provide their services, for instant transactions this will be time delay between transaction and its confimation by masternode. Since there may be no transactions and only elected masternodes will confirm transactions there is an empty service - each masternode will broadcast messages signining certain blocks to prove that it is running. Miners will include votes in their blocks. Votes can either be positive (elect not yet elected masternode) or negative (deelect already elected masternode). If masternode has more than 30 positive votes in the last 60 blocks then it is added to the list of elected masternodes. If masternode has more then 30 negative votes in the last 60 blocks then it is removed from the list of elected masternodes. Note that it is possible to determine which masternodes were elected at each particular block.

Can miners cheat to elect their own masternodes?
The system is designed in such a way that all miners will make almost the same votes. Thus, unless you control more than 50% of the hashrate you couldn't actually affect the voting process because you will be outvoted by the rest of the network.

Wouldn't storing votes in blockchain make it too large?
No, there is a limit of 10 votes per block and most blocks will have less votes.

How will masternodes receive payments?
In each block part of the reward (30%) will go to masternode instead of the miner. Elected masternodes are sorted according to their identifiers and receive payments in order, there is no randomness in this process. Since it is possible to uniquely determine which masternodes are elected solely from the blockchain it is also possible to uniquely determine which masternode should receive the payment, nodes cannot disagree on this.

How much SPR is required to run a masternode?
There is a limit of 1440 masternodes, only masternodes with top 1000 amounts will be elected to receive payments, therefore the exact amount you will need to lock will be determined by the market. This amount is locked but it is still yours, when you don't want to run your masternode anymore you can spend it.

Is static IP required to run a masternode?
It is not required and for instant transactions this is not necessary.

What is instant transaction?
It is a transaction which is confirmed by masternodes within seconds after broadcasting. Once confirmed there is guarantee that this transaction (and not any conflicting one) will be included in the blockchain.

What is the state of instant transactions implementation in SpreadCoin?
Most effort was put into developing masternode election/payments mechanism, instant transactions are currenrly not fully implemented. Although masternodes confirm them there is no logic in place to replace unconfirmed transactions with the confirmed ones in the case of double spending attacks and to reject blocks with conflicting transactions. Note that rejecting blocks based on whether or not it includes transactions which conflict with confirmed instant transactions can lead to forks but this can be solved.

Which transactions can be made instantly?
Currently these are all transactions with less than 15 inputs and fee of at least 0.001 SPR per input.

MyFarm

  • Sr. Member
  • ****
  • Posts: 259
    • View Profile
Re: Masternodes: About, Installation, and FAQ
« Reply #2 on: February 11, 2015, 09:43:32 pm »
How To Create a Masternode On Your Home Computer

At present, masternodes are being tested on Spreadcointalk.org.  You are welcome to join us there and this guide will work.  Or, once masternodes are released on mainnet, simply do the following to install one on your home computer (go to the next post if you want to install one on your VPS):

1.  Go to the, "Receive" tab and create a new address.  Many of us like to label our masternodes in a way we can keep track such as, "Masternode1", "Masternode 2" and so on.

2.  Go to the, "Sent" tab and send at least 100 SPR to that address.  Note that once 1440 masternodes are created, the masternodes with the least number of SPR in them become delisted.  As such, you may want to fund your masternode with more than 100.

3.  On either the, "Overview" or, "Transactions" tab, wait for 50 confirmations on the coins.

4.  Once you have 50 confirmations, go to the, "Masternodes" tab and enter the amazing GUI that Mr. Spread created.  There you will see:



5.  Under the, "Control" column you should see your masternode with an empty checkbox.  If you don't, click the, "Update" button and wait a couple seconds.  Check the box for your masternode. 

THAT IS IT!  Yes, really.  Once your masternode gets elected, you'll start receiving payments.  Yes, Mr. Spread made setting up a masternode that easy!  And yes, you can have more than one masternode per IP.


MyFarm

  • Sr. Member
  • ****
  • Posts: 259
    • View Profile
Re: Masternodes: About, Installation, and FAQ
« Reply #3 on: February 11, 2015, 09:44:54 pm »
How To Setup a Masternode On Your VPS

Many of us have VPS's and want to setup masternodes that way.  This guide was created by Vertoe and the discussion can be found here.  If this helps you, Vertoe's SPR address is at the bottom of this guide, feel free to send him some SPR love!

VPS: I used Amazon Webservice running Ubuntu 14.10. This will be running the masternode.
Local: I used a Qt wallet to generate the transaction input and masternode secret.

Single masternode on one VPS.

1 VPS: Get dependencies for building spreadcoin daemon:
Code: [Select]
sudo apt-get install git build-essential autoconf libboost-all-dev libssl-dev libprotobuf-dev protobuf-compiler libqt4-dev libqrencode-dev libdb-dev libdb++-dev libminiupnpc-dev

2 VPS: Get the source code:
Code: [Select]
git clone https://github.com/spreadcoin-project/spreadcoin
3 VPS: And switch directory:
Code: [Select]
cd spreadcoin/src

4 VPS: Checkout mn-test branch:
Code: [Select]
git checkout mn-test

5 VPS: Compile the daemon:
Code: [Select]
make -j $(nproc) -f makefile.unix

6 VPS: Create a config file:
Code: [Select]
mkdir -p ~/.spreadtestcoin
cat > ~/.spreadtestcoin/spreadcoin.conf <<EOF
rpcuser=spreadcoinrpc
rpcpassword=3btqdvnaaY8Lsv934ZeULWRcgnv4KblablablaB2S5FHB # change this to something usefull
daemon=1
server=1
testnet=1
EOF

7 VPS: ...and "Install" the daemon:
Code: [Select]
sudo cp spreadcoind /usr/bin/spreadcoind

8 VPS: Run the daemon:
Code: [Select]
spreadcoind -daemon -server

9 On your local wallet, get a new address and send at least 100 coins to that address and wait for 50 confirmations.
Code: [Select]
mnQEmuD8yC4UAkc8Fm6A49JfKaqAqTZEk5
10 On your local wallet, copy the transaction id.
Code: [Select]
7f7bbb802daa9723b1e060cfa28b6e1a1b6d5ad68f1136ca8f6aa9450edee6f7
11 Local: Generate a masternode secret from the transaction input by going to the console at tools > debug console. if input:0 fails, try:1, and so on until you get what you want:
Code: [Select]
mnsecret 7f7bbb802daa9723b1e060cfa28b6e1a1b6d5ad68f1136ca8f6aa9450edee6f7:1

12 On the VPS, put it directly into the config file:
Code: [Select]
echo "mnstart=7f7bbb802daa9723b1e060cfa28b6e1a1b6d5ad68f1136ca8f6aa9450edee6f7:1:1c574e216511919b4578586843198d6c006171592001003986fccae864a3db9b78b6e08037f30fcbbfd33aeec23a6d2130e06556ae66a4796c731b778ad790f0d6:925EuDdYmiQvgq1S6em6kQ1WR5wU5qB8t7treVVFBhwxFLrkN27" >> ~/.spreadtestcoin/spreadcoin.conf

... wait for 50 confirmations of the tx ...

13 VPS: ...and start the masternode:
Code: [Select]
spreadcoind mnstart 7f7bbb802daa9723b1e060cfa28b6e1a1b6d5ad68f1136ca8f6aa9450edee6f7:1:1c574e216511919b4578586843198d6c006171592001003986fccae864a3db9b78b6e08037f30fcbbfd33aeec23a6d2130e06556ae66a4796c731b778ad790f0d6:925EuDdYmiQvgq1S6em6kQ1WR5wU5qB8t7treVVFBhwxFLrkN27

If it says "true", you are done!!!einself

Multiple masternodes on one VPS.

Repeat steps 9-13 for each masternode input with >100 SPR and >50 confirmations you have. Happy masternoding.

Worked? SSHUvYeyGQcV6z1QvFiu2SppKDTbb2ZFC1

MyFarm

  • Sr. Member
  • ****
  • Posts: 259
    • View Profile
Re: Masternodes: About, Installation, and FAQ
« Reply #4 on: February 11, 2015, 09:46:21 pm »
Q. Why should I run a masternode?
A.  The primary reason most people run a masternode is it is profitable.  A percentage of every block mined goes to Spreadcoin.  At present, on testnet, 30% of mined Spreadcoin goes to masternode operators. 

Q.  How many Spreadcoin does it take to run a masternode?
A.  The minimum is 100.  However, only 1440 masternodes will be paid.  The 1440 masternodes that have the most Spreadcoin in them will be "elected" and get paid.  If you masternode 1440 has 101 SPR in it and your masternode has 100 SPR in it, you will not be elected and paid!  As such, it is a competitive system and it is theorized that you will need more than 100 SPR in your masternode to be paid.  How much exactly we don't know yet!

Q.  How much do I earn from a masternode?
A.  At present, on testnet, you get 30% of every block's Spreadcoin.  Your profit will depend on many factors such as whether you are on a VPS and how many SPR you put in your masternode.  How profitable they are is discussed here: http://spreadcointalk.org/index.php?topic=101.0

Q.  Is it hard to setup a masternode?
A.  It is EXTREMELY easy.  To setup a masternode on your home computer, go to the third post in this thread.  To setup one on your VPS, go to the fourth post in this thread.

Q.  Do I need a static IP to run a masternode?
A.  No you don't.

Q.  How many masternodes can I run on my home computer?
A.  At present, masternodes require very little resources and some people are running over 100 on a single computer!  However, as additional functionality is added to the masternode network requiring additional resources, this will change.


MyFarm

  • Sr. Member
  • ****
  • Posts: 259
    • View Profile
Re: Masternodes: About, Installation, and FAQ
« Reply #5 on: February 11, 2015, 10:01:51 pm »
Placeholder

MyFarm

  • Sr. Member
  • ****
  • Posts: 259
    • View Profile
Re: Masternodes: About, Installation, and FAQ
« Reply #6 on: February 11, 2015, 10:03:47 pm »
If you have any suggestions for edits or improvements, please let me know!

elbandi

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
If you set the 12., you dont need the 13.