Bitcoin Forum
June 14, 2025, 12:57:40 PM *
News: Latest Bitcoin Core release: 29.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: I am not able to carry my wallet in the RPC Electrum Windows. Help me.  (Read 40 times)
gmynis (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 1


View Profile
March 25, 2025, 02:30:30 PM
 #1

<?php
$rpcuser = '...';
$rpcpassword = '...';
$rpchost = "127.0.0.1";
$rpcport = "7777";


$request_load_wallet = json_encode([
    'jsonrpc' => '2.0',
    'id' => 1,
    'method' => 'load_wallet',
    'params' => [
        "wallet_path" => "...",
        "password" => "..."
    ]
]);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://$rpcuser:$rpcpassword@$rpchost:$rpcport");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $request_load_wallet);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);

$response_load_wallet = curl_exec($ch);
curl_close($ch);


RETURN: Load Wallet Response: {"id": 1, "jsonrpc": "2.0", "result": null}

after,
$request_list_wallets = json_encode([
    'jsonrpc' => '2.0',
    'id' => 2,
    'method' => 'list_wallets'
]);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://$rpcuser:$rpcpassword@$rpchost:$rpcport");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $request_list_wallets);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);

$response_list_wallets = curl_exec($ch);
curl_close($ch);

echo '<pre>';
echo "List Wallets Response: ";
echo $response_list_wallets;
echo '</pre>';


RETURN: List Wallets Response: {"id": 2, "jsonrpc": "2.0", "result": [{"path": "c:\\users\\user\\appdata\\roaming\\electrum\\wallets\\wallet", "synchronized": true, "unlocked": false}]}

after,

$request_unlock = json_encode([
        'jsonrpc' => '2.0',
        'id' => 3,
        'method' => 'password',
        'params' => ["..."]
    ]);

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, "http://$rpcuser:$rpcpassword@$rpchost:$rpcport");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $request_unlock);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);

$response_unlock = curl_exec($ch);
curl_close($ch);


RETURN: Unlock Response: {"id": 3, "jsonrpc": "2.0", "error": {"code": 1, "message": "Password required. Unlock the wallet, or add a --password option to your command"}}

In the latter case, I put in CMD:
ELECTRUM-4.5.8-Wallet "C: \ Ussers \ Gugam \ Appdata \ Roaming \ Electrum \ Wallets \wallet"
And then I filled the password on the graphic interface of the Electrum.

Note: With the daemon on I put the password.

nc50lc
Legendary
*
Offline Offline

Activity: 2814
Merit: 7296


Self-proclaimed Genius


View Profile
March 26, 2025, 06:27:21 AM
Merited by Forsyth Jones (1)
 #2

$request_unlock = json_encode([
        'jsonrpc' => '2.0',
        'id' => 3,
        'method' => 'password',
        'params' => ["..."]
    ]);
Method "password" is for changing or setting the wallet encryption password.
Is that the intent of your command?

Quote from: gmynis
In the latter case, I put in CMD:
ELECTRUM-4.5.8 -Wallet "C: \ Ussers \ Gugam \ Appdata \ Roaming \ Electrum \ Wallets \wallet"
And then I filled the password on the graphic interface of the Electrum.

Note: With the daemon on I put the password.
Are you using the stand-alone executable or installed version?
Because using the stand-alone or the installed executable "electrum-4.5.8.exe" will launch the GUI instead.

You'll need to use the "electrum-4.5.8-debug.exe" file for it to be compatible with command line.

Then the correct command is:
Code:
electrum-4.5.8-debug -w "C:\Users\Gugam\Appdata\Roaming\Electrum\Wallets\wallet" password
Considering that your wallet is named "wallet" inside the "Wallets" folder in default electrum datadir.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!