Distributed banking on git
Features
- Distributed
- Decentralized
- Codeless architecture
Installation
Creating account
- Add empty file (representing the account) to account folder
- Add and commit changes
touch account/alex
git add .
git commit -m'added account for alex'
Making transaction
- Subtract desired amount of git coins from the sender account file
- Add the same amount of git coins to the recipient account file
- Add and commit changes
# $ cat account/alex
# 1024
# $ cat account/bruno
# 16
echo 1000 > account/alex
echo 40 > account/bruno
git add .
git commit -m'transferred 24 coins from alex to bruno'
Syncing with peers
Use git pull/push
, or send a pull request
Advanced
Account file format
Each file represents one account and contains amount of git coins on this account
Validation
Sum of all git coins from all accounts is 9007199254740991
echo $(($(cat account/* | tr '\n' '+') - 9007199254740991))
# should be 0