项目作者: vgsantoniazzi

项目描述 :
blockchain — A Elixir-based blockchain engine.
高级语言: Elixir
项目地址: git://github.com/vgsantoniazzi/blockchain.git
创建时间: 2020-05-26T00:20:07Z
项目社区:https://github.com/vgsantoniazzi/blockchain

开源协议:

下载


Welcome to Blockchain

This project is an open-source blockchain engine based on Elixir. Use this engine to build a digital coin or smart contracts.

Getting Started

Clone the project:

  1. git clone git@github.com:vgsantoniazzi/blockchain.git

Usage

Install dependencies
  1. $ mix deps.get

CLI

  1. $ mix blockchain
  2. Commands
  3. balance Get balance
  4. check_address Check if address is valid
  5. check_block Check if block is valid
  6. add_wallet Add new wallet to local database
  7. add_block Add new block to blockchain
  8. wallets List addresses
  9. blocks Lists the blockchain

CLI Examples

  1. $ mix blockchain balance --address 3czs3SwkAnisqC3cUBi5XgytkA2NscG33AJ7YKhaz9scd2XY9pUqQktrXcZQ5aFa6VPCFT
  2. $ mix blockchain check_address --address 3czzKxPGECGxsfwG1zVUBvUxxe7c7AbPoburpmFdJxQdDyeT8Ng8KSCLmk2ewmQnKVPVAy
  3. $ mix blockchain check_block --block 0000C12AC4308926C493DBC3C93A4EBB724D6B2B480358E56E72ED394149F8CD
  4. $ mix blockchain add_wallet
  5. $ mix blockchain add_block --from "3czs3SwkAnisqC3cUBi5XgytkA2NscG33AJ7YKhaz9scd2XY9pUqQktrXcZQ5aFa6VPCFT" --to "3czzX9L9P8Sg1MhuZER1hekBde4bmyNwkER5FARYmVLb99Kn5efEXE65zJ5GDQ3zqZn2SX" --value 455
  6. $ mix blockchain wallets
  7. $ mix blockchain blocks
Initialize engine
  1. $ iex -S mix
Initialize Blockchain
  1. iex(1)> blockchain = Engine.initialize
Add Block to Blockchain
  1. iex(1)> blockchain = Blockchain.add(blockchain, Block.generate(List.last(blockchain), 99))
Format code
  1. mix format

Contributing

I :heart: Open source!

Before sending a pull request: Please, format the source code

  1. make format

Follow github guides for forking a project

Follow github guides for contributing open source

Squash pull request into a single commit

License

blockchain-engine is released under the MIT license.