Skip to content

AlekseyPleshkov/blockchain-swift-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blockchain swift example

A blockchain example

What is blockchain

Blockchain is a distributed database that maintains a continuously-growing list of records called blocks secured from tampering and revision.

Quick start

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

Use

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