- Truffle
- Ganache CLI
- Node: v8.9.4 or later
- Jest
- truffle.config.js
npm install
Step 1: Run ganache-cli on development port (ex: 8545):
ganache-cli -p 8545
Step 2: Run migrate on development network
truffle migrate --network development
Step 3: Test smart contract's methods on development
truffle console --network development
check your function here
Step 1: Run ganache-cli on test port (ex: 7545):
ganache-cli -p 7545
Step2: Run test
truffle test --network test
Step 1: Add your mnemonic
to truffle.config.js
:
var HDWalletProvider = require("truffle-hdwallet-provider");
var mnemonic = <your-mnemonic>;
Step 2: Configure custom network (ex: bsc testnet)
bsctest: {
provider: () => new HDWalletProvider(mnemonic, `https://data-seed-prebsc-1-s1.binance.org:8545`),
network_id: 97,
confirmations: 10,
timeoutBlocks: 200,
skipDryRun: true
},
Check document on here
Step 2: Deploy contract to custom network:
truffle migrate --network <your-custom-network>