zincir

Simple distributed blockchain experiment distributed cryptocurrency blockchain zincir
0.5.0 released

Zincir

Simple distributed blockchain experiment written in Crystal

Usage

Build

To build zincir, you will need Crystal and OpenSSL installed on your system. You can use Homebrew on Mac to install these dependencies.

> git clone git@github.com:oguzbilgic/zincir-crystal.git
  ...
> shards install
  ...
> shards build --release
  Dependencies are satisfied
  Building: zincird

Options

> ./bin/zincird --help
  Usage: zincir [arguments]
      -s IP, --seed-ip=IP              First node to connect, TestNet by default
      -i IP, --host-ip=IP              Node's public ip, If the node is public
      -p PORT, --port=PORT             Node's public port, If the node is public
      -l, --local-net                  Prevents node from connecting to public nodes
      -w, --web                        Start web server without making the node public
      -m, --mine                       Enable mining
      -h, --help                       Show this help
      -v, --version                    Show node version

Start

> ./bin/zincird --mine
  Connecting to testnet.zincir.xyz:9147
  Added <1-0878bff02..ec7> 1544946023
  ...

Node will connect to TestNet by default and sync the blockchain, before mining. Blockchain will be cached in ./blocks/ folder.

Start a public node

> ./bin/zincird --ip mynode.mywebsite.com --port 1234 --mine
  Connecting to testnet.zincir.xyz:9147
  Added <1-0878bff02..ec7> 1544946023
  ...

In public mode, node will advertise it's ip and host to the network for other nodes to connect. Therefore, node needs to be publicly accessible with the provided ip and port configuration

Development

Run tests

$ crystal spec
  ...
zincir:
  github: oguzbilgic/zincir-crystal
  version: ~> 0.5.0
Crystal 0.27.0

Authors

Dependencies 1

  • kemal ~> 0.25.1
    {'github' => 'kemalcr/kemal', 'version' => '~> 0.25.1'}

Development Dependencies 0

Dependents 0

Last synced .
search fire star recently