Go to file
terence tsao 798bbbdc82 Cold start for interop (#3437)
* coldstart flags for validator

* WIP beacon node flags

* wip beacon chain, flag fix in validator, arg fix in validator

* checkpoint

* Added interop service

* working on mock chainstart

* save the state lol

* fix tests

* Save genesis validators

* gaz

* fix validator help flags

* WaitForChainStart actually waits for genesis time

* cold start fixes

* cache

* change back

* allow for genesis state too

* remove logs

* increase mmap size

* dont process if head doesn't exist

* add 10ms tolerance

* enable libp2p debug at debug, fix pubsub

* works with checkpt

* initialize justified and finalized in db

* Removed preloadStatePath from blockchain service

* Clean up

* Write to disk for now post state

* revert b466dd536f8eadbdae2264a545a755370223d917

* Builds

* Only RPC test fails now

* use minimal config, no demo config

* clean up branch

* Lint

* resolve lint

* more lint fixes

* lint

* fix viz

* Fixing RPC test

* skip before epoch 2

* RPC time out

* Fixed ordering

* rename

* remove some dbg statements

* ensure index is correct

* fix some panics

* getting closer

* fix tests

* Fix private key

* Fixed RPC test

* Fixed beacon chain build for docker

* Add interop.go to validator go_image

* Fixed docker build

* handle errors

* skip test, skip disconnecting peers

* Fixed docker build

* tolerance for attestation processing

* revert copy

* clearer err message parse

* fix launching from dep contract
2019-09-11 13:38:35 -05:00
.github Create FUNDING.yml (#2800) 2019-06-17 01:49:06 -04:00
.well-known add security file (#2662) 2019-05-20 12:55:38 -04:00
beacon-chain Cold start for interop (#3437) 2019-09-11 13:38:35 -05:00
contracts Remove Statistical Package (#3129) 2019-08-03 06:47:46 -07:00
docs Update All Our Documentation (#2012) 2019-03-17 16:30:46 -06:00
k8s Add rule to push docker images (#3006) 2019-07-20 20:40:03 -04:00
proto Beaconblock over wire (#3436) 2019-09-10 10:24:14 -04:00
scripts Add tool and script for interop testing (#3417) 2019-09-09 17:31:19 -04:00
shared Cold start for interop (#3437) 2019-09-11 13:38:35 -05:00
slasher/db Add Test for Aggregating Large Amount of Attestations (#3358) 2019-09-02 13:49:37 -05:00
third_party Spec freeze updates (#2312) 2019-07-19 19:16:10 -05:00
tools Cold start for interop (#3437) 2019-09-11 13:38:35 -05:00
validator Cold start for interop (#3437) 2019-09-11 13:38:35 -05:00
.bazelrc Update to spec v0.8.3 (#3355) 2019-09-08 12:41:52 -07:00
.buildkite-bazelrc Spec freeze updates (#2312) 2019-07-19 19:16:10 -05:00
.codecov.yml Update codecov to ignore generated code (#2794) 2019-06-12 10:45:17 -04:00
.dockerignore Add tool and script for interop testing (#3417) 2019-09-09 17:31:19 -04:00
.gitattributes linguist-generated=true for mock and pb go files (#1465) 2019-02-02 17:25:28 -05:00
.gitignore Validator: performing for multiple keys - update rpc proto (#2040) 2019-03-23 19:46:25 -05:00
.golangci.yml upgrading linter from gometalinter to golangci-lint (#2100) 2019-04-26 14:24:01 +08:00
.travis.yml Resolve Proto Lint Issues (#3044) 2019-07-22 14:10:17 -05:00
BUILD.bazel Spec freeze updates (#2312) 2019-07-19 19:16:10 -05:00
CONTRIBUTING.md Update CONTRIBUTING.md (#2679) 2019-05-23 06:30:00 -07:00
interop.Dockerfile Add tool and script for interop testing (#3417) 2019-09-09 17:31:19 -04:00
INTEROP.md Genesis State Generator + Interop Docs (#3405) 2019-09-04 13:47:44 -05:00
LICENSE.md update to GPLv3 (#297) 2018-07-20 10:23:48 -05:00
nogo_config.json Nogo fix for mac (#3043) 2019-07-22 07:39:37 -07:00
PULL_REQUEST_TEMPLATE.md Update All Our Documentation (#2012) 2019-03-17 16:30:46 -06:00
README.md Updated how-prysm-works link in README.md (#3412) 2019-09-05 18:29:54 -07:00
renovate.json Update renovate.json (#1965) 2019-03-11 11:04:14 -04:00
service-account.json.enc Bazel cache for travis (#236) 2018-07-07 16:01:58 -04:00
VERSION Spec freeze updates (#2312) 2019-07-19 19:16:10 -05:00
WORKSPACE Update to spec v0.8.3 (#3355) 2019-09-08 12:41:52 -07:00

Prysm: Ethereum 'Serenity' 2.0 Go Implementation

Build status ETH2.0_Spec_Version 0.8.1 Discord Gitter

This is the Core repository for Prysm, Prysmatic Labs' Go implementation of the Ethereum protocol 2.0 (Serenity).

Need assistance?

A more detailed set of installation and usage instructions as well as explanations of each component are available on our official documentation portal. If you still have questions, feel free to stop by either our Discord or Gitter and a member of the team or our community will be happy to assist you.

Interested in what's next? Be sure to read our Roadmap Reference Implementation document. This page outlines the basics of sharding as well as the various short-term milestones that we hope to achieve over the coming year.

Come join the testnet!

Participation is now open to the public in our testnet release for Ethereum 2.0 phase 0. Visit prylabs.net for more information on the project itself or to sign up as a validator on the network.

Table of Contents

Dependencies

Prysm can be installed either with Docker (recommended method) or using our build tool, Bazel. The below instructions include sections for performing both.

For Docker installations:

  • The latest release of Docker

For Bazel installations:

  • The latest release of Bazel
  • A modern GNU/Linux operating system

Installation

Build via Docker

  1. Ensure you are running the most recent version of Docker by issuing the command:
docker -v
  1. To pull the Prysm images from the server, issue the following commands:
docker pull gcr.io/prysmaticlabs/prysm/validator:latest
docker pull gcr.io/prysmaticlabs/prysm/beacon-chain:latest

This process will also install any related dependencies.

Build via Bazel

  1. Open a terminal window. Ensure you are running the most recent version of Bazel by issuing the command:
bazel version
  1. Clone this repository and enter the directory:
git clone https://github.com/prysmaticlabs/prysm
cd prysm
  1. Build both the beacon chain node implementation and the validator client:
bazel build //beacon-chain:beacon-chain
bazel build //validator:validator

Bazel will automatically pull and install any dependencies as well, including Go and necessary compilers.

Running an Ethereum 2.0 Beacon Node

To understand the role that both the beacon node and validator play in Prysm, see this section of our documentation.

Running via Docker

Docker on Linux/Mac:

  1. To start your beacon node, issue the following command:
docker run -v /tmp/prysm-data:/data -p 4000:4000 \
  gcr.io/prysmaticlabs/prysm/beacon-chain:latest \
  --datadir=/data
  --clear-db

Docker on Windows:

  1. You will need to share the local drive you wish to mount to to container (e.g. C:).

    1. Enter Docker settings (right click the tray icon)
    2. Click 'Shared Drives'
    3. Select a drive to share
    4. Click 'Apply'
  2. You will next need to create a directory named /tmp/prysm-data/ within your selected shared Drive. This folder will be used as a local data directory for Beacon Node chain data as well as account and keystore information required by the validator. Docker will not create this directory if it does not exist already. For the purposes of these instructions, it is assumed that C: is your prior-selected shared Drive.

  3. To run the beacon node, issue the following command:

docker run -it -v c:/tmp/prysm-data:/data -p 4000:4000 gcr.io/prysmaticlabs/prysm/beacon-chain:latest --datadir=/data --clear-db

Running via Bazel

  1. To start your Beacon Node with Bazel, issue the following command:
bazel run //beacon-chain -- --clear-db --datadir=/tmp/prysm-data

This will sync up the Beacon Node with the latest head block in the network.

Staking ETH: Running a Validator Client

Once your beacon node is up, the chain will be waiting for you to deposit 3.2 Goerli ETH into the Validator Deposit Contract to activate your validator (discussed in the section below). First though, you will need to create a validator client to connect to this node in order to stake and participate. Each validator represents 3.2 Goerli ETH being staked in the system, and it is possible to spin up as many as you desire in order to have more stake in the network.

Activating Your Validator: Depositing 3.2 Goerli ETH

Using your validator deposit data from the previous step, follow the instructions found on https://prylabs.net/participate to make a deposit.

It will take a while for the nodes in the network to process your deposit, but once your node is active, the validator will begin doing its responsibility. In your validator client, you will be able to frequently see your validator balance as it goes up over time. Note that, should your node ever go offline for a long period, you'll start gradually losing your deposit until you are removed from the system.

Starting the validator with Bazel

  1. Open another terminal window. Enter your Prysm directory and run the validator by issuing the following command:
cd prysm
bazel run //validator

Congratulations, you are now running Ethereum 2.0 Phase 0!

Testing Prysm

To run the unit tests of our system, issue the command:

bazel test //...

To run our linter, make sure you have golangci-lint installed and then issue the command:

golangci-lint run

Contributing

We have put all of our contribution guidelines into CONTRIBUTING.md! Check it out to get started.

License

GNU General Public License v3.0