PRIVATE KEYwill be used in truffle configuration. So copy it down somewhere 2. After creating your Klaytn account, run faucet to receive 5 Baobab testnet KLAY in Baobab Klaytn Faucet
truffle-config.jsis a configuration file including deployment configuration. We are going to deploy our contract using
Private keywe've just created in the previous step. Paste your
Private keythat has enough KLAY to truffle-config.js
klaytnnetwork has 4 properties,
provider: () => new HDWalletProvider(PRIVATE_KEY, URL)Just as the name indicates, it injects private key and url defined above.
network_id: NETWORK_IDSpecify network id in Klaytn, you should set it to
1001to use Klaytn Baobab network (testnet).
gas: GASLIMITMaximum gas you are willing to spend.
gasPrice: nullThis is price per every gas unit. Currently in Klaytn, the gas price is fixed to
'25000000000'. By setting it to
null, truffle will automatically set the gas price.
const Klaystagram = artifacts.require('./Klaystagram.sol')
deployerto deploy your contract,
fs.writeFile(filename, content, callback)(optional)
$ truffle deploy --network klaytn. It will deploy your contract according to
--resetoption If you provide this option, truffle will recompile and redeploy your contract even if contracts haven't changed. ex)
$ truffle deploy --reset --network klaytn