Skip to content

Commit d6caa2b

Browse files
authored
Merge pull request #37 from EOSIO/develop
Release 3.0.0
2 parents 96d3325 + c4f5546 commit d6caa2b

29 files changed

+7845
-134
lines changed

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ yarn-error.log
88
.eslintrc.json
99
README.md
1010
build-docs.sh
11+
.npmrc.template
12+
scripts/*

.npmrc.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}

.travis.yml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,27 @@ language: node_js
33
node_js:
44
- '10.0.0'
55
before_install:
6+
- npm i -g [email protected]
67
- npm install -g typescript
7-
script:
8-
- npm run lint
9-
8+
stages:
9+
- test
10+
- name: deploy
11+
if: (NOT type IN (pull_request)) AND (branch = develop)
12+
jobs:
13+
include:
14+
- stage: test
15+
name: "Lint and Test"
16+
script:
17+
- npm run lint
18+
- npm run test
19+
- stage: deploy
20+
name: "Deploy to NPM"
21+
script:
22+
- npm run build
23+
deploy:
24+
provider: script
25+
skip_cleanup: true
26+
script:
27+
- ./scripts/publish.sh
28+
on:
29+
branch: develop

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,44 @@
11
# demux-js-postgres [![Build Status](https://travis-ci.org/EOSIO/demux-js-postgres.svg?branch=develop)](https://travis-ci.org/EOSIO/demux-js-postgres)
22

3+
## Installation
34

5+
```bash
6+
# Using yarn
7+
yarn add demux-postgres
8+
yarn add massive
9+
10+
# Using npm
11+
npm install demux-postgres --save
12+
npm install massive --save
13+
```
14+
15+
## Usage
16+
17+
### MassiveActionHandler
18+
19+
The MassiveActionHandler uses [massive-js](https://github.com/dmfay/massive-js) to interact with a Postgres database for storing internal demux state as well as the state calculated by updaters.
20+
21+
```javascript
22+
const { BaseActionWatcher } = require("demux")
23+
const { MassiveActionHandler } = require("demux-postgres")
24+
const { NodeosActionReader } = require("demux-eos") // Or any other compatible Action Reader
25+
26+
const massive = require("massive")
27+
28+
// See https://eosio.github.io/demux-js/ for info on Handler Versions, Updaters, and Effects
29+
const handlerVersions = require("./handlerVersions") // Import your handler versions
30+
31+
// See https://dmfay.github.io/massive-js/connecting.html for info on massive configuration
32+
const dbConfig = { ... }
33+
34+
massive(dbConfig).then((db) => {
35+
const actionReader = new NodeosActionReader("http://my-node-endpoint", 0)
36+
const actionHandler = new MassiveActionHandler(
37+
handlerVersions,
38+
db,
39+
dbConfig.schema
40+
)
41+
const actionWatcher = new BaseActionWatcher(actionReader, actionHander, 500)
42+
actionWatcher.watch()
43+
})
44+
```

docs/assets/css/main.css

Lines changed: 865 additions & 0 deletions
Large diffs are not rendered by default.

docs/assets/css/main.css.map

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/assets/images/icons.png

9.26 KB
Loading
27.1 KB
Loading

docs/assets/images/widgets.png

480 Bytes
Loading
855 Bytes
Loading

0 commit comments

Comments
 (0)