Mach 2
  • Getting Started
    • What is Mach?
    • Mach 2
      • Optimistic Settlement
      • Intents
      • Order Matching
      • Stables & RWAs
    • Trade Lifecycle
  • Navigation
    • Users
      • FAQ
    • Market Makers
  • Protocol
    • Overview
      • Cross-Chain Swap
      • Challenge Process
    • CCTP
    • LayerZero
    • API
      • Integration
    • Staging
    • Deployed Contracts
    • Supported Assets
    • Security
  • Whitepaper
  • Audits
  • Github
Powered by GitBook
On this page
  • Setting Up Your Environment
  • Create a .envrc File
  • Create a Virtual Environment
  • Running the Server Locally
  • Working on a Branch Locally
  • Pushing Local Changes
  • Reading Logs
  • Changing Secrets/Environment Variables of the Deployed App
  1. Protocol

Staging

PreviousIntegrationNextDeployed Contracts

Last updated 12 months ago

Setting Up Your Environment

Create a .envrc File

  1. Create the .envrc file:

    • In the root directory of the project, create a file named .envrc.

    • The file should contain the following lines (fill in the values or ask Trevor/Britton):

    shCopy codeexport ETHEREUM_RPC_URL=
    export OPTIMISM_RPC_URL=
    export ARBITRUM_RPC_URL=
    export AVALANCHE_RPC_URL=
    export POLYGON_RPC_URL=
    export PRIV_KEY=
  2. Use direnv to load environment variables:

    • We recommend using to automatically load the environment variables when you enter the root directory.

    • Follow the instructions to install direnv and hook into your shell.

Create a Virtual Environment

  1. Create the virtual environment:

    shCopy codepython3 -m venv .venv
  2. Activate the virtual environment:

    shCopy codesource .venv/bin/activate
    • Note: If you are using a shell other than bash or zsh, you may need to use a different activate binary.

  3. Install dependencies:

    shCopy codepip install -r requirements.txt
  4. Allow direnv to load the .envrc file:

    shCopy codedirenv allow

Running the Server Locally

After setting up your environment, run the server locally with:

shCopy codeuvicorn frontend:app --host localhost --port 8080

Working on a Branch Locally

  1. Clone the repository:

    • Using HTTPS:

      shCopy codegit clone https://github.com/tristeroresearch/cache-half-full
    • Using SSH:

      shCopy codegit clone git@github.com:tristeroresearch/cache-half-full
  2. Check out the staging branch (or any other branch):

    shCopy codegit checkout staging
  3. Create a new branch:

    shCopy codegit checkout -b new_branch_name

Pushing Local Changes

  1. Add your changes:

    • Add everything:

      shCopy codegit add .
    • Add specific files:

      shCopy codegit add <file_path>
  2. Commit your changes:

    shCopy codegit commit -m "commit message"
  3. Push your changes:

    shCopy codegit push
  4. Push a new branch to origin:

    shCopy codegit push -u origin new_branch_name

Reading Logs

  1. Access logs and metrics:

    • Navigate to the Tristero project:

Changing Secrets/Environment Variables of the Deployed App

  1. Install Flyctl:

    • Follow the instructions to install Flyctl.

  2. Log in to Flyctl:

    shCopy codeflyctl auth login
  3. Push to rebuild:

    • After making changes to secrets or environment variables, push to rebuild the staging app.

Go to the and ensure you have an invite.

direnv
Fly.io dashboard
View Logs and Metrics