如何运行卡尔达诺钱包?



我已经使用这个文档安装了cardano-wallet。一切都很好,只是我不知道如何运行它,所以我可以通过node js与它进行交互:

const { WalletServer } = require('cardano-wallet-js');
let walletServer = WalletServer.init('http://127.0.0.1:1337/v2');
async function test() {
let information = await walletServer.getNetworkInformation();
console.log(information);
}
test()

有谁有主意吗?

根据IOHK文档,在运行服务器之前,您必须先run一个节点:

cardano-node run                                    
--topology ~/cardano/config/mainnet-topology.json 
--database-path ~/cardano/db/ 
--socket-path ~/cardano/db/node.socket 
--host-addr 127.0.0.1                 
--port 1337 
--config ~/cardano/config/mainnet-config.json

然后调用带有适当标志的serve命令:

cardano-wallet serve                             
--port 8090 
--mainnet 
--database ~/cardano/wallets/db 
--node-socket $CARDANO_NODE_SOCKET_PATH

如果你需要更多的细节,请阅读我的medium post。

你必须运行cardano节点查询区块链。阅读本文https://developers.cardano.org/docs/get-started/cardano-wallet-js

你必须先下载这个文件docker- composer .yml

wget https://raw.githubusercontent.com/input-output-hk/cardano-wallet/master/docker-compose.yml 

然后通过以下命令运行您的节点testnet或mainnet

NETWORK=testnet docker-compose up

那么你就可以连接到区块链参考- https://github.com/tango-crypto/cardano-wallet-js

最新更新