Skip to content

Commit

Permalink
Merge branch 'master' into rossy/wa-ver-input
Browse files Browse the repository at this point in the history
  • Loading branch information
jmrossy committed Nov 8, 2019
2 parents db20e9f + e2bd6a7 commit 90675a4
Show file tree
Hide file tree
Showing 16 changed files with 59 additions and 53 deletions.
15 changes: 12 additions & 3 deletions SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
- [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)
Expand All @@ -31,9 +32,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 +111,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
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"report-coverage": "yarn run lerna run test-coverage",
"test:watch": "node node_modules/jest/bin/jest.js --watch",
"postinstall": "yarn run lerna run postinstall && patch-package && yarn keys:decrypt",
"preinstall": "bash scripts/create_key_templates.sh",
"keys:decrypt": "bash scripts/key_placer.sh decrypt",
"keys:encrypt": "bash scripts/key_placer.sh encrypt",
"check:packages": "node ./scripts/check-packages.js"
Expand Down
3 changes: 1 addition & 2 deletions packages/blockchain-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
"build": "tsc -p .",
"clean": "rm -rf dist coverage",
"gcp-build": "npm run build",
"deploy": "./deploy.sh",
"postinstall": "test -f src/secrets.json || echo \"{}\" > src/secrets.json"
"deploy": "./deploy.sh"
},
"dependencies": {
"@celo/contractkit": "0.1.6",
Expand Down
20 changes: 20 additions & 0 deletions packages/blockchain-api/src/secrets.json.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"local": {
"EXCHANGE_RATES_API_ACCESS_KEY": "CHANGE_ME"
},
"integration": {
"EXCHANGE_RATES_API_ACCESS_KEY": "CHANGE_ME"
},
"alfajores": {
"EXCHANGE_RATES_API_ACCESS_KEY": "CHANGE_ME"
},
"alfajoresstaging": {
"EXCHANGE_RATES_API_ACCESS_KEY": "CHANGE_ME"
},
"pilot": {
"EXCHANGE_RATES_API_ACCESS_KEY": "CHANGE_ME"
},
"pilotstaging": {
"EXCHANGE_RATES_API_ACCESS_KEY": "CHANGE_ME"
}
}
2 changes: 1 addition & 1 deletion packages/mobile/.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ENVIRONMENT=local
DEFAULT_TESTNET=alfajores
# If ZERO_SYNC_ENABLED_INITIALLY, local geth will not run initially.
# If toggled on, it will use DEFAULT_SYNC_MODE. See src/geth/consts.ts for more info
ZERO_SYNC_ENABLED_INITIALLY=false
ZERO_SYNC_ENABLED_INITIALLY=true
DEFAULT_SYNC_MODE=5
DEV_SETTINGS_ACTIVE_INITIALLY=true
FIREBASE_ENABLED=true
Expand Down
2 changes: 1 addition & 1 deletion packages/mobile/.env.integration
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ENVIRONMENT=integration
DEFAULT_TESTNET=integration
# If ZERO_SYNC_ENABLED_INITIALLY, local geth will not run initially.
# If toggled on, it will use DEFAULT_SYNC_MODE. See src/geth/consts.ts for more info
ZERO_SYNC_ENABLED_INITIALLY=false
ZERO_SYNC_ENABLED_INITIALLY=true
DEFAULT_SYNC_MODE=5
DEV_SETTINGS_ACTIVE_INITIALLY=true
FIREBASE_ENABLED=true
Expand Down
2 changes: 1 addition & 1 deletion packages/mobile/.env.pilot
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ENVIRONMENT=pilot
DEFAULT_TESTNET=pilot
# If ZERO_SYNC_ENABLED_INITIALLY, local geth will not run initially.
# If toggled on, it will use DEFAULT_SYNC_MODE. See src/geth/consts.ts for more info
ZERO_SYNC_ENABLED_INITIALLY=false
ZERO_SYNC_ENABLED_INITIALLY=true
DEFAULT_SYNC_MODE=5
DEV_SETTINGS_ACTIVE_INITIALLY=false
FIREBASE_ENABLED=true
Expand Down
2 changes: 1 addition & 1 deletion packages/mobile/.env.pilotstaging
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ENVIRONMENT=pilotstaging
DEFAULT_TESTNET=pilotstaging
# If ZERO_SYNC_ENABLED_INITIALLY, local geth will not run initially.
# If toggled on, it will use DEFAULT_SYNC_MODE. See src/geth/consts.ts for more info
ZERO_SYNC_ENABLED_INITIALLY=false
ZERO_SYNC_ENABLED_INITIALLY=true
DEFAULT_SYNC_MODE=5
DEV_SETTINGS_ACTIVE_INITIALLY=true
FIREBASE_ENABLED=true
Expand Down
2 changes: 1 addition & 1 deletion packages/mobile/.env.production
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ENVIRONMENT=production
DEFAULT_TESTNET=argentinaproduction
# If ZERO_SYNC_ENABLED_INITIALLY, local geth will not run initially.
# If toggled on, it will use DEFAULT_SYNC_MODE. See src/geth/consts.ts for more info
ZERO_SYNC_ENABLED_INITIALLY=false
ZERO_SYNC_ENABLED_INITIALLY=true
DEFAULT_SYNC_MODE=5
DEV_SETTINGS_ACTIVE_INITIALLY=false
FIREBASE_ENABLED=true
Expand Down
2 changes: 1 addition & 1 deletion packages/mobile/.env.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ENVIRONMENT=local
DEFAULT_TESTNET=integration
# If ZERO_SYNC_ENABLED_INITIALLY, local geth will not run initially.
# If toggled on, it will use DEFAULT_SYNC_MODE. See src/geth/consts.ts for more info
ZERO_SYNC_ENABLED_INITIALLY=false
ZERO_SYNC_ENABLED_INITIALLY=true
DEFAULT_SYNC_MODE=5
DEV_SETTINGS_ACTIVE_INITIALLY=true
FIREBASE_ENABLED=false
Expand Down
File renamed without changes.
7 changes: 3 additions & 4 deletions packages/mobile/src/web3/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,14 @@ function getWebSocketProvider(url: string): Provider {

function getWeb3(): Web3 {
Logger.info(
`${tag}@getWeb3`,
`Initializing web3, platform: ${Platform.OS}, geth free mode: ${isInitiallyZeroSyncMode()}`
)

if (isInitiallyZeroSyncMode() && Platform.OS === 'ios') {
throw new Error('Zero sync mode is currently not supported on iOS')
} else if (isInitiallyZeroSyncMode()) {
if (isInitiallyZeroSyncMode()) {
// Geth free mode
const url = DEFAULT_FORNO_URL
Logger.debug('contracts@getWeb3', `Connecting to url ${url}`)
Logger.debug(`${tag}@getWeb3`, `Connecting to url ${url}`)
return new Web3(getWebSocketProvider(url))
} else {
return new Web3(getIpcProvider(DEFAULT_TESTNET))
Expand Down
File renamed without changes.
File renamed without changes.
32 changes: 0 additions & 32 deletions scripts/create_key_templates.sh

This file was deleted.

22 changes: 17 additions & 5 deletions scripts/key_placer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,29 @@ elif [[ $1 != "encrypt" ]] && [[ $1 != "decrypt" ]]; then
exit 1
fi

# this is to allow the script to be called from anywhere
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd $DIR
cd ..

# place templates to be used (if they exist) in case the environment
# doesn't have access to decryption keys
if [[ $1 == "decrypt" ]]; then
for file_path in "${files[@]}"; do
template_file_path="$file_path.template"

if test -f "$template_file_path" && ! test -f "$file_path"; then
cp "$template_file_path" "$file_path"
fi
done
fi

command -v gcloud > /dev/null 2>&1
if [[ $? -eq 1 ]]; then
echo "gcloud is not installed - skipping ${1}ion"
exit 0
fi

# this is to allow the script to be called from anywhere
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd $DIR
cd ..

for file_path in "${files[@]}"; do
encrypted_file_path="$file_path.enc"

Expand Down

0 comments on commit 90675a4

Please sign in to comment.