익명 23:41

Electrum load_wallet through json-rpcs does not accept "wallet" parameter

Electrum load_wallet through json-rpcs does not accept "wallet" parameter

When calling load_wallet through json-rpc, using "wallet" param with a path to the wallet throws an error:

Commands.load_wallet() got an unexpected keyword argument 'wallet'

In the same time, electrum help load_wallet lists wallet as an acceptable option:

electrum help load_wallet

The question is, how do I specify wallet path when calling load_wallet through json-rpc.

Example payload:

{"jsonrpc":"2.0","id":"test","method":"load_wallet","params":{"wallet": "/electrum/testnet/wallets/orders001"}}


Top Answer/Comment:

It seems that the "wallet" parameter is not recognized by the "load_wallet" method in the context of the JSON-RPC call you are making.

One solution could be to pass the wallet path as a command-line argument when starting the JSON-RPC server. For example, if you are using Electrum, you could start the server with the following command:

electrum --testnet --rpcuser=<username> --rpcpassword=<password> --rpchost=localhost --rpcport=8000 /electrum/testnet/wallets/orders001

This command starts the Electrum server in testnet mode and specifies the wallet path as the last argument.

Once the server is running, you can make JSON-RPC requests to it without including the "wallet" parameter in the payload. The server should automatically load the wallet specified in the command-line argument.

Alternatively, you could try using the "load_wallet_file" method instead of "load_wallet". According to the Electrum documentation, "load_wallet_file" takes a single argument, which is the path to the wallet file. Here is an example payload:

{"jsonrpc":"2.0","id":"test","method":"load_wallet_file","params":["/electrum/testnet/wallets/orders001"]}

Note that the wallet path is passed as an array element in the "params" field, not as a separate "wallet" parameter.

상단 광고의 [X] 버튼을 누르면 내용이 보입니다