Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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
```