Create Sanctuary 2

From BiblePay Wiki
Jump to: navigation, search

Step by step guide to create/setup a Sanctuary (Masternode) by Togoshigekata

UPDATED: 2018/06/10


REQUIREMENTS

2 machines with 2 separate IP addresses and 1,550,001 BiblePay coins

you are setting up a Sanctuary on a remote Linux cloud server (Sanctuary Wallet)
and storing BiblePay coins on a local Windows PC (Controller Wallet)

This is called a Cold setup, your coins are stored safely on your own machine in the controller wallet,
compared to a Hot setup, where the coins are stored on the remote server in the sanctuary wallet (not recommended)


One Click Masternode Install Script:
https://raw.githubusercontent.com/biblepay/biblepay/master/contrib/masternode-install.sh
https://www.reddit.com/r/BiblePay/comments/9l61yo/one_click_masternode_install_script/

Rob Original Guide:
http://wiki.biblepay.org/Create_Sanctuary

Togo Notes:
http://forum.biblepay.org/index.php?topic=16.msg151#msg151
http://forum.biblepay.org/index.php?topic=16.msg792#msg792

Testnet Thread - Testing Sanctuaries
http://forum.biblepay.org/index.php?topic=16.0


PART A - Controller Wallet (Windows)

On local/home Windows PC:

1. Download & Install latest version of BiblePay:
http://biblepay.org/

2. Run and Sync BiblePay

3. Send any needed BiblePay coins to your Controller Wallet
Wallet Menu >> File >>> Receiving Addresses


PART B - Rent Linux Cloud Machine

A. Research and Choose Cloud Provider (Vultr, AWS, Google, Azure, etc) and Create Account
B. Choose Machine to Rent (Recommend: Ubuntu 16.04, 2GB RAM [1GB RAM is okay if use Swap File])
C. Payment Method
D. Connect to it / SSH (Putty http://www.putty.org/ SSH Client for Windows)

Vultr $5/month (1 CPU 1GB RAM)
AWS $8.3/month (1 CPU 1GB RAM)

(NOTE: These next steps assumes using Vultr)


1. Create Account
https://www.vultr.com/register/


2. Add Payment Information


3. Download & Install PuTTY (SSH Client):
http://www.putty.org/


4. OPTIONAL: Generate SSH Public/Private Keys
https://www.vultr.com/docs/how-do-i-generate-ssh-keys/


5. Deploy Instance
https://my.vultr.com/deploy/

Instance Type: VC2
1. Server Location: Random
2. Server Type: Ubuntu 16.04 x64
3. Server Size: 1 CPU, 1024MB RAM, $5/mo (*Assuming using SWAP file later for more RAM)
6. SSH Key: Add and Select Public Key you added in Step #4
7. Serverhostname: Add unique name


6. Use Putty to Connect to Vultr Server
Enter IP Address, Port 22, Connection type SSH
You can add your private key file: Connection >> SSH >> Auth >> Browse
You can name and save your connection info: Session >> Saved Sessions >> Enter a Unique Name >> Save


PART C - Install Sanctuary Linux Wallet

NOTE: this part can be automated by downloading a script.
1.  Download the script on the cloud machine:
    cd ~
    wget https://raw.githubusercontent.com/biblepay/biblepay/master/contrib/masternode-install.sh
2.  Ensure script is executable:
    chmod 777 masternode-install.sh
3.  Run the script:
    ./masternode-install.sh
Follow the prompts. If your Cloud Machine has less than 2GB RAM, please allow the script to create a Swap File. After the setup is complete, you can continue at PART E step 2 (and you can skip PART F). Alternatively, you can set up manually by starting at step 1 below.


1. Install BiblePay (thanks to togoshige https://www.reddit.com/r/BiblePay/comments/6ummuj/how_to_mine_biblepay_on_linux/ )

Linux Install Guide: (copy and paste each each line one by one)

 sudo apt-get update  
sudo apt-get install -y software-properties-common
sudo add-apt-repository -y ppa:bitcoin/bitcoin
sudo apt-get update
sudo apt-get install -y libdb4.8-dev libdb4.8++-dev
sudo apt-get install -y automake
sudo apt-get install -y bsdmainutils
sudo apt-get install -y g++
sudo apt-get install -y git
sudo apt install -y make
sudo apt-get install -y build-essential
sudo apt-get install -y autoconf libtool pkg-config
sudo apt-get install -y libboost-all-dev libssl-dev libevent-dev
sudo apt-get install -y libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler


 cd /home/YOURUSERNAME  
git clone https://github.com/biblepay/biblepay


 BP_ROOT=$(pwd)  
BDB_PREFIX="${BP_ROOT}/db4"
mkdir -p $BDB_PREFIX


 wget 'http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz'  
echo '12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef db-4.8.30.NC.tar.gz' | sha256sum -c
tar -xzvf db-4.8.30.NC.tar.gz
cd db-4.8.30.NC/build_unix
../dist/configure --enable-cxx --disable-shared --with-pic --prefix=$BDB_PREFIX
make install


 cd $BP_ROOT  
cd biblepay
sudo chmod 777 share/genbuild.sh
sudo chmod 777 autogen.sh


 ./autogen.sh  
./configure LDFLAGS="-L${BDB_PREFIX}/lib/" CPPFLAGS="-I${BDB_PREFIX}/include/"
sudo make


BIBLEPAY is now Installed!
NOTE: if server is 1GB RAM, before running last command "sudo make", set up the swap file in Step 1a.


1a. Swap File

 free #check if swap is 0
 dd if=/dev/zero of=/var/swap.img bs=1024k count=1000
 mkswap /var/swap.img
 swapon /var/swap.img
 free #check if swap is 1024
 sudo make

Swap File References:
https://digitizor.com/create-swap-file-ubuntu-linux/
http://forum.biblepay.org/index.php?topic=16.msg151#msg151


PART D - Run Sanctuary Linux Wallet

On remote Linux machine:

1. Run and Sync BiblePay

 cd home/yourusername/biblepay/src
 ./biblepayd -daemon

2. Close wallet:

 ./biblepay-cli stop
 #if BiblePay is stuck
 ps -ef #view processes and find BiblePay PID number, use in kill command
 kill PID

3. Run BiblePay:

 ./biblepayd -daemon

4. Check that blocks number matches home Windows Controller wallet

 ./biblepay-cli getinfo

PART E - Financing your Sanctuary (Masternode)

1. Generate private key on Sanctuary remote Linux machine

 ./biblepay-cli masternode genkey

(Store this as your SANCTUARY_PRIVATE_KEY)


2. Local Windows Controller Wallet - Show Proof of Coins

Create a unique name (SANCTUARY_NAME) for the address you will be storing your coins in
and send the required 1,550,001 coins to that address


2a. Create Masternode Coin Address with Label

Tools >> Debug Console

 getaccountaddress SANCTUARY_NAME 

this creates your SANCTUARY_ADDRESS

getaccountaddress: https://chainquery.com/bitcoin-api/getaccountaddress


2b. Combine All Your Coins into One Address

File >> Receiving Addresses >> Right click Copy Address (this is your RECEIVING_ADDRESS)
Send all of your wallet coins to this one address

Tools >> Debug Console

   sendtoaddress RECEIVING_ADDRESS 1550001 "" ""

sendtoaddress: https://chainquery.com/bitcoin-api/sendtoaddress


2c. Send Required Coins to Newly Created SANCTUARY_ADDRESS from step 2a

Enable Coin Control: Settings >> Options >> Wallet >> Click "Enable coin control features" checkbox >> Ok

Send >> Inputs >> Click Checkboxes of which Address(es) to Send Coins From

Send exactly 1550001 coins

NOTE: Fees are OK as long as you dont click the checkbox to Subtract fees. Fees are stored in a different vector
NOTE: Important thing is to make the amount exactly 1550001 and dont click instant send or any other options
NOTE: Coin Control will allow you to send coins from a specific address and not move coins you already set aside in other addresses
https://www.dash.org/forum/threads/how-to-send-1000-dash-from-a-specific-address-in-the-wallet.15926/


2d. Record Transaction Hash

Open the Explorer: https://biblepay-explorer.org/
Enter in your SANCTUARY_ADDRESS
Record Latest Hash for your 1,550,001 deposit (TRANSACTIONHASH)


3. Wait for 7-8 or so confirmations (at 7 minute block rate, that will be around 1 hour)


4.a Controller Windows Wallet - Get TRANSACTIONHASH and INDEX from running this command:
Tools >> Debug Console

 masternode outputs

You will get a string that looks like this:

 {
 "06e38868bb8f9958e34d5155437d009b72dff33fc28874c87fd42e51c0f74fdb" : "0",
 }

The long string is your TRANSACTIONHASH, and the last number is the INDEX.


4.b Controller Windows Wallet - Edit masternode.conf:
Open File Explorer, Enter in address bar: %appdata%/biblepaycore and press Enter
Find and Right Click >> Edit masternode.conf
Add line below and Save:

 SANCTUARY_NAME SANCTUARY_PUBLIC_IP:40000 SANCTUARY_PRIVATE_KEY TRANSACTIONHASH INDEX

SANCTUARY_NAME: The name/label that you set for your sanctuary address in step 2
SANCTUARY_PUBLIC_IP: Your sanctuary IP (Your sanctuary Linux VPS/Cloud machine IP)
SANCTUARY_PRIVATE_KEY: This is the private key that you placed in your remote configuration
TRANSACTIONHASH: This is the transaction hash for the transaction in which you got your 1550001 BBP deposited.
INDEX: This is the Index of your transaction for that address I'll show you how to get it in a bit.

NOTE: If you have multiple sanctuaries, should be able to add additional lines to masternode.conf
https://www.dash.org/forum/threads/how-to-setup-multiple-masternodes-from-one-wallet.13710/


5. Controller Windows Wallet - Edit biblepay.conf:
Open File Explorer, Enter in address bar: %appdata%/biblepaycore and press Enter
Find and Right Click >> Edit biblepay.conf

Decide on "RandomUsername" and "RandomPassword" to use for RPC credentials
NOTE: Password must be Alphanumeric only! (Letters and Numbers only)
Add Lines below and Save:

 rpcuser=RandomUsername
 rpcpassword=RandomPassword
 rpcallowip=127.0.0.1
 rpcport=9998
 listen=0
 server=1
 daemon=1
 logtimestamps=1
 maxconnections=256

NOTE: For the RPC Port, you can use whichever port you want, just make sure to open it in firewall in Step 7


6. Restart (Close and then Open/Run again) Windows Controller Wallet


7. Sanctuary Wallet Remote Linux Machine, Run Firewall/Port commands:

 sudo apt-get update
 sudo apt-get install ufw
 sudo ufw allow ssh/tcp
 sudo ufw limit ssh/tcp
 sudo ufw allow 40000/tcp
 sudo ufw allow 9998/tcp
 sudo ufw logging on
 sudo ufw enable
 sudo ufw status


8. Sanctuary Masternode Linux Wallet - Edit ~/.biblepaycore/biblepay.conf:

 cd ~/.biblepaycore
 vi biblepay.conf
 rpcuser=RandomUsername
 rpcpassword=RandomPassword
 rpcallowip=127.0.0.1
 rpcport=9998
 listen=1
 server=1
 daemon=1
 logtimestamps=1
 externalip=SANCTUARY_PUBLIC_IP
 maxconnections=256
 masternode=1
 masternodeprivkey=SANCTUARY_PRIVATE_KEY
 ESC :wq ENTER

(SANCTUARY_PUBLIC_IP: Public IP Address of Remote Linux Sanctuary Wallet)


9. Sanctuary Masternode Linux Wallet - Restart BiblePay:

 cd home/YOURUSERNAME/biblepay/src
 ./biblepay-cli stop
 #if BiblePay is stuck due to new password
 ps -ef #view processes and find BiblePay PID number, use in kill command
 kill PID
 ./biblepayd -daemon


10. Controller Windows Wallet - Start Sanctuary

View All Masternodes PRE_ENABLED, ENABLED, WATCHDOG_EXPIRED

 masternode list 

View Masternodes in your masternode.conf file

 masternode list-conf

(masternode was not in list but in list-conf and was in state MISSING)

Start your Masternode!

 masternode start-alias SANCTUARY_NAME 

NOTE: SANCTUARY_NAME is from Steps 2a and 4b
NOTE: Masternodes take a few minutes to sync
NOTE: If you have multiple masternodes should be able to start them all with: masternode start-many

Extra Commands for help and debugging:

 masternode help
 masternode debug

Show Masternodes Tab in Windows Controller Wallet

Settings >> Options >> Wallet >> Click "Show Masternodes Tab" checkbox >> Ok >> Restart BiblePay Wallet


11. Sanctuary Masternode Linux Wallet, Check Status:

 ./biblepay-cli masternode status
 ./biblepay-cli mnsync status


12. Wait about 1 - 2 Hours for Masternode Status to go from PRE_ENABLED to ENABLED

NOTE: Sometimes your own windows wallet may not show the correct masternode statuses, double check on a 2nd windows wallet to confirm



PART F - Watchman

How to install Watchman on the Wall
https://github.com/biblepay/biblepay/blob/master/BuildBiblePay.txt
https://github.com/biblepay/watchman

1. Clone & Install Watchman

 sudo apt update
 sudo apt -y install git python-virtualenv virtualenv
 cd ~/.biblepaycore
 git clone https://github.com/biblepay/watchman.git
 cd watchman
 virtualenv venv
 venv/bin/pip install -r requirements.txt

2. Run Watchman

 venv/bin/python bin/watchman.py

NOTE: You want to see empty output from running the command


3. Setup Watchman in Cron:

 crontab -e

NOTE: You might be prompted to choose which text editor you want to use as default, I enter 3 for vim basic

Add this line:

 * * * * * cd /home/YOURUSERNAME/.biblepaycore/watchman && ./venv/bin/python bin/watchman.py >/dev/null 2>&1

NOTE: Replace YOURUSERNAME with the username where biblepay is stored: root, ubuntu, etc

NOTE: (If using vi, press i for insert mode, add the line at the end of the file
press ESC for command mode, type :wq to save and exit)

NOTE: If watchman is not running, Proof-Of-Service will fail and your node will report WATCHDOG_EXPIRED in the controller sanctuary list.
To verify watchman is running, run the command you typed in the crontab above as the actual user.
For example, if biblepay runs as user bible, login as bible, then copy the command from above like this:

 cd /home/YOURUSERNAME/.biblepaycore/watchman && ./venv/bin/python bin/watchman.py

Without the trailing /dev/null 2>&1. Run the command.
Verify the output is empty. If so, you have successfully configured watchman!

NOTE: You could also potentially use this format and replace /home/YOURUSERNAME/ with ~/

 cd ~/.biblepaycore/watchman && ./venv/bin/python bin/watchman.py


SETUP COMPLETE!


SANCTUARY NOTES

Show Masternodes Tab in Windows Wallet
Settings >> Options >> Wallet >> Show Masternodes Tab >> OK


How to Edit Files on Linux
I like to use vi, example:

 vi filename #to open the file
 i #to go into edit mode and be able to insert characters
 ESC #to leave edit mode and go into command mode
 :wq #to save (write) the file and exit (quit) vi 


Testnet:
Port 40000 is biblepay-prod, while 40001 is biblepay-testnet


HOW TO UPDATE

Linux Sanctuary (Masternode) Update by 616westwarmoth
https://www.youtube.com/watch?v=5-WiMBCvI8g

Commands:

   ### Turn off/stop BiblePay 
   cd /home/yourusername/biblepay/src  
   ./biblepay-cli stop  
   
   ### Pull down latest Biblepay code and build it 
   cd ..
   git pull origin master
   
   ## Enable swap if running on 1 GB VPS (such as Vultr)
   free
   dd if=/dev/zero of=/var/swap.img bs=1024k count=1000
   mkswap /var/swap.img
   swapon /var/swap.img
   free
   
   ## Compile
   sudo make
   
   ## OPTIONAL use if need to clean old data files
   cd ~/.biblepaycore
   rm blocks -R
   rm chainstate -R
   rm banlist.dat fee_estimates.dat governance.dat mncache.dat mnpayments.dat netfulfilled.dat peers.dat db.log debug.log
   
   ## Start BiblePay
   cd /home/biblepay/src
   ./biblepayd -daemon -reindex  ## OPTIONAL use -reindex if blockchain needs to be rebuilt
   ./biblepay-cli getinfo
   ./biblepay-cli mnsync status
   ./biblepay-cli masternode status

Note: If there is a protocol version update, the sanctuary will have to be started again by the local windows wallet

   masternode start-alias SANCTUARY_NAME

Update/Upgrade Packages:

   sudo apt-get update
   sudo apt-get upgrade
   sudo apt-get dist-upgrade
   sudo apt-get autoremove



HOW TO UNLOCK FUNDS

1. Stop biblepay on remote linux machine: ./biblepay-cli stop
2. On home controller Windows wallet, edit masternode.conf and delete the entry for that masternode
3. Restart home controller Windows wallet
4. 1,550,001 BBP should now be unlocked

References:
https://forum.pivx.org/t/how-to-end-terminate-a-masternode-and-get-the-10k-back/469
https://www.dash.org/forum/threads/turn-off-masternode.16090/
https://www.reddit.com/r/BiblePay/comments/7qe06n/how_can_i_turn_off_masternode/


SANCTUARY REFERENCES

BiblePay Linux Guide:
https://www.reddit.com/r/BiblePay/comments/6ummuj/how_to_mine_biblepay_on_linux/

Rob Original Sanctuary Guide:
http://wiki.biblepay.org/Create_Sanctuary

Testnet Thread - Testing Sanctuaries
http://forum.biblepay.org/index.php?topic=16.0

Togo Sanctuary Notes:
http://forum.biblepay.org/index.php?topic=16.msg151#msg151
http://forum.biblepay.org/index.php?topic=16.msg792#msg792

Watchman Guide:
https://github.com/biblepay/biblepay/blob/master/BuildBiblePay.txt
https://github.com/biblepay/watchman

Dash Masternode Guides:
https://dashpay.atlassian.net/wiki/spaces/DOC/pages/1867820/TAO+S+SETUP+GUIDE+FOR+DUMMIES+12.1
https://dashpay.atlassian.net/wiki/spaces/DOC/pages/1867877/Start+multiple+masternodes+from+one+wallet+start-many
https://dashpay.atlassian.net/wiki/spaces/DOC/pages/24019061/Newcomer+Section+-+What+is+...+and+how+do+I+set+one+up

VIVO Masternode Guide:
https://www.youtube.com/watch?v=Lybtz7iucVs

More References:
https://en.bitcoin.it/wiki/API_reference_(JSON-RPC)#JSON-RPC
https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
https://github.com/dashpay/dash/blob/master/contrib/debian/examples/dash.conf


SANCTUARY FAQ

QUESTION: How to deal with fees when sending? Does amount have to be 1,550,001 exactly?
Fees are OK as long as you dont click the checkbox to Subtract fees. Fees are stored in a different vector, so the vout is still 1,550,001.


QUESTION: Are we sending coins to ourself?
It is OK to send the balance to yourself or from another node (I tested both).
The important thing is to make the amount exactly 1550001 and dont click instant send or any other options.

If you are creating a Hot wallet (IE funds live on the Sanctuary) you would send the 1,550,001 to the Sanctuary wallet.
Now that we know cold wallets work, the recommended way is to send the funds To the cold wallet (IE the home controller wallet).


QUESTION: Does the Masternode actually hold coins?
In a Hot masternode scenario, the masternode holds the coins, otherwise the masternode wallet is empty.
Biblepay puts a lock on the escrow when the masternode starts.


QUESTION: What are the rpc settings doing? Can the Home Wallet now control the Linux Wallet? or reverse of that?
These config settings only allow the home controller wallet to start and stop the masternode. This is not only to safeguard your eventual 1,550,001 BBP escrow if it goes up in value (to prevent vultr host from stealing it), but also because of Proof-Of-Service. Dash has created POSE, which monitors how much uptime your masternode has stayed up and eventually becomes important if we have more than about 800 masternodes, these nodes start falling to the back of the payment queue and do not get paid if they need restarts. When they fail and need restarted, it is easy for home computer controller wallet to start the masternode again.


QUESTION: Where does Watchman fit in the process? What is Watchman? what is it doing?
Peace be still and bear with us, why do we have to have yet another piece of software called Watchman-on-the-wall?

Watchman implements proof of service and one major superblock budget feature.
The watchman requires Pro-players for Sanctuaries and shuns the lackadaisical nodes [such as one that is on a video game PC that is rebooted].
With watchman, every node has to send a watchdog alert every couple hundred blocks and prove their static IP and how long they been online.
This means as competition heats up you really have to have provided good service to stay in the payment queue.
The other thing watchman does is collects a database of gobjects. Governance objects are stored in tables. Votes are kept.
This feature allows internal deleting governance objects by masternode.

The most important thing it does is when we create a very complicated budget that got approved from a proposal, it creates a text file of budget items for the superblock. Without it the superblocks dont work properly.

The code developed and ported to Watchman was created for a modular design, in case the sanctuary needs to upgrade the superblock code side and NOT the entire network (to upgrade the wallet). We inherited this design and embrace it.


QUESTION: Sanctuaries are only Linux? Or will there be a Windows solution to this?
They are linux only, primarily because the proof-of-service software we use only runs on linux.
No windows solution is currently scheduled, unless our stratis Proof-of-concept is really well received.
If it is, Ill port watchman-on-the-wall to c# so that then you can run a Pose-enabled biblepay node in c#.


QUESTION: Is a static IP required?
Static ip is required, thats primarily why we recommend web hosts for this.
If your node fails to vote when its asked to you lose your sanctuary payment.


QUESTION: Is much bandwidth required ? Any calculations on this?
Very low bandwidth is required, only 10% more than a normal node,
Except since you are a full PoSE node you would be servicing inbound connections, however these are split among all the nodes.
Im running one with 1023 connections and its taking 40kbps so its pretty low.
You can see the network graph in the qt wallet btw (Tools | Network Traffic).


QUESTION: Is it OK to run a masternode on a dedicated machine with a high speed internet connection?
You can run your own sanctuary even on home dynamic IP, as long as its on linux running watchman on the wall, however you have two big risks:
1) If you do go down, you will lose your sanctuary payment, and if you fall out of the payment queue it might take 24 hours to get back in.
2) If your dynamic IP changes, you will have to re-create your whole sanctuary! The Escrow is tied to the static IP. <- This is a real pain..


QUESTION: How long will masternode with 40 GB storage last?
Our blockchain size is only 17 Megs right now with 21000 blocks,
with our small blockchain size and 7 minute blocks, we should technically sync fast and stay small for a long time


QUESTION: My wallet has multiple receiving addresses including masternode address. If I send coin to other address, will it affect masternode?
Or when I run the masternode, is that masternode address locked?
1) Enable coin control features:

Settings > options > wallet > enable coin control features.

2) Go to send and click on "Inputs..", you should see the escrow amount being locked (you can unlock it by right clicking on it > unlock).


QUESTION: Why use cold wallet setup vs hot wallet setup?
To not leave your 1.55M BBP vulnerable on a web host. A cold Sanctuary means you can keep your BBP off site, in an encrypted wallet (in your controller wallet) where the coins are safer.

Would your computer withstand a DOS attack:
You can shut off your RPC port at home and run a private node, and add a firewall, and encrypt the wallet and even leave the coins in cold storage.

Easier and cheaper to run a VPS:
Based on my experience with the pool the only way to have 99.9% uptime is on a VPS. Too much happens on home networks that make it unreliable. Because we implement proof-of-service, you should consider the VPS option to keep your IP from changing and to ensure you receive your sanctuary rewards.


QUESTION: For a cold masternode setup, does the Controller Wallet have to stay online 24/7 like the Masternode Wallet?
No- controller only needs to be online to start the sanctuary.


QUESTION: Is it possible to setup multiple masternodes on one VPS?
Since you need a static IP per sanctuary, it can only be done via a lot of hacking, so without hacking - its not possible, and if you do pay for a block of IPs at the VPS, then it requires extremely advanced network config scripts to get it to work.


BLOCK REWARD & EMISSION

Block Reward Breakdown:
10% Charity
5% IT
2.5% PR (Public Relation campaigns)
2.5% P2P (Orphan Letter Writing, Pay To Preach, Pay to be a Priest, FAQ writers, Social Media functions)
40% Miners
40% Sanctuaries (Masternodes)

Emission Schedule: http://wiki.biblepay.org/Emission_Schedule


SANCTUARY PAYMENTS

QUESTION: How to view sanctuary payments?

   masternode winners 100


As far as "luck" of winning the spot, we are using an algorithm where the nodes rank is determined by how close its vin is to the blockhash its voting on, so its really luck. Its ranking the winner based on blockhash uint256 minus masternode vin (this is called sanctuary delta), with the smallest delta ascending.

PRE_ENABLED means no chance of winning the vote, as the sanctuary is not trusted yet.

NOTE: If a sanctuary goes offline or falls into a bad state like "WATCHDOG_EXPIRED" it takes 30 hours for the sanctuary to fall out of the payment queue


SUBMIT PROPOSAL

Anyone can submit a proposal to the community requesting funding for work,
here are some ideas of work we need done: https://www.reddit.com/r/BiblePay/comments/7v0pxz/todo_list/

NOTE: Creating a proposal through the pool costs 2500 BBP
if you do not have enough funds in your pool account ask the community for help


0. Setup a BiblePay Wallet to receive funds at:
Windows -- http://biblepay.org/#wallets-section (Download and install exe file)
Linux ------ https://www.reddit.com/r/BiblePay/comments/6ummuj/how_to_mine_biblepay_on_linux/
MacOS ---- https://www.reddit.com/r/BiblePay/comments/7id9r9/advice_for_bible_pay_wallet_on_mac/


1. Create a Forum Post of the Proposal in the BiblePay Forum:
Production Proposal Section: http://forum.biblepay.org/index.php?board=5.0
Example Proposal: http://forum.biblepay.org/index.php?topic=44.0


2. Create a Proposal on the BiblePay Pool website: https://pool.biblepay.org/
Left sidebar >>> Click Governance Tab >>>
Click Add Proposal >>> Fill in Details Below >>> Save

Details:
- Proposal Name
- Funding Receiving Address (BiblePay address)
- Proposal Amount (How many BiblePay coins needed)
- Discussion URL (BiblePay Forum Post link)

NOTE: With Windows or Linux GUI Wallet, you can find your Receiving Address by clicking File >> Receiving Addresses
and right click copy Address, you can also create new addresses (and can also label them!)

QUESTION: How to calculate BiblePay price?
Use the USD per BBP value at CoinMarketCap: https://coinmarketcap.com/currencies/biblepay/
In the future we may use a moving average

NOTE: Once the proposal is entered through the Pool, it goes into Prepared state and then after a little whiles goes into Submitted state
once it is in Submitted state you can see it in the gobject list and you can post your vote commands http://wiki.biblepay.org/index.php?title=Create_Sanctuary_2#VOTE_ON_PROPOSAL

   gobject list


Approval occurs when yes votes minus no votes equals 10% or more of the total available votes.


QUESTION: How to sell BiblePay after I get funded?
BiblePay is listed for trade on a few exchange, you can trade it for Bitcoin, Litecoin, USD (Dollars), etc
and then you may have to send Bitcoin somewhere else to convert it to Dollars


To Read & Watch:
Understanding the Governance and Budget System
https://dashpay.atlassian.net/wiki/spaces/DOC/pages/8585240/Understanding+the+Governance+and+Budget+System

Using Decentralized Governance: Proposals, Voting, and Budgets
https://dashpay.atlassian.net/wiki/spaces/DOC/pages/19169430/Using+Decentralized+Governance+Proposals+Voting+and+Budgets

Anyone Can Apply for Dash Treasury Funds: A 3-Step Tutorial
https://www.youtube.com/watch?v=52TzOgq15h8

8 Steps to a Successful Proposal
https://dashpay.atlassian.net/wiki/spaces/DOC/pages/126189905/8+Steps+to+a+Successful+Proposal

Budget Proposals and the Problem of “Extra Money”
https://www.dashforcenews.com/dash-budget-proposals-and-the-problem-of-extra-money/

Evaluating How Much a Dash Budget Proposal is Worth
https://www.dashforcenews.com/evaluating-how-much-a-dash-budget-proposal-is-worth/


QUESTION: Are proposals funded all at once or in payments throughout the month? All at once.

QUESTION: What happens to budget funds that do not get allocated/spent on any proposals?
Coins are destroyed (equivalent to burnt, or not expanding the money supply) and opportunity to spend that allocation is lost for one month.


QUESTION: What is our current budget/proposal schedule? how to look it up? How many coins are in the budget?

View next Superblock and Check Budget:

 getgovernanceinfo
 getsuperblockbudget 24600

Subtract the Super Block from the Current Block https://biblepay-explorer.org/
Multiply 7 minute block rate, divide by 60 minutes, divide by 24 hours, and that is how many days until the superblock runs. ~3 Days before that the approved proposals will be moved into budgets, they will need to be voted on and then ~1 Day before the superblock the budgets will be frozen.


Block Rewards & Emission Schedule: http://wiki.biblepay.org/Create_Sanctuary_2#BLOCK_REWARD_.26_EMISSION
// Final Distribution: 10% Charity, 2.5% PR, 2.5% P2P, 5% for IT
so of the budget that would be 50% Charity, 12.5% PR, 12.5% P2P, 25% IT of the superblock

5,789,219.786313 Total BBP for December budget cycle:

50.0% Charity = 2,894,609.89
12.5% PR ----- = __723,652.47
12.5% P2P --- = __723,652.47
25.0% IT ------ = 1,447,304.94


QUESTION: Are the budget categories hardcoded in? It seems like its just one big budget and we have to do some work ourselves to balance it out correctly? Yes, as far as figuring it ourself, we do have to multiply our superblock budget by the percents currently


NOTE: Proposals are not the same as budgets. The proposals become budgets after they reach a supermajority and have a triggerheight for a superblock.

There are two phases each expense has to go through: proposal and budget.
The week before the superblock, we need to run the budget process (from the pool), and what happens is every proposal that fits in the budget will move to the Budget voting list. (Sorted by expense type (IE Charity, IT, PR, or P2P), votes descending , while Charity has the highest priority).

Anyway, once the budget is established it needs to be voted on by the sanctuaries. They need to vote on the budget before the deadline which is 24 hours before the superblock hits. So we need to be voting on it Id say T-3. Then T-1 the budget is frozen and cannot be changed.

When we believe the budget is frozen, we issue a superblock trigger in the chain (the pool is programmed to automatically do this for us). At this point the "triggerheight" that equals the superblock will be on all the budget records.

Then we sit back and pray that the superblock is generated. After this happens, the budget items are moved to Funded.


NOTE: I was trying to reconcile the 2.8MM coin emission in the 30 day superblock cycle for one month of charity expenses, vs. the huge amount of coins we initially sold for the very first month of existence (7MM), and I was thinking, why less than half?

It turns out the reason why is our superblocks use the assumption of maximum diff and minimum block payment, to ensure that enough BBP is held back during the period regardless of the dynamic emission level - another words, it assumes each days minimum subsidy is paid to comprise the 30 day 20% total.

So if you are trying to reconcile this 5.78MM budget for one month, its based on the minimum 5,000 BBP block minus deflation (1.5% per month) * .20.



VOTE ON PROPOSAL

NOTE: Only Sanctuaries can Vote

To see Proposals login to the pool website: https://pool.biblepay.org/
and on left sidebar click "Governance" >> "Proposal List"

You can right click a proposal and click "Vote For Proposal" or "Vote Against Proposal" and paste this directly into your command line to vote

View proposals:

 gobject list

NOTE: Copy the Hash value, you will need it in the next command to vote on it

Vote yes, no or abstain with a sanctuary:

 gobject vote-alias Hash funding yes SANCTUARY_NAME

Vote yes or no with many sanctuaries

 gobject vote-many Hash funding yes

Check that the YesCount, NoCount or AbstainCount has incremented

 gobject list

See all gobject commands:

 gobject help


Video Tutorial by 616westwarmoth
https://www.youtube.com/watch?v=0nz5DEM5dDU


REMEMBER ALL: (Note from Lead Dev) We have IT integration with compassion for the inbound letters, the outbound letters, the orphan row click (biographies), and they have translators, so remember we potentially lose all that if we sponsor children from another charity.

When it comes to Charity, our entire mission is based on Charity, in this case I recommend we sacrifice every other department for Charity

Ill try to be more careful and only sponsor new children where the amount extends out to One Year (of premiums), so we have a buffer (we talked about that in the beginning)


HELP MAKE GUIDE BETTER

PIVX - https://pivx.org/knowledge-base/masternode-setup-guide/
Bulwark - https://github.com/bulwark-crypto/Bulwark-MN-Install
Phore - https://github.com/phoreproject/vps/blob/master/README.md
Rapture - https://docs.google.com/document/d/1kz6OuR1ybR_ZpvKEvJQybUdn_jVZVfviks7h-77_1Gs/edit


1. There is no need to kill biblepayd if you simply first do biblepay-cli stop, and then edit the conf file, so you can just reverse the steps and first put the step to stop biblepay, then you can edit the conf file without problems with rpc, so then you can start biblepayd again normally

2. Sometimes two commands can be one, I don't know if it's easier for beginners to follow if there are two simple commands, or it's easier if there is just one command if they just copy/paste anyway: for example, instead of: cd ~/.biblepaycore/
vi biblepay.conf
it could be just
vi ~/.biblepaycore/biblepay.conf

3. For beginners it can be really hard to find the AppData folder on their PC (being hidden and all) to edit the conf files, so I suggest you simply replace that with GUI (wallet) instructions, which is as easy as: Tools => Open Wallet Configuration File (for biblepay.conf) and Tools => Open Masternode Configuration File (for masternode.conf)

4. "getaccountaddress SANCTUARY_NAME" can also be easily done in GUI, File => Receiving addresses... => New, also the Start alias part, there's simply a button there in GUI, but since other commands can't avoid debug console, then perhaps I would leave that as is.(edited) 5. I would move the "Financing your masternode" part somewhere above previous steps, because waiting for confirmations about the collateral tx takes more than one hour, and then you just have to wait if you did everything else already. I think it's more rational to first just do the transaction and then setup the Linux wallet in the meantime while the tx is being confirmed.

5. Next step is to create screenshots.