- clone:
git clone https://github.com/kyokan/bob-wallet
- install:
cd bob-wallet; npm install
- run in developer mode:
npm run dev
This will launch Bob Wallet with a few extra "inspector" windows.
One is for the React UI and the other is for a "hidden" window that actually is running hsd.
You'll notice the terminal where you ran npm run dev
also has a lot of log messages.
As soon as you can, enter the settings panel of Bob and switch to regtest. Even after Bob restarts in regtest, you may need to cntl+R (reload) the settings panel UI. Copy the API key.
In a second terminal window:
export HSD_API_KEY=<api key from Bob>
export HSD_NETWORK=regtest
Now you can start making CLI commands (assuming hs-client is installed globally in your environment).
For example, you can get a receive address from Bob UI and then generate 10 blocks to yourself:
hsd-rpc generatetoaddress 10 <receive address>
Sometimes you'll want to generate blocks to confirm something but don't want to crowd up your portfolio screen. Generate blocks to an address from the primary wallet instead!
hsw-rpc selectwallet primary
hsd-rpc generatetoaddress 10 `hsw-rpc getnewaddress`
ooh, notice the command-within-another-command there?
With these methods you can open and bid on auctions from the Bob UI, then go back to the terminal and generate blocks to move the auction progress forward. Keep in mind on regtest, auction phases are extremely short:
regtest.names = {
auctionStart: 0,
rolloutInterval: 2,
lockupPeriod: 2,
renewalWindow: 5000,
renewalPeriod: 2500,
renewalMaturity: 50,
claimPeriod: 250000,
biddingPeriod: 5,
revealPeriod: 10,
treeInterval: 5,
transferLockup: 10,
revocationDelay: 50,
auctionMaturity: 5 + 10 + 50,
noRollout: false,
noReserved: false
};
Other tips and tricks:
Here's an easy to remember 24-word phrase THAT SHOULD ONLY EVER BE USED IN TESTING ENVIRONMENTS.
This phrase (and its 12-word counterpart) are used in example documentation all throughout the Bitcoin
space and so it should only be used for testing. "EVERYONE" has this private key. It's essentially all zeros
with a valid checksum. I reccomend the greatest regtest wallet password of all time: 12345678
.
abandon abandon abandon abandon
abandon abandon abandon abandon
abandon abandon abandon abandon
abandon abandon abandon abandon
abandon abandon abandon abandon
abandon abandon abandon art
abandon abandon abandon abandon
abandon abandon abandon abandon
abandon abandon abandon about
It's so easy to remember you shouldn't have to write it down and obviously you don't need to keep it safe because you will NEVER use it for anything where real money is invovled.
This makes it easy to test the flow where a user has to import from seed: Do whatever you want with the wallet, then go to settings and click "Remove wallet and create new wallet". The blockchain data stays put (whatever TX you sent or auctions you bid on, won or lost) but the wallet will get cleared out and Bob will attempt to restore the wallet via the BIP44 recovery process.
You can watch the hsd log output from the Electon data directory. On OSX for example you can tail the log here:
tail -F ~/Library/Application\ Support/Electron/hsd_data/regtest/debug.log
Note that a compiled release of Bob will store data here instead:
~/Library/Application\ Support/Bob
So you can have a "personal mainnet" Bob and still develop on a different Bob
If you comment out this line when building Bob from source, it will launch hsd without an API key. Of course this is insecure for mainnet and production, but when you are restarting Bob in dev mode every ten seconds and need to use CLI commands, it's a huge time saver.
Btw, under the Extra bonus tip, the code has moved from
app/hsdMain.js
toapp/background/node/service.js
. Searching fornew FullNode
in the file gets the right line.