Bible Pay

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Rob Andrews

Pages: 1 ... 235 236 237 238 239 240 241 [242] 243 244
Alright everyone, I believe we are now at the point where we need to perform end-to-end sanctuary testing!

Lets try to go through this process from start-finish to see what needs improvements  :'(

So first, log in to and click Network: Testnet.  If you are not in testnet mode, the proposals lists will be empty.

Next click Governance | Proposal List.  You will see the list of Active proposals at the top (those not funded yet that need voted on) and then in the Funded List you will see those proposals that are already inside superblocks and paid.
NOTE: I will be adding a chart soon so we can see a graphical view of the proximity to funding per row one proposal is generating in popularity.

We need to simulate: Keeping compassion as a charity, Paying a single invoice, Paying multiple invoices in a superblock, Shooting down a proposal, and watching a proposal get paid (included in a superblock), verifying the budget, test inability to exceed the budget, and review a historical expense.

First lets test a dry run of the theoretical monthly recurring expense for compassion.  I added a new proposal and it is ready to be voted on, for Octobers recurring orphan sponsorships (39,900 BBP).  Click on Proposal List.  Note the gobjectID in the second row of each item row (that is the Detail row).  Copy the gobjectID to the clipboard (note - Clicking on the first line of each row allows you to View the proposal), so you need to double click the gobject id (62a9c8afaf2af86f3820d6d30a93b4f84b29927b66c88badf8ad9699a48e20a6) from the second row, (the row that says the Proposal Name hyphen the gobjectid).  To vote on this for funding from your sanctuary issue this command:

Code: [Select]
gobject vote-many 62a9c8afaf2af86f3820d6d30a93b4f84b29927b66c88badf8ad9699a48e20a6 funding yes

The pool will actually update the row eventually with voting information also.

After the supermajority votes on it, the pool will create a budget item automatically that "fits" as many proposals as possible into a superblock (IE it will try to create a superblock for us), the pool has no power to vote, all it can do is suggest to the sanctuary network that "4 approved proposals can fit in superblock Y" and Y must be an upcoming superblock with at least enough lead time to be voted on (this is called the budget maturity period).  We need to test that also.

So please go ahead and vote on this proposal, and we will watch to see if it moves through the phases.

Also, I wanted to mention, for the very first Discussion URL, I used the wiki page just to get started.  But, technically, we need to use a Forum topic for this purpose so that other Biblepayers and Sanctuaries can discuss the validity in an open forum of the actual item.  For example, if someone submits a proposal to place a BiblePay ATM with a "medicianal weed" dispenser in it, the community should stand up and say: Wait I thought we were a Christian community isnt this going to tarnish our image, and coax the sanctuaries to vote it down.

Initiative II:

Id also like to ask someone here, who has a running sanctuary, to go ahead and create a Mock up proposal with a real testnet discussion URL, one that we can vote on, so we can test the "multiple proposals in one budget and in one superblock" issue.  Who is up for it?  Click on Proposals| Add.
Create a discussion URL on in the Testnet Forum, as a new Topic.  Ensure you can post to it (test it).  Use that as the discussion URL.
Enter an amount below 10000 BBP as the "amount" because the superblock budget is only 72000 on testnet and the orphan budget is already at 39,900.
Add the Proposal and verify it exists and notify us so that we can discuss and vote on it. 

And finally, please, someone who wants to make a really negative and tacky proposal, go ahead and make one, and let us know, one that we deliberately want to shoot down so that it misses the budget.

Good news, I think I got a master node working!
(One gotchya was that with AWS (Amazon Web Services) I needed to add inbound rule for port 40001 in the security group of the EC2)

Love your updates to the Masternode guide Rob!


Bad news, Im having trouble with Watchman:

Im using Ubuntu 16.04

My watchman.conf:
~/.biblepaycore/watchman$ venv/bin/python bin/
Code: [Select]
[error]: unable to open database file
Cannot connect to database. Please ensure database service is running and user access is properly configured in 'watchman.conf'.

Source Code:


~/.biblepaycore/watchman$ venv/bin/pip list

inflection (0.3.1)
peewee (2.8.3)
pip (9.0.1)
pkg-resources (0.0.0)
py (1.4.31)
wheel (0.30.0)


So it seems like database file isnt getting created? Im not sure
Looks like peewee library handles the database stuff?

if driver == peewee.SqliteDatabase:
        db_conn = {}

db = driver(db_name, **db_conn)

Oh man thats great!  You almost have it working.  Yeah, on the watchman, I will add those instructions to the create_masternode guide in a few minutes for everyone else.

So lets start with a couple basic things to see if the problem reveals itself.

Im no python guy, but during the time that I was debugging the first superblock I had to figure out how to turn peewee logging on and I was successfully able to see the watchman debug output and figure out where the system was breaking.  So step 1 that might help a little is turning on the logging, and then try to run the venv/bin/python again, here is how I turned on logging:

First cd into the watchman directory
Then execute the python interpreter like this:


Then you will see the python interpreter command line:
Python interpreter>>


import os;

Then rerun venv/bin/python first to see if it reveals anything.
Btw, I think you already modified your config file properly as it looks good.
The database file itself should have been downloaded to the watchman directory - its called "Watchman".  If you ls -l, and cat the file it should have some tables in it.  Note the case is "Watchman" in this case.

To check to see what is in the database, if you have not gotten further try this:

sudo apt-get install sqlite3
sqlite3 Watchman
select * from votes;
.table <enter>

See if the .table command lists out all the governance object tables?  Or if possibly the "Watchman" file does not even exist in the directory?

Im not sure if you have access to any other machines, but it would also be good to know if the behavior is different on another machine (IE Watchman gets created on ubuntu, but not at AWS).

We will have to see which step it fails to create the database file in.

This is it. This was somehow missing from the wiki instructions, I added it now:
(I have no idea how all of you set it up and knew about that :) )

Now when I type masternode status, I get this:

Code: [Select]
  "vin": "CTxIn(COutPoint(0000000000000000000000000000000000000000000000000000000000000000, 4294967295), coinbase )",
  "service": "",
  "status": "Not capable masternode: Masternode not in masternode list"

Which I reckon is normal and you just need to add this IP to some list, right? So there it is above. Thanks
Thanks, glad you added that.  I think we had that line in the config at one time and deleted it by accident.

I believe this error is coming from the wallets broadcast identifier, it stores the masternodes public ip, port, and vin (which is the txid and vout of the escrow) in order to validate the masternode when you come on line.

So, check to see if you have ''externalip=your_public_ip" in your base biblepay.conf file on the masternode itself (ie under masternode=1).  Try leaving off the colon and port # as I monkeyed with that and mine is working without the port number crrently at least for that setting.

Then restart the masternode, and wait until 'mnsync status' shows 999, then check the 'masternode status'  again and lets see if it works?

EDIT:  Also ensure your masternode.conf file in the /testnet3 directory of your controller wallet has the public IP And the colon and 40001 in it, and it matches, the public ip, and that you can reach the public ip from the controller wallet with:
telnet public_IP 40001

So a little update for everyone- I spent last night adding the ability to the pool to add a governance object, added a proposal object, and the ability to list proposals.  Since the proposals have to go through phases (IE created, submitted, voted, budgeted, approved, queued for superblock, paid) I have to still add more code to the pool on the testnet side in order to get everyone on board and vote from testnet for the first proposal!  Then we can watch it go through the phases, and add some more code to be able to see the masternodes voting on it!  Kind of like dash-central does, when they see the progress of their proposals, and the entry into the budget superblock cycle.
I also have to ensure we move these proposals to history so we dont clutter up the screen.  We will probably have an active proposals list (those that you can vote on) respecting testnet and prod of course, and then the Historical proposals (those are the ones that have been Paid in a superblock already).

Just as a side note, I am going to create a wiki page for a Fundraiser for testnet, to pay our orphan recurring expenses as a Proposal - IE to simulate a real world use case for January 2018!  Then we can all vote on it here in testnet and see if it pays the keypair properly!

Exciting stuff!  You will be able to click on the row in the proposal to bring up the wiki page to see what you are voting as a masternode....

Maybe this is the problem? Was this exactly 500000 BBP or not? I'm confused with the fee. I used the command from the wiki instructions:

Code: [Select]
sendtoaddress <ESCROW_ADDRESS> 500000
But maybe I need to send it through the GUI and uncheck any fees?

Also, this is how the transaction appears in the wallet:

And balance:

Yeah, you sent it right.  There are a couple ways to double check it.  But first of all when you do it from the command line like that, you cant screw it up.

First, if you do a getrawtransaction b0cfdfa2194556e211099bc620a7e27487958aa5774db0c78ded0f839e3105d2 1, and look at the vout1 you will see its exactly 500 grand.

Next if you type masternode outputs from the node that received the BBP, you will get the proper txid and vout to use for the masternode.conf.

Regarding the 'not a masternode' issue,from masternode status, you have to run that command from the masternode (not the controller wallet).  The masternode has to have the masternode=1 in the config file, along with its masternodeprivkey=XXX in the config.  Was all that set up?

Hopefully you got it all worked out.


*** YIPPI ****

We had our first testnet superblock!  I feel like Evan Duffield.    The Hex encoding finally broke through, oh but the convoluted feeling.

Alright now I need to regroup and figure out how we can add this to the testnet side of the pool.

Will be back tomorrow for more testing.

PS: If anyone wants to see the very first testnet superblock, do a showblock 10125.
I see that the miner gets the block subsidy (no sanctuary is paid the 50% on the superblock, lucky miner gets entire subsidy), and the 15% budget we allocate to IT/PR and Charity is paid in vout 2+ to the recipients of the passing voted budget.  So if we had a superblock every 100 blocks in prod for example (this is only an example), 15% would be held back from all 99 blocks (10% for charity, 5% for IT-PR) and on block 1000, that superblock would have the sum of the 15% allocated over the last 99 blocks included in the voted and approved budget, paying recipients 2+ (IE for the distinct count of approved campaigns) for those 100 blocks.....  Sweet....   

The website will allow us to create proposals in an easier manner, and enter receiving addresses.

Right now it will be a little convoluted to vote on things from the masternodes.  I forgot to mention an added benefit of the cold wallet.  If you plan on hosting say 5 masternodes, you can create one controller wallet and vote on an issue with all masternode keys at once with the command 'gobject vote-many objectid action vote'.  That will alleviate a lot of the pain once we work this template out.

Just got in from work, in my wallet it still says status:enabled in both the My Sanctuaries and All Sanctuaries views.

Got txID f864a54729cff1c481ba3e1a275b5d4c9402560022739bffb9d7cc2bfbf35ad8-000 for block 9461 at 10/12/17 04:43:22 (a few minutes ago local time)

Ok cool, well Im learning more about the details of watchdog now.  It looks like after 7200 seconds, if watchman runs while your node is dead, it fails to create a signable gobject for POSE.  So, somewhere in the picture, it looks like your node would eventually fall behind in the payment queue if you werent the miner.  I think right now we can all get paid because our actual biblepayd instances are miners themselves, so they can always find the receiving address to append to the block plus we have more than enough blocks to go around.

Anyway, this is a very deep rabbit hole, the budgets and superblocks.  It looks like we actually need more code to be executed between proposal, budget and superblock creation (called a trigger).  Im merging in the trigger code now and Ill let everyone know what happens after I figure this out. 

Since we are on testnet, we only need 2 signing masternodes to approve the budget.  Since I have 2 I might be able to approve the budget, will update asap.

So now I am doing a little Biblepay hacking to try to find out if our approved proposal made it into the budget, and therefore becomes a lone superblock.

On a side note, we have superblocks every 25 blocks in testnet. 

If you want to see what is inside watchman, you can do the following:

apt-get install sqlite3

cd into the watchman directory

sqlite3 watchman

sqlite> .tables (ENTER)

select * from proposals;

To dump the schema:


So now, on the bright side, I see our proposal has become a proposal in SQLite.  And I see our watchdog is communicating back and forth for POSE into biblepayd.  I see the votes going into the gobject in SQL. 
     However what Im trying to find next is if the superblock height has to be between the start and end unix time of the approved proposal.  I believe all we had to do was have more than 2 absolute votes for validity and funding for this proposal to become part of the superblock, but cant say for certain yet.  Checking...

910ac78557d3fbefe063e0a070333de4043010db95016002f0661aaa31344de9-001 is one of the MN payments. It was for block 8980.  I also mined block 8980 with TXID 910ac78557d3fbefe063e0a070333de4043010db95016002f0661aaa31344de9-000.
I see it, looks like a masternode payment.

I did see your watchdog expire while I was casually looking.  I wonder if your payments stopped after that?

So far I've received several hundred transactions the last one was about 10 minutes ago, and the node shows enabled in the sanctuary list as well.

Running 'gobject list' from Debug shows two proposals, one with a hash of 86e1a81115085f055d585db97a42e5189e613baddc1c244dd4bce0b756e5db08 for 444 BBP, and the second with a hash of e4470e53f65843b8f5c82172b41c10a5e31a74bdbe4aaba32a83ca1fd1e2f656 for 5777 BBP.  I voted for the later and the vote count increased by one.
Good on the vote, so far.

Could you please double click one of the transactions from the tx list row, and grab the txid and paste here?  Id like to verify it is a masternode payment and not a mining payment.

Btw, if anyone wants to learn how to audit a payment you can do this:

getrawtransaction txid 1
When you use a 1, you will see everything about it.  In the vout list, the coinbase payment to the miner is in location 0.  A masternode payment is in location 1.  A superblock payment is in location 2->count of superblockpayment list for approved budget.  The destination address is also shown in the vout so you can see if its your masternode alias address also, by comparing it to your receiving address book list (Receiving Addresses -> List).  Your mn alias should be labeled on that list since you did the getaccountaddress alias command when you set up the cold wallet (this is all done inside the controller wallet btw).

Its also a very helpful command when someone asks you where the missing coins are.  Getrawtransaction txid 1 means the tx reached the entire network.

Good morning all-

I modified enough to at least allow you to create a cold sanctuary.   Ill put Togos FAQs in at the end in a half hour.

Next, now is the time to get our wheels rolling.  I added our first proposal in testnet.  (Ill explain more later on how to create a decentralized proposal, but for now, behind the scenes, I have to collect the 8 input fields- things like discussion URL, start date time, end date time, the times fit between the superblock trigger time, the payment address and the funding amount- convert this to hex- which I did create a tool for inside the wallet - I will enable the tool that does all this automatically for you).  For now, I created an proposal for 5777 biblepay, sending the reward to my testnet address for payment on one of my sanctuaries, with a start time 1 second in the future and ending tomorrow at 10 pm (for voting).  What I am hoping is today we can vote yes on this for funding, and then we can check to see if everyone sees the votes and if it goes into the superblock for payment and then obviously if I receive the money.

So first, do a 'gobject list' and see if you see the proposal for 5777bbp.

Next to vote on it for funding, grab your masternode alias name - this is done on the controller wallet wherever the escrow is and type this:
gobject vote-alias 86e1a81115085f055d585db97a42e5189e613baddc1c244dd4bce0b756e5db08 funding yes your_node_alias

Next do a gobject list. and see if the YesCount as incremented above 1 (I voted Yes 20 minutes ago).

My node is a cold node.  The only thing I've yet to get working is the watchman. 

Mine is (cold node, no watchman, Vultr).

Could you please tell us something about a non-watchman node?  I am under the impression from interpreting the watchdog code that after a certain number of blocks passes, your non-watchman node status should go from "ENABLED" to NEW_START_REQUIRED.   

It will be interesting to know if you get paid your masternode fees with watchman off.  Are you receiving subsidies of 8300~ or so?  Note in your receiving list, the subsidy to the masternode comes in BY NAME, not by address.  For example I named my masternode DEBIAN in the cold sanctuary, so the payments come in the receiving list to DEBIAN.

Either way you will probably get tripped up when we get to the voting but it is interesting to know if you are getting paid, and when you get tripped up without watchman.

Thank you so much for answering my questions!!!  :D

No problem.  I am going to edit the create_masternode wiki page now (with that port number) etc.  I tested a cold masternode yesterday and it worked.

What I would like to do is get a few of us together here in a synced quorum, so we have at least 4 running masternodes on our synced list.
Then I can go ahead and create a governance object and see if everyone sees it.

Please, post here if you have your running static IP masternode in the masternode list.


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 500000 and dont click instant send or any other options.

If you are creating a Hot wallet (IE funds live on the masternode) you would send the 500k to the masternode 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: Which node is the Masternode?
  -> The masternode is the sanctuary running at the hosting company with the static IP.

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: Is there a certain label that should be used for getaccountaddress?
One pitfall I noticed is if you use the same label more than once sometimes I get a new address.  I would recommend something short such as "MN1".  To ensure its only in the book once, click Receiving addresses and if it is already there as MN1, copy it to clipboard.

QUESTION: How to deal with fees when sending? Does amount have to be 500,000 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 500,000.

QUESTION: Why port 51472? And does it need to be changed in any firewalls?
-> Oh no, this is a mistake, I will modify the guide.  This should be 40001.  Also in the UFW command list, it should be 40001.
Port 40001 is BBP testnets P2P port, 40000 is Prod BBP p2p port.

QUESTION: What IP address goes in this part of the config? "externalip=your_public_ip"
-> So when you rent your VM, and click into its hosted properties, you should see a public IP.  You should copy that and make it like this:
NOTE: This is only required on the sanctuary side, not on the controller wallet side.

QUESTION: What are these config 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 million 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: Im stuck, help! :)
I opened /testnet3 debug.log with baretail and I see action happening, is their a syncing Period?
-> Yes, unfortunately this is a very frustrating, thats one reason I had to go to 1 minute blocks in testnet.  The wallet requires blocks to be moving for the 'mnsync status' command to iterate to the next step.  Do a setgenerate true 5, to keep blocks moving.  After 'mnsync status' shows 999, then you can start and stop the masternode and see the masternode list 'masternodelist'.

QUESTION: Where does Watchman fit in the process? What is Watchman? what is it doing?
-> Yes, I know.  Why 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.  Let us say without it, Dashs POSE system would be in tatters.  Basically, if BBP ever reaches say $50 million market cap and then we have 1000 masternodes, situation A is without watchman, all the nodes who do a start on windows and then start playing video games a few hours later and kill the node by accident those nodes would not be doing anything for us, and would still get paid fully.  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.  It allows 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 very well.  Dash probably could have added code to masternode governance for all of it, but they chose this modular design in case they want to have masternodes upgrade the superblock code side and NOT the entire network to upgrade the wallet.  We inherited it so we have to embrace it now - what I am hoping is the version we ported is already stable and I can code a lot more on the web side and sort of freeze what we have for a year and grow as we are until we have our extra few IT devs helping me out to ensure we have the bitcoin commits committed constantly.

Cannot connect to biblepayd. Please ensure biblepayd is running and the JSONRPC port is open to watchman.

STUCK: What am I doing wrong here?
-> In this case I would go to the masternode and edit the biblepay.conf, and ensure rpcallowip= is set.
Also check to make sure watchman.conf has testnet uncommented and prod commented.

I just wanted to mention that I have been a little busy lately (other than being interrupted to upload the pool, which is a huge necessity), with a brand new cryptocurrency feature for biblepay.  I think it might be "the killer" feature for us.

I'm thinking about adding colored coins into biblepay with an integrated 401k or retirement account fund inside the wallet.  And in-wallet trading.

I'm thinking maybe we can be the first coin with the ability to trade BiblePay for our second asset inside the wallet (other than Ripple, but technically, Ripple is a network of market makers making existing markets).  This is a little different.

I'm thinking we emit a new deflationary colored currency (called either retirement coins or 401k coins) inside the wallet on a schedule decreasing by 1% per day.  Then, the wallet will keep track of both normal balance and "colored coin" balances.  So you would have your BBP balance and your rBBP balance. 

   Starting on the day we have retirement coins, the retirement system would emit 1 million retirement coins per day equally divided over 202 daily blocks to the miners who mine the blocks.  However each day, the emission rate would decrease by 1% .  So on day 2 we would emit 10,000 coins less (or 990,000 retirement coins over 202 blocks).  Each block solver would receive normal BBP, plus a separate share of colored retirement coins.  If you mined 4,000 retirement coins on day #1, your balance would now be:  1,000,000 BBP and 4,000 rBBP (retirement bbp). 

You cannot send colored coins to an exchange to sell them and cannot buy colored coins on an exchange.
All colored coins must be sent in a transaction that includes a reference to the root of the colored coins (another words, the colored indicator on the tx, the previous output is colored, and the new vout for the receiver is colored).

Available coins for spending will never select colored coins for spending (IE They cannot be spent). But they can be Traded for BBP with other holders through Trade transactions.

A new RPC command will allow you to send colored coins back and forth among others, if you want to give them to others.

Now here is where it gets interesting.  If we view the colored coins as a deflationary retirement account (assuming that IF they are becoming scarcer, storing FIAT in rBBP would theoretically result in a gain in value).

We implement in-wallet trading to allow trading from BBP to rBBP.  So we would have RPC commands to "execute order SELL 9000 rBBP for 1100 BBP" for example.  Other in-wallet users would "execute order BUY rBBP 5000 for 700 BBP".  When the matching engine matches an order over the nodes, one masternode  who is the chosen winner of the round (chosen winner meaning which masternode has the closest hash to the center of the blockhash for the current BBP block, can be active market maker for this tx).

At this point, the masternode jumps in, Locks the trade, grabs the collateral from the seller and the buyer, crosses the trade, then unlocks it and it is completed.  We will have a Trading log in biblepay, so you can go into your separate debug file and monitor STEPS that occur during trading.  (In case something goes wrong partially through).

Lastly, partially executed orders would be changed via a MODIFY - so if only 1000 got filled your order would readvertise with the partial amount left.

In this way, we would have in-wallet trading, colored coins, and a second deflationary asset inside biblepay.

My projection shows that the retirement coins would deflate for 4000 days before reaching a floor where they would be emitted at approximately 1 per day (if we start with a million per day).  I think at that point, I would like the system to reverse split the coins and start over, so that we perpetually have a deflationary retirement asset inside BBP.

One benefit of having this particular feature is we would attract outside investors that would need to buy BBP in order to have the ability to buy rBBP and they also potentially download the wallet and be users and might have a tendency to be long term holders.

Pages: 1 ... 235 236 237 238 239 240 241 [242] 243 244