Clef Tutorial

Initialization

First, you need to init clef dir to create masterseed

# CLEFDIR - directory with clef data(defualt: $HOME/.clef)
clef init --configdir CLEFDIR

Screenshot

"Unlocking" Keystore

then you should COPY your keystore file to keysotre folder and add password to clef

cp keystoreFile KEYSTOREDIR
clef setpw --configdir CLEFDIR 0x123dead #password will prompted and decrypted by masterseed

Rules

to accept or reject some requests create rule file:

function ApproveListing() {
    return "Approve"
}
function ApproveTx(){
        return "Approve"
}

and then add checksum of rules file to clef

clef attest --configdir CLEFDIR $(sha256sum rules.js)

Start Service

clef --configdir CLEFDIR --keystore KEYSTOREDIR --chainid=35441 --rules=/data/rules.js

then you can use clef as signer in geth

geth ...YOUR FLAGS... --signer=CLEFDIR/clef.ipc

(more info about clef in offcial docs)[https://geth.ethereum.org/docs/clef/tutorial]

Demo

Sending Tx with "unlocked" Account

Screenshot

Screenshot

Screenshot

Sending Tx from "locked" Account

rm password from clef clef --configdir=CLEFDIR $address

Screenshot

password prompted in clef

Screenshot