Google Cloud Function that pulls messages from Pub/Sub and saves them in Firestore.
This documentation builds upon that in the repo blockchain-etl/bigquery-to-pubsub.
gcloud config set project <PROJECT-NAME>
gcloud services enable cloudbuild.googleapis.com
gcloud services enable cloudfunctions.googleapis.comfirebase login --reauth --no-localhostVisit
https://console.firebase.google.com/project/<PROJECT-NAME>/firestore
We recommend creating in production mode, data stored in nam5
(us-central).
firestore init firebaseFor example, the contents might be:
#!/usr/bin/env bash
FUNCTION_NAME=transactions-pubsub-to-firestore
FUNCTION_RUNTIME=nodejs12
FUNCTION_TRIGGER_TOPIC=bigquery-to-pubsub-test0
FIRESTORE_COLLECTION_NAME=transactionsbash deploy.sh config.shAssuming there are unexpired messages in $FUNCTION_TRIGGER_TOPIC, the
deployed function will immediately begin to process them and insert into the
Firestore collection $FIRESTORE_COLLECTION_NAME