Skip to content

Commit

Permalink
Merge branch 'master' of github.com:celo-org/celo-monorepo into deplo…
Browse files Browse the repository at this point in the history
…y_ethstats
  • Loading branch information
jcortejoso committed Nov 14, 2019
2 parents 20af717 + 413739b commit 12b5098
Show file tree
Hide file tree
Showing 602 changed files with 20,206 additions and 12,832 deletions.
57 changes: 30 additions & 27 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ jobs:
- run: nvm install v10.16.3 && nvm use v10.16.3
- run:
name: install miscellaneous
command: HOMEBREW_NO_AUTO_UPDATE=1 brew install tree
command: |
HOMEBREW_NO_AUTO_UPDATE=1 brew install tree coreutils
# Currently not used
# - run: npm install --global react-native-kill-packager
- run:
Expand All @@ -202,8 +203,8 @@ jobs:
# echo "Cache found, just run post-script."
# yarn postinstall
# fi
yarn
yarn build
yarn || yarn
yarn build || yarn build
yarn run jetify
- save_cache:
key: yarn-v4-macos-{{ .Branch }}-{{ checksum "yarn.lock" }}
Expand All @@ -216,6 +217,9 @@ jobs:
command: HOMEBREW_NO_AUTO_UPDATE=1 brew install pidcat watchman
- restore_cache:
key: yarn-v3-{{ arch }}-{{ .Branch }}-{{ checksum "packages/mobile/android/build.gradle" }}-{{ checksum "packages/mobile/android/settings.gradle" }}-{{ checksum "packages/mobile/android/app/build.gradle" }}-{{ checksum "packages/mobile/.env.test" }}
- run:
name: Make sure there's only one adb # This is probably a brew bug
command: cp /usr/local/share/android-sdk/platform-tools/adb /usr/local/bin/adb
- run:
name: Start emulator
command: cd ~/src/packages/mobile && bash ./scripts/start_emulator.sh
Expand All @@ -233,12 +237,26 @@ jobs:
name: Sleep until Device connects
command: cd ~/src/packages/mobile && bash ./scripts/wait_for_emulator_to_connect.sh
# TODO - run: unlock device
- run:
name: Start pidcat logging
command: pidcat -t "GoLog" -t "Go" # React logs are on metro step since RN 61
background: true
- run:
name: Run yarn dev
command: cd ~/src/packages/mobile && ENVFILE=".env.test" yarn dev
- run:
name: Restart adb
command: adb kill-server && adb start-server
- run:
name: Run test itself
command: cd ~/src/packages/mobile && ENVFILE=".env.test" yarn test:detox

command: |
cd ~/src/packages/mobile
# detox sometimes without releasing the terminal and thus making the CI timout
# 480s = 8 minutes
timeout 480 yarn test:detox || echo "failed, try again"
timeout 480 yarn test:detox || echo "detox failed, return 0 to prevent CI from failing"
# TODO errors are currently not reported, until we figure out why detox can't find functions https://github.com/wix/Detox/issues/1723
- run: cd ~/src
- save_cache:
key: yarn-v3-{{ arch }}-{{ .Branch }}-{{ checksum "packages/mobile/android/build.gradle" }}-{{ checksum "packages/mobile/android/settings.gradle" }}-{{ checksum "packages/mobile/android/app/build.gradle" }}-{{ checksum "packages/mobile/.env.test" }}
Expand Down Expand Up @@ -430,10 +448,12 @@ jobs:
- attach_workspace:
at: ~/app
- run:
name: Test
name: Generate DevChain
command: |
set -euo pipefail
yarn --cwd=packages/cli test
(cd packages/cli && yarn test:reset)
- run:
name: Run Tests
command: yarn --cwd=packages/cli test
- run:
name: Fail if someone forgot to commit CLI docs
command: |
Expand Down Expand Up @@ -506,7 +526,7 @@ jobs:
cd packages/celotool
./ci_test_transfers.sh checkout master
end-to-end-geth-exit-test:
end-to-end-geth-blockchain-parameters-test:
<<: *e2e-defaults
steps:
- attach_workspace:
Expand All @@ -522,7 +542,7 @@ jobs:
command: |
set -e
cd packages/celotool
./ci_test_exit.sh checkout master
./ci_test_blockchain_parameters.sh checkout master
end-to-end-geth-governance-test:
<<: *e2e-defaults
Expand Down Expand Up @@ -563,23 +583,6 @@ jobs:
cd packages/celotool
./ci_test_sync.sh checkout master
end-to-end-geth-integration-sync-test:
<<: *e2e-defaults
steps:
- attach_workspace:
at: ~/app
- run:
name: Check if the test should run
command: |
FILES_TO_CHECK="${PWD}/packages/celotool,${PWD}/packages/protocol,${PWD}/.circleci/config.yml"
./scripts/ci_check_if_test_should_run_v2.sh ${FILES_TO_CHECK}
- run:
name: Run test
command: |
set -e
cd packages/celotool
./ci_test_sync_with_network.sh checkout master
end-to-end-geth-attestations-test:
<<: *e2e-defaults
resource_class: medium+
Expand Down Expand Up @@ -728,7 +731,7 @@ workflows:
requires:
- lint-checks
- contractkit-test
- end-to-end-geth-exit-test:
- end-to-end-geth-blockchain-parameters-test:
requires:
- lint-checks
- contractkit-test
Expand Down
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ TRANSACTION_METRICS_EXPORTER_DOCKER_IMAGE_REPOSITORY="gcr.io/celo-testnet/celo-m
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-5035b241cbcfbd4f261e3d77e1fca8f6dc8edc32"
ATTESTATION_SERVICE_DOCKER_IMAGE_TAG="attestation-service-74f329b014c40c7af19cf89b4c0d080c344d4a1c"

GETH_EXPORTER_DOCKER_IMAGE_REPOSITORY="gcr.io/celo-testnet-production/geth-exporter"
GETH_EXPORTER_DOCKER_IMAGE_TAG="ed7d21bd50592709173368cd697ef73c1774a261"
Expand Down
6 changes: 3 additions & 3 deletions .env.alfajores
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ BLOCKSCOUT_SUBNETWORK_NAME="Alfajores"
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="027dba2e4584936cc5a8e8993e4e27d28d5247b8"
GETH_NODE_DOCKER_IMAGE_TAG="9575a01c12438e1adc6bb610c891cb5066aaa7aa"

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="027dba2e4584936cc5a8e8993e4e27d28d5247b8"
GETH_BOOTNODE_DOCKER_IMAGE_TAG="9575a01c12438e1adc6bb610c891cb5066aaa7aa"

CELOTOOL_DOCKER_IMAGE_REPOSITORY="gcr.io/celo-testnet/celo-monorepo"
CELOTOOL_DOCKER_IMAGE_TAG="celotool-552b1accf90404fdcd886670d150af0a5cae116f"
Expand All @@ -40,7 +40,7 @@ GETH_EXPORTER_DOCKER_IMAGE_REPOSITORY="gcr.io/celo-testnet-production/geth-expor
GETH_EXPORTER_DOCKER_IMAGE_TAG="6df683de7ae30d3fbca384abb14599d0e8130d35"

# Genesis Vars
NETWORK_ID=44784
NETWORK_ID=44785
CONSENSUS_TYPE="istanbul"
BLOCK_TIME=5
EPOCH=720 // 1 hour
Expand Down
8 changes: 4 additions & 4 deletions .env.alfajoresstaging
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ BLOCKSCOUT_SUBNETWORK_NAME="Alfajores Staging"
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="ae27fd3aa8b0de7bbf7926aecd34690feef7d069"
GETH_NODE_DOCKER_IMAGE_TAG="9575a01c12438e1adc6bb610c891cb5066aaa7aa"

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="ae27fd3aa8b0de7bbf7926aecd34690feef7d069"
GETH_BOOTNODE_DOCKER_IMAGE_TAG="9575a01c12438e1adc6bb610c891cb5066aaa7aa"

CELOTOOL_DOCKER_IMAGE_REPOSITORY="gcr.io/celo-testnet/celo-monorepo"
CELOTOOL_DOCKER_IMAGE_TAG="celotool-552b1accf90404fdcd886670d150af0a5cae116f"
Expand All @@ -47,8 +47,8 @@ GETH_EXPORTER_DOCKER_IMAGE_TAG="6df683de7ae30d3fbca384abb14599d0e8130d35"
NETWORK_ID=1101
CONSENSUS_TYPE="istanbul"
BLOCK_TIME=5
# Minimum epoch length is 1 day
EPOCH=17280
# Minimum epoch length is 10 minutes
EPOCH=120
ISTANBUL_REQUEST_TIMEOUT_MS=10000

# "og" -> our original 4 tx nodes, "${n}" -> for deriving n tx nodes from the MNEMONIC
Expand Down
Binary file modified .env.mnemonic.enc
Binary file not shown.
21 changes: 11 additions & 10 deletions .env.pilot
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,30 @@ BLOCKSCOUT_DOCKER_IMAGE_REPOSITORY="gcr.io/celo-testnet/blockscout"
BLOCKSCOUT_WEB_DOCKER_IMAGE_TAG="web-f6c3e0888d1d0ef72dc8bf870808702b7fd13730"
BLOCKSCOUT_INDEXER_DOCKER_IMAGE_TAG="indexer-f6c3e0888d1d0ef72dc8bf870808702b7fd13730"
BLOCKSCOUT_WEB_REPLICAS=3
BLOCKSCOUT_DB_SUFFIX="2"
BLOCKSCOUT_DB_SUFFIX="4"
BLOCKSCOUT_SUBNETWORK_NAME="Pilot"

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="f68c6301cad91196867f06c701e6b4aa30838939"
GETH_NODE_DOCKER_IMAGE_TAG="9575a01c12438e1adc6bb610c891cb5066aaa7aa"

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="f68c6301cad91196867f06c701e6b4aa30838939"
GETH_BOOTNODE_DOCKER_IMAGE_TAG="9575a01c12438e1adc6bb610c891cb5066aaa7aa"

CELOTOOL_DOCKER_IMAGE_REPOSITORY="gcr.io/celo-testnet/celo-monorepo"
CELOTOOL_DOCKER_IMAGE_TAG="celotool-2a96d35273ba2f8db80ba529a05c614171c24491"
CELOTOOL_DOCKER_IMAGE_TAG="celotool-552b1accf90404fdcd886670d150af0a5cae116f"

TRANSACTION_METRICS_EXPORTER_DOCKER_IMAGE_REPOSITORY="gcr.io/celo-testnet/celo-monorepo"
TRANSACTION_METRICS_EXPORTER_DOCKER_IMAGE_TAG="transaction-metrics-exporter-2616309a839a30e53faecfafb9b68ab51a5fcdcf"
TRANSACTION_METRICS_EXPORTER_DOCKER_IMAGE_TAG="transaction-metrics-exporter-552b1accf90404fdcd886670d150af0a5cae116f"

ATTESTATION_SERVICE_DOCKER_IMAGE_REPOSITORY="gcr.io/celo-testnet/celo-monorepo"
ATTESTATION_SERVICE_DOCKER_IMAGE_TAG="attestation-service-5035b241cbcfbd4f261e3d77e1fca8f6dc8edc32"

GETH_EXPORTER_DOCKER_IMAGE_REPOSITORY="gcr.io/celo-testnet-production/geth-exporter"
GETH_EXPORTER_DOCKER_IMAGE_TAG="ed7d21bd50592709173368cd697ef73c1774a261"
GETH_EXPORTER_DOCKER_IMAGE_TAG="6df683de7ae30d3fbca384abb14599d0e8130d35"

# Genesis Vars
NETWORK_ID=1101
Expand All @@ -50,8 +53,8 @@ TX_NODES=2
STATIC_IPS_FOR_GETH_NODES=false
# Whether tx_nodes/validators stateful set should use ssd persistent disks
GETH_NODES_SSD_DISKS=true

ADMIN_RPC_ENABLED=false
IN_MEMORY_DISCOVERY_TABLE=false
PING_IP_FROM_PACKET=true

# Testnet vars
GETH_NODES_BACKUP_CRONJOB_ENABLED=true
Expand All @@ -77,6 +80,4 @@ NOTIFICATION_SERVICE_FIREBASE_DB="https://console.firebase.google.com/u/0/projec
PROMTOSD_SCRAPE_INTERVAL="5m"
PROMTOSD_EXPORT_INTERVAL="5m"

AUCTION_CRON_SPEC="*/5 * * * *"

SMS_RETRIEVER_HASH_CODE=1SlgTw9pFW5
24 changes: 14 additions & 10 deletions .env.pilotstaging
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,36 @@ BLOCKSCOUT_DOCKER_IMAGE_REPOSITORY="gcr.io/celo-testnet/blockscout"
BLOCKSCOUT_WEB_DOCKER_IMAGE_TAG="web-f6c3e0888d1d0ef72dc8bf870808702b7fd13730"
BLOCKSCOUT_INDEXER_DOCKER_IMAGE_TAG="indexer-f6c3e0888d1d0ef72dc8bf870808702b7fd13730"
BLOCKSCOUT_WEB_REPLICAS=3
BLOCKSCOUT_DB_SUFFIX="5"
BLOCKSCOUT_DB_SUFFIX="7"
BLOCKSCOUT_SUBNETWORK_NAME="Pilot Staging"

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="f68c6301cad91196867f06c701e6b4aa30838939"
GETH_NODE_DOCKER_IMAGE_TAG="9575a01c12438e1adc6bb610c891cb5066aaa7aa"

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="f68c6301cad91196867f06c701e6b4aa30838939"
GETH_BOOTNODE_DOCKER_IMAGE_TAG="9575a01c12438e1adc6bb610c891cb5066aaa7aa"

CELOTOOL_DOCKER_IMAGE_REPOSITORY="gcr.io/celo-testnet/celo-monorepo"
CELOTOOL_DOCKER_IMAGE_TAG="celotool-2a96d35273ba2f8db80ba529a05c614171c24491"
CELOTOOL_DOCKER_IMAGE_TAG="celotool-552b1accf90404fdcd886670d150af0a5cae116f"

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

ATTESTATION_SERVICE_DOCKER_IMAGE_REPOSITORY="gcr.io/celo-testnet/celo-monorepo"
ATTESTATION_SERVICE_DOCKER_IMAGE_TAG="attestation-service-5035b241cbcfbd4f261e3d77e1fca8f6dc8edc32"

GETH_EXPORTER_DOCKER_IMAGE_REPOSITORY="gcr.io/celo-testnet-production/geth-exporter"
GETH_EXPORTER_DOCKER_IMAGE_TAG="ed7d21bd50592709173368cd697ef73c1774a261"
GETH_EXPORTER_DOCKER_IMAGE_TAG="6df683de7ae30d3fbca384abb14599d0e8130d35"

# Genesis Vars
NETWORK_ID=1101
CONSENSUS_TYPE="istanbul"
BLOCK_TIME=5
EPOCH=17280 // Minimum epoch length is 1 day
EPOCH=720 // 1 hour
ISTANBUL_REQUEST_TIMEOUT_MS=10000

# "og" -> our original 4 tx nodes, "${n}" -> for deriving n tx nodes from the MNEMONIC
Expand All @@ -47,8 +53,8 @@ TX_NODES=2
STATIC_IPS_FOR_GETH_NODES=false
# Whether tx_nodes/validators stateful set should use ssd persistent disks
GETH_NODES_SSD_DISKS=true

ADMIN_RPC_ENABLED=false
IN_MEMORY_DISCOVERY_TABLE=false
PING_IP_FROM_PACKET=true

# Testnet vars
GETH_NODES_BACKUP_CRONJOB_ENABLED=true
Expand All @@ -74,6 +80,4 @@ NOTIFICATION_SERVICE_FIREBASE_DB="https://console.firebase.google.com/u/0/projec
PROMTOSD_SCRAPE_INTERVAL="5m"
PROMTOSD_EXPORT_INTERVAL="5m"

AUCTION_CRON_SPEC="*/5 * * * *"

SMS_RETRIEVER_HASH_CODE=1SlgTw9pFW5
8 changes: 8 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,12 @@ module.exports = {
printWidth: 100,
tabWidth: 2,
bracketSpacing: true,
overrides: [
{
files: '**/*.sol',
options: {
singleQuote: false,
},
},
],
}
33 changes: 30 additions & 3 deletions SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@
- [Celo Engineering Setup](#celo-engineering-setup)
- [Getting Everything Installed](#getting-everything-installed)
- [MacOS](#macos)
- [XCode](#xcode)
- [Xcode](#xcode)
- [Homebrew](#homebrew)
- [Install Node, Yarn and friends](#install-node-yarn-and-friends)
- [Java](#java)
- [Install Android Dev Tools](#install-android-dev-tools)
- [Install iOS Dev Tools](#install-ios-dev-tools)
- [Linux](#linux)
- [Install Node, Yarn and friends](#install-node-yarn-and-friends-1)
- [Installing OpenJDK 8](#installing-openjdk-8)
- [Install Android Dev Tools](#install-android-dev-tools-1)
- [Some common stuff](#some-common-stuff)
- [Install Go](#install-go)
- [Optional: Install Rust](#optional-install-rust)
- [Optional: Install an Android Emulator](#optional-install-an-android-emulator)
- [Optional: Genymotion](#optional-genymotion)
Expand All @@ -31,9 +33,9 @@ build the celo-monorepo codebase.

### MacOS

#### XCode
#### Xcode

Install XCode and its command line tools:
Install Xcode and its command line tools:

```bash
xcode-select --install
Expand Down Expand Up @@ -110,6 +112,14 @@ Then install the Android 28 platform:
sdkmanager 'platforms;android-28'
```

#### Install iOS Dev Tools

Install [Xcode 10.3](https://download.developer.apple.com/Developer_Tools/Xcode_10.3/Xcode_10.3.xip) (an Apple Developer Account is needed to access this link).

We do not recommend installing Xcode through the App Store as it can auto update and become incompatible with our projects (until we decide to upgrade).

Note that using the method above, you can have multiple versions of Xcode installed in parallel by using different app names. For instance `Xcode10.3.app` and `Xcode11.app` inside the `/Applications` folder.

### Linux

#### Install Node, Yarn and friends
Expand Down Expand Up @@ -167,6 +177,23 @@ You can find the complete instructions about how to install the tools in Linux e

### Some common stuff

#### Install Go

We need Go for [celo-blockchain](https://github.com/celo-org/celo-blockchain), the Go Celo implementation, and `gobind` to build Java language bindings to Go code for the Android Geth client).

Note: We currently use Go 1.11. Brew installs Go 1.12 by default, which is not entirely compatible with our repositories. [Install Go 1.11 manually](https://golang.org/dl/), then run

```
go get golang.org/x/mobile/cmd/gobind
```

Execute the following (and make sure the lines are in your `~/.bash_profile`):

```
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
```

#### Optional: Install Rust

We use Rust to build the [bls-zexe](https://github.com/celo-org/bls-zexe) repo, which Geth depends on. If you only use the monorepo, you probably don't need this.
Expand Down
Loading

0 comments on commit 12b5098

Please sign in to comment.