Install Development Tools
Installing caver-js
We recommend to create a klaytn project directory such that:
You need
npm
andnode.js
installed to proceed. Please refer to get-npm and node.js for installation on your system.
caver-js is a JSON RPC framework for the Klaytn network (equivalent to web3.js in Ethereum). Before installing caver-js, you must generate package.json
file via npm init
command, and then type npm install caver-js
to install caver-js.
NOTE: If you already installed caver-js, please update it to the latest version.
If you receive the following errors while updating the caver-js, remove .git
folder in the websocket
directory.
Note: For all the function calls that begin with web3.eth...
in web3.js, should be replaced with caver.klay...
.
web3.eth.sendTransaction({ ... })
(X)
caver.klay.sendTransaction({ ... })
(O)
Installing Truffle
In this tutorial, Truffle is used to compile and deploy smart contracts written in Solidity. Currently, Klaytn supports Truffle version 4.1.15. For further information about Truffle, refer to the following sites:
Truffle repository - https://github.com/trufflesuite/truffle
Truffle documents - https://trufflesuite.com/docs
We can install Truffle either
1) globally using npm by executing the following commands:
or
2) locally, i.e., in your local directory, by executing the followings:
Installing vvisp
vvisp is an easy-to-use cli tool/framework for developing smart contracts, provided by HEACHI LABS. You can easily set environment, deploy and execute Klaytn smart contracts with a single-command. It supports the Truffle framework, so developers familiar with Truffle can use vvisp without difficulty.
Here, we introduce how to install vvisp and use it to set up the Klaytn dApp development environment.
vvisp repository - https://github.com/HAECHI-LABS/vvisp
vvisp document - https://github.com/HAECHI-LABS/vvisp/blob/dev/README_KLAYTN.md
vvisp can be easily installed if you have npm or yarn by executing the following command:
Upon installation, you can utilize the vvisp command to ensure it has been installed properly. NOTE: You should use version over v2.1.0.
Last updated