├── .github └── workflows │ └── publish.yaml ├── Dockerfile ├── README.md └── examples └── fly.io ├── README.md ├── fly-launch.png └── fly.toml /.github/workflows/publish.yaml: -------------------------------------------------------------------------------- 1 | # 2 | name: Create and publish a Docker image 3 | 4 | # Configures this workflow to run every time a change is pushed to the branch called `release`. 5 | on: 6 | push: 7 | tags: 8 | - '**' 9 | 10 | # Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds. 11 | env: 12 | REGISTRY: ghcr.io 13 | IMAGE_NAME: ${{ github.repository }} 14 | 15 | # There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu. 16 | jobs: 17 | build-and-push-image: 18 | runs-on: ubuntu-latest 19 | # Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job. 20 | permissions: 21 | contents: read 22 | packages: write 23 | # 24 | steps: 25 | - uses: actions/checkout@v4 26 | - uses: dsaltares/fetch-gh-release-asset@master 27 | with: 28 | repo: ${{ github.repository }} 29 | version: 'latest' 30 | file: 'jupiter-swap-api-x86_64-unknown-linux-gnu.zip' 31 | token: ${{ secrets.GITHUB_TOKEN }} 32 | # Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here. 33 | - name: Log in to the Container registry 34 | uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 35 | with: 36 | registry: ${{ env.REGISTRY }} 37 | username: ${{ github.actor }} 38 | password: ${{ secrets.GITHUB_TOKEN }} 39 | # This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels. 40 | - name: Extract metadata (tags, labels) for Docker 41 | id: meta 42 | uses: docker/metadata-action@v5 43 | with: 44 | images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} 45 | # This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages. 46 | # It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository. 47 | # It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step. 48 | - name: Build and push Docker image 49 | uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 50 | with: 51 | context: . 52 | push: true 53 | tags: ${{ steps.meta.outputs.tags }} 54 | labels: ${{ steps.meta.outputs.labels }} 55 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM --platform=linux/amd64 debian:bookworm-slim 2 | 3 | RUN apt-get update && apt-get install unzip openssl ca-certificates -y 4 | COPY ./jupiter-swap-api-x86_64-unknown-linux-gnu.zip ./jupiter-swap-api-x86_64-unknown-linux-gnu.zip 5 | RUN unzip jupiter-swap-api-x86_64-unknown-linux-gnu.zip 6 | RUN rm jupiter-swap-api-x86_64-unknown-linux-gnu.zip 7 | RUN chmod +x jupiter-swap-api 8 | 9 | ENV RUST_LOG=info 10 | 11 | CMD ["./jupiter-swap-api"] -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # jupiter-swap-api 2 | 3 | The binary of the Jupiter V6 Swap API 4 | 5 | Refer to [self-hosted](https://station.jup.ag/docs/apis/self-hosted) for documentation 6 | 7 | To receive updates from telegram, can join https://t.me/jup_dev 8 | -------------------------------------------------------------------------------- /examples/fly.io/README.md: -------------------------------------------------------------------------------- 1 | # Deploy Jupiter V6 Swap API on Fly.io 2 | 3 | https://fly.io/ 4 | 5 | ## To launch an app in fly.io 6 | 7 | ``` 8 | fly launch 9 | ``` 10 | 11 | ![fly launch ui settings](./fly-launch.png) 12 | 13 | Note: 14 | - Create an app name 15 | - Recommended size: performance-8x 16 | 17 | 18 | ## To do deployment updates, when new new version release 19 | 20 | ``` 21 | fly deploy 22 | ``` -------------------------------------------------------------------------------- /examples/fly.io/fly-launch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jup-ag/jupiter-swap-api/5c7a33c9258c26762394591028f4f1e2d56067fe/examples/fly.io/fly-launch.png -------------------------------------------------------------------------------- /examples/fly.io/fly.toml: -------------------------------------------------------------------------------- 1 | # fly.toml app configuration file generated for test-jupiter-swap-api on 2023-12-04T14:14:21+08:00 2 | # 3 | # See https://fly.io/docs/reference/configuration/ for information about how to use this file. 4 | # 5 | 6 | app = "" 7 | primary_region = "sin" 8 | 9 | [build] 10 | image = "ghcr.io/jup-ag/jupiter-swap-api:latest" 11 | 12 | [deploy] 13 | strategy = "bluegreen" 14 | 15 | [env] 16 | PORT = "8080" 17 | RPC_URL = "" 18 | # YELLOWSTONE_GRPC_ENDPOINT = "" # Optional 19 | # YELLOWSTONE_GRPC_X_TOKEN = "" # Optional 20 | 21 | [http_service] 22 | internal_port = 8080 23 | auto_stop_machines = true 24 | auto_start_machines = true 25 | min_machines_running = 1 26 | [http_service.concurrency] 27 | type = "requests" 28 | hard_limit = 30 29 | soft_limit = 10 30 | 31 | [[http_service.checks]] 32 | interval = "30s" 33 | timeout = "5s" 34 | grace_period = "20s" 35 | method = "GET" 36 | path = "/program-id-to-label" 37 | 38 | [[vm]] 39 | cpu_kind = "performance" 40 | cpus = 8 41 | memory_mb = 16384 42 | --------------------------------------------------------------------------------