How can I build a fully decentralized dapp where the frontend code (.html,.css,.js) and ABI files (build/contracts/json) are stored in ipfs and contracts on test-network. But I am unable to do so because I am not getting the ABI after deploying in rinkeby etc. through Remix or truffle. Please guide me through the whole process stepwise.
1 Answer
Connect with rinkeby network by including this in truffle-config.js
var HDWalletProvider = require("truffle-hdwallet-provider");
var mnemonic ="<your account mnemoic>";
var INFURA_API_KEY = "<your api key>";
module.exports = {
networks: {
rinkeby: {
provider: () =>
new HDWalletProvider(
mnemonic,
"https://rinkeby.infura.io/v3/" + INFURA_API_KEY
),
network_id: 4,
gas: 3000000,
gasPrice: 10000000000
}
}
};
Connect the metamask by including this:
web3Provider = new Web3.providers.HttpProvider("http://rinkeby.infura.io/v3/<your api key>");
run this command from console
truffle migrate -f 2 --network rinkeby
And include the frontend files and the contracts ABI generated on IPFS.