Skip to content

blockfrost/blockfrost-yoroi-bridge

Repository files navigation

Blockfrost-Yoroi Bridge


A bridge between Blockfrost.io API and Yoroi Frontend.

AboutGetting startedInstallationUsage


About

This repository provides a tool, which allows you to run Yoroi without the need of running your own full node backends, as all the data is being fetched from Blockfrost.io.

Endpoint are mirroring Yoroi GraphQL Migration Backend.

Getting started

Blockfrost.io

To use this SDK, you first need to log in to blockfrost.io, create your project and retrieve the API token.


Yoroi

You'll also need to modify the Yoroi Frontend a bit if you want it to connect to custom backend. To do this, change this URL to the URL where you'll run the bridge. For example, you can use http://localhost:21000, same as it's already used for the test switch, like so:

image

Note: when using testnet, change the appropriate URL in the Cardano Testnet section below.

Then, follow their README to build and run Yoroi.

Installation

yarn

$ yarn
$ yarn build

nix

$ nix-build

Usage

There are 3 environment variables that can be set, only the first one is mandatory.

PROJECT_ID: Your Blockfrost.io API token.

PORT (optional): default 21000.

NETWORK (optional): Accepted values are mainnet and testnet. Default mainnet.

Production

Mainnet:

$ PROJECT_ID='yourBlockfrostTokenForMainnet' yarn start

Mainnet custom port:

$ PROJECT_ID='yourBlockfrostTokenForMainnet' PORT=21001 yarn start

Testnet:

$ PROJECT_ID='yourBlockfrostTokenForTestnet' NETWORK=testnet yarn start

Testnet custom port:

$ PROJECT_ID='yourBlockfrostTokenForTestnet' PORT=21002 NETWORK=testnet yarn start

Nix: Run the binary with appropriate variables.

Development

Mainnet:

$ PROJECT_ID='yourBlockfrostTokenForMainnet' yarn dev

Mainnet custom port:

$ PROJECT_ID='yourBlockfrostTokenForMainnet' PORT=21001 yarn dev

Testnet:

$ PROJECT_ID='yourBlockfrostTokenForTestnet' NETWORK=testnet yarn dev

Testnet custom port:

$ PROJECT_ID='yourBlockfrostTokenForTestnet' PORT=21002 NETWORK=testnet yarn dev