Skip to content

Commit

Permalink
feat: add goerli config support (#357)
Browse files Browse the repository at this point in the history
* feat: add goerli config support

* feat: add goerli example env, update prod ipfs hash
  • Loading branch information
Jeroen Offerijns authored Sep 8, 2021
1 parent db94d7a commit 06bcac5
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tinlake-ui-deploy-to-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
NEXT_PUBLIC_ONBOARD_API_HOST: 'https://onboard-api.centrifuge.io/'
NEXT_PUBLIC_POOL_REGISTRY: '0xddf1c516cf87126c6c610b52fd8d609e67fb6033'
NEXT_PUBLIC_POOLS_CONFIG: 'mainnetProduction'
NEXT_PUBLIC_POOLS_IPFS_HASH_OVERRIDE: 'QmRyVZWDqdioGDYDEqJHiXfbXY2HmdTpPif5dq2vcX6fX9'
NEXT_PUBLIC_POOLS_IPFS_HASH_OVERRIDE: 'QmZEh2BmAeRmwpE8NqcjDr42n3mxxJRfAvGGcGY2mESz2r'
NEXT_PUBLIC_PORTIS_KEY: 'bc9e2922-2ebd-4e2b-86f6-7c7855bdf07f'
NEXT_PUBLIC_REWARDS_TREE_URL: 'https://storage.googleapis.com/rad-rewards-trees-mainnet-production/latest.json'
NEXT_PUBLIC_RPC_URL: 'https://mainnet.infura.io/v3/ed5e0e19bcbc427cbf8f661736d44516'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tinlake-ui-deploy-to-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ jobs:
NEXT_PUBLIC_ONBOARD_API_HOST: 'https://onboard-api.centrifuge.io/'
NEXT_PUBLIC_POOL_REGISTRY: '0xddf1c516cf87126c6c610b52fd8d609e67fb6033'
NEXT_PUBLIC_POOLS_CONFIG: 'mainnetProduction'
NEXT_PUBLIC_POOLS_IPFS_HASH_OVERRIDE: 'QmRyVZWDqdioGDYDEqJHiXfbXY2HmdTpPif5dq2vcX6fX9'
NEXT_PUBLIC_POOLS_IPFS_HASH_OVERRIDE: 'QmZEh2BmAeRmwpE8NqcjDr42n3mxxJRfAvGGcGY2mESz2r'
NEXT_PUBLIC_PORTIS_KEY: 'bc9e2922-2ebd-4e2b-86f6-7c7855bdf07f'
NEXT_PUBLIC_REWARDS_TREE_URL: 'https://storage.googleapis.com/rad-rewards-trees-mainnet-production/latest.json'
NEXT_PUBLIC_RPC_URL: 'https://mainnet.infura.io/v3/ed5e0e19bcbc427cbf8f661736d44516'
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ yarn-error.log
.env*.local
.env*
!.env.kovan-example
!.env.goerli-example
!.env.mainnet-example
18 changes: 18 additions & 0 deletions tinlake-ui/.env.goerli-example
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# goerli
NEXT_PUBLIC_CENTRIFUGE_CHAIN_URL=wss://fullnode.amber.centrifuge.io
NEXT_PUBLIC_CLAIM_CFG_CONTRACT_ADDRESS=0x297237e17F327f8e5C8dEd78b15761A7D513353b
NEXT_PUBLIC_ENV=demo
NEXT_PUBLIC_ETHERSCAN_URL=https://goerli.etherscan.io
NEXT_PUBLIC_FEATURE_FLAG_NEW_ONBOARDING=0x1f4155D64D75555B9B36E4514C0FCC11313d5A54,0x25dF507570c8285E9c8E7FFabC87db7836850dCd
NEXT_PUBLIC_INFURA_KEY=bf808e7d3d924fbeb74672d9341d0550
NEXT_PUBLIC_IPFS_GATEWAY=https://cloudflare-ipfs.com/ipfs/
NEXT_PUBLIC_MULTICALL_CONTRACT_ADDRESS=0x5BA1e12693Dc8F9c48aAD8770482f4739bEeD696
NEXT_PUBLIC_ONBOARD_API_HOST=https://onboard-api.amber.centrifuge.io/
NEXT_PUBLIC_POOL_REGISTRY=0x46A01532De22Baa1DFDB58b5bB62845667146E5c
NEXT_PUBLIC_POOLS_CONFIG=goerliStaging
NEXT_PUBLIC_POOLS_IPFS_HASH_OVERRIDE=QmXJTtXoBG9W4MhiDaXSZap3kfAoxSjMQaoVqWyNEbD16r
NEXT_PUBLIC_PORTIS_KEY=bc9e2922-2ebd-4e2b-86f6-7c7855bdf07f
NEXT_PUBLIC_REWARDS_TREE_URL=https://storage.googleapis.com/rad-rewards-trees-kovan-staging/latest.json
NEXT_PUBLIC_RPC_URL=https://goerli.infura.io/v3/f9ba987e8cb34418bb53cdbd4d8321b5
NEXT_PUBLIC_TINLAKE_DATA_BACKEND_URL=https://api.thegraph.com/subgraphs/name/offerijns/tinlake-goerli
NEXT_PUBLIC_TRANSACTION_TIMEOUT=3600
2 changes: 1 addition & 1 deletion tinlake-ui/.env.mainnet-example
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ NEXT_PUBLIC_MULTICALL_CONTRACT_ADDRESS=0xeefba1e63905ef1d7acba5a8513c70307c1ce44
NEXT_PUBLIC_ONBOARD_API_HOST=https://onboard-api.centrifuge.io/
NEXT_PUBLIC_POOL_REGISTRY=0xddf1c516cf87126c6c610b52fd8d609e67fb6033
NEXT_PUBLIC_POOLS_CONFIG=mainnetProduction
NEXT_PUBLIC_POOLS_IPFS_HASH_OVERRIDE=QmRyVZWDqdioGDYDEqJHiXfbXY2HmdTpPif5dq2vcX6fX9
NEXT_PUBLIC_POOLS_IPFS_HASH_OVERRIDE=QmZEh2BmAeRmwpE8NqcjDr42n3mxxJRfAvGGcGY2mESz2r
NEXT_PUBLIC_PORTIS_KEY=bc9e2922-2ebd-4e2b-86f6-7c7855bdf07f
NEXT_PUBLIC_REWARDS_TREE_URL=https://storage.googleapis.com/rad-rewards-trees-mainnet-production/latest.json
NEXT_PUBLIC_RPC_URL=https://mainnet.infura.io/v3/ed5e0e19bcbc427cbf8f661736d44516
Expand Down
14 changes: 7 additions & 7 deletions tinlake-ui/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ interface PoolMetadata {
}

export interface BasePool {
network: 'mainnet' | 'kovan'
network: 'mainnet' | 'kovan' | 'goerli'
version: 2 | 3
metadata: PoolMetadata
}
Expand Down Expand Up @@ -107,7 +107,7 @@ interface Config {
transactionTimeout: number
tinlakeDataBackendUrl: string
isDemo: boolean
network: 'Mainnet' | 'Kovan'
network: 'Mainnet' | 'Kovan' | 'Goerli'
portisApiKey: string
infuraKey: string
gasLimit: number
Expand Down Expand Up @@ -207,15 +207,15 @@ const metadataSchema = yup.object().shape({
})

const poolSchema = yup.object().shape({
network: yup.string().oneOf(['mainnet', 'kovan']).required('poolSchema.network is required'),
network: yup.string().oneOf(['mainnet', 'kovan', 'goerli']).required('poolSchema.network is required'),
version: yup.number().oneOf([2, 3]).required('poolSchema.version is required'),
addresses: contractAddressesSchema.required('poolSchema.addresses is required'),
contractConfig: contractConfigSchema.default(undefined),
metadata: metadataSchema.required('poolSchema.metadata is required'),
})

const upcomingPoolSchema = yup.object().shape({
network: yup.string().oneOf(['mainnet', 'kovan']).required('poolSchema.network is required'),
network: yup.string().oneOf(['mainnet', 'kovan', 'goerli']).required('poolSchema.network is required'),
version: yup.number().oneOf([2, 3]).required('poolSchema.version is required'),
metadata: metadataSchema.required('poolSchema.metadata is required'),
presetValues: yup.object().shape({
Expand All @@ -231,7 +231,7 @@ const upcomingPoolSchema = yup.object().shape({
})

const archivedPoolSchema = yup.object().shape({
network: yup.string().oneOf(['mainnet', 'kovan']).required('poolSchema.network is required'),
network: yup.string().oneOf(['mainnet', 'kovan', 'goerli']).required('poolSchema.network is required'),
version: yup.number().oneOf([2, 3]).required('poolSchema.version is required'),
metadata: metadataSchema.required('poolSchema.metadata is required'),
archivedValues: yup.object().shape({
Expand Down Expand Up @@ -316,9 +316,9 @@ const config: Config = {
.validateSync(process.env.NEXT_PUBLIC_TINLAKE_DATA_BACKEND_URL),
isDemo: yup.string().required('NEXT_PUBLIC_ENV is required').validateSync(process.env.NEXT_PUBLIC_ENV) === 'demo',
network: yup
.mixed<'Mainnet' | 'Kovan'>()
.mixed<'Mainnet' | 'Kovan' | 'Goerli'>()
.required('NEXT_PUBLIC_RPC_URL is required')
.oneOf(['Mainnet', 'Kovan'])
.oneOf(['Mainnet', 'Kovan', 'Goerli'])
.validateSync(networkUrlToName(process.env.NEXT_PUBLIC_RPC_URL || '')),
portisApiKey: yup
.string()
Expand Down

0 comments on commit 06bcac5

Please sign in to comment.