| 
 | 1 | +# Note: Disabling this workflow for now, have to figure out how to run the complicated setup on github actions  | 
 | 2 | + | 
 | 3 | +name: Archive Comparison  | 
 | 4 | + | 
 | 5 | +# TODO: Add proper triggers  | 
 | 6 | +on:  | 
 | 7 | +  workflow_dispatch:  | 
 | 8 | + | 
 | 9 | +env:  | 
 | 10 | +  PG_PORT: 5432  | 
 | 11 | +  PG_DB: archive  | 
 | 12 | +  # TODO: Add proper secrets  | 
 | 13 | +  # POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}  | 
 | 14 | +  POSTGRES_PASSWORD: mina-testnet  | 
 | 15 | +  ARCHIVE_OUTPUT_DIR: ./archive-outputs  | 
 | 16 | +  ARCHIVE_PORT: 3086  | 
 | 17 | +  P2P_PORT: 8302  | 
 | 18 | +  CLIENT_PORT: 8301  | 
 | 19 | +  RPC_PORT: 5000  | 
 | 20 | +  PEER_LIST_URL: https://bootnodes.minaprotocol.com/networks/devnet.txt  | 
 | 21 | + | 
 | 22 | +jobs:  | 
 | 23 | +  compare-archives:  | 
 | 24 | +    runs-on: ubuntu-latest  | 
 | 25 | + | 
 | 26 | +    services:  | 
 | 27 | +      postgres-ocaml:  | 
 | 28 | +        image: postgres  | 
 | 29 | +        env:  | 
 | 30 | +          POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }}  | 
 | 31 | +        options: >-  | 
 | 32 | +          --health-cmd pg_isready  | 
 | 33 | +          --health-interval 5s  | 
 | 34 | +          --health-timeout 10s  | 
 | 35 | +          --health-retries 10  | 
 | 36 | +
  | 
 | 37 | +      postgres-openmina:  | 
 | 38 | +        image: postgres  | 
 | 39 | +        env:  | 
 | 40 | +          POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }}  | 
 | 41 | +        options: >-  | 
 | 42 | +          --health-cmd pg_isready  | 
 | 43 | +          --health-interval 5s  | 
 | 44 | +          --health-timeout 10s  | 
 | 45 | +          --health-retries 10  | 
 | 46 | +
  | 
 | 47 | +    steps:  | 
 | 48 | +      - name: Checkout code  | 
 | 49 | +        uses: actions/checkout@v4  | 
 | 50 | + | 
 | 51 | +      - name: Create output directories  | 
 | 52 | +        run: |  | 
 | 53 | +          mkdir -p ${{ github.workspace }}/archive-outputs/ocaml  | 
 | 54 | +          mkdir -p ${{ github.workspace }}/archive-outputs/openmina  | 
 | 55 | +
  | 
 | 56 | +      - name: Initialize Databases  | 
 | 57 | +        run: |  | 
 | 58 | +          sudo apt-get update  | 
 | 59 | +          sudo apt-get install -y postgresql-client  | 
 | 60 | +
  | 
 | 61 | +          # Initialize OCaml database  | 
 | 62 | +          psql postgres://postgres:${{ env.POSTGRES_PASSWORD }}@postgres-ocaml:${{ env.PG_PORT }}/${{ env.PG_DB }} -c "CREATE DATABASE ${{ env.PG_DB }};"  | 
 | 63 | +          psql postgres://postgres:${{ env.POSTGRES_PASSWORD }}@postgres-ocaml:${{ env.PG_PORT }}/${{ env.PG_DB }} -c "  | 
 | 64 | +            ALTER SYSTEM SET max_connections = 500;  | 
 | 65 | +            ALTER SYSTEM SET max_locks_per_transaction = 100;  | 
 | 66 | +            ALTER SYSTEM SET max_pred_locks_per_relation = 100;  | 
 | 67 | +            ALTER SYSTEM SET max_pred_locks_per_transaction = 5000;  | 
 | 68 | +          "  | 
 | 69 | +          psql postgres://postgres:${{ env.POSTGRES_PASSWORD }}@postgres-ocaml:${{ env.PG_PORT }}/${{ env.PG_DB }} \  | 
 | 70 | +            -f producer-dashboard/src/archive/sql/archive_schema.sql  | 
 | 71 | +
  | 
 | 72 | +          # Initialize OpenMina database  | 
 | 73 | +          psql postgres://postgres:${{ env.POSTGRES_PASSWORD }}@postgres-openmina:${{ env.PG_PORT }}/${{ env.PG_DB }} -c "CREATE DATABASE ${{ env.PG_DB }};"  | 
 | 74 | +          psql postgres://postgres:${{ env.POSTGRES_PASSWORD }}@postgres-openmina:${{ env.PG_PORT }}/${{ env.PG_DB }} -c "  | 
 | 75 | +            ALTER SYSTEM SET max_connections = 500;  | 
 | 76 | +            ALTER SYSTEM SET max_locks_per_transaction = 100;  | 
 | 77 | +            ALTER SYSTEM SET max_pred_locks_per_relation = 100;  | 
 | 78 | +            ALTER SYSTEM SET max_pred_locks_per_transaction = 5000;  | 
 | 79 | +          "  | 
 | 80 | +          psql postgres://postgres:${{ env.POSTGRES_PASSWORD }}@postgres-openmina:${{ env.PG_PORT }}/${{ env.PG_DB }} \  | 
 | 81 | +            -f producer-dashboard/src/archive/sql/archive_schema.sql  | 
 | 82 | +
  | 
 | 83 | +      - name: Start OCaml Archive  | 
 | 84 | +        uses: docker://adrnagy/mina-archive  | 
 | 85 | +        with:  | 
 | 86 | +          args: >  | 
 | 87 | +            mina-archive run  | 
 | 88 | +            --postgres-uri postgres://postgres:${{ env.POSTGRES_PASSWORD }}@postgres-ocaml:${{ env.PG_PORT }}/${{ env.PG_DB }}  | 
 | 89 | +            --server-port ${{ env.ARCHIVE_PORT }}  | 
 | 90 | +            --output-dir /data  | 
 | 91 | +        options: >-  | 
 | 92 | +          --name archive-ocaml  | 
 | 93 | +          --network ${{ job.container.network }}  | 
 | 94 | +          -v ${{ github.workspace }}/archive-outputs/ocaml:/data  | 
 | 95 | +          -d  | 
 | 96 | +
  | 
 | 97 | +      - name: Start OpenMina Archive  | 
 | 98 | +        uses: docker://adrnagy/mina-archive  | 
 | 99 | +        with:  | 
 | 100 | +          args: >  | 
 | 101 | +            mina-archive run  | 
 | 102 | +            --postgres-uri postgres://postgres:${{ env.POSTGRES_PASSWORD }}@postgres-openmina:${{ env.PG_PORT }}/${{ env.PG_DB }}  | 
 | 103 | +            --server-port ${{ env.ARCHIVE_PORT }}  | 
 | 104 | +            --output-dir /data  | 
 | 105 | +        options: >-  | 
 | 106 | +          --name archive-openmina  | 
 | 107 | +          --network ${{ job.container.network }}  | 
 | 108 | +          -v ${{ github.workspace }}/archive-outputs/openmina:/data  | 
 | 109 | +          -d  | 
 | 110 | +
  | 
 | 111 | +      - name: Wait for Archive processes  | 
 | 112 | +        run: |  | 
 | 113 | +          sleep 10  # Replace with proper health check  | 
 | 114 | +
  | 
 | 115 | +      - name: Start OCaml Node  | 
 | 116 | +        uses: docker://gcr.io/o1labs-192920/mina-daemon:3.0.0-dc6bf78-bullseye-devnet  | 
 | 117 | +        with:  | 
 | 118 | +          args: >  | 
 | 119 | +            daemon  | 
 | 120 | +            --archive-address archive-ocaml:${{ env.ARCHIVE_PORT }}  | 
 | 121 | +            --insecure-rest-server  | 
 | 122 | +            --log-level Info  | 
 | 123 | +        options: >-  | 
 | 124 | +          --name node-ocaml  | 
 | 125 | +          --network ${{ job.container.network }}  | 
 | 126 | +          -e MINA_CLIENT_TRUSTLIST="10.0.0.0/8,172.16.0.0/12,192.168.0.0/16"  | 
 | 127 | +          -d  | 
 | 128 | +
  | 
 | 129 | +      - name: Start OpenMina Node  | 
 | 130 | +        uses: docker://adrnagy/openmina:archive-test  | 
 | 131 | +        with:  | 
 | 132 | +          args: >  | 
 | 133 | +            node  | 
 | 134 | +            --archive-address archive-openmina:${{ env.ARCHIVE_PORT }}  | 
 | 135 | +        options: >-  | 
 | 136 | +          --name node-openmina  | 
 | 137 | +          --network ${{ job.container.network }}  | 
 | 138 | +          -d  | 
 | 139 | +
  | 
 | 140 | +      - name: Wait for nodes to be ready  | 
 | 141 | +        run: |  | 
 | 142 | +          # Add health check for nodes  | 
 | 143 | +          sleep 10  # Replace with proper health check  | 
 | 144 | +
  | 
 | 145 | +      - name: Build comparison tool  | 
 | 146 | +        run: |  | 
 | 147 | +          cargo build --release -p archive-breadcrumb-compare  | 
 | 148 | +
  | 
 | 149 | +      - name: Run comparison  | 
 | 150 | +        env:  | 
 | 151 | +          OCAML_NODE_GRAPHQL: http://node-ocaml:3085/graphql  | 
 | 152 | +          OPENMINA_NODE_GRAPHQL: http://node-openmina:3085/graphql  | 
 | 153 | +          OCAML_NODE_DIR: ${{ github.workspace }}/archive-outputs/ocaml  | 
 | 154 | +          OPENMINA_NODE_DIR: ${{ github.workspace }}/archive-outputs/openmina  | 
 | 155 | +        run: |  | 
 | 156 | +          ./target/release/archive-breadcrumb-compare  | 
 | 157 | +
  | 
 | 158 | +      - name: Upload results  | 
 | 159 | +        uses: actions/upload-artifact@v4  | 
 | 160 | +        with:  | 
 | 161 | +          name: comparison-results  | 
 | 162 | +          path: ${{ github.workspace }}/archive-outputs  | 
0 commit comments