Files
ipfs-bch-wallet-consumer/README.md
T

78 lines
3.0 KiB
Markdown
Raw Normal View History

2021-11-23 10:10:42 -08:00
# ipfs-bch-wallet-consumer
2021-11-23 08:38:01 -08:00
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
2021-11-23 10:10:42 -08:00
This is a REST API server based on [Koa](https://koajs.com/). It's essentially a mirror image of [ipfs-bch-wallet-service](https://github.com/Permissionless-Software-Foundation/ipfs-bch-wallet-service). Where ipfs-bch-wallet-service is intended to be coupled to [bch-api](https://github.com/Permissionless-Software-Foundation/bch-api) to _provide_ blockchain service, ipfs-bch-wallet-consumer provides a localized REST API for _consuming_ that blockchain service.
2021-11-23 08:38:01 -08:00
2021-11-23 10:10:42 -08:00
When started, this web server starts an [IPFS](https://ipfs.io) node and connects to an ipfs-bch-wallet-service server over the IPFS network. It then pipes that connection over its own localized REST API.
2021-11-23 08:38:01 -08:00
2023-04-29 07:12:27 -07:00
More details are available at [CashStack.info](https://CashStack.info).
2021-11-23 08:38:01 -08:00
## Requirements
2022-01-03 11:35:26 -08:00
- node **^14.18.2**
- npm **^8.3.0**
- Docker **^20.10.8**
- Docker Compose **^1.27.4**
2021-11-23 08:38:01 -08:00
## Installation
### Development Environment
2023-04-29 07:12:27 -07:00
To run this software, you must have an instance of go-ipfs running in daemon mode, with the `--enable-pubsub-experiment` flag set. [Here are instruction for installing go-ipfs](https://gist.github.com/christroutner/a39f656850dc022b60f25c9663dd1cdd#install-ipfs).
2021-11-23 08:38:01 -08:00
2023-04-29 07:12:27 -07:00
Clone this repository and install npm dependencies. You'll also need to install MongoDB if you don't already have it installed:
2021-11-23 08:38:01 -08:00
```bash
2023-04-29 07:12:27 -07:00
git clone https://github.com/Permissionless-Software-Foundation/ipfs-bch-wallet-consumer
cd ipfs-bch-wallet-consumer
2021-11-23 08:38:01 -08:00
./install-mongo-sh
sudo npm install -g node-pre-gyp
npm install
2023-04-29 07:12:27 -07:00
cd shell-script
./local-external-ipfs-node.sh
2021-11-23 08:38:01 -08:00
```
### Production Environment
2022-01-03 11:35:26 -08:00
The [docker](./production/docker) directory contains a Dockerfile for building a production deployment.
2021-11-23 08:38:01 -08:00
```
2022-05-16 12:31:53 -07:00
docker-compose pull
2021-11-23 08:38:01 -08:00
docker-compose up -d
```
2022-05-16 12:31:53 -07:00
You can bring the containers back up with `docker-compose up -d`.
2022-01-03 11:35:26 -08:00
2023-04-29 07:12:27 -07:00
## Code Structure
2021-11-23 08:38:01 -08:00
2023-04-29 07:12:27 -07:00
The file layout of this repository differs from the koa-api-boilerplate. Instead, it follows the file layout of [Clean Architecture](https://christroutner.github.io/trouts-blog/blog/clean-architecture).
2021-11-23 08:38:01 -08:00
## Usage
- `npm start` Start server on live mode
- `npm run docs` Generate API documentation
- `npm test` Run mocha tests
- `docker-compose build` Build a 'production' Docker container
- `docker-compose up` Run the docker container
## Documentation
API documentation is written inline and generated by [apidoc](http://apidocjs.com/).
Visit `http://localhost:5000/docs/` to view docs
2022-06-27 10:09:08 -07:00
There is additional developer documentation in the [dev-docs directory](./dev-docs).
2021-11-23 08:38:01 -08:00
## Dependencies
2023-04-29 07:12:27 -07:00
This repository is forked from [ipfs-service-provider](https://github.com/Permissionless-Software-Foundation/ipfs-service-provider).
2021-11-23 08:38:01 -08:00
## IPFS
Snapshots pinned to IPFS will be listed here.
## License
[MIT](./LICENSE.md)