Created
September 26, 2020 16:12
-
-
Save leonprou/d87df893cb284a4bd15647492a7966c6 to your computer and use it in GitHub Desktop.
Syncing Fuse with Ethereum.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Clone the repo and install the dependencies | |
``` | |
git clone https://github.com/fuseio/fuse-bridge | |
cd fuse-bridge | |
git checkout feature/find-not-relayed-messages | |
cd fuse-bridge/native-to-erc20/oracle | |
npm install | |
``` | |
Fuse and Ethereum networks are connected via the bridge that relay messages from Fuse network to Ethereum. | |
The messages are update of validator set, Fuse tokens minting, or Fuse transfers. | |
Validator set updates and minting done on EoC (End of Cycle) on Fuse. | |
While the transfers happen when Fuse transferred between networks via the bridge. | |
To relay the message you're interested in to Ethereum, all signers of the message needs to be in the validator set on Ethereum. | |
If they're not, it means that more events in the past wasn't missed and you need to relay them before. | |
Good to notice: validator set event is fired on every EoC, and might not have any new validators. | |
In that case that event can be skiped and doesn't need to be relayed to Ethereum, as it doesn't introduce new data. | |
Look into the file `src/tx/cycle.js`. It is used both to look for the messages and to relay them. | |
uncomment the funcion you intend execute and congifure the parameters, then run | |
``` | |
node src/tx/cycle.js collected-signatures-watcher.config | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Added UserRequestForSignature so we can look for relayed fuse tokens
Also had to add event variable to relayMessages:
Example:
getMessages({ fromBlock: 6680590, toBlock: 6680592, isRelayedFilter: false, isNewSetFilter: false, event: 'UserRequestForSignature' })
relayMessages({ fromBlock: 6680590, toBlock: 6680592, isRelayedFilter: false, isNewSetFilter: false, execute: true, event: 'UserRequestForSignature'})