How do you select an account to deploy a contract using: 1)Metamask 2)Parity 3)some config file
1 Answer
I figured it out.
in truffle.js
you can specify from:
field like this:
// Allows us to use ES6 in our migrations and tests. require('babel-register') module.exports = { networks: { development: { host: 'localhost', port: 8545, network_id: '*', // Match any network id from: '0xA21983B35C767CF8609D95F4886C9A18A194D8AA' } } }
-
3that's the public address, but how does truffle knows the associated private key? Commented Sep 29, 2017 at 7:04
-
@David天宇Wong it doesn't need to know, your geth/parity node doesn't even know it. You have to
unlock
your key– rstormsfCommented Oct 1, 2017 at 2:02 -
2It needs to know it to sign transactions coming from this address. If you deploy a contract you need to sign the transaction deploying that contract. Commented Oct 2, 2017 at 20:55