I wrote the following to interact with a Geth node. Got Error: authentication needed: password or unlock
. Is there any way to bypass that? I don't want to use private key in my code either. Can I interact with the node directly to send transaction or sign message?
var Web3 = require('web3');
var web3 = new Web3(new Web3.providers.HttpProvider('http://127.0.0.1:8545'));
web3.eth.sendTransaction({
from: "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
to: "0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
value: web3.toWei(2, "ether"),
nonce: '0x1',
gasPrice: '0x5b9aca00',
gasLimit: '0x56f90',
}, function(err, transactionHash) {
if (err) {
console.log(err);
} else {
console.log(transactionHash);
}
});