Skip to content

Commit

Permalink
pandacash-core extracted to a separate repo
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianbarwicki committed Nov 7, 2018
1 parent 244b929 commit 8b5f770
Show file tree
Hide file tree
Showing 12 changed files with 211 additions and 817 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# pandacash-cli Release Notes & Changelog

## v0.4.2
* pandacash-core extract to a separate module

## v0.4.1
* Fixes of address generation, rpc extracted to a separate module

## v0.4.0
* Pandacash can be imported in another nodejs application as a node module.

Expand Down
51 changes: 3 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# pandacash-cli
# Pandacash CLI
Panda Suite is a suite of tools to make BCH development more accessible to every developer.

When developing applications for Bitcoin Cash, it is important that its functionality is well-tested, as the app can potentially be dealing with large amounts of money. For testing purposes, there is a public Bitcoin Cash testnet, but this testnet can not be used without an internet connection, and obtaining larger amounts of BCH can be cumbersome. Finally, in earlier stages of development, many developers would rather not be using a public network already, and would rather develop locally until development has furthered.
Expand All @@ -20,41 +20,11 @@ npm install --global pandacash-cli
## Usage
After installing `pandacash-cli`, it can be used as a command-line tool to quickly spin up a local development BCH blockchain with a single command. The local blockchain comes with ten pre-funded BCH addresses, which can be used in the local development process. `pandacash-cli` will also spin up a REST API to interface with the local blockchain that is fully compatible with [BITBOX](https://developer.bitcoin.com/bitbox/).

**As a general HTTP server**
```js
const panda = require("pandacash-cli");

const server = panda.server({
// optional, will be generated if not provider
mnemonic: "cigar magnet ocean purchase travel damp snack alone theme budget wagon wrong",
// default: 10
totalAccounts: 10,
// will log in the console
enableLogs: true,
// will show logs from the bch node
debug: false
});

server.listen({
port: 48332
walletPort: 48334
}, (err, pandaCashCore) => {
if (err) {
return console.error(err);
}

console.log("Mnemonic: " + pandaCashCore.opts.mnemonic);
console.log("Account[0] public key: " + pandaCashCore.accounts[0].address);
console.log("Account[0] private key: " + pandaCashCore.accounts[0].privateKeyWIF);
});
```

**Command Line**
```bash
$ pandacash-cli <options>
```


Options:
* `-a` or `--accounts`: Specify the number of accounts to generate at startup.
* `-m` or `--mnemonic`: bip39 mnemonic phrase for generating a PRNG seed, which is in turn used for hierarchical deterministic (HD) account generation.
Expand Down Expand Up @@ -110,23 +80,8 @@ Starting BITBOX API at port 3000
Bitcoin Cash Wallet Listening on http://localhost:48333
```
**In Jasmine/Mocha tests**
```js
const panda = require("pandacash-cli")
beforeAll(done => {
const server = panda.server({
enableLogs: false,
debug: false
})
server.listen(48332, (err, pandaCashCore) => {
if (err) done(err);
done()
})
});
```
**More usage options**
In order to use pandacash in your tests or as a server, use [`pandacash-core`](https://github.com/panda-suite/pandacash-core).
## Pandacash and bch.js
[`bch.js`](https://github.com/panda-suite/bchjs) can be added to your application or tests, and be used accordingly. It can be configured to connect to any node such as the pandacash local blockchain.
Expand Down
29 changes: 0 additions & 29 deletions examples/node-getinfo.js

This file was deleted.

139 changes: 0 additions & 139 deletions examples/send-bch.js

This file was deleted.

17 changes: 0 additions & 17 deletions examples/server.js

This file was deleted.

30 changes: 0 additions & 30 deletions examples/wallet-get-balance.js

This file was deleted.

30 changes: 0 additions & 30 deletions examples/wallet-listunspent.js

This file was deleted.

Loading

0 comments on commit 8b5f770

Please sign in to comment.