1

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
Edward Ruchevits
  • 1,285
  • 2
  • 15
  • 24

2 Answers2

2

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

Example:

   --unlock 0x001fc7d7e506866aeab82c11da515e9dd6d32c25 --password password.txt
Mikko Ohtamaa
  • 22,269
  • 6
  • 62
  • 127
1

You can unlock an account via RPC.

curl --data '{"method":"personal_unlockAccount","params":["0x8f0227d45853a50eefd48dd4fec25d5b3fd2295e","hunter2",null],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545

For details, see https://wiki.parity.io/JSONRPC-personal-module#personal_unlockaccount

ulu
  • 740
  • 6
  • 20