Javascript 如何在deno RPC中使用比特币-rpcwallet标志
我想使用bitcoin cli在钱包中创建地址,对于加载的钱包Javascript 如何在deno RPC中使用比特币-rpcwallet标志,javascript,typescript,rpc,deno,bitcoind,Javascript,Typescript,Rpc,Deno,Bitcoind,我想使用bitcoin cli在钱包中创建地址,对于加载的钱包bitcoin cli getnewaddress一些用户我可以使用Deno import { createRemote } from "https://deno.land/x/gentleRpc/rpcClient.ts"; let Node = new URL("http://127.0.0.1:8332"); Node.port = "8332"; Node.user
bitcoin cli getnewaddress一些用户
我可以使用Deno
import { createRemote } from "https://deno.land/x/gentleRpc/rpcClient.ts";
let Node = new URL("http://127.0.0.1:8332");
Node.port = "8332";
Node.username = "some_user";
Node.password = "some_password";
const remote = createRemote(Node);
const address = remote.getnewaddress(addressLabel);
我想知道如何在需要指定
-rpcwallet
标志的情况下使用deno rpc,如比特币cli-rpcwallet=some_unique\u wallet getnewaddress some_用户
,因此在进一步阅读文档后,我意识到我可以通过如下方式将钱包名称传递到url来实现这一点http://127.0.0.1:8332/wallet/${walletName}或仅此http://127.0.0.1:8332/wallet/
用于默认钱包
所以代码看起来像这样
createConnection(walletName?:字符串){
常量uri=!!walletName?
'http://127.0.0.1:8332/wallet/${walletName}':
'http://127.0.0.1:8332/wallet/';
让节点=新URL(uri);
Node.port=“8332”;
Node.username=“某些用户”;
Node.password=“some_password”;
返回createRemote(节点);
}
因此,在进一步阅读文档后,我意识到我可以通过将钱包名称传递到url来实现这一点,就像这样http://127.0.0.1:8332/wallet/${walletName}
或仅此http://127.0.0.1:8332/wallet/
用于默认钱包
所以代码看起来像这样
createConnection(walletName?:字符串){
常量uri=!!walletName?
'http://127.0.0.1:8332/wallet/${walletName}':
'http://127.0.0.1:8332/wallet/';
让节点=新URL(uri);
Node.port=“8332”;
Node.username=“某些用户”;
Node.password=“some_password”;
返回createRemote(节点);
}