Migrating From SL

This section provides practical tips for migrating from SL.

I am using explorer from cardano-sl, what should I do?

The API from the old explorer has been ported identically to cardano-submit-api. This component is part of cardano-rest. Source code dealing with the explorer API from cardano-sl should be straightforward to migrate. See the installation instructions and documentation available on cardano-rest for more details.

The setup is slightly different. With cardano-sl, the explorer is mounted directly on the core node as one monolith, and can be turned on and off. These components have been split off one another and use an extra middleware to communicate. The “infrastructure” is slightly more complex, but enables greater flexibility and robustness.

INFORMATION: It is possible to automatically migrate an existing blockchain database from cardano-sl into its new format compatible with cardano-node. For this, have a look at the db-converter and in particular, the convert command:

$ db-converter convert --help
Usage: db-converter convert --epochDir STRING --dbDir STRING --epochSlots WORD64

Available options:
  -h,--help                Show this help text
  --epochDir STRING        Path to the directory containing old epoch files
  --dbDir STRING           Path to the new database directory
  --epochSlots WORD64      Slots per epoch

INFORMATION: On Byron, the number of slots per epoch is fixed to 21600.

This can save you an hour of time downloading the blockchain from the network!

Build it with Nix as follows:

$ git clone https://github.com/input-output-hk/ouroboros-network
$ cd ouroboros-network
$ nix-build -A haskellPackages.ouroboros-consensus-byron.components.exes.db-converter -o db-converter
$ ./db-converter/bin/db-converter --help

I am using wallet V1 from cardano-sl, what should I do?

A new V2 API is now available on cardano-wallet. In a similar fashion to cardano-rest, this component used to be mounted directly on the core node, but it is now an independent process. The cardano-wallet is nothing more than a webserver that connects to a local core node through a domain socket.

There are some variations between the V2 and V1 APIs, but both APIs follow a very similar approach and are still very resource-centric (a.k.a ReST). cardano-wallet is a large component that covers multiple networks and node backends. If you’re coming from sl, you’re most likely interested in cardano-wallet-byron at the moment, since it is integrated with a Byron-reboot OBFT cardano-node. Follow the setup instructions on cardano-wallet’s README and Wiki.

The API documentation is available in API References. Note that only the Legacy sub-part of the API matters at this stage. The Shelley part is not available on the Byron integration but can be looked up as a reference for future integration.

WARNING: cardano-sl had the concept of “accounts” inside wallets. This concepts is now entirely gone. If you need multiple accounts, use multiple wallets.

I am using wallet V0 from cardano-sl, what should I do?

If you use wallet V0, it will be harder to migrate to cardano-wallet. The gaps between V0 and V2 are larger, but everything from the previous section applies.

More questions? Have a look at the FAQ or else, reach out on Github!