This is a sample project intended to show how to use antenny. It leverages aws-cdk along with antenny constructs from antenny-cdk.
The app captures realtime trades from the gemni exchange via their public websocket api. It partitions trades by minute and allows you to view the current minute:
- opening price
- high price
- low price
- current price
- aws-cli
- node
- aws-cdk
To get started you'll first need to subscribe to antenny if you haven't yet. Once subscribed you'll create some secrets in your aws account. This is a best practice to handle sensitive parameters and keys within your aws account.
Find your secret on the admin dashboard. Your customer secret lets your app verify antenny is the actual sender of incomming requests. Replace customerSecret
with the value copied from your dashboard.
aws secretsmanager create-secret --name atyCustSecret --secret-string customerSecret
Find your customer id on the admin dashboard. We use an ssm parameter because your customer id isn't sensitive. Replace --value
flag with your customer id.
aws ssm put-parameter --name /antenny/customerId --value customerId
You'll need to create a client for your antenny account. Create one on the clients page. Navigate to your created client and replace --secret-string
with your copied api key.
aws secretsmanager create-secret --name atyApiKey --secret-string apiKey
After you clone the repository, install npm dependencies.
npm ci
You're all ready to create the app. Deploy with aws-cdk.
cdk deploy SampleStack
Once deployed, you can go to your cloudformation console and there will be a stack output for SampleStack
that will have your api url. You can plug this into your browser suffixed with /view
. You'll be greeted with a json document with the aforementioned data points. Note some may be null. Once the data starts to filter in, you can refresh and that data will populate.
Once your satisfied with the app, you can destroy it to avoid incurring further charges.
cdk destroy SampleStack
You can use this sample-app as scaffolding to make your own app. To learn more about how antenny interacts with the app, you can reference antenny docs. If you have questions you can always contact us.