How to run Cardano Wallet?

Viewed 212

I have installed cardano-wallet using this documentation. Everything is OK, Just I don't know how to run it so I can have interaction with it via 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()

Does's anyone have an idea?

2 Answers

According to IOHK documentation, prior to running a server you have to run a node:

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

And after that call a serve command with appropriate flags:

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

If you need more details, read my medium post.

Related