Skip to main content

Working with Relay

Relay provides @dstack-js/transport compatible scalable signaling server and GraphQL API

Public Relay

Public relay has multi-regional and blue-green deploy to provide as higher as possible SLA and latencies

It is accesible here:

You can check status and uptime here:

Getting Bootstrap data

As of version v0.2.46 no need to bootstrap

you can provide an GraphQL endpoint to your relay directly in @dstack-js/lib

import { Stack } from '@dstack-js/lib';

const stack = await Stack.create({
  namespace: 'namespace',
  relay: ''
How to get bootstrap data

Relay provides necessary GraphQL resolvers for initializing the Stack instance

import { request, gql } from "graphql-request";
import { Stack } from "@dstack-js/lib";
import { create } from "@dstack-js/ipfs";

export const createStack = async () => {
  const endpoint = "";
  const url = new URL(endpoint);

  const query = gql`
    query Bootstrap($protocol: Protocol!, $hostname: String!, $port: Int!) {
      listen(protocol: $protocol, hostname: $hostname, port: $port)
      peers(randomize: true)

  const {listen, peers} = await request<{ listen: string[]; peers: string[] }>(
      protocol: url.protocol.replace(":", ""),
      hostname: url.hostname,
      port: Number(url.port || "443")

  const ipfs = await create({
    config: {
      Addresses: {
        Swarm: listen
      Bootstrap: peers


/GraphQL Playground
/graphqlGraphQL Endpoint