Skip to content

Commit

Permalink
Merge pull request #201 from rsksmart/etherscan-api
Browse files Browse the repository at this point in the history
Add Etherscan API to have a fallback option
  • Loading branch information
pmprete authored May 20, 2021
2 parents b03fa82 + 2dbdb1a commit 93afe3f
Show file tree
Hide file tree
Showing 7 changed files with 351 additions and 135 deletions.
7 changes: 4 additions & 3 deletions federator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The federators will be the owners of the contracts willing to allow to cross the
## Config

Go to /federator/config copy `config.sample.js` file and rename it to `config.js` set mainchain and sidechain to point to the json files of the networks you are suing, for example rsktestnet-kovan.json and kovan.json, `make sure to set the host parameter of those files`. Create the file `federator.key` inside the config folder, and add the private key of the member of the Federation contract. The members of the federation are controled by the MultiSig contract, same that is owner of the Bridge and AllowedTokens contracts.

You will also need to add an [etherscan api key](https://etherscan.io/myapikey) in this config file.
## Usage

Run `npm install` to install the dependencies, make sure you followed the previous config step. Then to start the service run `npm start` which will start a single federator that listen to both networks. Check the logs to see that everything is working properly.
Expand All @@ -24,14 +24,15 @@ In order to test with multiple federators, ensure they're added as members of th

To run the federator using Docker first, go to the /federator/config folder and rename `config.sample.js` to `config.js`. In that file you will dedcide the networks the federate must be listening, for example for the bridge in testnet a federator config.js will look like

```json
```js
module.exports = {
mainchain: require('./rsktestnet-kovan.json'),
sidechain: require('./kovan.json'),
runEvery: 1, // In minutes,
confirmations: 10,// Number of blocks before processing it,
privateKey: require('federator.key'),
storagePath: './db'
storagePath: './db',
etherscanApiKey: '<YOUR ETHERSCAN API KEY>',
}
```

Expand Down
3 changes: 2 additions & 1 deletion federator/config/config.sample.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ module.exports = {
runEvery: 2, // In minutes,
confirmations: 120, // Number of blocks before processing it, if working with ganache set as 0
privateKey: fs.readFileSync(`${__dirname}/federator.key`, 'utf8'),
storagePath: './db'
storagePath: './db',
etherscanApiKey: '',
}
Loading

0 comments on commit 93afe3f

Please sign in to comment.