pinax-network / substreams-sink

Substreams Sink library
MIT License
4 stars 1 forks source link

include `--labels [...string]` to sink #7

Closed DenisCarriere closed 1 year ago

DenisCarriere commented 1 year ago

bin/cli.ts

command.option('-l --labels [...string]', "To apply generic labels to all default metrics (ex: --labels foo=bar)", handleLabels, {})
export function handleLabels(value: string, previous: {}) {
    const params = new URLSearchParams(value);
    return { ...previous, ...Object.fromEntries(params) };
}
chamorin commented 1 year ago

Done in commit: https://github.com/pinax-network/substreams-sink/commit/f6a59fbbbd4e6e6284edcf31e13ebbb2dff692f2