BLOCKFROST_TOKEN='WEBHOOK-AUTH-TOKEN' dart run bin/server.dart
curl -X GET http://localhost:8080/status
curl --location 'http://localhost:8080/webhook' \
--header 'blockfrost-signature: YOUR_GENERATED_SIGNATURE' \
--header 'Content-Type: application/json' \
--data '{"type": "block", "payload": {"hash": "0a26dd2b2c2cd32e66029215d22cd9f1572e41bd6549c75cf2479fb9b771487a"}}'
# This command builds the image locally and tags it for pushing to Google's registry (GCR).
# Important: Attach the "--platform linux/amd64" when you built it on arm (MacOS) architecture!
docker build --platform linux/amd64 -t us-central1-docker.pkg.dev/blockfrost-webhook/dart-webhooks/blockfrost-secure-webhook:latest . --no-cache
### Note: if error comes up clean the dart tool and run docker build again
# Delete the local configuration cache
rm -rf .dart_tool
docker run -d \
-p 8080:8080 \
--name blockfrost-secure-webhook-test \
-e BLOCKFROST_TOKEN='WEBHOOK-AUTH-TOKEN' \
us-central1-docker.pkg.dev/blockfrost-webhook/dart-webhooks/blockfrost-secure-webhook:latest
docker logs -f blockfrost-secure-webhook-test
Generate the signature using the generate_test_signature.dart and paste it into the header
curl --location 'http://localhost:8080/webhook' \
--header 'blockfrost-signature:
ADD_SIGNATURE_HERE' \
--header 'Content-Type: application/json' \
--data '{"type": "block", "payload": {"hash": "0a26dd2b2c2cd32e66029215d22cd9f1572e41bd6549c75cf2479fb9b771487a"}}'
brew install --cask google-cloud-sdk
gcloud auth login
# Example: blockfrost-webhook
gcloud config set project [YOUR_PROJECT_ID]
e.g.: gcloud config set project blockfrost-webhook
gcloud auth list
gcloud config list
gcloud services enable artifactregistry.googleapis.com
gcloud artifacts repositories create dart-webhooks \
--repository-format=docker \
--location=us-central1 \
--project=blockfrost-webhook \
--description="Docker images for Blockfrost secure webhooks"
This command tells Docker how to authenticate with the new Artifact Registry service.
gcloud auth configure-docker us-central1-docker.pkg.dev
Open the Google Cloud Console.
Navigate to IAM & Admin > IAM.
Click + Grant Access at the top or edit already existing user.
In the New principals field, enter your Google account email address (e.g., YOUR_EMAIL).
In the Role dropdown, search for and select:
Artifact Registry Writer (If you only want permission to push images).
Click Save.
This uploads the image so Cloud Run can access it.
docker push us-central1-docker.pkg.dev/blockfrost-webhook/dart-webhooks/blockfrost-secure-webhook:latest
Choose a region close to you or your users (e.g., us-central1). Note: replace the 'WEBHOOK-AUTH-TOKEN' with the auth-token from blockfrost webhook settings page
gcloud run deploy blockfrost-webhook \
--image us-central1-docker.pkg.dev/blockfrost-webhook/dart-webhooks/blockfrost-secure-webhook:latest \
--platform managed \
--region us-central1 \
--allow-unauthenticated \
--port 8080 \
--set-env-vars BLOCKFROST_TOKEN='WEBHOOK-AUTH-TOKEN' \
--project blockfrost-webhook
# Example:
Service URL: https://blockfrost-webhook-PROJECT_NUMBER.us-central1.run.app/webhook