Using Truffle
Truffle is a development environment, testing framework and asset pipeline for Ethereum, aiming to make life as an Ethereum developer easier.
Adding Truffle to your project
You'll need Node.js v8+ installed before we get started. And you can choose a preferred package management tool to begin with:
# To use truffle locally in your project, you must init a package.json file
$ npm init
# Install truffle and wallet-provider to your project
$ npm i -D truffle @truffle/hdwallet-provider
# Generate truffle configuation file and default folders
$ npm exec -- truffle init# To use truffle locally in your project, you must init a package.json file
$ yarn init
# Install truffle and wallet-provider to your project
$ yarn add --dev truffle @truffle/hdwallet-provider
# Generate truffle configuation file and default folders
$ yarn truffle initSetup Truffle config file
We are going to edit truffle-config.js. First, we uncomment this line to import @truffle/hdwallet-provider:
- // const HDWalletProvider = require('@truffle/hdwallet-provider');
+ const HDWalletProvider = require('@truffle/hdwallet-provider');Then, we add ThunderCore network settings into your project.
Never store your private key directly in truffle-config.js
Deploy a Contract
Now, we can deploy the Migrator contract in the template to ThunderCore testnet.
When it's done, should show messages like this:
Congratulations! You have successfully deployed a smart contract onto the ThunderCore network.
You can check the deployment status at:
Last updated