What does this implement/fix? Explain your changes.
This PR adds a DataPublisher utility class to the nightfall client, that is used to publish L2 block data to external services via webhook. This is enabled via the environment variable CALL_WEBHOOK_ON_CONFIRMATION. The url of the webhook is configurable via the environment variable WEBHOOK_PATH.
The DataPublisher supports multiple destinations(webhook for now, could be different transport mechanisms in future like grpc or socket), including multiple webhook destinations for fallback/backup.
The PayloadSigner class abstracts away the optional signing of the payload using HMAC. The signing key(secret) is configurable via the environment variable WEBHOOK_SIGNING_KEY.
The RetryHandler class abstracts away the retry mechanism with exponential backoff strategy that is configurable via environment variables CALL_WEBHOOK_MAX_RETRIES and CALL_WEBHOOK_INITIAL_BACKOFF.
Does this close any currently open issues?
No
What commands can I run to test the change?
Add the required environment variables to docker-compose.dev.yml:
What does this implement/fix? Explain your changes.
This PR adds a
DataPublisher
utility class to the nightfall client, that is used to publish L2 block data to external services via webhook. This is enabled via the environment variableCALL_WEBHOOK_ON_CONFIRMATION
. The url of the webhook is configurable via the environment variableWEBHOOK_PATH
.The
DataPublisher
supports multiple destinations(webhook for now, could be different transport mechanisms in future like grpc or socket), including multiple webhook destinations for fallback/backup.The
PayloadSigner
class abstracts away the optional signing of the payload using HMAC. The signing key(secret) is configurable via the environment variableWEBHOOK_SIGNING_KEY
.The
RetryHandler
class abstracts away the retry mechanism with exponential backoff strategy that is configurable via environment variablesCALL_WEBHOOK_MAX_RETRIES
andCALL_WEBHOOK_INITIAL_BACKOFF
.Does this close any currently open issues?
No
What commands can I run to test the change?
docker-compose.dev.yml
: