GithubHelp home page GithubHelp logo

abef / chainkit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from blocklayerhq/chainkit

0.0 1.0 0.0 8.91 MB

ChainKit is a toolkit for blockchain development. It includes primitives for creating, building and running decentralized applications.

License: Apache License 2.0

Makefile 1.04% Go 77.79% Shell 19.68% Smarty 1.49%

chainkit's Introduction

ChainKit

CircleCI GoDoc

ChainKit is a toolkit for blockchain development. It includes primitives for creating, building and running decentralized applications built on top of Tendermint and the Cosmos SDK.

Key features:

  • Scaffold: Generate all the Tendermint & Cosmos SDK boilerplate automatically to get started in seconds.
  • Build and Run: Under the hood, chainkit packages your app in a Docker container.
  • Testnet: Anyone in the world can join your network by running one command. Under the hood, chainkit uses IPFS and libp2p to share data and discover peers.

chainkit demo

Installing

Requirements:

From this repository, run:

$ make
$ cp chainkit /usr/local/bin

Usage

Create, Build & Start

In order to create a new (empty) application, just run the following:

$ cd ~/go/src/github.com
$ chainkit create demoapp

You can then start by running:

$ cd demoapp
$ chainkit start

Then open http://localhost:42001/ to see Tendermint's RPC interface or open the Explorer url.

You can also access the CLI: If chainkit is running in the current terminal, go to a new one and go to chainkit's project directory.

$ cd demoapp
$ chainkit cli --help
$ chainkit cli status

All CLI commands usually accessible from a Cosmos-SDK application is available in the same way via chainkit cli ....

Edit the genesis file before the chain starts

It may be useful to edit the genesis file before the chain starts: either to add new accounts with funds or to add more validators. In order to do so, use the following command:

$ cd demoapp
$ chainkit start --edit-genesis

It'll spawn an editor (taken from the $EDITOR env variable if it exists) with the original genesis file. Once you apply your changes, you can review the diff before applying the new genesis file, or revert the changes.

Please note that if the chain has been started already (or any block has been created), this command won't work. The genesis is "sealed" once a new block has been created.

Testnet

Anyone in the world can join your network. They'll need to run:

$ chainkit create demoapp
$ chainkit join <network ID>

where <network ID> is found in the output from starting the first node, or, for a mainnet, published by the network operator.

Under the hood, chainkit uses IPFS to transfer your network's manifest, genesis file and Docker image between nodes.

A built-in discovery mechanism (using libp2p DHT) allows nodes to discover themselves in a completely decentralized fashion.

Moving an existing project to chainkit

When chainkit creates a new project, it generates two files:

  • chainkit.yml
  • Dockerfile

It's useful to understand what they contain in order to move an existing project to chainkit. If the project already contains a Dockerfile, you won't need to change it.

Chainkit.yml:

name: myapp
image: chainkit-myapp
binaries:
  cli: myappcli
  daemon: myappd

The name is simply the name of the project (taken from chainkit create myapp).

The image is the docker image built by chainkit. You can specify your own image if you already have a build system building a docker image.

The last field binaries contain the binaries of the CLI and the Daemon of a cosmos app. It must map to what's inside the docker image, both binary names have to exist after you run a docker build using the Dockerfile of the project.

chainkit's People

Contributors

aluzzardi avatar samalba avatar zramsay avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.