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://702efed8e606...ad041b4371a91989@127.0.0.1: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?

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.

  • If I have 2 nodes doing a work of one won't that double the disk usage? – netuser24 Jun 4 '18 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 Jun 4 '18 at 7:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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