[Ethereum] Custom Parity signer – programmatically unlock accounts for a certain time

parityparity-signer

Default Parity Signer

How can I implement a custom transaction signer (which will unlock accounts on the fly) and tell parity client to use it?

I don't want to unlock all accounts at startup (and always keep them unlocked. Instead, I want to set some logic for account unlocking on each transaction, say:

if (isDay && accountAddress in [addr1, addr2, addr3])
    unlockAccount and signTransaction
else
    rejectTransaction

I'm looking into JSONRPC signer module as a possible option, but not able to connect to the Parity Signer UI using websockets

Connect Error: Error: Server responded with a non-101 status: 403
Response Headers Follow:
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block
x-content-type-options: nosniff
server: Parity/SignerUI
content-length: 524
content-type: text/html
connection: close

Best Answer

Parity takes a command line option to keep certain accounts unlocked:

Example:

   --unlock 0x001fc7d7e506866aeab82c11da515e9dd6d32c25 --password password.txt
Related Topic