I am trying to create a managed account and deploy a custom wallet contract through web3 on my own private network. The code I'm using is:
// Create account
let account = this.web3.eth.accounts.create();
let encryptedAccount = account.encrypt(password);
// Create and deploy contract
let walletCreationData = new this.web3.eth.Contract(walletContractAbi, null, {
data: walletContractData
}).deploy().encodeABI();
// Sign contract creation with created account
this.web3.eth.accounts.signTransaction({
data: walletCreationData,
from: account.address,
gasPrice: 0,
gas: 200000
}, account.privateKey).then((signedTransaction) => {
this.web3.eth.sendSignedTransaction(signedTransaction.rawTransaction).then(console.log);
});
Now this will give me an error with the message invalid sender
at the sendSignedTransaction
promise. I have tried many combinations, among which using an in-memory wallet and loading an account with an existing balance instead of freshly creating one, but they all ended up giving the same error. What crucial part is missing that would allow me to create a smart contract?
This was tested using web3 1.0.0-beta.24 and geth 1.7.1-stable.