var Web3 = require('web3');
var web3 = new Web3(new Web3.providers.HttpProvider('http://XXX.XXX.XXX.XXX:PPPP'));
var account = '0xb5cF1ee3481B45d1A1cB939921f3f6E3f0C97f80'
console.log('Account: ' + account);
web3.eth.personal.unlockAccount(account, "dos", 50000)
const deployedContract = new web3.eth.Contract([{"constant":true,"inputs":[],"name":"displayMessage","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"displayMessagex","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"}]);
deployedContract.deploy({
data: '0x6060604052341561000f57600080fd5b6101ad8061001e6000396000f30060606040526004361061004b5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416632d59dc128114610050578063910dc524146100da575b600080fd5b341561005b57600080fd5b6100636100ed565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561009f578082015183820152602001610087565b50505050905090810190601f1680156100cc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156100e557600080fd5b61006361012e565b6100f561016f565b60408051908101604052601281527f5768616c652068656c6c6f2074686572652100000000000000000000000000006020820152905090565b61013661016f565b60408051908101604052601781527f5768616c652068656c6c6f2074686572655858585858210000000000000000006020820152905090565b602060405190810160405260008152905600a165627a7a723058208eeb846120df236de217b296df57febcc6f992caf709d5cb6d4637c86b9427a40029'
}).send({
from: account,
gas: 10000000
})
.ononce('confirmation', function(confirmationNumber, receipt){
console.log('confirmation: ' + confirmationNumber)
})
.on('transactionHash', function(hash){
console.log('trans hash: ' + hash)
})
.on('error', function(error){
console.log('error: ' + error)
})
.on('receipt', function(receipt){
console.log('receipt: ' + receipt.toString())
})
.then(function(contract) {
console.log('Contract address: ' + contract.options.address);
})
.catch(function(error) {
console.log(error);
})
After start mining the main problem convert in the first problem (is an advance), changed the on('confirmation') to once('confirmation') the output now is:
Account: 0xb5cF1ee3481B45d1A1cB939921f3f6E3f0C97f80
trans hash: 0xc5a2dc489815c205a53658bf5ebcde95593e83da4ead07355fcae4d722636c12
confirmation: 0
receipt: [object Object]
Contract address: 0x6b4A76Ab26e487Fdc502779Abc438d0cF59299bc