Bitcoin Forum
June 03, 2024, 09:09:31 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Error when using +1 wallets in Bitcoin Core testnet (denpamusic/php-bitcoinrpc)  (Read 75 times)
thekillingjoke (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
May 19, 2023, 07:12:11 PM
 #1

Hello everyone,

I have two wallets with Bitcoin Core testnet in the folder C:\Users' User's DataData, in the folder C:\Users' Data, in the folder C:\Users' User's Data. I use this PHP library: https://github.com/denpamusic/php-bitcoinrpc

Next, in this path is the folder named wallet and test1 with the .dat files of each wallet

If only one wallet exists, it detects it and can work without even putting 'walletdir' or 'wallet' in $config. But if there are two wallets, it does not work when I put the path in:

$config = [
    scheme' => 'http',
    'host' => 'localhost',
    'port' => 8332,
    'user' => 'user',
    'password' => 'pass',
    'walletdir' => '/wallets/wallet'
];

I have tried a thousand ways, for example: '/testnet3/wallets/wallet/wallet', '/wallets/wallet/wallet.dat' and it doesn't work either.

The error I get back is this: 'Fatal error: Uncaught Denpa\Bitcoin\Exceptions\BadRemoteCallException: Wallet file not specified (must request wallet RPC through /wallet/<filename> uri-path)'.
thekillingjoke (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
May 19, 2023, 07:45:26 PM
 #2

Welcome to the forum
How to use -rpcwallet? I think this link can help answer your question.

I'm using PHP, not -rcpwallet in CLI. I think this is not for me
ABCbits
Legendary
*
Offline Offline

Activity: 2898
Merit: 7531


Crypto Swap Exchange


View Profile
May 20, 2023, 09:56:47 AM
Merited by PowerGlove (1)
 #3

I have tried a thousand ways, for example: '/testnet3/wallets/wallet/wallet', '/wallets/wallet/wallet.dat' and it doesn't work either.

Does that include specify wallet filename outside config, as described on this test file?

Code:
// Source [url]https://github.com/denpamusic/php-bitcoinrpc/blob/2.2.x/tests/ClientTest.php#L103-L144[/url]
    /**
     * Test multiwallet request.
     *
     * @return void
     */
    public function testMultiWalletRequest(): void
    {
        $wallet = 'testwallet.dat';

        $response = $this->bitcoind
            ->setClient($this->mockGuzzle([$this->getBalanceResponse()]))
            ->wallet($wallet)
            ->request('getbalance');

        $this->assertEquals(self::$balanceResponse, $response->get());
        $this->assertEquals(
            $this->getHistoryRequestUri()->getPath(),
            "/wallet/$wallet"
        );
    }

    /**
     * Test async multiwallet request.
     *
     * @return void
     */
    public function testMultiWalletAsyncRequest(): void
    {
        $wallet = 'testwallet2.dat';

        $this->bitcoind
            ->setClient($this->mockGuzzle([$this->getBalanceResponse()]))
            ->wallet($wallet)
            ->requestAsync('getbalance', []);

        $this->bitcoind->wait();

        $this->assertEquals(
            $this->getHistoryRequestUri()->getPath(),
            "/wallet/$wallet"
        );
    }



--snip--
I think you are getting it wrong PHP if am not  is a programming language for web development while RPC is implemented in the web software to communicate with each other using HTTP. And checking your error message I found out it was similar to thread I linked before, but would still advice you check the thread out if it can in any way help.

PHP and any mature programming language can make RPC request just fine.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
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!