Skip to content
This repository has been archived by the owner on Apr 18, 2021. It is now read-only.
/ vvisp Public archive

A Smart Way to Operate Smart Contracts on EVM Based Blockchains like Ethereum

License

Notifications You must be signed in to change notification settings

HAECHI-LABS/vvisp

Repository files navigation

vvisp

Korean version: README-ko.md

CircleCI NPM Coverage Status standard-readme compliant Conventional Commits lerna

The easiest smart contract development framework and command line interface on EVM based blockchain.

Simple and fast smart contract deployment and execution with a single command line

VVISP is sponsored by the EF(Ethereum Foundation). EF gave the grants to HAECHI LABS at ethcon korea 2019.

Key Benefits

  • Improving Environment of Blockchain Service Development
  • Reducing Operation Time of Blockchain Service Development
  • Shortening the Learning Curve of Developers Who Are Not Familiar with Blockchain

Table of Contents

Description

CLI tool easy to use for developers who are not familiar with blockchain.

: Smart contracts in the blockchain are uncommon development areas. There are many things that developers are unfamiliar with DApp development. Even if you create a contract by referring to several references, there is an entry barrier to learn how to deploy and how to use smart contracts. vvisp is a command line interface (CLI) tool designed to reduce the learning curve.

(1) Deploying a contract with a single line of command

: Deploying smart contracts to a blockchain is very complex. In order to deploy a contract, you must write your smart contract deployment codes as well as create smart contracts. A developer needs to consider deploying multiple smart contracts in order for DApp. vvisp defines deployment target as a simple configuration file and then deploys smart contracts by considering the dependencies automatically with a single line of command instead of hundreds lines of code.

(2) Executing the contract function with one command line

: Developers had to study the library, call the function, and manually write the function call code to execute the function of a contract. This is a big entry barrier for developers who are unfamiliar with smart contract development. However, vvisp is designed to execute a specific function of a contract with a single command line and to receive results without complex processes.

Contributors: Please see the Contributing section of this README.

Install

Install Node.js first. Then, install npm and

$ npm install -g @haechi-labs/vvisp

or install yarn and

$ yarn global add @haechi-labs/vvisp

Usage

If you want to see sample repository, see here.

1. Start your project

$ vvisp init my-project
$ cd my-project

$ npm install #or yarn install

You don't have to do $ npm init or $ truffle init. We supports environment for truffle and it will make package.json automatically.

See details for $ vvisp init.

2. Make your Contracts at contracts/

Now, you can use gen-script, compile and flatten commands.

3. Set vvisp-config.js file

Please set environment variables in vvisp-config.js file.

Example

const MNEMONIC = 'YOUR_MNEMONIC';

module.exports = {
  networks: {
    development: {
      url: 'URL_TO_ETHEREUM_NODE',
      gasLimit: 6721975,
    }
  },
  compilers: {
    solc: {
      version: '0.5.8'
    }
  },
  from: { // or from: 'YOUR_PRIVATE_KEY'
    mnemonic: MNEMONIC,
    index: 0
  },
};

See more information at here for more information about vvisp-config.js. Now you can use deploy-contract command.

4. Set service.vvisp.json file

Please set information about your DApp service in service.vvisp.json.

Example

{
  "serviceName": "Haechi",
  "variables" : {
    "exampleVarName": 123
  },
  "contracts": {
    "ContractKeyName1": {
      "path": "./contracts/Contract1.sol",
      "name": "Contract1",
      "constructorArguments": [
        "${contracts.ContractKeyName1.address}",
        "${variables.exampleVarName}"
      ],
      "initialize": {
        "functionName": "initialize",
        "arguments": ["argument1", "argument2"]
      }
    },
    "ContractKeyName2": {
      "path": "./contracts/Contract2.sol",
      "name": "Contract2",
      "initialize": {
        "functionName": "initialize",
        "arguments": ["argument1", "argument2"]
      }
    }
  }
}

See more information at here for more information about service.vvisp.json. Now you can use deploy-service command.

Please see CONFIGURATION.md to configure your project.

Run $ vvisp --help for more details about functions of vvisp.

Commands

Please see linked documentation below:

  • init: Start your project
  • compile: Compile solidity contract files
  • deploy-contract: Deploy contract
  • deploy-service: Deploy service of your contracts
  • gen-script: Generate javascript APIs interacting with smart contract on blockchain
  • console: Provides a console environment that can invoke contracts interactively
  • flatten: Flatten several contract files in one file

Architecture

vvisp communicates with main-net, test-net through rpc, and helps to develop, upgrade, test, compile and control the user’s current version of the DApp service. vvisp supports truffle test framework.

  • vvisp

    vvisp consists of vvisp-utils and vvisp.

    • vvisp-utils

      vvisp-utils provides several useful functions for use with vvisp or vvisp-sample.

    • vvisp

      vvisp performs the core logic of vvisp.

  • vvisp-sample

    vvisp-sample is the boilerplate package generated by vvisp init command.

    • contractApis

      It is generated automatically by the vvisp gen-script command and provides a javascript library that allows you to easily execute deployed projects.

    • configuration

      These are the configuration files needed for vvisp to work and test such as vvisp-config.js, service.vvisp.json, state.vvisp.json

    • test

      These are test cases of user-written contracts.

    • contracts

      The contracts that the user write himself.

Contributing

Thank you for considering to join this project! We always welcome contributors :)

Notes on project main branches:

  • master: Stable, released version
  • dev: Work targeting stable release

To contribute, please see CONTRIBUTING.md.

Contact

License

MIT