Git Product home page Git Product logo

hypermint's Introduction

hypermint

CircleCI

hypermint is a Tendermint-based blockchain that support WebAssembly smart contract.

Features

Build

$ make build

If you use Golang 1.12 or 1.11, export GO111MODULE=on for modules.

Getting started

Run a validator node

First, you need to initialize genesis state.

# these outputs will be different per execution
$ make init
{
  "chain_id": "test-chain-6AHEow",
  "node_id": "67b4f60a2b371a908848af2d35e7816b55610115",
  "app_message": "success"
}
export ADDR1=0x1221a0726d56aEdeA9dBe2522DdAE3Dd8ED0f36c
export ADDR2=0xD8eba1f372b9e0D378259F150d52C2e6C2e4109a

Next, run a blockchain node:

$ make start

If you want to deploy hypermint node on k8s, see here.

Smart contract

hypermint supports wasm based smart contract.

Contract example project is here.

If you don't have cargo and wasm-gc, you should install these.

To deploy simple token project, exec below commands:

# '0x1221a0726d56aEdeA9dBe2522DdAE3Dd8ED0f36c' should be replace with the value which was got by `make init`
$ export ADDR1=0x1221a0726d56aEdeA9dBe2522DdAE3Dd8ED0f36c

# To exec deploy cmd, cargo with wasm32 and wasm-gc
$ make -C ./example/token deploy
cargo build --target=wasm32-unknown-unknown
   Compiling hmc v0.1.0 (/Users/jun/go/src/github.com/bluele/hypermint/hmc)
   Compiling token v0.1.0 (/Users/jun/go/src/github.com/bluele/hypermint/example/token)
    Finished dev [unoptimized + debuginfo] target(s) in 2.08s
wasm-gc ./target/wasm32-unknown-unknown/debug/token.wasm -o ./token.min.wasm
contract address is 0xceD4629963CCc0549094e962a01f454EBFD80Cbd

Now you got the first contract address! Next, try to check your balance.

$ ./build/hmcli contract call --address=$ADDR1 --contract=0xceD4629963CCc0549094e962a01f454EBFD80Cbd --func="get_balance" --type=int --password=password --simulate --gas=1
10000

Contract development

We develop an emulation library to ease contract development and testing. https://github.com/bluele/hmemu

Please check this out.

Maintainers

hypermint's People

Contributors

3100 avatar bluele avatar ikehara 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.