I'm trying to deploy a contract private to one node in the Quourm 7-nodes example. The migrate works as expected when deployed normally with truffle, but ignores the privateFor
part and deploys a public contract when used with truffle-hdwallet-provider
. Are there any changes I can make to make the HDWalletProvider work?
2_deploy_contract.js
var SimpleStorage = artifacts.require("SimpleStorage");
module.exports = function (deployer) {
// Pass 42 to the contract as the first constructor parameter
deployer.deploy(SimpleStorage, 42, { privateFor: ['ROAZBWtSacxXQrOe3FGAqJDyJjFePR5ce4TSIzmJ0Bc='] })
};
truffle.js
Works:
development: {
host: "127.0.0.1",
port: 22000,
network_id: "*",
gasPrice: 0,
gas: 4500000
}
Fails (Deploys a public contract instead of a private one):
quorum: {
provider: () => new HDWalletProvider(mnemonic, 'http://localhost:22000'),
network_id: "*",
gas: 4500000,
gasPrice: 0
}
The consensus I am using is IBFT, if that is useful.