Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/scrypt-inc/oracle-demo
https://github.com/scrypt-inc/oracle-demo
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/scrypt-inc/oracle-demo
- Owner: sCrypt-Inc
- Created: 2023-11-17T02:05:34.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2023-11-23T05:52:17.000Z (about 1 year ago)
- Last Synced: 2024-11-05T09:37:05.814Z (3 months ago)
- Language: TypeScript
- Size: 327 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# oracle-demo
Vercel deployment of this Oracle service: https://oracle-demo.vercel.app/docs
A [code example](./test/priceBet.e2e-spec.ts#L42-L83) of how smart contract [PriceBet](./src/contracts/priceBet.ts) uses this Oracle.
## Installation
```bash
$ npm install
```## Running the app
**Step 1**. Create a `.env` file under the project root directory from template `.env.example`.
Generate `RABIN_PRIV_P` and `RABIN_PRIV_Q` with command `npm run genRabinPrivKey`.
![](https://aaron67-public.oss-cn-beijing.aliyuncs.com/202311210711000.png)
Generate `PRIVATE_KEY` with command `npm run genBsvPrivKey`.
![](https://aaron67-public.oss-cn-beijing.aliyuncs.com/202311210709519.png)
**Step 2**. Run this app with the following commands.
```bash
# development
$ npm run start# watch mode
$ npm run start:dev# production mode
$ npm run start:prod
```**Step 3**. View Swagger docs at http://localhost:3000/docs
## Test
```bash
# unit tests
$ npm run test# e2e tests
$ npm run test:e2e# test coverage
$ npm run test:cov
```