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

Alfajores changes & comment on unlocking accounts #1297

Merged
merged 18 commits into from
Oct 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions dockerfiles/cli/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ RUN npm install @celo/celocli
FROM node:10-alpine as final_image

ARG network_name="alfajores"
ARG network_id="44782"
ARG network_id="44784"

# Without musl-dev, geth will fail with a confusing "No such file or directory" error.
# bash is required for start_geth.sh
Expand All @@ -62,8 +62,8 @@ COPY packages/cli/start_geth.sh /celo/start_geth.sh
COPY --from=geth /usr/local/bin/geth /usr/local/bin/geth
COPY --from=geth /celo/genesis.json /celo
COPY --from=geth /celo/static-nodes.json /celo
COPY --from=node /celo-monorepo/node_modules /celo-monorepo/node_modules
COPY --from=node /celo-monorepo/node_modules /celo-monorepo/node_modules
RUN chmod ugo+x /celo/start_geth.sh && ln -s /celo-monorepo/node_modules/.bin/celocli /usr/local/bin/celocli

EXPOSE 8545 8546 30303 30303/udp
ENTRYPOINT ["/celo/start_geth.sh", "/usr/local/bin/geth", "alfajores", "full", "44782", "/root/.celo", "/celo/genesis.json", "/celo/static-nodes.json"]
ENTRYPOINT ["/celo/start_geth.sh", "/usr/local/bin/geth", "alfajores", "full", "44784", "/root/.celo", "/celo/genesis.json", "/celo/static-nodes.json"]
10 changes: 5 additions & 5 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@celo/celocli",
"description": "CLI Tool for transacting with the Celo protocol",
"version": "0.0.18",
"version": "0.0.27",
"author": "Celo",
"license": "Apache-2.0",
"repository": "celo-org/celo-monorepo",
Expand Down Expand Up @@ -29,19 +29,19 @@
"test": "TZ=UTC jest"
},
"dependencies": {
"@celo/contractkit": "^0.1.6",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How recent is this version? is this == as master? or was it a while ago?

There's a small change that makes master != to alfajores: GasPriceMinimun has proposerFraction and before was infrastructureFraction

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the version of contractkit I had to redeploy in order to get the CLI to work on Alfajores-- I think it was around October 3/4. Is it safe to have this contractkit version?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i believe so

"@celo/utils": "^0.1.0",
"@celo/contractkit": "^0.1.1",
"@oclif/command": "^1",
"@oclif/config": "^1",
"@oclif/plugin-help": "^2",
"ethereumjs-util": "^5.2.0",
"bip32": "^1.0.2",
"bip39": "^2.5.0",
"chalk": "^2.4.2",
"cli-table": "^0.3.1",
"cli-ux": "^5.3.1",
"debug": "^4.1.1",
"elliptic": "^6.4.1",
"ethereumjs-util": "^5.2.0",
"events": "^3.0.0",
"firebase": "^6.2.4",
"fs-extra": "^8.1.0",
Expand All @@ -54,11 +54,11 @@
"@celo/dev-cli": "^2.0.3",
"@types/bip32": "^1.0.1",
"@types/bip39": "^2.4.2",
"@types/elliptic": "^6.4.9",
"@types/mocha": "^5.2.7",
"@types/cli-table": "^0.3.0",
"@types/debug": "^4.1.4",
"@types/elliptic": "^6.4.9",
"@types/fs-extra": "^8.0.0",
"@types/mocha": "^5.2.7",
"@types/node": "^10",
"@types/web3": "^1.0.18",
"globby": "^8",
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/start_geth.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ GETH_BINARY=${1:-"/usr/local/bin/geth"}
NETWORK_NAME=${2:-"alfajores"}
# Default to testing the ultralight sync mode
SYNCMODE=${3:-"ultralight"}
# Default to 44782
NETWORK_ID=${4:-"44782"}
# Default to 44784
NETWORK_ID=${4:-"44784"}
DATA_DIR=${5:-"/tmp/tmp1"}
GENESIS_FILE_PATH=${6:-"/celo/genesis.json"}
STATIC_NODES_FILE_PATH=${7:-"/celo/static-nodes.json"}
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/getting-started/running-a-full-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ In order to allow the node to sync with the network, give it the address of exis

This command specifies the settings needed to run the node, and gets it started.

`` $ docker run -p 127.0.0.1:8545:8545 -p 127.0.0.1:8546:8546 -p 30303:30303 -p 30303:30303/udp -v `pwd`:/root/.celo us.gcr.io/celo-testnet/celo-node:alfajores --verbosity 3 --networkid 44782 --syncmode full --rpc --rpcaddr 0.0.0.0 --rpcapi eth,net,web3,debug,admin,personal --lightserv 90 --lightpeers 1000 --maxpeers 1100 --etherbase $CELO_ACCOUNT_ADDRESS ``
`` $ docker run -p 127.0.0.1:8545:8545 -p 127.0.0.1:8546:8546 -p 30303:30303 -p 30303:30303/udp -v `pwd`:/root/.celo us.gcr.io/celo-testnet/celo-node:alfajores --verbosity 3 --networkid 44784 --syncmode full --rpc --rpcaddr 0.0.0.0 --rpcapi eth,net,web3,debug,admin,personal --lightserv 90 --lightpeers 1000 --maxpeers 1100 --etherbase $CELO_ACCOUNT_ADDRESS ``

You'll start seeing some output. There may be some errors or warnings that are ignorable. After a few minutes, you should see lines that look like this. This means your node has synced with the network and is receiving blocks.

Expand Down
10 changes: 5 additions & 5 deletions packages/docs/getting-started/running-a-validator.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,21 @@ In order to allow the node to sync with the network, give it the address of exis

Start up the node:

`` $ docker run -p 127.0.0.1:8545:8545 -p 127.0.0.1:8546:8546 -p 30303:30303 -p 30303:30303/udp -v `pwd`:/root/.celo us.gcr.io/celo-testnet/celo-node:alfajores --verbosity 3 --networkid 44782 --syncmode full --rpc --rpcaddr 0.0.0.0 --rpcapi eth,net,web3,debug,admin,personal --maxpeers 1100 --mine --miner.verificationpool=https://us-central1-celo-testnet-production.cloudfunctions.net/handleVerificationRequestalfajores/v0.1/sms/ --etherbase $CELO_VALIDATOR_ADDRESS ``
`` $ docker run -p 127.0.0.1:8545:8545 -p 127.0.0.1:8546:8546 -p 30303:30303 -p 30303:30303/udp -v `pwd`:/root/.celo us.gcr.io/celo-testnet/celo-node:alfajores --verbosity 3 --networkid 44784 --syncmode full --rpc --rpcaddr 0.0.0.0 --rpcapi eth,net,web3,debug,admin,personal --maxpeers 1100 --mine --miner.verificationpool=https://us-central1-celo-testnet-production.cloudfunctions.net/handleVerificationRequestalfajores/v0.1/sms/ --etherbase $CELO_VALIDATOR_ADDRESS ``

{% hint style="danger" %}
**Security**: The command line above includes the parameter `--rpcaddr 0.0.0.0` which makes the Celo Blockchain software listen for incoming RPC requests on all network adaptors. Exercise extreme caution in doing this when running outside Docker, as it means that any unlocked accounts and their funds may be accessed from other machines on the Internet. In the context of running a Docker container on your local machine, this together with the `docker -p` flags allows you to make RPC calls from outside the container, i.e from your local host, but not from outside your machine. Read more about [Docker Networking](https://docs.docker.com/network/network-tutorial-standalone/#use-user-defined-bridge-networks) here.
{% endhint %}

The `mine` flag does not mean the node starts mining blocks, but rather starts trying to participate in the BFT consensus protocol. It cannot do this until it gets elected -- so next we need to stand for election.

The `networkid` parameter value of `44782` indicates we are connecting the Alfajores Testnet.
The `networkid` parameter value of `44784` indicates we are connecting the Alfajores Testnet.

## Obtain and lock up some Celo Gold for staking

Visit the [Alfajores Faucet](https://celo.org/build/faucet) to send **both** of your accounts some funds.

In a new tab, unlock your accounts so that you can send transactions:
In a new tab, unlock your accounts so that you can send transactions. This only unlocks the accounts for the lifetime of the validator that's running, so be sure to unlock `$CELO_VALIDATOR_ADDRESS` again if your node gets restarted:

```
$ celocli account:unlock --account $CELO_VALIDATOR_GROUP_ADDRESS --password <YOUR_FIRST_PASSWORD>
Expand All @@ -126,8 +126,8 @@ $ celocli lockedgold:register --from $CELO_VALIDATOR_ADDRESS
Make a locked Gold commitment for both accounts in order to secure the right to register a validator and validator group. The current requirement is 1 Celo Gold with a notice period of 60 days. If you choose to stake more gold, or a longer notice period, be sure to use those values below:

```
$ celocli lockedgold:deposit --from $CELO_VALIDATOR_GROUP_ADDRESS --goldAmount 1000000000000000000 --noticePeriod 5184000
$ celocli lockedgold:deposit --from $CELO_VALIDATOR_ADDRESS --goldAmount 1000000000000000000 --noticePeriod 5184000
$ celocli lockedgold:lockup --from $CELO_VALIDATOR_GROUP_ADDRESS --goldAmount 1000000000000000000 --noticePeriod 5184000
$ celocli lockedgold:lockup --from $CELO_VALIDATOR_ADDRESS --goldAmount 1000000000000000000 --noticePeriod 5184000
```

## Run for election
Expand Down