Giter Club home page Giter Club logo

wallet-integration-guide's Introduction

Guide

Welcome to HOPR's wallet integration guide. In this guide, we will be making sure you have everything you need to begin integrating your favorite wallet and HOPR.

Getting Started

HOPR is a privacy-preserving messaging protocol which enables the creation of a secure communication network via relay nodes powered by economic incentives using digital tokens. You run HOPR by using HOPRd (HOPR Daemon).

HOPR RPC Relay is an application you can run alongside your HOPRd node which will send all your RPC requests through HOPR, preserving your privacy.

How it works

HOPR RPC Relay acts as a translation layer between the wallet and a HOPRd node. All RPC requests made by the wallet need to be send to HOPR RPC Relay, once received, HOPR RPC Relay will send these messages through the HOPR network, and await for a response to return.

Diagram of how HOPR RPC Relay works

For this guide, we have created an easy to use docker-compose file which can be used to create the environment requires (5 HOPRd nodes, 5 HOPR RPC Relay) so you don't need to shuffle through all our docs and setup the environment manually.

Setting up a working environment

In the following setup, we are creating a local environment where we are making 5 HOPRd nodes and 5 HOPR RPC Relays available. For every HOPRd node we have one HOPR RPC Relay, as we want every HOPRd node to have the capability of processing RPC requests. Five HOPRd nodes are enough to emulate a working HOPR network, allowing us to run everything locally.

Requirements

  • make
  • docker
  • docker-compose

Steps

  1. Go to HOPR RPC Relay repository
  2. Clone the project locally
  3. Run RELAY_VERSION=v0.0.1 make devkit-run

Once steps are completed, you will have a local HOPR and HOPR Relay cluster running, ready to accept RPC requests!

Three important endpoints become available locally:

  1. http://localhost:9001 used later on to send requests to HOPR RPC Relay, use http://localhost:9001/?exit-provider=https://primary.gnosis-chain.rpc.hoprtech.net to send requests to Gnosis chain via HOPR
  2. http://localhost:13301 HOPRd's API endpoint, checkout http://localhost:13301/api/v2/_swagger
  3. http://localhost:19501 HOPRd's admin panel, use http://localhost:19501/?apiEndpoint=http://localhost:13301&apiToken=^^awesomeHOPRr3l4y^^ to access

Connecting a wallet

HOPR RPC Relay was designed to be a drop-in replacement from your usual provider (ex: infura). This means that within the wallet, the only changes that need to be done are:

  1. Switch provider URL to one of your locally running HOPR RPC Relays Example: https://primary.gnosis-chain.rpc.hoprtech.net to http://localhost:9001/?exit-provider=https://primary.gnosis-chain.rpc.hoprtech.net
  2. As you can see from the example above, the only difference is that you need to specify within the URL parameters the exiting provider, which the requests will eventually be processed.

List of wallets

Implementation ideas

  1. Most importantly, is not ideal to ask users to update their existing URL such as <hopr-rpc-relay>/?exit-provider=<exit-provider> to finding creative ways on how to make this as user-friendly as possible is important. Possible options:
    • Add an input field per network
    • Add an input field in the settings, and a checkbox for every network to that enables HOPR.
  2. While HOPR RPC Relay offers on restful API endpoint, you can use HOPRd's API endpoint http://localhost:13301/api/v2/_swagger to fetch various data can be complimentary to the wallet integration. For example, using API http://localhost:13301/api/v2/account/balances will show you the balance available for the running HOPRd node, which is useful to know.

Assets

You can find access to various HOPR assets such as logos and color values here.

wallet-integration-guide's People

Contributors

nionis avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.