GithubHelp home page GithubHelp logo

bch-js-examples's Introduction

This repository has been deprecated

These code examples have been moved to the psf-js-examples code repository. They are maintained there. This bch-js-examples repository has been frozen and is no longer maintained.


This repository contains a series of small example apps that illustrate how to code up common use cases for a Bitcoin Cash application using the bch-js JavaScript library and the bch-api REST API, offered by FullStack.cash

Here are two YouTube walk-through videos to help you get started:

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

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

For a full-blown wallet app, check out the following libraries:

  • minimal-slp-wallet is a single-address wallet library that has been optimized for web apps. It's the wallet engine that powers wallet.FullStack.cash.
  • slp-cli-wallet is both a command-line wallet as well as an NPM JavaScript library for providing high-level wallet functionality to your own applications. It's primarily used as a sand-box for rapid prototyping of ideas. It support HD wallet functionality.
  • psf-bch-wallet is a single-address command line wallet used by the PSF community to access 'freedom-enforcing' software.

If you want to chat with other developers interested in Bitcoin Cash, be sure to join our Telegram channel.

Installation

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

npm install

These examples (and all PSF code) target the Ubuntu operating system. If you're trying to get setup on Windows, check out this video.

Running Examples

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

More Information

If you're new to Bitcoin Cash or need to brush up on your fundamentals, here are some resources:

Basic BCH Wallet Functions

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

  1. Create a wallet
  2. Check the balance
  3. Send some BCH

A note about testnet

Testnet isn't just a network for software developers. Many mining pools, research labs, and even malicious miners, use the testnet and can disrupt the development workflow. Most professional developers on the Bitcoin Cash network prefer to use mainnet. They use 1000 satoshi transactions (a fraction of a penny) to test their software, or use SLP tokens to test large transaction amounts, and thus avoid using the disruptive testnet.

FullStack.cash does not provide any testnet support. It's expensive and disruptive, and very few professional developers use it.

bch-js-examples's People

Contributors

christroutner avatar danielhumgon avatar dependabot[bot] avatar ethanmackie avatar mr-zwets avatar nicocappabianca avatar rwlobster avatar therealbitcoinclub avatar zh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

bch-js-examples's Issues

Examples default to badly maintained testnet

When trying the basic examples as recommended I got a 502 Bad Gateway error when trying to check use check-balance.js.
Apparently this was because testnet servers are down and it is now better to just use mainnet instead.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.