Sample gRPC python application using Chief of State.
This sample application uses Chief of State to build a Bank Account service that tracks debit/credit events to derive the current balance.
code
├── banking_app # generated gRPC service code
├── banking_app_impl # implements the banking service
├── chief_of_state # generated COS code
├── read_handler_impl # implements the COS read side handler
├── shared # shared helpers
├── test_client # test client for sample traffic
└── write_handler_impl # implements the COS write side handler
# update submodules
git submodule update --init
# download earth
brew install earthly
# updates submodules, generates protobufs
earthly +all
# starts all containers
docker-compose up -d
# create sample traffic
docker-compose exec test-client python -m test_client
# OTHER HELPFUL COMMANDS
# only generate protobufs locally
earthly +protogen
# supervise app logs
docker-compose logs -f --tail="all" api write-handler read-handler
# cos logs
docker-compose logs -f chiefofstate
# configure virtual env
python -m venv .venv
# activate it
. .venv/bin/activate
# install dependencies
pip install -r requirements.txt