Skip to content

Releases: pinax-network/substreams-sink-webhook

v0.9.2

21 Feb 01:53
5b55894
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.9.1...v0.9.2

v0.9.1

20 Feb 14:07
Compare
Choose a tag to compare
  • remove pm2 from start

v0.9.0

20 Feb 04:16
Compare
Choose a tag to compare
  • improve cursor handling on restart or error
  • improve logging
  • add pm2 to start

v0.8.6

15 Feb 02:06
c95a95d
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.8.4...v0.8.6

v0.8.4

14 Feb 15:44
10cad67
Compare
Choose a tag to compare
  • fix: allow TweetNaCl private key format
  • fix: if DISABLE_SIGNATURE=true don't check if private key exists
  • export schemas
import { ManifestSchema } from "substreams-sink-webhook/schemas"

What's Changed

Full Changelog: v0.8.0...v0.8.4

v0.8.0

13 Feb 21:06
Compare
Choose a tag to compare

Performance increase

A significant improvement replacing tweetnacl with @noble/curves

  • sign: 6.5x faster
  • verify: 2.5x faster
image

What's Breaking?

What's new?

  • update substreams-sink
    • improved inactivity handling
  • add new webhook CLI flags
    • disablePing
    • disableSignature
    • maximumAttempt
  • Add more test cases for sign & verify
  • add /keypair as HTTP endpoint

Tweetnacl

const nacl = require("tweetnacl");

// Your public key can be found on your application in the Developer Portal
const PUBLIC_KEY = "APPLICATION_PUBLIC_KEY";

const signature = req.get("X-Signature-Ed25519");
const timestamp = req.get("X-Signature-Timestamp");
const body = req.rawBody; // rawBody is expected to be a string, not raw bytes

const isVerified = nacl.sign.detached.verify(
    Buffer.from(timestamp + body),
    Buffer.from(signature, "hex"),
    Buffer.from(PUBLIC_KEY, "hex")
);

if (!isVerified) {
    return res.status(401).end("invalid request signature");
}

@noble/curves

import { ed25519 } from "@noble/curves/ed25519.js";

// validate signature using public key
const isVerified = ed25519.verify(
  signature,
  Buffer.from(timestamp + body),
  PUBLIC_KEY,
);

.env

# Webhook
PRIVATE_KEY=<Ed25519 Private Key>
WEBHOOK_URL=http://127.0.0.1:3000
PORT=9102

# Get Substreams API Key
# https://app.pinax.network
# https://app.streamingfast.io/
SUBSTREAMS_API_KEY=<Substreams API Token @ https://pinax.network>
SUBSTREAMS_ENDPOINT=https://eth.substreams.pinax.network:443

# Substreams Package (*.spkg)
MANIFEST=https://github.com/pinax-network/substreams/releases/download/blocks-v0.1.0/blocks-v0.1.0.spkg
MODULE_NAME=map_blocks
START_BLOCK=-10
PRODUCTION_MODE=true

# Webhook (Optional)
DISABLE_PING=false
DISABLE_SIGNATURE=false
VERBOSE=true
MAXIMUM_ATTEMPTS=100

What's Changed

New Contributors

Full Changelog: v0.7.5...v0.8.0

v0.7.5

11 Dec 15:08
Compare
Choose a tag to compare

v0.7.4

05 Dec 17:37
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.7.3...v0.7.4

v0.7.3

01 Dec 04:29
Compare
Choose a tag to compare

v0.7.2

29 Nov 04:45
Compare
Choose a tag to compare
  • export BodySchema to substreams-sink-webhook/auth