Author

Topic: Error when using +1 wallets in Bitcoin Core testnet (denpamusic/php-bitcoinrpc) (Read 75 times)

legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
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.
newbie
Activity: 2
Merit: 0
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
newbie
Activity: 2
Merit: 0
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/ uri-path)'.
Jump to: