Welcome to HOPR's wallet integration guide. In this guide, we will be making sure you have everything you need to begin integrating your favourite wallet with HOPR.
Additionally, you may check our video guide.
HOPR is a privacy-preserving messaging protocol which enables the creation of a secure communication network via incentivized relay nodes. You run HOPR by using HOPRd (HOPR Daemon).
RPCh is an application you can run alongside your HOPRd node, which will send all your RPC requests through HOPR, preserving your privacy.
RPCh acts as a translation layer between the wallet and a HOPRd node. All RPC requests made by the wallet must be sent to RPCh. Once received, RPCh will send these messages through the HOPR network and await a response to return.
For this guide, we have created an easy-to-use docker-compose file which can be used to create the environment required (5 HOPRd nodes, 5 RPCh) so you don't need to shuffle through all our docs and set up the environment manually.
In the following setup, we are creating a local environment, making 5 HOPRd nodes and 5 RPChs available. For every HOPRd node, we have one RPCh, as we want every HOPRd node to be capable of processing RPC requests. Five HOPRd nodes are enough to emulate a working HOPR network, allowing us to run everything locally.
- make
- docker
- docker-compose
- Go to RPCh repository
- Clone the project locally
- Run
RELAY_VERSION=latest make devkit-run
Once you've completed the steps, you will have a local HOPR and HOPR Relay cluster running, ready to accept RPC requests!
Three important endpoints become available locally:
http://localhost:9001
used later on to send requests to RPCh. Usehttp://localhost:9001/?exit-provider=https://primary.gnosis-chain.rpc.hoprtech.net
to send requests to Gnosis chain via HOPRhttp://localhost:13301
HOPRd's API endpoint, check outhttp://localhost:13301/api/v2/_swagger
http://localhost:19501
HOPRd's admin panel, usehttp://localhost:19501/?apiEndpoint=http://localhost:13301&apiToken=^^awesomeHOPRr3l4y^^
for access
RPCh is designed to be a drop-in replacement to your usual provider (ex: infura). This means that within the wallet, the only change that needs to be made is:
- Switching the provider URL to one of your locally running RPChs
Example:
https://primary.gnosis-chain.rpc.hoprtech.net
tohttp://localhost:9001/?exit-provider=https://primary.gnosis-chain.rpc.hoprtech.net
As you can see from the example above, the only difference is that you need to specify the exiting provider (used to process requests) within the URL parameters.
or your favorite wallet
- Most importantly, it is not ideal to ask users to update their existing URLs, such as
<rpch>/?exit-provider=<exit-provider>
. Your job is to find creative ways to make this as user-friendly as possible. Possible options:- Add an input field per network
- Add an input field in the settings and a checkbox for every network that enables HOPR.
- While RPCh uses a restful API endpoint, you can use HOPRd's API endpoint
http://localhost:13301/api/v2/_swagger
to fetch various data that can be complementary to the wallet integration. For example, APIhttp://localhost:13301/api/v2/account/balances
will show you the balance available for the running HOPRd node, which the user might find helpful.
You can find access to various HOPR assets such as logos and colour values here.