Skip to content

Commit

Permalink
feat: using node url instead of infura key
Browse files Browse the repository at this point in the history
  • Loading branch information
fforbeck committed Sep 22, 2021
1 parent 72b966d commit e5865f1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Added the following environment variables to your local .env file:

- `DAO_NAME`: The name of the DAO.
- `DAO_OWNER_ADDR`: The DAO Owner ETH Address (0x...) in the target network.
- `INFURA_KEY`: The Infura API Key is used to communicate with the Ethereum blockchain.
- `ETH_NODE_URL`: The Ethereum Node URL to connect to the Ethereum blockchain, it can be http/ws.
- `TRUFFLE_MNEMONIC`: The truffle mnemonic string containing the 12 keywords.
- `ETHERSCAN_API_KEY`: The Ether Scan API Key to verify the contracts after the deployment.
- `DEBUG_CONTRACT_VERIFICATION`: Debug the Ether Scan contract verification calls (`true`|`false`).
Expand All @@ -117,7 +117,7 @@ Checkout the [sample .env file](https://github.com/openlawteam/tribute-contracts

- Ganache deployment: `DAO_NAME`, `ERC20_TOKEN_NAME`, `ERC20_TOKEN_SYMBOL`, `ERC20_TOKEN_DECIMALS`, `COUPON_CREATOR_ADDR`.

- Rinkeby deployment: `DAO_NAME`, `DAO_OWNER_ADDR`, `ERC20_TOKEN_NAME`, `ERC20_TOKEN_SYMBOL`, `ERC20_TOKEN_DECIMALS`, `COUPON_CREATOR_ADDR`.
- Rinkeby deployment: `DAO_NAME`, `DAO_OWNER_ADDR`, `ERC20_TOKEN_NAME`, `ERC20_TOKEN_SYMBOL`, `ERC20_TOKEN_DECIMALS`, `COUPON_CREATOR_ADDR`, `ETH_NODE_URL`.

- Test deployment: `DAO_NAME`, `ERC20_TOKEN_NAME`, `ERC20_TOKEN_SYMBOL`, `ERC20_TOKEN_DECIMALS`.

Expand Down
18 changes: 11 additions & 7 deletions truffle-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
require("dotenv").config();
require("solidity-coverage");

const getNetworkProvider = () => {
let HDWalletProvider = require("@truffle/hdwallet-provider");
let mnemonic = process.env.TRUFFLE_MNEMONIC;
return new HDWalletProvider(mnemonic, process.env.ETH_NODE_URL);
};

module.exports = {
networks: {
ganache: {
Expand All @@ -29,17 +35,15 @@ module.exports = {
network_id: "1337", // Any network (default: none)
},
rinkeby: {
provider: function () {
let infuraKey = process.env.INFURA_KEY;
let HDWalletProvider = require("@truffle/hdwallet-provider");
let mnemonic = process.env.TRUFFLE_MNEMONIC;
let infuraUrl = "wss://rinkeby.infura.io/ws/v3/" + infuraKey;
return new HDWalletProvider(mnemonic, infuraUrl);
},
provider: getNetworkProvider,
network_id: 4,
gasPrice: 10000000000,
skipDryRun: true,
},
mainnet: {
provider: getNetworkProvider,
network_id: 1,
},
coverage: {
host: "localhost",
network_id: "*",
Expand Down

0 comments on commit e5865f1

Please sign in to comment.