burrata-puppeteer v1.0.0
burrata-v2-integration
This repository contains the integration tools for the Burrata v2 Architecture.
Prerequisites
To run the integration repository, you need to have several secrets available:
- NPM login - You need to be logged in to NPM and have access to the @burrata private repository
- ghcr login - You need to be logged in to the github container repository via Docker
You can find instructions on how to login to ghcr here
You also need to have installed:
- nodejs > 16.0
- docker
- docker-compose v2 (see here on how to install)
You'll need to make sure that the docker-compose command returns v2:
docker-compose --version
Docker Compose version v2.5.1
On Linux, you can achieve this by running
sudo curl -SL https://github.com/docker/compose/releases/download/v2.5.0/docker-compose-linux-$(uname -m) -o /usr/local/bin/docker-compose
chmod a+x /usr/local/bin/docker-compose
You'll also need several secrets if you wish to launch provider integrations or deploy to real networks.
These are set via environment variables - see template.env
for a set of variables you should acquire and set.
These can be set in a .env
file, or passed through the environment.
Local Deployment
If you install the node packages:
npm i
You can then run:
./deploy.ts
Which will start a local Burrata deployment.
./deploy.ts shutdown
Will shutdown this deployment.
Local development
The integration repository is designed to simplify full-stack development of Burrata.
To work on a specific repository while using published docker images, simply run:
./deploy.ts --build <repo-name>
For instance, to work on the contracts, run:
./deploy.ts --build contracts
This will checkout the contracts repository from github and place it in the repos
directory,
and build the docker image on deploy. You can make local changes and the image will be re-built
from your changes.
You might also find it useful to run with the no pull flag:
./deploy.ts --build contracts --no-pull
This instructs the deployment script not to pull the latest images, which can save some time while you're iterating on local changes.
Deployment
The integration repository can also be used for deployment.
To deploy outside of a local chain, you need to set the environment. Currently, valid environments are "test" and "staging". For example, to deploy to staging, run:
./deploy.ts --environment staging
In production environments where deployments of the hub is managed by another system (for example, Kubernetes), you can disable the docker compose deploy:
./deploy.ts --environment staging --no-deployment
This will only deploy the contracts. The contract deployment should be idempotent, so it will only deploy/upgrade the contracts if the contract code has changed.
You will probably need the deployed contract data, which is output in
deploy/${ENVIRONMENT_NAME}/chain_data_${PROJECT_NAME}.json
This data should be passed to the Burrata hub so the SDK can find the contracts.
It is also possible to only deploy the containers, which might be useful if the contracts have not been updated:
./deploy.ts --environment staging --no-contracts
Docker
If you don't want to install or prepare an environment, the integration scripts are available to be run from Docker.
You'll need to run ./docker_build.sh
to build the container, and then ./docker_run.sh <args>
to run the integration script.
You'll still need to login to ghcr to pull the appropiate containers.
As an alternative to building, you can just use the latest built container from ghcr. To do this, run the docker_build.sh
script with
the environment var BURRATA_INTEGRATION_FROM_GH=1.
2 years ago