To run this project, install it locally using npm:
Available init parameters in CLI:
- -p 'Private key for the relayer such as 0x126740...' (required)
- -n ' 'Ethereum Network ID - default: 1 (mainnet), 3 (ropsten)'
- -w ' 'Wait time between each rate check (in secs) - default: 45'
- -mw ' 'Max wait time between each provide, forces a provide (in secs) - default: 21600 (6 hours)'
- -c ' 'List of currencies to provide, separated by commas'
- -oc ' 'Oracle Factory contract address'
- -uc ' 'Uniswap Factory contract address'
- -t ' 'Percentage delta required to update the rate'
- -r ' 'Ethereum RPC node URL'
$ npm install
$ node index.js -p <private-key> -w <wait> -wm <max-wait> -n <network> ...
You need to have docker and docker-compose previously installed:
Create a .env file with key-value pairs as follow:
- RCNORACLE_PRIVATE_KEY==<private_key> (required)
- RCNORACLE_NETWORK=
- RCNORACLE_WAIT=
- RCNORACLE_MAX_WAIT=
- RCNORACLE_CURRENCIES=
- RCNORACLE_ORACLE_FACTORY_CONTRACT=
- RCNORACLE_ORACLE_FACTORY_CONTRACT=
- RCNORACLE_PERCENTAGE_THRESHOLD=
- RCNORACLE_RPC=
$docker-compose build
$docker-compose up
You need to have a private key in keystore-file format or use geth (go-ethereum) to import account from private key and generate one.
Steps to create a new keystore-file:
- Create a file with the private key in hex such as 0x126740...
- Use the geth console to import account and set passphrase:
$ geth account import ./key.prv
- This will create a keystore file with the privateKey encrypted in the Ethereum data directory (default: ~/.ethereum/keystore)
Next, to run this project, install it locally using npm: Set the following arguments:
- -f 'File key for the relayer in keystore-file format (Ex: /home/User/UTC--2019-09-04T21-10-18.268682738Z--e057277d76... )' (required)
- -n ' 'Ethereum Network ID - default: 1 (mainnet), 3 (ropsten)'
- -w ' 'Wait time between each rate check (in secs) - default: 45'
- -mw ' 'Max wait time between each provide, forces a provide (in secs) - default: 21600 (6 hours)'
- -c ' 'List of currencies to provide, separated by commas'
- -oc ' 'Oracle Factory contract address'
- -uc ' 'Uniswap Factory contract address'
- -t ' 'Percentage delta required to update the rate'
- -r ' 'Ethereum RPC node URL'
$ npm install
$ node index.js -f <file-path> -w <wait> -m <waitMarket> -n <network> ...
$ Key: <passphrase>