The Conflux Reach connector works almost identically to the Ethereum connector, except that it behaves differently at runtime: using, for example, Conflux Portal rather than MetaMask, and connecting to Conflux nodes.
Backends must respect the following environment variables:
Or this to run on Conflux MainNet:
It is strongly recommended that you also use
to avoid waiting for unnecessary queries.
For example, this code snippet sets the lower bound at 2000 blocks ago:
DApp startup doesn’t have to be slow.
Reach relies on querying Conflux event logs in order to run the DApp.
The Conflux network does not yet provide fast APIs for querying event logs for a given contract across all time,
so instead, Reach incrementally queries across chunks of 1000 blocks at a time.
You can use
setQueryLowerBound to help Reach know at what block number to start querying,
so that it does not have to start querying at the beginning of time, which can take quite a while.
If you find that ConfluxPortal’s Localhost 12537 default configuration does not work correctly with Reach apps, you can try configuring ConfluxPortal to use a custom RPC endpoint:
Click the network dropdown in Conflux Portal
Select: Custom RPC
Use RPC url: http://127.0.0.1:12537
If your locally-running Conflux devnet restarts, you may find that you need to reset ConfluxPortal’s account history, which you can do like so:
Select the desired account
Click the profile image of the account (top-right)
Click Settings > Advanced > Reset Account > (confirm) Reset
Switch to a different network and back
CTRL+SHIFT+R to hard-reset the webpage.