break out deploy configs and add a 3 testnet script (#676)
* feature: add rinkeby config and 3 testnet deploy script * chore: add threeTestnets bridge and improve scripts layout * chore: move configs to mainnet/testnet folders * chore: move RPC to an env var, fix some importsbuddies-main-deployment
parent
f6f9404cb6
commit
31140fa24b
@ -1,2 +1,8 @@ |
|||||||
ALFAJORES_DEPLOYER_KEY= |
ALFAJORES_DEPLOYER_KEY= |
||||||
KOVAN_DEPLOYER_KEY= |
ALFAJORES_RPC= |
||||||
|
|
||||||
|
KOVAN_DEPLOYER_KEY= |
||||||
|
KOVAN_RPC= |
||||||
|
|
||||||
|
RINKEBY_DEPLOYER_KEY= |
||||||
|
RINKEBY_RPC= |
@ -1,12 +1,18 @@ |
|||||||
import { ChainJson, toChain } from '../src/chain'; |
import { ChainJson, toChain } from '../../src/chain'; |
||||||
import * as dotenv from 'dotenv'; |
import * as dotenv from 'dotenv'; |
||||||
import { CoreConfig } from '../src/core/CoreDeploy'; |
import { CoreConfig } from '../../src/core/CoreDeploy'; |
||||||
import { BridgeConfig } from '../src/bridge/BridgeDeploy'; |
import { BridgeConfig } from '../../src/bridge/BridgeDeploy'; |
||||||
|
|
||||||
dotenv.config(); |
dotenv.config(); |
||||||
|
|
||||||
|
const rpc = process.env.ALFAJORES_RPC; |
||||||
|
if (!rpc) { |
||||||
|
throw new Error('Missing RPC URI'); |
||||||
|
} |
||||||
|
|
||||||
export const chainJson: ChainJson = { |
export const chainJson: ChainJson = { |
||||||
name: 'alfajores', |
name: 'alfajores', |
||||||
rpc: 'https://alfajores-forno.celo-testnet.org', |
rpc, |
||||||
deployerKey: process.env.ALFAJORES_DEPLOYER_KEY, |
deployerKey: process.env.ALFAJORES_DEPLOYER_KEY, |
||||||
domain: 1000, |
domain: 1000, |
||||||
}; |
}; |
@ -1,15 +1,20 @@ |
|||||||
import * as dotenv from 'dotenv'; |
import * as dotenv from 'dotenv'; |
||||||
|
|
||||||
import { ChainJson, toChain } from '../src/chain'; |
import { ChainJson, toChain } from '../../src/chain'; |
||||||
import { CoreConfig } from '../src/core/CoreDeploy'; |
import { CoreConfig } from '../../src/core/CoreDeploy'; |
||||||
import { BridgeConfig } from '../src/bridge/BridgeDeploy'; |
import { BridgeConfig } from '../../src/bridge/BridgeDeploy'; |
||||||
import { BigNumber } from 'ethers'; |
import { BigNumber } from 'ethers'; |
||||||
|
|
||||||
dotenv.config(); |
dotenv.config(); |
||||||
|
|
||||||
|
const rpc = process.env.KOVAN_RPC; |
||||||
|
if (!rpc) { |
||||||
|
throw new Error('Missing RPC URI'); |
||||||
|
} |
||||||
|
|
||||||
const chainJson: ChainJson = { |
const chainJson: ChainJson = { |
||||||
name: 'kovan', |
name: 'kovan', |
||||||
rpc: 'https://kovan.infura.io/v3/5c456d7844fa40a683e934df60534c60', |
rpc, |
||||||
deployerKey: process.env.KOVAN_DEPLOYER_KEY, |
deployerKey: process.env.KOVAN_DEPLOYER_KEY, |
||||||
domain: 3000, |
domain: 3000, |
||||||
gasPrice: BigNumber.from(10_000_000_000), |
gasPrice: BigNumber.from(10_000_000_000), |
@ -0,0 +1,44 @@ |
|||||||
|
import * as dotenv from 'dotenv'; |
||||||
|
|
||||||
|
import { ChainJson, toChain } from '../../src/chain'; |
||||||
|
import { CoreConfig } from '../../src/core/CoreDeploy'; |
||||||
|
import { BridgeConfig } from '../../src/bridge/BridgeDeploy'; |
||||||
|
import { BigNumber } from 'ethers'; |
||||||
|
|
||||||
|
dotenv.config(); |
||||||
|
|
||||||
|
const rpc = process.env.RINKEBY_RPC; |
||||||
|
if (!rpc) { |
||||||
|
throw new Error('Missing RPC URI'); |
||||||
|
} |
||||||
|
|
||||||
|
const chainJson: ChainJson = { |
||||||
|
name: 'rinkeby', |
||||||
|
rpc, |
||||||
|
deployerKey: process.env.RINKEBY_DEPLOYER_KEY, |
||||||
|
domain: 2000, |
||||||
|
}; |
||||||
|
|
||||||
|
export const chain = toChain(chainJson); |
||||||
|
|
||||||
|
export const devConfig: CoreConfig = { |
||||||
|
environment: 'dev', |
||||||
|
updater: '0x4177372FD9581ceb2367e0Ce84adC5DAD9DF8D55', |
||||||
|
optimisticSeconds: 10, |
||||||
|
watchers: ['0x20aC2FD664bA5406A7262967C34107e708dCb18E'], |
||||||
|
recoveryTimelock: 180, |
||||||
|
recoveryManager: '0x24F6c874F56533d9a1422e85e5C7A806ED11c036', |
||||||
|
}; |
||||||
|
|
||||||
|
export const stagingConfig: CoreConfig = { |
||||||
|
environment: 'staging', |
||||||
|
updater: '0x201dd86063Dc251cA5a576d1b7365C38e5fB4CD5', |
||||||
|
watchers: ['0x22B2855635154Baa41C306BcA979C8c9a077A180'], |
||||||
|
recoveryManager: '0x24F6c874F56533d9a1422e85e5C7A806ED11c036', |
||||||
|
optimisticSeconds: 10, |
||||||
|
recoveryTimelock: 180, |
||||||
|
}; |
||||||
|
|
||||||
|
export const bridgeConfig: BridgeConfig = { |
||||||
|
weth: '0xc778417E063141139Fce010982780140Aa0cD5Ab', |
||||||
|
}; |
@ -1,8 +1,8 @@ |
|||||||
import { getPathToLatestDeploy } from '../src/verification/readDeployOutput'; |
import { getPathToLatestDeploy } from '../../src/verification/readDeployOutput'; |
||||||
import { deployBridges } from '../src/bridge'; |
import { deployBridges } from '../../src/bridge'; |
||||||
import * as alfajores from '../config/alfajores'; |
import * as alfajores from '../../config/testnets/alfajores'; |
||||||
import * as kovan from '../config/kovan'; |
import * as kovan from '../../config/testnets/kovan'; |
||||||
import { BridgeDeploy } from '../src/bridge/BridgeDeploy'; |
import { BridgeDeploy } from '../../src/bridge/BridgeDeploy'; |
||||||
|
|
||||||
// get the path to the latest core system deploy
|
// get the path to the latest core system deploy
|
||||||
const path = getPathToLatestDeploy(); |
const path = getPathToLatestDeploy(); |
@ -1,8 +1,8 @@ |
|||||||
import { deployTwoChains } from '../src/core'; |
import { deployTwoChains } from '../../src/core'; |
||||||
import * as alfajores from '../config/alfajores'; |
import * as alfajores from '../../config/testnets/alfajores'; |
||||||
import * as kovan from '../config/kovan'; |
import * as kovan from '../../config/testnets/kovan'; |
||||||
import { CoreDeploy } from '../src/core/CoreDeploy'; |
import { CoreDeploy } from '../../src/core/CoreDeploy'; |
||||||
import { deployEnvironment } from '../src/chain'; |
import { deployEnvironment } from '../../src/chain'; |
||||||
|
|
||||||
let environment = deployEnvironment(); |
let environment = deployEnvironment(); |
||||||
|
|
@ -0,0 +1,23 @@ |
|||||||
|
import { getPathToLatestDeploy } from '../../src/verification/readDeployOutput'; |
||||||
|
import { deployBridges } from '../../src/bridge'; |
||||||
|
import * as alfajores from '../../config/testnets/alfajores'; |
||||||
|
import * as kovan from '../../config/testnets/kovan'; |
||||||
|
import * as rinkeby from '../../config/testnets/rinkeby'; |
||||||
|
import { BridgeDeploy } from '../../src/bridge/BridgeDeploy'; |
||||||
|
|
||||||
|
// get the path to the latest core system deploy
|
||||||
|
const path = getPathToLatestDeploy(); |
||||||
|
|
||||||
|
const alfajoresDeploy = new BridgeDeploy( |
||||||
|
alfajores.chain, |
||||||
|
alfajores.bridgeConfig, |
||||||
|
path, |
||||||
|
); |
||||||
|
const kovanDeploy = new BridgeDeploy(kovan.chain, kovan.bridgeConfig, path); |
||||||
|
const rinkebyDeploy = new BridgeDeploy( |
||||||
|
rinkeby.chain, |
||||||
|
rinkeby.bridgeConfig, |
||||||
|
path, |
||||||
|
); |
||||||
|
|
||||||
|
deployBridges([alfajoresDeploy, kovanDeploy, rinkebyDeploy]); |
@ -0,0 +1,21 @@ |
|||||||
|
import { deployNChains } from '../../src/core'; |
||||||
|
import * as alfajores from '../../config/testnets/alfajores'; |
||||||
|
import * as kovan from '../../config/testnets/kovan'; |
||||||
|
import * as rinkeby from '../../config/testnets/rinkeby'; |
||||||
|
import { CoreDeploy } from '../../src/core/CoreDeploy'; |
||||||
|
import { deployEnvironment } from '../../src/chain'; |
||||||
|
|
||||||
|
let environment = deployEnvironment(); |
||||||
|
|
||||||
|
let alfaConfig = |
||||||
|
environment === 'staging' ? alfajores.stagingConfig : alfajores.devConfig; |
||||||
|
let kovanConfig = |
||||||
|
environment === 'staging' ? kovan.stagingConfig : kovan.devConfig; |
||||||
|
let rinkebyConfig = |
||||||
|
environment === 'staging' ? rinkeby.stagingConfig : rinkeby.devConfig; |
||||||
|
|
||||||
|
const alfaDeploy = new CoreDeploy(alfajores.chain, alfaConfig); |
||||||
|
const kovanDeploy = new CoreDeploy(kovan.chain, kovanConfig); |
||||||
|
const rinkebyDeploy = new CoreDeploy(rinkeby.chain, rinkebyConfig); |
||||||
|
|
||||||
|
deployNChains([alfaDeploy, kovanDeploy, rinkebyDeploy]); |
Loading…
Reference in new issue