3

Hello I have a local blockchain, Geth client, 2 nodes and clique proof of authority algorithm.

I start geth with this command:

geth --datadir node2/ --syncmode 'full' --port 30312 
     --rpc --rpcport 8546 --rpccorsdomain "*" 
     --ipcpath geth.ipc --rpcapi 'personal,db,eth,net,web3,txpool,miner' 
     --bootnodes 'enode://[email protected]:30310' 
     --networkid 2456 --gasprice '1' --mine 
     --unlock '0x46004DEAfddb60d11cA04501df8C52aE4679Be8f' --password password.txt

but because of unlock now everyone can transfer ether from this account to some other account

like so:

const Web3 = require("web3");    
var web3Client = new Web3(new Web3.providers.HttpProvider("http://localhost:8546"));
await web3Client.eth.sendTransaction({
  from: "0x46004DEAfddb60d11cA04501df8C52aE4679Be8f", 
  to: "0xE77e5634A46153e1cfCa02350cf212BdbC18fbC6", 
  value: 23
});

but if I remove --unlock from geth command I can no longer seal blocks

WARN [06-01|14:44:52] Block sealing failed    err="authentication needed: password or unlock"

is it possible to seal blocks without having to unlock the account?

1 Answer 1

3

is it possible to seal blocks without having to unlock the account?

Sealer account has to be unlocked, otherwise you can not sign and you'll not be able to seal blocks.

From the security perspective, it's a bad idea to have a RPC port open at a sealer node. While in test, you can do it like this, but if you plan to setup the production environment, I would recommend to have a separate node for the sealer.

2
  • If I have 2 nodes doing a work of one won't that double the disk usage?
    – netuser24
    Commented Jun 4, 2018 at 7:42
  • Yes, that would be the case. But the question is what is more important: Security or disk usage? Moreover, since you're in the PoA context, the size of the chain shoudn't be the most important problem.
    – ivicaa
    Commented Jun 4, 2018 at 7:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.