Development
Technical plans
Background
The sBTC bridge and API applications have been developed so far on two separate stacks for the staging and production environments.
Using Linode (Akamai) supported the initial prototyping and bootstrapping phase but maintaining this going forward will dilute the skillsets and focus required to set up a robust CI for the Bridge project. This means some devops work will be ongoing to achieve the following goals.
Geographical load balancing of client and api applications
Support for multiple networks (testnet, mainnet) within single client application
Support for full, multiple blockchain nodes (stacks, bitcoin / testnet, mainnet)
Support additional indexers (Electrumx, Bitcoin Sync etc)
Redundancy in the data layer
Scalability of the API and DB layers
Backup / restore data features
CI Definition
Branches for building the staging and production branches;
staging
for stagingmain
for production
Client CI
Client deploys on PR merge to
staging
branch assuming all CI checks passStaging client has stable ssl URL e.g. https://staging.sbtc.world
Client deploys on PR merge to
main
branch assuming all CI checks passProduction client has stable ssl URL e.g. https://sbtc.world
Staging and production clients are hosted in GCP
Staging/prod static client bundles stored/load balanced from GCP Storage
Transient development build (PRs etc) use Cloudflare for running integrity checks
API CI
Use GCP Kubernetes cluster for running the API
The cluster provides scalability, redundancy and availability of the api as needed via configuration.
Use Mongo Cloud for running the database.
Migrate Web Hosting from GCP to Cloudflare
Note:
Switch off DNSSEC on the domain at GCP
Set Cloudflare NameServers in Google DNS
Tried various things over the course of the weekend of 22/23rd April. But the nameserver switch from Googla to Cloudflare is hanging.
Remove the following nameservers
Add Cloudflare's nameservers
Click to copy
Click to copy
But as far as GCP Network Services is concerned they reside with cloudflare;
annalise.ns.cloudflare.com.
ganz.ns.cloudflare.com.
And independent NS check also indicates the nameservers reside with Cloudflare.
This might require a ticket with Cloudflare support to resolve
Note: In Google cloud domains - locate the domain and unlock the domain for transfer. Check https://lookup.icann.org/en/lookup for confirmation the domain is not in clientTransferProhibited.
GCP Cloud DNS records;
Type
TTL (seconds)
Routing policy
A
300
34.96.125.8
A
300
34.96.125.8
A
300
34.96.125.8
A
300
162.159.38.234
NS
21600
ns-cloud-d1.googledomains.com.
ns-cloud-d2.googledomains.com.
ns-cloud-d3.googledomains.com.
ns-cloud-d4.googledomains.com.
SOA
21600
ns-cloud-d1.googledomains.com. cloud-dns-hostmaster.google.com. 1 21600 3600 259200 300
TXT
300
"google-site-verification=xQlbxDaTTo7EIzjjjhQJn4fYFWnZSn5sMlDBaEFEy4U"
"google-site-verification=_hHMvQ3EVCmqas_DeDrDrQbm26ele1yVVjjFuHTAePk"
A
300
23.239.9.92
A
300
162.159.38.234
DNS name
Type
TTL (seconds)
Routing policy
A
300
34.96.125.8
A
300
34.96.125.8
A
300
34.96.125.8
SOA
21600
ns-cloud-d1.googledomains.com. cloud-dns-hostmaster.google.com. 1 21600 3600 259200 300
NS
21600
annalise.ns.cloudflare.com.
ganz.ns.cloudflare.com.
A
300
34.110.176.196
TXT
300
"google-site-verification=xQlbxDaTTo7EIzjjjhQJn4fYFWnZSn5sMlDBaEFEy4U"
"google-site-verification=_hHMvQ3EVCmqas_DeDrDrQbm26ele1yVVjjFuHTAePk"
A
300
34.110.176.196
Cloudlfare DNS
Type
Name
Content
Proxy status
TTL
A
api
34.96.125.8
Proxied
Auto
A
sbtc.world
162.159.38.234
Proxied
Auto
A
staging
162.159.38.234
DNS only
Auto
A
www
162.159.38.234
Proxied
Auto
TXT
sbtc.world
google-site-verification=xQlbxDaTTo7EIzjjjhQJn4fYFWnZSn5sMlDBaEFEy4U
DNS only
Auto
TXT
sbtc.world
google-site-verification=_hHMvQ3EVCmqas_DeDrDrQbm26ele1yVVjjFuHTAePk
DNS only
Auto
Scan zone:
Notes
Bridge Web
Static files
Can use any service
Uses GCP Buckets for Production
Uses CloudFlare for Developer branches
Load Balancer -> reads Bucket
Deployment API
Dockerfile.api
Cloud Run or K8s
CHANGES(mijoco)
Fork Dockerfile into Dockerfile.api
Read chain from env variable
Disable time here
Deployment Functions
Dockerfile.lambda
Google Lambda or K8s
CHANGES(mijoco)
Fork Dockerfile into Dockerfile.timer
Read chain from env variable
Disable the http request handler
Last updated