Skip to content

Commit

Permalink
update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisCarriere committed May 29, 2023
1 parent 789419d commit 4047f70
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 19 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: CI

on: push

permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -14,13 +16,14 @@ jobs:
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
- run: npm run pkg --if-present
- run: npm test --if-present

- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
*-linux
*-macos
*-win.exe
*-x64
*-arm64
*-x64.exe
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ dist
*.log
data
build
*.lock
*.lock

*-x64
*-arm64
*-x64.exe
70 changes: 57 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# [`Substreams`](https://substreams.streamingfast.io/) [Redis](https://redis.com/) CLI `Node.js`

<!-- [<img alt="github" src="" height="20">](https://github.com/pinax-network/substreams-sink-redis) -->
<!-- [<img alt="npm" src="" height="20">](https://www.npmjs.com/package/substreams-sink-redis) -->
<!-- [<img alt="GitHub Workflow Status" src="" height="20">](https://github.com/pinax-network/substreams-sink-redis/actions?query=branch%3Amain) -->
[<img alt="github" src="https://img.shields.io/badge/Github-substreams.redis-8da0cb?style=for-the-badge&logo=github" height="20">](https://github.com/pinax-network/substreams-sink-redis)
[<img alt="npm" src="https://img.shields.io/npm/v/substreams-sink-redis.svg?style=for-the-badge&color=CB0001&logo=npm" height="20">](https://www.npmjs.com/package/substreams-sink-redis)
[<img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/pinax-network/substreams-sink-redis/ci.yml?branch=main&style=for-the-badge" height="20">](https://github.com/pinax-network/substreams-sink-redis/actions?query=branch%3Amain)

> `substreams-sink-redis` is a tool that allows developers to pipe data extracted from a blockchain to a Redis KV store.
## 📖 Documentation

<!-- ### https://www.npmjs.com/package/substreams-sink-redis -->
### https://www.npmjs.com/package/substreams-sink-redis

### Further resources

Expand All @@ -19,11 +19,10 @@

- [`sf.substreams.sink.kv.v1.KVOperations`](https://github.com/streamingfast/substreams-sink-kv/blob/develop/proto/substreams/sink/kv/v1/kv.proto)

## CLI
[**Use pre-built binaries**](https://github.com/pinax-network/substreams-sink-redis/releases)
- [x] MacOS
- [x] Linux
- [x] Windows
## [Pre-built binaries**](https://github.com/pinax-network/substreams-sink-redis/releases)
- MacOS
- Linux
- Windows

**Install** globally via npm
```
Expand All @@ -32,16 +31,61 @@ $ npm install -g substreams-sink-redis

**Run**
```
$ substreams-sink-redis run [options] <spkg>
$ substreams-sink-redis run --help
Usage: substreams-sink-redis run [options] [<manifest>] <module_name>
Substreams redis sink module
Arguments:
<manifest> URL or IPFS hash of Substreams package
module_name Name of the output module (declared in the manifest)
Options:
-e --substreams-endpoint <string> Substreams gRPC endpoint to stream data from (default:
"https://mainnet.eth.streamingfast.io:443")
-s --start-block <int> Start block to stream from (defaults to -1, which means
the initialBlock of the first module you are streaming)
-t --stop-block <string> Stop block to end stream at, inclusively
--substreams-api-token <string> API token for the substream endpoint
--substreams-api-token-envvar <string> Environnement variable name of the API token for the
substream endpoint (default: "SUBSTREAMS_API_TOKEN")
--delay-before-start <int> [OPERATOR] Amount of time in milliseconds (ms) to wait
before starting any internal processes, can be used to
perform to maintenance on the pod before actually letting
it starts (default: "0")
--cursor-file <string> cursor lock file (default: "cursor.lock")
--production-mode Enable Production Mode, with high-speed parallel
processing (default: false)
--verbose Enable verbose logging (default: false)
--metrics-listen-address If non-empty, the process will listen on this address for
Prometheus metrics requests
--metrics-listen-port If non-empty, the process will listen on this port for
Prometheus metrics requests
-p, --params <string...> Set a params for parameterizable modules. Can be specified
multiple times. Ex: -p module1=valA -p module2=valX&valY
(default: [])
-H --host <string> Redis instance host (default: "localhost")
-p --port <string> Redis instance port number (default: "6379")
-d --db <string> Redis database (default: "0")
-u --username <string> Username to access Redis instance (default: "")
-P --password <string> Password to access Redis instance (default: "")
-T --tls Use TLS to connect to the Redis instance (default: false)
-i --store-interval <int> Interval in seconds, based on sf.substreams.v1.Clock, at
which the data is stored in the KV database (default:
"30")
-h, --help display help for command
```
## Features

### Substreams
## Features

- Consume `*.spkg` from:
- [x] Load URL or IPFS
- [ ] Read from `*.spkg` local filesystem
- [ ] Read from `substreams.yaml` local filesystem
- [x] Handle `cursor` restart

<!-- ### Redis -->
### Redis

- [x] set
- [x] mset
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"scripts": {
"prepublishOnly": "tsc",
"build": "tsup index.ts bin/cli.ts --dts",
"pkg": "ncc build bin/cli.ts -o build && pkg build/index.js"
"pkg": "ncc build bin/cli.ts -o build && pkg dist/bin/cli.js --target linux-x64,mac-x64,win-x64,mac-arm64 --output substreams-sink-redis"
},
"dependencies": {
"commander": "latest",
Expand Down

0 comments on commit 4047f70

Please sign in to comment.