JetStream
In one window start a JetStream enabled nats server:
1
docker run --network host -p 4222:4222 nats -js
Copied!
And make sure you have the CLI tools nats and nsc installed
Now skip to the Administer JetStream section.

Using Docker with NGS

You can join a JetStream instance to your NGS account, first we need a credential for testing JetStream:
You'll want to do this outside of docker to keep the credentials that are generated.
1
nsc add user -a YourAccount --name leafnode --expiry 1M
Copied!
You'll get a credential file somewhere like ~/.nkeys/creds/synadia/YourAccount/leafnode.creds, mount this file into the docker container for JetStream using -v ~/.nkeys/creds/synadia/YourAccount/leafnode.creds:/leafnode.creds.
1
docker run -ti -v ~/.nkeys/creds/synadia/YourAccount/leafnode.creds:/leafnode.creds --name jetstream nats:latest
Copied!
1
[1] 2021/10/08 21:48:51.426008 [INF] Starting nats-server
2
[1] 2021/10/08 21:48:51.426091 [INF] Version: 2.6.1
3
...
4
[1] 2021/10/08 21:48:51.849033 [INF] Connected leafnode to "connect.ngs.global"
Copied!
Export as PDF
Copy link
Edit on GitHub