Skip to content

Commit

Permalink
Added dotenv dependency for truffle config
Browse files Browse the repository at this point in the history
  • Loading branch information
alexroan committed Feb 6, 2021
1 parent 578c988 commit fd34534
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
MNEMONIC="..."
RPC_URL="https://kovan.infura.io/v3/..."
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules/
build/
package-lock.json
package-lock.json
.env
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"dependencies": {
"@chainlink/contracts": "^0.1.6",
"@openzeppelin/contracts": "^3.4.0",
"@truffle/hdwallet-provider": "^1.2.1"
"@truffle/hdwallet-provider": "^1.2.1",
"dotenv": "^8.2.0"
},
"devDependencies": {
"@chainlink/belt": "^0.0.3",
Expand Down
12 changes: 7 additions & 5 deletions truffle-config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
const HDWalletProvider = require('@truffle/hdwallet-provider')
require('dotenv').config();

const mnemonic = process.env.MNEMONIC
const url = process.env.RPC_URL

module.exports = {
networks: {
Expand All @@ -14,12 +18,10 @@ module.exports = {
},
kovan: {
provider: () => {
return new HDWalletProvider(process.env.MNEMONIC, process.env.RPC_URL)
return new HDWalletProvider(mnemonic, url)
},
network_id: '*',
// ~~Necessary due to https://github.com/trufflesuite/truffle/issues/1971~~
// Necessary due to https://github.com/trufflesuite/truffle/issues/3008
skipDryRun: true,
network_id: '42',
skipDryRun: true
},
},
compilers: {
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3426,6 +3426,11 @@ domutils@^2.4.3, domutils@^2.4.4:
domelementtype "^2.0.1"
domhandler "^4.0.0"

dotenv@^8.2.0:
version "8.2.0"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.2.0.tgz#97e619259ada750eea3e4ea3e26bceea5424b16a"
integrity sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==

dotignore@~0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/dotignore/-/dotignore-0.1.2.tgz#f942f2200d28c3a76fbdd6f0ee9f3257c8a2e905"
Expand Down

0 comments on commit fd34534

Please sign in to comment.