Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arbitrum deployment #2120

Closed
wants to merge 14 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions .github/workflows/amplify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ on:
push: # Disabling auto deployment until production branch is merged
branches:
- master
- master-arbitrum
paths:
- 'amplify/**'

concurrency:
group: cdapp-amplify
group: ${{ github.ref }}-cdapp-amplify
cancel-in-progress: true

# Set global env variables
Expand All @@ -26,13 +27,13 @@ jobs:
runs-on: ubuntu-latest

env:
AWS_AMPLIFY_WEBHOOK_QA: ${{ vars.AWS_AMPLIFY_WEBHOOK_QA }}
AWS_AMPLIFY_WEBHOOK: ${{ github.ref == 'refs/heads/master' && vars.AWS_AMPLIFY_WEBHOOK_QA || github.ref == 'refs/heads/master-arbitrum' && vars.AWS_AMPLIFY_WEBHOOK_QA_ARBITRUM_SEPOLIA }}
AWS_AMPLIFY_APP_ID_QA: ${{ vars.AWS_AMPLIFY_APP_ID_QA }}

steps:
- name: Trigger Amplify AWS Pipeline
run: |
curl -X POST -d {} "${AWS_AMPLIFY_WEBHOOK_QA}&operation=startbuild" -H "Content-Type:application/json"
curl -X POST -d {} "${AWS_AMPLIFY_WEBHOOK}&operation=startbuild" -H "Content-Type:application/json"

- name: Post AWS Amplify console link in GH summary
run: |
Expand All @@ -54,13 +55,13 @@ jobs:
runs-on: ubuntu-latest

env:
AWS_AMPLIFY_WEBHOOK_PROD: ${{ vars.AWS_AMPLIFY_WEBHOOK_PROD }}
AWS_AMPLIFY_WEBHOOK: ${{ github.ref == 'refs/heads/master' && vars.AWS_AMPLIFY_WEBHOOK_PROD || github.ref == 'refs/heads/master-arbitrum' && vars.AWS_AMPLIFY_WEBHOOK_PROD_ARBITRUM }}
AWS_AMPLIFY_APP_ID_PROD: ${{ vars.AWS_AMPLIFY_APP_ID_PROD }}

steps:
- name: Trigger Amplify AWS Pipeline
run: |
curl -X POST -d {} "${AWS_AMPLIFY_WEBHOOK_PROD}&operation=startbuild" -H "Content-Type:application/json"
curl -X POST -d {} "${AWS_AMPLIFY_WEBHOOK}&operation=startbuild" -H "Content-Type:application/json"

- name: Post AWS Amplify console link in GH summary
run: |
Expand Down
334 changes: 169 additions & 165 deletions .github/workflows/build-deploy.yaml

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion amplify/backend/api/colonycdapp/parameters.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"AppSyncApiName": "colonycdapp",
"DynamoDBBillingMode": "PAY_PER_REQUEST",
"DynamoDBEnableServerSideEncryption": false
"DynamoDBEnableServerSideEncryption": false,
"DynamoDBEnablePointInTimeRecovery": "true"
}
18 changes: 17 additions & 1 deletion amplify/backend/backend-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,22 @@
}
]
},
"AMPLIFY_function_removeMemberFromColonyWhitelist_deploymentBucketName": {
"usedBy": [
{
"category": "function",
"resourceName": "removeMemberFromColonyWhitelist"
}
]
},
"AMPLIFY_function_removeMemberFromColonyWhitelist_s3Key": {
"usedBy": [
{
"category": "function",
"resourceName": "removeMemberFromColonyWhitelist"
}
]
},
"AMPLIFY_function_updateContributorsWithReputation_deploymentBucketName": {
"usedBy": [
{
Expand Down Expand Up @@ -507,4 +523,4 @@
]
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,28 @@
"Type": "String"
}
},

"Conditions": {
"IsQaEnv": {
"Fn::Equals": [
"IsQaOrClonedEnv": {
"Fn::Or": [
{
"Ref": "env"
"Fn::Equals": [
{
"Ref": "env"
},
"qaarbsep"
]
},
"qa"
{
"Fn::Equals": [
{
"Ref": "env"
},
"qaarbsepcl"
]
}
]
}
},

"Resources": {
"chainNetworkSSM": {
"Type": "AWS::SSM::Parameter",
Expand All @@ -25,8 +35,13 @@
"Fn::Sub": "/amplify/cdapp/${env}/chain_network"
},
"Type": "String",

"Value": "gnosis",
"Value": {
"Fn::If": [
"IsQaOrClonedEnv",
"arbitrumSepolia",
"arbitrumOne"
]
},
"Description": "The name of the network"
}
},
Expand All @@ -39,12 +54,12 @@
"Type": "String",
"Value": {
"Fn::If": [
"IsQaEnv",
"https://qa-gnosis.colony.io/rpc/",
"https://gnosis.colony.io/rpc/"
"IsQaOrClonedEnv",
"https://arbitrum-sepolia.core.chainstack.com/5ee6818452437d552323df146564523d",
"https://arbitrum-mainnet.core.chainstack.com/09365a049b04d0d7f3e3d40f97c18f2d"
]
},
"Description": "Xdai chain RPC endpoint"
"Description": "Arbitrum chain RPC endpoint"
}
},
"chainNetworkContractSSM": {
Expand All @@ -56,12 +71,12 @@
"Type": "String",
"Value": {
"Fn::If": [
"IsQaEnv",
"0x6a05DD32860C1b5351B97b4eCAAbFbc60edb102f",
"0x78163f593D1Fa151B4B7cacD146586aD2b686294"
"IsQaOrClonedEnv",
"0x7777494e3d8cce0D3570E21FEf820F9Fee077777",
"0xcccccdcc0ccf6c708d860e19353c5f9a49accccc"
]
},
"Description": "Xdai chain network contract"
"Description": "Arbitrum chain network contract"
}
},
"reputationEndpointSSM": {
Expand All @@ -73,9 +88,9 @@
"Type": "String",
"Value": {
"Fn::If": [
"IsQaEnv",
"https://qa-gnosis.colony.io/reputation/xdai",
"https://gnosis.colony.io/reputation/xdai"
"IsQaOrClonedEnv",
"https://arbitrum-sepolia.colony.io/reputation/arbitrum-sepolia",
"https://app.colony.io/reputation/arbitrum-one"
]
},
"Description": "Reputation endpoint"
Expand All @@ -90,14 +105,14 @@
"Type": "String",
"Value": {
"Fn::If": [
"IsQaEnv",
"https://4wbzavolujffngfax5dalwsywi.appsync-api.eu-west-2.amazonaws.com/graphql",
"https://ti5jbmzg65agjjm3fb2ukcj7jy.appsync-api.eu-west-2.amazonaws.com/graphql"
"IsQaOrClonedEnv",
"https://wmc3qb57g5cnhhpok2bvdhmism.appsync-api.eu-west-2.amazonaws.com/graphql",
"https://o4mnvckgrjhanhdnspfchnl6py.appsync-api.eu-west-2.amazonaws.com/graphql"
]
},
"Description": "App Sync Graphql Url endpoint"
}
}
},
"Description": "{\"createdOn\":\"Linux\",\"createdBy\":\"Amplify\",\"createdWith\":\"11.1.1\",\"stackType\":\"custom-customCloudformation\",\"metadata\":{}}"
"Description": "{\"createdOn\":\"Linux\",\"createdBy\":\"AmplifyAdmin\",\"createdWith\":\"12.10.1-rc.73b08dc424db2fb.0\",\"stackType\":\"custom-customCloudformation\",\"metadata\":{}}"
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Lambda layer resource stack creation using Amplify CLI",
"Description": "{\"createdOn\":\"Linux\",\"createdBy\":\"AmplifyAdmin\",\"createdWith\":\"12.10.1-rc.73b08dc424db2fb.0\",\"stackType\":\"function-LambdaLayer\",\"metadata\":{}}",
"Parameters": {
"env": {
"Type": "String"
Expand All @@ -20,7 +20,7 @@
}
},
"Resources": {
"LambdaLayerVersion36b13528": {
"LambdaLayerVersion6a852b9a": {
"Type": "AWS::Lambda::LayerVersion",
"Properties": {
"CompatibleRuntimes": {
Expand Down Expand Up @@ -51,22 +51,22 @@
"DeletionPolicy": "Delete",
"UpdateReplacePolicy": "Retain"
},
"LambdaLayerPermissionAwsAccounts20403174601636b13528": {
"LambdaLayerPermissionAwsAccounts2040317460166a852b9a": {
"Type": "AWS::Lambda::LayerVersionPermission",
"Properties": {
"Action": "lambda:GetLayerVersion",
"LayerVersionArn": {
"Ref": "LambdaLayerVersion36b13528"
"Ref": "LambdaLayerVersion6a852b9a"
},
"Principal": "204031746016"
}
},
"LambdaLayerPermissionPrivate36b13528": {
"LambdaLayerPermissionPrivate6a852b9a": {
"Type": "AWS::Lambda::LayerVersionPermission",
"Properties": {
"Action": "lambda:GetLayerVersion",
"LayerVersionArn": {
"Ref": "LambdaLayerVersion36b13528"
"Ref": "LambdaLayerVersion6a852b9a"
},
"Principal": {
"Ref": "AWS::AccountId"
Expand All @@ -77,7 +77,7 @@
"Outputs": {
"Arn": {
"Value": {
"Ref": "LambdaLayerVersion36b13528"
"Ref": "LambdaLayerVersion6a852b9a"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"runtimes": [
"nodejs20.x"
],
"description": "Updated layer version 2024-02-09T13:40:27.894Z"
"description": "Updated layer version 2024-03-26T13:46:36.901Z"
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ let graphqlURL = 'http://localhost:20002/graphql';

const setEnvVariables = async () => {
const ENV = process.env.ENV;
if (ENV === 'qa' || ENV === 'prod') {
if (ENV === 'qaarbsep' || ENV === 'prodarbone') {
const { getParams } = require('/opt/nodejs/getParams');
[apiKey, graphqlURL] = await getParams([
'appsyncApiKey',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ let graphqlURL = 'http://localhost:20002/graphql';

const setEnvVariables = async () => {
const ENV = process.env.ENV;
if (ENV === 'qa' || ENV === 'prod') {
if (ENV === 'qaarbsep' || ENV === 'prodarbone') {
const { getParams } = require('/opt/nodejs/getParams');
[apiKey, graphqlURL] = await getParams(['appsyncApiKey', 'graphqlUrl']);
}
Expand Down
2 changes: 1 addition & 1 deletion amplify/backend/function/createUniqueUser/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ let graphqlURL = 'http://localhost:20002/graphql';
const setEnvVariables = async () => {
const ENV = process.env.ENV;

if (ENV === 'qa' || ENV === 'prod') {
if (ENV === 'qaarbsep' || ENV === 'prodarbone') {
const { getParams } = require('/opt/nodejs/getParams');
[apiKey, graphqlURL] = await getParams(['appsyncApiKey', 'graphqlUrl']);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ let networkAddress;

const setEnvVariables = async () => {
const ENV = process.env.ENV;
if (ENV === 'qa' || ENV === 'prod') {
if (ENV === 'qaarbsep' || ENV === 'prodarbone') {
const { getParams } = require('/opt/nodejs/getParams');
[networkAddress, apiKey, graphqlURL, rpcURL, network] = await getParams([
'networkContractAddress',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ let rpcURL = 'http://network-contracts:8545'; // this needs to be extended to al

const setEnvVariables = async () => {
const ENV = process.env.ENV;
if (ENV === 'qa' || ENV === 'prod') {
if (ENV === 'qaarbsep' || ENV === 'prodarbone') {
const { getParams } = require('/opt/nodejs/getParams');
[rpcURL] = await getParams(['chainRpcEndpoint']);
}
Expand Down
2 changes: 1 addition & 1 deletion amplify/backend/function/fetchMotionState/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ let network = Network.Custom;

const setEnvVariables = async () => {
const ENV = process.env.ENV;
if (ENV === 'qa' || ENV === 'prod') {
if (ENV === 'qaarbsep' || ENV === 'prodarbone') {
const { getParams } = require('/opt/nodejs/getParams');
[
apiKey,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let reputationOracleEndpoint =

const setEnvVariables = async () => {
const ENV = process.env.ENV;
if (ENV === 'qa' || ENV === 'prod') {
if (ENV === 'qaarbsep' || ENV === 'prodarbone') {
const { getParams } = require('/opt/nodejs/getParams');
[rpcURL, networkAddress, reputationOracleEndpoint, network] =
await getParams([
Expand Down
8 changes: 7 additions & 1 deletion amplify/backend/function/fetchTokenFromChain/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const setEnvVariables = async (network) => {
rpcURL = getDevRpcUrl(network);
}

if (ENV === 'qa' || ENV === 'prod') {
if (ENV === 'qaarbsep' || ENV === 'prodarbone') {
let chainRpcParam = getRpcUrlParamName(network);

const { getParams } = require('/opt/nodejs/getParams');
Expand Down Expand Up @@ -63,6 +63,11 @@ exports.handler = async (event) => {
throw new Error('Unable to set env variables. Reason:', e);
}

console.log('ENV', process.env.ENV);
console.log('RPC URL', rpcURL);
console.log('GRAPHQL URL', graphqlURL);
console.log('API KEY', apiKey);

/*
* We do not store native chain tokens in the database and the ethers logic
* fails with a native token so return null early
Expand Down Expand Up @@ -99,6 +104,7 @@ exports.handler = async (event) => {
*/
const checksummedAddress = utils.getAddress(tokenAddress);
const provider = new providers.StaticJsonRpcProvider(rpcURL);
console.log('PROVIDER', provider);
const tokenFromChain = new Contract(
checksummedAddress,
basicTokenAbi,
Expand Down
2 changes: 1 addition & 1 deletion amplify/backend/function/fetchVoterRewards/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ let reputationOracleEndpoint =

const setEnvVariables = async () => {
const ENV = process.env.ENV;
if (ENV === 'qa' || ENV === 'prod') {
if (ENV === 'qaarbsep' || ENV === 'prodarbone') {
const { getParams } = require('/opt/nodejs/getParams');
[
apiKey,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let rpcURL = 'http://network-contracts:8545'; // this needs to be extended to al

const setEnvVariables = async () => {
const ENV = process.env.ENV;
if (ENV === 'qa' || ENV === 'prod') {
if (ENV === 'qaarbsep' || ENV === 'prodarbone') {
const { getParams } = require('/opt/nodejs/getParams');
[rpcURL] = await getParams(['chainRpcEndpoint']);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const getApiKey = async (chainId) => {
let etherscanApiKey = '';
const ENV = process.env.ENV;

if (ENV === 'qa' || ENV === 'prod') {
if (ENV === 'qaarbsep' || ENV === 'prodarbone') {
const { getParams } = require('/opt/nodejs/getParams');
[bscscanApiKey, etherscanApiKey] = await getParams([
'bscscanApiKey',
Expand Down Expand Up @@ -139,7 +139,7 @@ const getHomeProvider = async () => {
const ENV = process.env.ENV;
let rpcURL = LOCAL_HOME_CHAIN;

if (ENV === 'qa' || ENV === 'prod') {
if (ENV === 'qaarbsep' || ENV === 'prodarbone') {
const { getParams } = require('/opt/nodejs/getParams');
[rpcURL] = await getParams(['chainRpcEndpoint']);
}
Expand Down
2 changes: 1 addition & 1 deletion amplify/backend/function/getUserReputation/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let network = Network.Custom;

const setEnvVariables = async () => {
const ENV = process.env.ENV;
if (ENV === 'qa' || ENV === 'prod') {
if (ENV === 'qaarbsep' || ENV === 'prodarbone') {
const { getParams } = require('/opt/nodejs/getParams');
[rpcURL, networkAddress, reputationOracleEndpoint, network] =
await getParams([
Expand Down
Loading
Loading