Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lbroudoux/cloud-tradegame
A Trading Game to deploy on Google Cloud on multi-clusters / multi-clouds mode
https://github.com/lbroudoux/cloud-tradegame
google-pubsub kubernetes quarkus redis
Last synced: about 2 months ago
JSON representation
A Trading Game to deploy on Google Cloud on multi-clusters / multi-clouds mode
- Host: GitHub
- URL: https://github.com/lbroudoux/cloud-tradegame
- Owner: lbroudoux
- License: mit
- Created: 2022-11-08T14:04:09.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-11-23T16:18:54.000Z (about 2 years ago)
- Last Synced: 2024-10-06T05:04:37.839Z (4 months ago)
- Topics: google-pubsub, kubernetes, quarkus, redis
- Language: Java
- Homepage:
- Size: 165 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
```sh
$ gcloud iam service-accounts create tradegame-pubsub-sa \
--description="Service Account for accessing PubSub from quotegame"$ PROJECT=cloud-tradegame
# Directly put the sa as editor as we need to publish, subscribe and also create subscriptions.
$ gcloud projects add-iam-policy-binding $PROJECT \
--member=serviceAccount:tradegame-pubsub-sa@$PROJECT.iam.gserviceaccount.com\
--role=roles/pubsub.editor
``````sh
$ curl localhost:8080/api/quote/CYB
140.57$ curl localhost:8080/api/quote/TYR
187.71$ curl localhost:8080/api/user -XPOST -H 'Content-type: application/json' \
-d '{"name":"lbroudoux", "email":"[email protected]"}' -s | jq
$ curl localhost:8080/api/portfolio -s | jq
[
{
"username": "lbroudoux",
"money": 1000,
"quotes": {}
}
]$ curl localhost:8080/api/order -XPOST -H 'Content-type: application/json' \
-d '{"username":"lbroudoux","orderType":"BUY","timestamp":1665130686122,"quote":"TYR","price":187.71,"number":1}' -s | jq
``````shell
$ curl localhost:8083/api/order -XPOST -H 'Content-type: application/json' \
-d '{"username":"lbroudoux","orderType":"BUY","timestamp":1665130686122,"quote":"TYR","price":187.71,"number":1}' -s | jq
```