Skip to content

Commit

Permalink
Merge branch 'master' of github.com:celo-org/celo-monorepo into yorho…
Browse files Browse the repository at this point in the history
…des/contract-upgrades
  • Loading branch information
yorhodes committed Nov 22, 2019
2 parents 138308a + 6b0f1de commit f0d5274
Show file tree
Hide file tree
Showing 277 changed files with 5,819 additions and 7,404 deletions.
14 changes: 9 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ e2e-defaults: &e2e-defaults
<<: *defaults
docker:
- image: celohq/circleci
environment:
CELO_BLOCKCHAIN_BRANCH_TO_TEST: master

general:
artifacts:
Expand All @@ -44,6 +46,8 @@ general:
jobs:
install_dependencies:
<<: *defaults
# Source: https://circleci.com/docs/2.0/configuration-reference/#resource_class
resource_class: medium+
steps:
- restore_cache:
keys:
Expand Down Expand Up @@ -525,7 +529,7 @@ jobs:
command: |
set -e
cd packages/celotool
./ci_test_transfers.sh checkout master
./ci_test_transfers.sh checkout ${CELO_BLOCKCHAIN_BRANCH_TO_TEST}
end-to-end-geth-blockchain-parameters-test:
<<: *e2e-defaults
Expand All @@ -543,7 +547,7 @@ jobs:
command: |
set -e
cd packages/celotool
./ci_test_blockchain_parameters.sh checkout master
./ci_test_blockchain_parameters.sh checkout ${CELO_BLOCKCHAIN_BRANCH_TO_TEST}
end-to-end-geth-governance-test:
<<: *e2e-defaults
Expand All @@ -563,7 +567,7 @@ jobs:
command: |
set -e
cd packages/celotool
./ci_test_governance.sh checkout master
./ci_test_governance.sh checkout ${CELO_BLOCKCHAIN_BRANCH_TO_TEST}
end-to-end-geth-sync-test:
<<: *e2e-defaults
Expand All @@ -582,7 +586,7 @@ jobs:
command: |
set -e
cd packages/celotool
./ci_test_sync.sh checkout master
./ci_test_sync.sh checkout ${CELO_BLOCKCHAIN_BRANCH_TO_TEST}
end-to-end-geth-validator-order-test:
<<: *e2e-defaults
Expand All @@ -600,7 +604,7 @@ jobs:
command: |
set -e
cd packages/celotool
./ci_test_validator_order.sh checkout master
./ci_test_validator_order.sh checkout ${CELO_BLOCKCHAIN_BRANCH_TO_TEST}
web:
working_directory: ~/app
Expand Down
11 changes: 6 additions & 5 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@ ETHSTATS_DOCKER_IMAGE_TAG="0ffe524c625ea59e4492dc92c2e638689c36e4b0"
GETH_NODE_DOCKER_IMAGE_REPOSITORY="us.gcr.io/celo-testnet/geth"
# When upgrading change this to latest commit hash from the master of the geth repo
# `geth $ git show | head -n 1`
GETH_NODE_DOCKER_IMAGE_TAG="7ccc0a81920e6e09663855fc0ed46a98d634e74a"
GETH_NODE_DOCKER_IMAGE_TAG="master"

GETH_BOOTNODE_DOCKER_IMAGE_REPOSITORY="gcr.io/celo-testnet/geth-all"
# When upgrading change this to latest commit hash from the master of the geth repo
# `geth $ git show | head -n 1`
GETH_BOOTNODE_DOCKER_IMAGE_TAG="7ccc0a81920e6e09663855fc0ed46a98d634e74a"
GETH_BOOTNODE_DOCKER_IMAGE_TAG="master"

CELOTOOL_DOCKER_IMAGE_REPOSITORY="gcr.io/celo-testnet/celo-monorepo"
CELOTOOL_DOCKER_IMAGE_TAG="celotool-dfdc3e8b26e98aa294b27e2b5621c184488a10db"
CELOTOOL_DOCKER_IMAGE_TAG="celotool-c8e3392aa2ca44ff83b4035700ece5fd12ed2b84"

TRANSACTION_METRICS_EXPORTER_DOCKER_IMAGE_REPOSITORY="gcr.io/celo-testnet/celo-monorepo"
TRANSACTION_METRICS_EXPORTER_DOCKER_IMAGE_TAG="transaction-metrics-exporter-d3d165a7db548d175cd703c86c20c1657c04368d"

ATTESTATION_SERVICE_DOCKER_IMAGE_REPOSITORY="gcr.io/celo-testnet/celo-monorepo"
ATTESTATION_SERVICE_DOCKER_IMAGE_TAG="attestation-service-74f329b014c40c7af19cf89b4c0d080c344d4a1c"
ATTESTATION_SERVICE_DOCKER_IMAGE_REPOSITORY="us.gcr.io/celo-testnet/celo-monorepo"
ATTESTATION_SERVICE_DOCKER_IMAGE_TAG="attestation-service-c8e3392aa2ca44ff83b4035700ece5fd12ed2b84"

GETH_EXPORTER_DOCKER_IMAGE_REPOSITORY="gcr.io/celo-testnet-production/geth-exporter"
GETH_EXPORTER_DOCKER_IMAGE_TAG="ed7d21bd50592709173368cd697ef73c1774a261"
Expand All @@ -46,6 +46,7 @@ NETWORK_ID=1101
CONSENSUS_TYPE="istanbul"
BLOCK_TIME=1
EPOCH=1000
LOOKBACK=12
ISTANBUL_REQUEST_TIMEOUT_MS=3000

# "og" -> our original 4 validators, "${n}" -> for deriving n validators from the MNEMONIC
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,7 @@ lerna-debug.log
!.env.mnemonic*.enc

.terraform/
tsconfig.tsbuildinfo
tsconfig.tsbuildinfo

# git mergetool
*.orig
5 changes: 5 additions & 0 deletions SETUP.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Celo Engineering Setup

- [Celo Engineering Setup](#celo-engineering-setup)
- [Reading](#reading)
- [Getting Everything Installed](#getting-everything-installed)
- [MacOS](#macos)
- [Xcode](#xcode)
Expand All @@ -26,6 +27,10 @@

This is a living document! Please edit and update it as part of your onboarding process :-)

## Reading

Review the README from each directory in [packages](packages/).

## Getting Everything Installed

Follow these steps to get everything that you need installed to develop and
Expand Down
2 changes: 2 additions & 0 deletions dockerfiles/attestation-service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ COPY scripts/ scripts/
# Copy only pkg.json
COPY packages/typescript/package.json packages/typescript/
COPY packages/utils/package.json packages/utils/
COPY packages/dev-utils/package.json packages/dev-utils/
COPY packages/protocol/package.json packages/protocol/
COPY packages/contractkit/package.json packages/contractkit/
COPY packages/attestation-service/package.json packages/attestation-service/
Expand All @@ -17,6 +18,7 @@ RUN yarn install --frozen-lockfile --network-timeout 100000 && yarn cache clean
# Copy the rest
COPY packages/typescript packages/typescript/
COPY packages/utils packages/utils/
COPY packages/dev-utils packages/dev-utils/
COPY packages/protocol packages/protocol/
COPY packages/contractkit packages/contractkit/
COPY packages/attestation-service packages/attestation-service/
Expand Down
2 changes: 2 additions & 0 deletions dockerfiles/celotool/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ RUN apt-get update && \
COPY lerna.json package.json yarn.lock ./
COPY scripts/ scripts/
COPY packages/utils/package.json packages/utils/
COPY packages/dev-utils/package.json packages/dev-utils/
COPY packages/typescript/package.json packages/typescript/
COPY packages/walletkit/package.json packages/walletkit/
COPY packages/contractkit/package.json packages/contractkit/
Expand All @@ -26,6 +27,7 @@ COPY packages/celotool/package.json packages/celotool/
RUN yarn install --network-timeout 100000 --frozen-lockfile && yarn cache clean

COPY packages/utils packages/utils/
COPY packages/dev-utils packages/dev-utils/
COPY packages/typescript packages/typescript/
COPY packages/walletkit packages/walletkit/
COPY packages/contractkit packages/contractkit/
Expand Down
12 changes: 12 additions & 0 deletions packages/attestation-service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ You can use the following environment variables to configure the attestation ser
- `NEXMO_SECRET` - The API secret to the Nexmo API
- `NEXMO_BLACKLIST` - A comma-sperated list of country codes you do not want to serve

`twilio`

- `TWILIO_ACCOUNT_SID` - The SID of your Twilio account
- `TWILIO_MESSAGE_SERVICE_SID` - The SID of the messaging service you want to use. The messaging service should have at least 1 phone number associated with it.
- `TWILIO_AUTH_TOKEN` - The auth token for your Twilio account

### Operations

This service uses `bunyan` for structured logging with JSON lines. You can pipe STDOUT to `yarn run bunyan` for a more human friendly output. The `LOG_LEVEL` environment variable can specify desired log levels. With `LOG_FORMAT=stackdriver` you can get stackdriver specific format to recover information such as error traces etc.

This service exposes prometheus metrics under `/metrics`.

### Running locally

After checking out the source, you should create a local sqlite database by running:
Expand Down
10 changes: 9 additions & 1 deletion packages/attestation-service/config/.env.development
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@ CELO_PROVIDER=https://integration-forno.celo-testnet.org
ACCOUNT_ADDRESS=0xE6e53b5fc2e18F51781f14a3ce5E7FD468247a15
ATTESTATION_KEY=x
APP_SIGNATURE=x
SMS_PROVIDERS=nexmo
SMS_PROVIDERS=twilio,nexmo
NEXMO_KEY=x
NEXMO_SECRET=x
NEXMO_BLACKLIST=
TWILIO_ACCOUNT_SID=x
TWILIO_MESSAGING_SERVICE_SID=x
TWILIO_AUTH_TOKEN=x
TWILIO_BLACKLIST=
# Options: default, stackdriver
LOG_FORMAT=
# Options: fatal, error, warn, info, debug, trace
LOG_LEVEL=
1 change: 1 addition & 0 deletions packages/attestation-service/index.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
declare module 'nexmo'
declare module 'express-request-id'
8 changes: 8 additions & 0 deletions packages/attestation-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
"@celo/utils": "^0.1.0",
"bignumber.js": "^7.2.0",
"body-parser": "1.19.0",
"bunyan": "1.8.12",
"bunyan-gke-stackdriver": "0.1.2",
"debug": "^4.1.1",
"dotenv": "8.0.0",
"eth-lib": "^0.2.8",
Expand All @@ -39,18 +41,24 @@
"nexmo": "2.4.2",
"web3": "1.0.0-beta.37",
"express": "4.17.1",
"express-rate-limit": "5.0.0",
"express-request-id": "1.4.1",
"mysql2": "2.0.0-alpha1",
"pg": "7.12.1",
"pg-hstore": "2.3.3",
"prom-client": "11.2.0",
"sequelize": "5.13.1",
"sequelize-cli": "5.5.0",
"sqlite3": "4.0.9",
"twilio": "^3.23.2",
"yargs": "13.3.0"
},
"devDependencies": {
"@celo/protocol": "1.0.0",
"@types/bunyan": "1.8.4",
"@types/dotenv": "4.0.3",
"@types/debug": "^4.1.5",
"@types/express-rate-limit": "2.9.3",
"@types/web3": "^1.0.18",
"ts-node": "8.3.0",
"nodemon": "1.19.1",
Expand Down
Loading

0 comments on commit f0d5274

Please sign in to comment.