2018-12-10 10:11:36 +01:00
|
|
|
import * as HDWalletProvider from "truffle-hdwallet-provider"
|
|
|
|
import Config from "../models/Config"
|
|
|
|
import * as config from "./config/config.json"
|
|
|
|
|
2019-01-11 11:17:42 +01:00
|
|
|
if (process.env.SEED_WORDS) {
|
|
|
|
const seedphrase = process.env.SEED_WORDS
|
2019-01-16 11:02:48 +01:00
|
|
|
// There are 20 accounts availabe (19 + 1)
|
|
|
|
const accountIndex = Math.floor(Math.random() ** 19)
|
2018-12-10 10:11:36 +01:00
|
|
|
|
|
|
|
// @ts-ignore
|
|
|
|
config.web3Provider = new HDWalletProvider(
|
|
|
|
seedphrase,
|
|
|
|
config.nodeUri,
|
2019-01-16 11:02:48 +01:00
|
|
|
accountIndex,
|
|
|
|
2,
|
2018-12-10 10:11:36 +01:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default config as Config
|