I am developing a Dapp, which has a smart contract in solidity and uses truffle framework. My smart contract has a constructor that takes a value as an argument I want to initialize this smart contract from truffle framework in node.js But the value that I need to pass to initialize has to be fetched from a database(mongoDB). How can this be done? Can we write fetching this code logic in 2_deploy_contracts.js? Thank you in advance
1 Answer
Yes. If you can do it with JavaScript, you integrate into your migration process.
Hope it helps.