How to start wallet server

Overview

The easiest and most common way of managing your funds on the Cardano blockchain is through a wallet. This guide is to show how to start cardano-wallet together with cardano-node.

Full node mode

Here we are going to start cardano-wallet in full node mode, meaning that we need to have also cardano-node running on the same machine. We can get binaries of cardano-wallet and compatible version of cardano-node from cardano wallet release page. Cardano-wallet archives published for each release, besides cardano-wallet itself, include all the relevant tools like cardano-node, cardano-cli, cardano-addresses or bech32.

ℹ️ Alternatively one can use handy docker-compose to start wallet and the node on different networks:

$ NETWORK=mainnet docker-compose up

$ NETWORK=preprod docker-compose up

$ NETWORK=preview docker-compose up

Pre-requisites

Start cardano-wallet in full node mode

ℹ️ Configuration files for all Cardano networks can be found in Cardano Book.

  • Start node:
$ cardano-node run \
  --config config.json \
  --topology topology.json \
  --database-path ./db \
  --socket-path /path/to/node.socket
  • Start wallet:

When starting a wallet instance that targets a testing environment such as preview or preprod, we need to provide a byron-genesis.json file to the wallet:

$ cardano-wallet serve --port 8090 \
  --node-socket /path/to/node.socket \
  --testnet byron-genesis.json \
  --database ./wallet-db \
  --token-metadata-server https://metadata.cardano-testnet.iohkdev.io

In case of mainnet we simply replace --testnet byron-genesis.json with option --mainnet.

$ cardano-wallet serve --port 8090 \
  --node-socket /path/to/node.socket \
  --mainnet \
  --database ./wallet-db \
  --token-metadata-server https://tokens.cardano.org

ℹ️ Notice that we use different URLs for mainnet and test networks with the –token-metadata-server option. These URLs point to Cardano Token Registry servers. See Managing native assets for more information.

That’s it! We can basically start managing our wallets from this point onwards. See How to create a wallet and How to manage wallets.

However, in order to be able to make transactions, we still need to wait until cardano-node is synced fully with the Cardano blockchain. In case of mainnet it may take several hours, in case of testnet a bit less.

We can monitor this process using cardano-wallet's GET /network/information endpoint. Once the endpoint returns sync_progress status ready we’ll know we are good to go:

$ curl -X GET http://localhost:8090/v2/network/information | jq .sync_progress
{
  "status": "ready"
}