Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Production Deployment Guide

This document outlines the steps required for deploying the Satoshi Port application to production, covering the Smart Contract, Frontend, and Backend components.

Contract Deployment

Prerequisites

  • Private Keys: You need the private keys to deploy a new smart contract. Ask Sibi or Michael for access.

Deployment Steps

  1. Trigger CI: Push a new tag to the develop branch.
  2. Obtain Artifact: Wait for the CI job to complete. It will produce a new WASM file for the smart contract (see an example release).
  3. Update Configuration: Update the contract version accordingly in the production.justfile.
  4. Deploy: Run the following command to deploy the newer version of the contract:
    just prod::deploy
    
    Note: Ensure you handle any necessary state migration upgrades if applicable.

Frontend Deployment

Frontend deployment is managed using Cloudflare Pages.

  • The main branch serves as the source of truth for production.
  • To trigger a deployment, create a pull request for your changes to the main branch.

Backend Deployment

Backend deployments are managed via the devops repository.

Deployment Steps

  1. Update the Docker image version in the kustomization.yaml file.
  2. The deployment should then be synced via K3s ArgoCD.

Monitoring & Operations

  • Documentation: For more details, refer to the Kube360 cluster documentation.
  • Alerts: You should join the k3s-alertmanger Slack channel to monitor cluster alerts. Ask Sibi or Noris to be added to the channel.

How to Run Indexer DB Migrations

1. Build and push the new Indexer image to GHCR.io

Go to the satoshi-port repository, then open the Actions tab. Select the indexer workflow and run it from the branch you want to use for the migration. Once the workflow is complete, open it and navigate to the Push image step. There you will find the new image tag — copy it.

2. Update the indexer-ingester image tag in the DevOps repo

Open a PR in the DevOps repo, replacing the old image with the new one in the /k3s/staging/kustomization.yaml file. You will need approval before merging into main.

After merging, go to K3s ArgoCD and select the project where you are applying these changes: satoshi-sandbox or satoshi-mainnet. Check the Diff, and if the only change is the indexer-ingester image tag, you can click on Sync. Make sure you check all the resources except the one related to the indexer-rest-api deployment, which must be unchecked, and then click Synchronize. Indexer Rest Api unchecked

3. Run migrations

The indexer-ingester will run the migrations automatically, so you do not need to do anything. Just monitor for any error notifications in ArgoCD or the monitoring channels in Slack.

4. Synchronize the indexer-rest-api

Similar to step 2, go to Argo, click on Sync. This time, select all the resources, including the indexer-rest-api. Finally, click on Synchronize.

If everything is working well, it means the migrations ran successfully and everything is operating normally.


Reminder: If any error occurs, notify the Slack channel immediately.