How To Guides

How to set up BigQuery Reporting Bridge

Learn how to set up BigQuery Reporting Bridge (BQRB) in a ledger.

There are two options to set up your ledger to work with BQRB, one for an RTP ledger and another one in case you are doing something custom.

Running the BQRB Setup layout

Here we assume that you already have an RTP ledger prepared according to this guide: How to set up an RTP Ledger .

To set up this ledger to work with BigQuery Reporting Bridge, you will need to run the BigQuery Reporting Bridge Setup layout using the minka CLI tool like in the guide above. Replace bqrb-example in the example below to match your ledger handle.

$ minka layout apply
? Select layout: BigQuery Reporting Bridge Setup
? Bridge public key: jQ1KJHCcB+5oZ5CaEvcrMOUQGSHOH6Md6lfiForSUyA=
? Bridge URL: http://bridge-bqrb:8080/ledgers/bqrb-example
? Select main signer: owner
? Signer password for owner [hidden]

✅ Layout applied successfully:
Ledger: bqrb-example
Layout: BigQuery Reporting Bridge Setup
Layout changelog:
  Signer
    + bqrb-bridge (added)
  Policy
    + bqrb-bridge (added)
  Bridge
    + bqrb (added)
  Effect
    + report-created (added)

In case you are setting up BQRB in an environment other than STG located at https://ldg-stg.one/api/v2, you should use different values for the parameters above.

Custom setup

In case you are not using the RTP layout, you will need to manually set up your ledger for BQRB. You will need to add the following:

  1. A signer record for your BQRB bridge that the bridge will use to connect to ledger and add proofs to reports.
  2. A bridge record with the effects trait.
  3. An effect record with the report-created signal and bridge schema connected to the bridge record you created.
  4. An access policy with record any and the values below. Replace SIGNER_BQRB_BRIDGE with the signer you created above.
[{
  "action": { "$in": ["read"] },
  "record": {
    "$in": [
      "schema",
      "report",
      "signer"
    ]
  },
  "bearer": { "$signer": { "handle": "SIGNER_BQRB_BRIDGE" } }
},
{
  "action": "create",
  "record": {
    "$in": ["report-proof"]
  },
  "signer": { "handle": "SIGNER_BQRB_BRIDGE" }
}]

At this point you should have your RTP ledger configured to work with BQRB. To test it out, you will first need to set up a report which you can do by following How to enable BQRB reports.