Sample repository about utilizing vvisp
1. Install vvisp
$ npm install -g @haechi-labs/vvisp
#or you can run
$ yarn global add @haechi-labs/vvisp
2. Initialize your directory
$ vvisp init vvisp-sample
$ cd vvisp-sample
$ npm install #or yarn install
3. Make your Contracts at contracts/
Now, you can use gen-script
, compile
and flatten
commands.
4. Set vvisp-config.js
file
Please set environment variables in vvisp-config.js
file.
See here for more information about vvisp-config.js
.
Now you can use deploy-contract
command.
5. Set service.vvisp.json
file
Please set information about your DApp service in service.vvisp.json
.
See here for more information about service.vvisp.json
.
Now you can use deploy-service
command.
Download sample repository for test.
git clone https://github.com/HAECHI-LABS/vvisp-sample
- Sample
service.vvisp.json
file is already made. - Default network is
localhost:8545
. Use your own client or ganache-cli. (npm install -g ganache-cli
andganache-cli
) - Make
from
variable invvisp-config.js
. See details. If you use ganache, get the mnemonic key used in ganache and enter it. - Run
vvisp deploy-service
at root directory. It will act like this demo. - Wait for deploying the sample app.
Then,
state.vvisp.json
will be generated. This file is necessary to upgrade your service
Add contract property at service.vvisp.json#contracts
like:
"contracts": {
...
"NewContract": {
"path": "contracts/NewContract.sol"
}
}
Then, run vvisp deploy-service
.
It will act like this demo.
If the service is already deployed and has state.vvisp.json
(necessary), you can operate your contracts with vvisp console
.
First, make apis of contracts which are written in state.vvisp.json
.
$ vvisp gen-script
Then run vvisp console
and operate functions of your contracts.
- Create your own contracts in
contracts/
directory.
- We support use truffle framework.
- Create test files in
test/
directory. - Run
npm run test
to test all test files intest/
directory ornpm run test <fileName>
to test specific file.
- Make
vvisp-config.js
andservice.vvisp.json
.
Please see linked documentation below for details:
- deploy-contract: Deploy contract
- deploy-service: Deploy service of your contracts
- console: Console to operate your contracts
- configuration files: Configuration guide about
vvisp-config.js
andservice.vvisp.json
- General Contact: hello@haechi.io
- Medium