Skip to content

Commit 93afe3f

Browse files
authored
Merge pull request #201 from rsksmart/etherscan-api
Add Etherscan API to have a fallback option
2 parents b03fa82 + 2dbdb1a commit 93afe3f

File tree

7 files changed

+351
-135
lines changed

7 files changed

+351
-135
lines changed

federator/README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The federators will be the owners of the contracts willing to allow to cross the
77
## Config
88

99
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.
10-
10+
You will also need to add an [etherscan api key](https://etherscan.io/myapikey) in this config file.
1111
## Usage
1212

1313
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.
@@ -24,14 +24,15 @@ In order to test with multiple federators, ensure they're added as members of th
2424

2525
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
2626

27-
```json
27+
```js
2828
module.exports = {
2929
mainchain: require('./rsktestnet-kovan.json'),
3030
sidechain: require('./kovan.json'),
3131
runEvery: 1, // In minutes,
3232
confirmations: 10,// Number of blocks before processing it,
3333
privateKey: require('federator.key'),
34-
storagePath: './db'
34+
storagePath: './db',
35+
etherscanApiKey: '<YOUR ETHERSCAN API KEY>',
3536
}
3637
```
3738

federator/config/config.sample.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ module.exports = {
55
runEvery: 2, // In minutes,
66
confirmations: 120, // Number of blocks before processing it, if working with ganache set as 0
77
privateKey: fs.readFileSync(`${__dirname}/federator.key`, 'utf8'),
8-
storagePath: './db'
8+
storagePath: './db',
9+
etherscanApiKey: '',
910
}

0 commit comments

Comments
 (0)