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

master #8

Merged
merged 28 commits into from
Nov 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
4b2bed1
Add golang to setup docs
tkporter Nov 12, 2019
6ef3735
Remove integration sync test
Nov 12, 2019
87bfc3c
[Wallet] Use the country of the phone number for determining the defa…
jeanregisser Nov 13, 2019
1eb56cf
Switch to correct cluster when fauceting (#1687)
tkporter Nov 13, 2019
3b9138a
Merge branch 'master' into asaj/e2e-integration-sync
Nov 13, 2019
db634e7
[Wallet] Add more local currencies (#1698)
jeanregisser Nov 13, 2019
9f1446f
Merge pull request #1675 from celo-org/trevor/docs
timmoreton Nov 13, 2019
9f4c083
Merge pull request #1681 from celo-org/asaj/e2e-integration-sync
timmoreton Nov 13, 2019
413739b
Adjust e2e transfer and governance tests to match new fee distributio…
Nov 13, 2019
5717939
[Wallet] Reset isRedeemingInvite on rehydrate (#1716)
cmcewen Nov 14, 2019
368e434
[Wallet] Style fixes on iOS for verification and backup flows (#1718)
jmrossy Nov 14, 2019
236ce42
Check in spanish verification translations (#1726)
nityas Nov 14, 2019
7feadc0
[Wallet] Prompt user to restart app when turning off Forno a second t…
annakaz Nov 14, 2019
f29e6d9
Change the event we emit when selecting issuers (#1706)
nambrot Nov 14, 2019
88608f8
Removed end-to-end-geth-integration-sync-test job in workflow (#1730)
jcortejoso Nov 14, 2019
f11571d
Update genesis block after adding parent signatures to block header (…
Nov 14, 2019
64fb8a8
[Wallet] Set default gradle properties (#1629)
jeanregisser Nov 14, 2019
0049e92
Add AccountClaim to Metadata (#1663)
nambrot Nov 14, 2019
1700119
Fix flaky end-to-end transfer, protocol unit tests (#1734)
Nov 15, 2019
d0229ce
Added helper function to get the list of current validators (#1713)
mrsmkl Nov 15, 2019
4ef73ba
Remove end-to-end attestations test from circle (#1739)
Nov 15, 2019
6917597
New Version for contractkit (#1727)
Nov 15, 2019
05c3f96
Make styling more consistent in validator quick start and add passwor…
Nov 15, 2019
860d9ec
Update genesis block to include round in aggregated signature (#1736)
Nov 16, 2019
013708d
Fix support for validator key rotation, add end-to-end test (#1643)
Nov 16, 2019
101b27f
Point end-to-end tests back to master (#1747)
Nov 16, 2019
598e2cb
Improve reliability of flaky end-to-end governance test (#1748)
Nov 17, 2019
dc51087
Support blacklisting country codes for the attestation service (#1738)
nambrot Nov 17, 2019
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
76 changes: 17 additions & 59 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ reference:
shell: /bin/bash --login -eo pipefail
environment:
TERM: dumb
_JAVA_OPTIONS: "-Xmx7g -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"
GRADLE_OPTS: '-Dorg.gradle.daemon=false -Dorg.gradle.configureondemand=true -Dorg.gradle.jvmargs="-Xmx6g -XX:MaxPermSize=3g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8"'
_JAVA_OPTIONS: "-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"
GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.configureondemand=true"

defaults: &defaults
working_directory: ~/app
Expand All @@ -28,8 +28,8 @@ android-defaults: &android-defaults
docker:
- image: circleci/android:api-28-node
environment:
_JAVA_OPTIONS: "-Xmx7g -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"
GRADLE_OPTS: '-Dorg.gradle.daemon=false -Dorg.gradle.configureondemand=true -Dorg.gradle.jvmargs="-Xmx6g -XX:MaxPermSize=3g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8"'
_JAVA_OPTIONS: "-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"
GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.configureondemand=true"

e2e-defaults: &e2e-defaults
<<: *defaults
Expand Down Expand Up @@ -240,7 +240,7 @@ jobs:
- run:
name: Start pidcat logging
command: pidcat -t "GoLog" -t "Go" # React logs are on metro step since RN 61
background: true
background: true
- run:
name: Run yarn dev
command: cd ~/src/packages/mobile && ENVFILE=".env.test" yarn dev
Expand All @@ -249,7 +249,7 @@ jobs:
command: adb kill-server && adb start-server
- run:
name: Run test itself

command: |
cd ~/src/packages/mobile
# detox sometimes without releasing the terminal and thus making the CI timout
Expand Down Expand Up @@ -450,7 +450,7 @@ jobs:
- run:
name: Generate DevChain
command: |
(cd packages/cli && yarn test:reset)
(cd packages/cli && yarn test:reset)
- run:
name: Run Tests
command: yarn --cwd=packages/cli test
Expand All @@ -468,15 +468,16 @@ jobs:
command: |
yarn --cwd=packages/cli run celocli account:new

- run:
name: Install and test the npm package
command: |
set -euo pipefail
cd packages/cli
yarn pack
cd /tmp
npm install ~/app/packages/cli/celo-celocli-*.tgz
./node_modules/.bin/celocli account:new # Small test
# Won't work when cli uses git dependencies!
# - run:
# name: Install and test the npm package
# command: |
# set -euo pipefail
# cd packages/cli
# yarn pack
# cd /tmp
# npm install ~/app/packages/cli/celo-celocli-*.tgz
# ./node_modules/.bin/celocli account:new # Small test

typescript-test:
<<: *defaults
Expand Down Expand Up @@ -583,41 +584,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+
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_attestations.sh checkout master

end-to-end-geth-validator-order-test:
<<: *e2e-defaults
resource_class: large
Expand Down Expand Up @@ -760,14 +726,6 @@ workflows:
requires:
- lint-checks
- contractkit-test
- end-to-end-geth-integration-sync-test:
requires:
- lint-checks
- contractkit-test
- end-to-end-geth-attestations-test:
requires:
- lint-checks
- contractkit-test
- end-to-end-geth-validator-order-test:
requires:
- lint-checks
Expand Down
18 changes: 18 additions & 0 deletions SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- [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 Down Expand Up @@ -176,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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"**/codecov/**/js-yaml": "^3.13.1",
"**/deep-extend": "^0.5.1",
"**/extend": "^3.0.2",
"**/cross-fetch": "^3.0.2",
"sha3": "1.2.3"
}
}
33 changes: 33 additions & 0 deletions packages/attestation-service/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Attestation Service

A service run by validators on the Celo network to send SMS messages, enabling attestations of user phone numbers and their accounts on the Celo network.

### Configuration

You can use the following environment variables to configure the attestation service:

- `DATABASE_URL` - The URL under which your database is accessible, currently supported are `postgres://`, `mysql://` and `sqlite://`
- `CELO_PROVIDER` - The URL under which a celo blockchain node is reachable, i.e. something like `https://integration-forno.celo-testnet.org`
- `ACCOUNT_ADDRESS` - The address of the account on the `Accounts` smart contract
- `ATTESTATION_KEY` - The private key with which attestations should be signed. You could use your account key for attestations, but really you should authorize a dedicated attestation key
- `APP_SIGNATURE` - The hash with which clients can auto-read SMS messages on android
- `SMS_PROVIDERS` - A comma-separated list of providers you want to configure, we currently support:

`nexmo`

- `NEXMO_KEY` - The API key to the Nexmo API
- `NEXMO_SECRET` - The API secret to the Nexmo API
- `NEXMO_BLACKLIST` - A comma-sperated list of country codes you do not want to serve

### Running locally

After checking out the source, you should create a local sqlite database by running:

```sh
yarn run db:create:dev
yarn run db:migrate:dev
```

You will also have to set the environment variables in `.env.development`

Then start the service with `yarn run dev` (you'll have to add the appropriate credentials for the text providers)
4 changes: 3 additions & 1 deletion packages/attestation-service/config/.env.development
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ CELO_PROVIDER=https://integration-forno.celo-testnet.org
ACCOUNT_ADDRESS=0xE6e53b5fc2e18F51781f14a3ce5E7FD468247a15
ATTESTATION_KEY=x
APP_SIGNATURE=x
SMS_PROVIDERS=nexmo
NEXMO_KEY=x
NEXMO_SECRET=x
NEXMO_SECRET=x
NEXMO_BLACKLIST=
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ module.exports = {
allowNull: false,
type: Sequelize.STRING,
},
status: {
allowNull: false,
type: Sequelize.STRING,
},
smsProvider: {
allowNull: false,
type: Sequelize.STRING,
},
createdAt: {
allowNull: false,
type: Sequelize.DATE,
Expand Down
2 changes: 1 addition & 1 deletion packages/attestation-service/nodemon.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"ignore": ["**/*.test.ts", "**/*.spec.ts", ".git", "node_modules"],
"watch": ["src"],
"exec": "yarn start",
"exec": "yarn start-ts",
"ext": "ts"
}
2 changes: 1 addition & 1 deletion packages/attestation-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"lint": "tslint -c tslint.json --project ."
},
"dependencies": {
"@celo/contractkit": "0.1.6",
"@celo/contractkit": "0.2.1-dev",
"@celo/utils": "^0.1.0",
"bignumber.js": "^7.2.0",
"body-parser": "1.19.0",
Expand Down
Loading