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

WIP: Making Twilio the default provider in the attestation service #2028

Merged
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
2b57e99
Merge pull request #1 from celo-org/master
aaitor Oct 15, 2019
dbf364d
Merge pull request #2 from celo-org/master
aaitor Oct 28, 2019
bea22ce
Merge pull request #3 from celo-org/master
aaitor Nov 1, 2019
e816c2f
Merge pull request #4 from celo-org/master
aaitor Nov 5, 2019
3885464
Merge pull request #5 from celo-org/master
aaitor Nov 8, 2019
4bf9b9c
Merge pull request #6 from celo-org/master
aaitor Nov 11, 2019
6e48d18
Merge pull request #7 from celo-org/master
aaitor Nov 13, 2019
cfe2b4b
Merge pull request #8 from celo-org/master
aaitor Nov 18, 2019
5ec5e52
Merge pull request #9 from celo-org/master
aaitor Nov 19, 2019
eb20309
Merge pull request #10 from celo-org/master
aaitor Nov 25, 2019
ef3d8d1
Merge pull request #12 from celo-org/master
aaitor Nov 27, 2019
a5be9c5
Merge pull request #13 from celo-org/master
aaitor Nov 28, 2019
b8ad1af
Merge pull request #14 from celo-org/master
aaitor Dec 2, 2019
92cf27c
Merge pull request #15 from celo-org/master
aaitor Dec 3, 2019
e98781e
Update script for baklava
cmcewen Dec 4, 2019
a315f09
More script changes
cmcewen Dec 4, 2019
ed0ed8e
Merge pull request #16 from celo-org/master
aaitor Dec 4, 2019
6e8333b
Merge pull request #17 from celo-org/cmcewen/new-script
aaitor Dec 4, 2019
abcfec3
fixing the command to allow to unlock the account used by the local g…
aaitor Dec 4, 2019
5c28901
making Twilio the default messaging provider
aaitor Dec 4, 2019
52c0510
Merge branch 'master' into feature/making-twilio-default
aaitor Dec 4, 2019
e8f19dd
Merge pull request #18 from celo-org/master
aaitor Dec 5, 2019
181e782
Merge pull request #19 from celo-org/master
aaitor Dec 6, 2019
bec30ca
Merge branch 'master' into feature/making-twilio-default
aaitor Dec 6, 2019
bf57e69
Merge branch 'feature/making-twilio-default' of github.com:aaitor/cel…
aaitor Dec 6, 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
5 changes: 3 additions & 2 deletions packages/docs/getting-started/running-a-validator.md
Original file line number Diff line number Diff line change
Expand Up @@ -483,11 +483,12 @@ With this proof, authorize the attestation signer on your local machine:
celocli account:authorize --from $CELO_VALIDATOR_ADDRESS --role attestation --signature 0x$CELO_ATTESTATION_SIGNER_SIGNATURE --signer 0x$CELO_ATTESTATION_SIGNER_ADDRESS
```

You can now run the node for the attestation service in the background:
You can now run the node for the attestation service in the background. In the below command remember to specify the password you used during the creation of the `CELO_ATTESTATION_SIGNER_ADDRESS` account:

```bash
# On the Attestation machine
docker run --name celo-attestations --restart always -p 8545:8545 -v $PWD:/root/.celo $CELO_IMAGE --verbosity 3 --networkid $NETWORK_ID --syncmode full --rpc --rpcaddr 0.0.0.0 --rpcapi eth,net,web3,debug,admin --unlock $CELO_ATTESTATION_SIGNER_ADDRESS
docker run -v $PWD:/root/.celo --entrypoint sh --rm $CELO_IMAGE -c "echo ATTESTATION_SIGNER_ADDRESS_PASSWORD > /root/.celo/.password"
docker run --name celo-attestations -d --restart always -p 8545:8545 -v $PWD:/root/.celo $CELO_IMAGE --verbosity 3 --networkid $NETWORK_ID --syncmode full --rpc --rpcaddr 0.0.0.0 --rpcapi eth,net,web3,debug,admin --unlock $CELO_ATTESTATION_SIGNER_ADDRESS --password /root/.celo/.password
```

By now, you should have setup your Validator account appropriately. You can finish the actual deploy of the attestation service under the [Attestation Service at the documentation page](running-attestation-service.md).
Expand Down
29 changes: 14 additions & 15 deletions scripts/run-docker-validator-network.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,23 @@ export LC_ALL=en_US.UTF-8
COMMAND=${1:-"pull,accounts,run-validator,run-proxy,status,print-env"}
DATA_DIR=${2:-"/tmp/celo/network"}

export CELO_IMAGE=${3:-"us.gcr.io/celo-testnet/geth@sha256:37ff19487dfe436ca2be87725cf7ba0009c223614bbaf5b79d856ea9e73917f4"}
export NETWORK_ID=${4:-"31417"}
export NETWORK_NAME=${5:-"baklavastaging"}
export CELO_IMAGE=${3:-"us.gcr.io/celo-testnet/celo-node:baklava"}
export NETWORK_ID=${4:-"12219"}
export NETWORK_NAME=${5:-"baklava"}
export DEFAULT_PASSWORD=${6:-"1234"}
export CELO_IMAGE_ATTESTATION=${7:-"us.gcr.io/celo-testnet/celo-monorepo@sha256:90ea6739f9d239218245b5dce30e1bb5f05ac8dbc59f8e6f315502635c05ccb1"}
export CELO_PROVIDER=${8:-"https://baklavastaging-forno.celo-testnet.org/"} # https://berlintestnet001-forno.celo-networks-dev.org/
export CELO_PROVIDER=${8:-"https://baklava-forno.celo-testnet.org/"} # https://berlintestnet001-forno.celo-networks-dev.org/
export DATABASE_URL=${9:-"sqlite://db/attestation.db"}

export VALIDATOR_NAME=johndoe_$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 8 | head -n 1)
export VALIDATOR_GROUP_NAME=tijuana_$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 8 | head -n 1)

export CELOCLI="celocli"
export NEXMO_KEY="xx"
export NEXMO_SECRET="xx"
export NEXMO_BLACKLIST=""
export CELOCLI="npx celocli"
export TWILIO_MESSAGING_SERVICE_SID=MG00000000000000000000000000000000
export TWILIO_ACCOUNT_SID=AC00000000000000000000000000000000
export TWILIO_BLACKLIST=""
export TWILIO_AUTH_TOKEN="ffffffffffffffffffffffffffffffff"

HOSTNAME=$(hostname)
export ETHSTATS_ARG="$HOSTNAME@$NETWORK_NAME-ethstats.celo-testnet.org"

Expand Down Expand Up @@ -242,10 +244,10 @@ if [[ $COMMAND == *"run-attestation"* ]]; then
echo -e "\tPulling docker image: $CELO_IMAGE_ATTESTATION"
docker pull $CELO_IMAGE_ATTESTATION

export ATTESTATION_KEY=0x$(celocli account:new| tail -3| head -1| cut -d' ' -f 2| tr -cd "[:alnum:]\n")
export ATTESTATION_KEY=0x$($CELOCLI account:new| tail -3| head -1| cut -d' ' -f 2| tr -cd "[:alnum:]\n")
echo -e "\tATTESTATION_KEY=$ATTESTATION_KEY"

screen -S attestation-service -d -m docker run -v $PWD/attestation-service:/celo-monorepo/packages/attestation-service/db --name celo-attestation-service -d --restart always --entrypoint /bin/bash -e ATTESTATION_KEY=$ATTESTATION_KEY -e ACCOUNT_ADDRESS=0x$CELO_VALIDATOR_ADDRESS -e CELO_PROVIDER=$CELO_PROVIDER -e DATABASE_URL=$DATABASE_URL -e SMS_PROVIDERS=nexmo -e NEXMO_KEY=$NEXMO_KEY -e NEXMO_SECRET=$NEXMO_SECRET -e NEXMO_BLACKLIST=$NEXMO_BLACKLIST -p 3000:80 -v $PWD/attestation-service:/root/.celo $CELO_IMAGE_ATTESTATION -c " cd /celo-monorepo/packages/attestation-service && touch db/attestation.db && yarn run db:migrate && yarn start "
screen -S attestation-service -d -m docker run --name celo-attestation-service -v $PWD/attestations:/celo-monorepo/packages/attestation-service/db -d --restart always --entrypoint /bin/bash -e ATTESTATION_SIGNER_ADDRESS=0x$CELO_ATTESTATION_SIGNER_ADDRESS -e CELO_VALIDATOR_ADDRESS=0x$CELO_VALIDATOR_ADDRESS -e CELO_PROVIDER=$CELO_PROVIDER -e DATABASE_URL=$DATABASE_URL -e SMS_PROVIDERS=twilio -e TWILIO_MESSAGING_SERVICE_SID=$TWILIO_MESSAGING_SERVICE_SID -e TWILIO_ACCOUNT_SID=$TWILIO_ACCOUNT_SID -e TWILIO_BLACKLIST=$TWILIO_BLACKLIST -e TWILIO_AUTH_TOKEN=$TWILIO_AUTH_TOKEN -p 3000:80 $CELO_IMAGE_ATTESTATION -c " cd /celo-monorepo/packages/attestation-service && yarn run db:migrate && yarn start "

echo -e "\tAttestation service should be running, you can check running 'screen -ls'"
echo -e "\tYou can re-attach to the attestation-service running:"
Expand All @@ -266,7 +268,7 @@ if [[ $COMMAND == *"run-fullnode"* ]]; then

docker rm -f celo-fullnode || echo -e "Container removed"

export CELO_ACCOUNT_ADDRESS=$(celocli account:new |tail -1| cut -d' ' -f 2| tr -cd "[:alnum:]\n")
export CELO_ACCOUNT_ADDRESS=$($CELOCLI account:new |tail -1| cut -d' ' -f 2| tr -cd "[:alnum:]\n")

docker run -v $PWD/fullnode:/root/.celo --entrypoint /bin/sh -it $CELO_IMAGE -c "wget https://www.googleapis.com/storage/v1/b/static_nodes/o/$NETWORK_NAME?alt=media -O /root/.celo/static-nodes.json"

Expand Down Expand Up @@ -304,9 +306,6 @@ fi
if [[ $COMMAND == *"get-cooking"* ]]; then

echo -e "* Prepping validator for The Great Celo Stake Off..."
cd $ACCOUNTS_DIR

which $CELOCLI

echo -e "\t1. Unlocking accounts .."
$CELOCLI account:unlock --account $CELO_VALIDATOR_GROUP_ADDRESS --password $DEFAULT_PASSWORD
Expand Down