0 Members and 1 Guest are viewing this topic.
./programs/cli_wallet/cli_wallet -H 127.0.0.1:8092
curl --data '{"jsonrpc": "2.0", "method": "call", "params": [0,"unlock",["PASSWORD"]], "id": 0
expect is used for this, here is an exampleCode: [Select]#!/usr/bin/expect -fset chain_id "0f8b631d7a9dfebf16d6776fab96b629a14429762bf9c3eb95db1e4e4af637a4"set wallet "test_wallet"set rpc_user "alt"set rpc_password "alt"set port "8092"set unlock_password "thisismypassword"spawn ./cli_wallet -w $wallet --chain-id $chain_id -H 127.0.0.1:$port -u $rpc_user -p $rpc_passwordexpect -exact "locked >>> "send -- "info\r"expect -exact "locked >>> "send -- "unlock $unlock_password\r"expect -exact "unlocked >>> "send -- "list_my_accounts\r"interactwait
#!/usr/bin/expect -fset chain_id "0f8b631d7a9dfebf16d6776fab96b629a14429762bf9c3eb95db1e4e4af637a4"set wallet "test_wallet"set rpc_user "alt"set rpc_password "alt"set port "8092"set unlock_password "thisismypassword"spawn ./cli_wallet -w $wallet --chain-id $chain_id -H 127.0.0.1:$port -u $rpc_user -p $rpc_passwordexpect -exact "locked >>> "send -- "info\r"expect -exact "locked >>> "send -- "unlock $unlock_password\r"expect -exact "unlocked >>> "send -- "list_my_accounts\r"interactwait
screen -S cli_wallet cli_wallet --chain-id 0f8b631d7a9dfebf16d6776fab96b629a14429762bf9c3eb95db1e4e4af637a4 -H 127.0.0.1:8092echo -e "password\n"