@dstack-js/relay

Relay provides DStack peer with libp2p-webrtc-star compatible signaling server written with multi-tenancy support using redis

Usage no npm install needed!

<script type="module">
  import dstackJsRelay from 'https://cdn.skypack.dev/@dstack-js/relay';
</script>

README

@dstack-js/relay

Relay provides DStack peer with libp2p-webrtc-star compatible signaling server written with multi-tenancy support using redis

Metrics (Grafana Dashboard)

Login into Grafana using your GitHub, Grafana can be only accessed by organization members, remember to grant access to dstack-js organization while logging in.

Supported transport versions

  • libp2p-webrtc-star@0.20.1
  • libp2p-websockets@0.15.0

Public relay

PeerId - QmV2uXBKbii29iJKHKVy8sx5m49qdDTBYNybVoa5uLJtrf

Signaling - /dns4/relay.dstack.dev/tcp/443/wss/p2p-webrtc-star/

Bootstrap - ['/dns4/relay.dstack.dev/tcp/443/wss/p2p-webrtc-star/p2p/QmV2uXBKbii29iJKHKVy8sx5m49qdDTBYNybVoa5uLJtrf']

Using predefined peer id

Generate peer id private key using peer-id package

const PeerId = require('peer-id');

const id = await PeerId.create({ bits: 1024, keyType: 'RSA' });
console.log(JSON.stringify(id.toJSON(), null, 2));
{
  "id": "Qma9T5YraSnpRDZqRR4krcSJabThc8nwZuJV3LercPHufi",
  "privKey": "CAAS4AQwggJcAgEAAoGBAMBgbIqyOL26oV3nGPBYrdpbv..",
  "pubKey": "CAASogEwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMBgbIqyOL26oV3nGPBYrdpbvzCY..."
}

or generate in browser

Then you can store privKey in PRIVATE_KEY environment key