Skip to content

Releases: pinax-network/substreams-sink-webhook

v0.3.4

28 Jul 17:55
Compare
Choose a tag to compare

v0.3.3

27 Jul 22:22
Compare
Choose a tag to compare
  • Exit with code 1 when ping fail

v0.3.2

27 Jul 14:36
Compare
Choose a tag to compare
  • Add http.listen()

v0.3.1

21 Jul 18:58
Compare
Choose a tag to compare
  • Updated substreams-sink version to latest
  • Added binary generation

v0.3.0

12 Jul 20:29
Compare
Choose a tag to compare
  • Update to latest substreams-sink

v0.2.1

10 Jul 20:10
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.2.0...v0.2.1

v0.2.0

15 Jun 23:41
Compare
Choose a tag to compare
  • Change signing provider to TweetNaCl
    • Use x-signature-ed25519 in header
    • Removed R1 Signing

Updates on Substreams Webhooks v0.2.0

  • Change signing provider to TweetNaCl
    • Use x-signature-ed25519 in header
    • Removed R1 Signing

Updated our Ping examples

ping-isVerified
https://github.com/pinax-network/pinax-cloud-webhooks/blob/main/examples/ping-isVerified.http

ping-not-isVerified
https://github.com/pinax-network/pinax-cloud-webhooks/blob/main/examples/ping-not-isVerified.http

The public key used to verify NaCl signature

Public Key
a3cb7366ee8ca77225b4d41772e270e4e831d171d1de71d91707c42e7ba82cc9

❗️One difference is signature header is referenced as ed25519

Headers

x-signature-ed25519
x-signature-timestamp

Typescript example to sign NaCl signature

image

v0.1.0

06 Jun 02:55
Compare
Choose a tag to compare

Substreams Sink Webhook

substreams-sink-webhook is a tool that allows developers to pipe data extracted from a blockchain to Webhook.

📖 References

Pre-built binaries

  • MacOS
  • Linux
  • Windows

Docker environment

docker build -t substreams-sink-webhook .
docker run -it --rm --env-file .env substreams-sink-webhook run

.env Environment variables

PRIVATE_KEY=PVT_K1_...
PUBLIC_KEY=PUB_K1_...
SUBSTREAMS_API_TOKEN=...
URL=http://127.0.0.1:3000
CHAIN=wax
SPKG=eosio.token
MODULE_NAME=map_transfers
START_BLOCK=-1
PARAM="symcode=WAX"

Help

$ substreams-sink-webhook --help

Usage: substreams-sink-webhook [options] [command]

Substreams Sink Webhook

Options:
  -v, --version                           version for substreams-sink-webhook
  -e --substreams-endpoint <string>       Substreams gRPC endpoint to stream data from
  --manifest                              URL of Substreams package
  --spkg                                  Substreams package (ex: eosio.token)
  --module_name                           Name of the output module (declared in the manifest)
  --chain <string>                        Substreams supported chain (ex: eth)
  -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: true)
  --metrics-listen-address <string>       The process will listen on this address for Prometheus
                                          metrics requests (default: "localhost")
  --metrics-listen-port <int>             The process will listen on this port for Prometheus
                                          metrics requests (default: "9102")
  --metrics-disabled                      If set, will not send metrics to Prometheus (default:
                                          false)
  -p, --params <string...>                Set a params for parameterizable modules. Can be
                                          specified multiple times. (ex: -p module1=valA -p
                                          module2=valX&valY) (default: [])
  --url <string>                          Webhook URL to send POST.
  --private-key <string>                  Private key to sign POST data payload (ex: "PVT_K1_...")
  -h, --help                              display help for command

Commands:
  completion                              Generate the autocompletion script for the specified
                                          shell
  help                                    Display help for command

Features

  • POST data to URL
  • Map hash module
  • Signing policy
    • R1 private keys
    • Ether.js
  • Retry policy
    • Exponential backoff (2x)
    • Initial Interval (1s)
    • Maximum Attempts (Infinity)
    • Maximum Interval (100 * initialInterval)
  • Queue
    • Conccurent requests (1)
  • Dockerfile
  • Provide CLI arguments or Environment Variables (.env)
  • Params injection
  • Prometheus metrics
    • add metrics from substreams-sink
    • add queue counter
    • add post counter
    • add error counter
    • update block stats when errors
  • PING URL on start (invalid + valid)
  • Save cursor.lock file on successful POST
  • Use clock data