A blockchain example
Blockchain is a distributed database that maintains a continuously-growing list of records called blocks secured from tampering and revision.
Clone repository and install dependencies
git clone git@github.com:AlekseyPleshkov/blockchain-swift-example.git
cd blockchain-swift-example
swift package update
swift build
swift run
Use in Xcode
swift package generate-xcodeproj
open blockchain-swift-example.xcodeproj
Get list of blockchain blocks
curl http://localhost:8080/blocks
Get list of transactions
curl http://localhost:8080/transactions
Mine block
curl http://localhost:8080/mine
Create transaction
curl http://localhost:8080/transaction?actor=NAME&target=NAME&count=NUMBER
Validate blocks in blockchain
curl http://localhost:8080/validateBlockchain