I am running a private Quorum
chain consisting of 3 nodes with raft
consensus. When I deploy a contract to the chain via web3
I get returned a hash and can then look up the transaction with the local geth console (geth attach qdata/geth.ipc
) and check its status with eth.getTransaction(hash)
, so I get this:
{
blockHash: "0x0000000000000000000000000000000000000000000000000000000000000000",
blockNumber: null,
from: "0xc58a28d310c76e8298fa086381e6f2da9f046c07",
gas: 4700000,
gasPrice: 0,
hash: "0x75bf6fc10400fa493851b8105973e9b5aab2955dc5d87d217f13ed9562ccafbd",
input: "0xc2f448268ee5019782beeaee884bc92112187a16af7b23df948fd0f867ecb2f41f34f34e477e2ddd53c74ef20fc48b0ebcda0a003f991f9c6e1a4bedfc65288d",
nonce: 0,
r: "0x3cd6c0a90a9b2367d6d47f081ad8509ea374f4db54bbf51eb9ace8360e50bc7a",
s: "0x6d6cabc76a0d7774ada6ba753d06be0400353a5d3d42d85c92c4db7b8ad2f7bd",
to: null,
transactionIndex: 0,
v: "0x26",
value: 0
}
But there is no address! So why is the transaction still not mined?
EDIT: Here is the code I used to deploy the contract:
const Web3 = require('web3-quorum');
const web3 = new Web3(new Web3.providers.HttpProvider('http://..SERVER_ADDRESS..:22000'));
var abiArray = [{...ABI...}];
var simpleContract = web3.eth.contract(abiArray);
var bytecode = "0x6080604052348...";
const account = '0xc58a28d310c76...';
var nonce = web3.eth.getTransactionCount(account);
const contractData = {
from: account,
data: bytecode,
gas: 0x47b760,
privateFor: ["oUEMYuV2DOlgk88JxKx..."],
nonce: '0x' + nonce
};
//contract instance
const contractInstance = simpleContract.new(123, contractData, function(e, contract) {
if (e) {
console.log("err creating contract", e);
} else {
if (!contract.address) {
console.log("Contract transaction send: TransactionHash: " + contract.transactionHash + " waiting to be mined...");
} else {
console.log("Contract mined! Address: " + contract.address);
console.log(contract);
}
}
});
eth.getTransaction
.