Adds an alternative to the BIP32_XPUB env var for address derivation using BitGo's API
Requires 2 new env vars, BITGO_WALLET_ID & BITGO_ACCESS_TOKEN
Enables configuration of a FIXIE_URL to proxy BitGo requests with a static IP using Fixie
Adds a flask command reset-db-chain-data that deletes any data that relies on chain state, allowing you to keep data that doesn't without wiping out the whole DB
Cleans up error logging a bit with a utility function to extract useful error text
Apologies for the diff noise added by this, it was driving me bonkers to see [object Object] in our error logs so often though.
Adds some better error handling to prevent silent failures in the blockchain watcher
Steps to Test
Basic happy path tests
Make sure you have a user with a refund address and a proposal created.
Run the new command flask reset-db-chain-data to wipe your chain-dependent database data. Confirm the site functions properly after, and doesn't have any of the data we wanted wiped.
Create a new BitGo ZEC wallet. Save the wallet id for later.
Create a new BitGo API key. Give it read access, save the access token for later.
Update your .env files in the following ways
Backend
EXPLORER_URL (to mainnet explorer)
Frontend
EXPLORER_URL (to mainnet explorer)
TESTNET (remove)
Blockchain watcher
ZCASH_NODE_URL (to mainnet node)
ZCASH_NODE_USERNAME (to mainnet node)
ZCASH_NODE_PASSWORD (to mainnet node)
BITGO_WALLET_ID (to wallet id from above)
BITGO_ACCESS_TOKEN (to access token from above)
MAINNET_START_BLOCK (to current block height - some)
BIP32_XPUB (remove)
SPROUT_ADDRESS (remove)
SPROUT_VIEWKEY (remove)
Create a proposal, confirm staking contribution generates an address.
Confirm that address matches the one in bitgo with a proper label.
Confirm that going to your profile and clicking the stake button presents you with the same address.
Pay to the address, confirm your proposal
Production static IP tests
Generate a new BitGo access token and specify all of the Fixie IPs as the whitelisted IPs (can be found by clicking on Fixie in the heroku resources tab) and set that in the blockchain .env file
Confirm that blockchain watcher fails to start due to unauthorized IP address
Grab a FIXIE_URL environment variable from one of the heroku watcher instances and add it to your own blockchain .env file
Confirm that blockchain watcher is able to start now
Re-run through the address generation process, confirm it still works
Sad path tests
Remove either BITGO_WALLET_ID or BITGO_ACCESS_TOKEN, not both. Confirm blockchain watcher fails to start.
Set the node to a testnet or regtest node with BITGO* env vars set. Confirm blockchain watcher fails to start.
Put garbage in the access token env var and wallet id. Confirm blockchain watcher fails to start immediately.
Set BIP32_XPUB in addition to BITGO env vars, confirm you're warned that it'll use bitgo instead.
Closes #317.
What This Does
BIP32_XPUB
env var for address derivation using BitGo's APIBITGO_WALLET_ID
&BITGO_ACCESS_TOKEN
FIXIE_URL
to proxy BitGo requests with a static IP using Fixiereset-db-chain-data
that deletes any data that relies on chain state, allowing you to keep data that doesn't without wiping out the whole DB[object Object]
in our error logs so often though.Steps to Test
Basic happy path tests
flask reset-db-chain-data
to wipe your chain-dependent database data. Confirm the site functions properly after, and doesn't have any of the data we wanted wiped..env
files in the following waysProduction static IP tests
FIXIE_URL
environment variable from one of the heroku watcher instances and add it to your own blockchain .env fileSad path tests
Screenshots