upgrade to infura v3

This commit is contained in:
Josh Harvey 2018-08-10 17:33:26 +03:00
parent 2de5c6d78f
commit d28c6ae691
2 changed files with 19 additions and 3 deletions

View file

@ -2,10 +2,10 @@ const _ = require('lodash/fp')
const base = require('../geth/base')
function run (account) {
const apiKey = account.apiKey
if (!apiKey) throw new Error('Need to configure API key for Infura')
const endpoint = account.endpoint
if (!endpoint) throw new Error('Need to configure API endpoint for Infura')
base.connect(`https://mainnet.infura.io/${apiKey}`)
base.connect(endpoint)
}
module.exports = _.merge(base, {run})

View file

@ -9,6 +9,22 @@
"secret": true,
"required": true,
"value": ""
},
{
"code": "apiSecret",
"display": "API secret",
"fieldType": "password",
"secret": true,
"required": true,
"value": ""
},
{
"code": "endpoint",
"display": "Endpoint",
"fieldType": "password",
"secret": true,
"required": true,
"value": ""
}
]
}