项目作者: AlekseyPleshkov

项目描述 :
Swift blockchain example
高级语言: Swift
项目地址: git://github.com/AlekseyPleshkov/blockchain-swift-example.git


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

  1. git clone git@github.com:AlekseyPleshkov/blockchain-swift-example.git
  2. cd blockchain-swift-example
  3. swift package update
  4. swift build
  5. swift run

Use in Xcode

  1. swift package generate-xcodeproj
  2. open blockchain-swift-example.xcodeproj

Use

Get list of blockchain blocks

  1. curl http://localhost:8080/blocks

Get list of transactions

  1. curl http://localhost:8080/transactions

Mine block

  1. curl http://localhost:8080/mine

Create transaction

  1. curl http://localhost:8080/transaction?actor=NAME&target=NAME&count=NUMBER

Validate blocks in blockchain

  1. curl http://localhost:8080/validateBlockchain