Thank you, will check!
Found the values and app runs.
For contract in Truffle map I had to do next steps, to compile and deploy the contracts to ropsten or rinkebey testnet networksâŚ
update truffle-config.js:
const { projectId, mnemonic } = require('./.secrets.json');
const HDWalletProvider = require('@truffle/hdwallet-provider');
// ProjectId: https://infura.io/docs/gettingStarted/chooseaNetwork
// npm install @truffle/hdwallet-provider
module.exports = {
contracts_directory: "./contracts",
// Uncommenting the defaults below
// provides for an easier quick-start with Ganache.
// You can also follow this format for other networks;
// see <http://truffleframework.com/docs/advanced/configuration>
// for more details on how to specify configuration options!
//
networks: {
develop: {
host: "127.0.0.1",
port: 7545,
chainId: 1337,
network_id: 1337,
deploymentPollingInterval: 10,
},
ropsten: {
provider: () => new HDWalletProvider(mnemonic, `https://ropsten.infura.io/v3/${projectId}`),
network_id: 3, // Ropsten's id
gas: 5500000, // Ropsten has a lower block limit than mainnet
confirmations: 2, // # of confs to wait between deployments. (default: 0)
timeoutBlocks: 200, // # of blocks before a deployment times out (minimum/default: 50)
skipDryRun: true, // Skip dry run before migrations? (default: false for public nets )
from: `${from}`
},
rinkeby: {
provider: function() {
return new HDWalletProvider(mnemonic, `https://rinkeby.infura.io/v3/${projectId}`);
},
network_id: 4,
gas: 4500000,
gasPrice: 10000000000,
from: `${from}`
},
},
//
// Truffle DB is currently disabled by default; to enable it, change enabled:
// false to enabled: true. The default storage location can also be
// overridden by specifying the adapter settings, as shown in the commented code below.
//
// NOTE: It is not possible to migrate your contracts to truffle DB and you should
// make a backup of your artifacts to a safe location before enabling this feature.
//
// After you backed up your artifacts you can utilize db by running migrate as follows:
// $ truffle migrate --reset --compile-all
//
// db: {
// enabled: true,
// host: "127.0.0.1",
// adapter: {
// name: "sqlite",
// settings: {
// directory: ".db",
// },
// },
// },
};
Get an infura key as projectId : https://infura.io/docs/gettingStarted/chooseaNetwork
create the .secrets.json file (my values not shown) and this file added to a .gitignore file):
{
"mnemonic": "..metamask secret words..",
"projectId": "..infura project ID..",
"from": "..my metamask address.."
}
run:
npm install @truffle/hdwallet-provider
truffle compile --reset
truffle deploy --network rinkeby
=> success.
Since contracts are not changed , the âŚ/contracts/contractInfo.json does not to be updated with abi data of the deployed contract (see contract at its testnet explorer) and add contract address of Deployed Metacoin as REACT_APP_CHAR_CONTRACT in .env
to run:
yarn
yarn start