Skip to content

Latest commit

 

History

History
 
 

examples

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

This directory contains a series of small example apps that illustrate how to code up common use cases for a Bitcoin Cash application.

The low-level directory contains low-level applications exercising a single feature of bitbox. Think of these examples like lego blocks that can be used to build a bigger app.

The applications directory contains example applications like wallets, voting, and other ideas.

Installation

Prior to running these examples, you need to setup this code repository. In the root directory run these commands:

npm install
npm run build
npm run postbuild

Running Examples

You can run each example script by entering its directory and executing npm start

Basic BCH Wallet Functions

These basic examples in the applications/wallet directory are used to bootstrap a BCH testnet wallet for use with the other examples. Recommended path:

  1. Create a wallet
  2. Fund it with a testnet faucet
  3. Check the balance
  4. Send some tBCH (testnet BCH)
  5. Send tBCH back to the faucet.

Once those objectives are achieved, you're ready explore some of the other examples.

  • create-wallet Create a BCH compatible HD Node wallet on the BCH testnet. Send test BCH using a testnet faucet (like this one) to the address saved in the wallet.json file generated by this app.

  • check-balance Check the balance of your BCH wallet.

  • send-bch Send BCH to another address. You can send small amounts of tBCH (testnet BCH) to the address in the address in the wallet to generate UTXOs and explore the difference between addresses and utxos in Bitcoin.

  • consolidate-utxos to combine multiple utxos in an address back into a single UTXO.

  • send-all sends all BCH in an address to another address. Great for sending you tBCH back to the testnet faucet.