75521fffbd
* Update seed domains (#3872) * Remove Transfers (#3870) * Remove active index roots and compact committee roots (#3869) * Update inclusion reward (#3886) * Alter proposer selection logic (#3884) * Fix early committee bias (#3888) * Remove shards and committees (#3896) * Epoch spec tests v0.9 (#3907) * Block spec test v0.9 (#3905) * rm'ed in protobuf * build proto * build proto * build proto * fix core package * Gazelle * Fixed all the tests * Fixed static test * Comment out spec test for now * One more skip * fix-roundRobinSync (#3862) * Starting but need new seed function * Revert initial sync * Updated Proposer Slashing * Fixed all tests * Lint * Update inclusion reward * Fill randao mixes with eth1 data hash * Test * Fixing test part1 * All tests passing * One last test * Updated config * Build proto * Proper skip message * Conflict and fmt * Removed crosslinks and shards. Built * Format and gazelle * Fixed all the block package tests * Fixed all the helper tests * All epoch package tests pass * All core package tests pass * Fixed operation tests * Started fixing rpc test * RPC tests passed! * Fixed all init sync tests * All tests pass * Fixed blockchain tests * Lint * Lint * Preston's feedback * Starting * Remove container * Fixed block spec tests * All passing except for block_processing test * Failing block processing test * Starting * Add AggregateAndProof * All mainnet test passes * Update deposit contract (#3906) * Proto spec tests v0.9 (#3908) * Starting * Add AggregateAndProof * Unskip block util tests (#3910) * rm'ed in protobuf * build proto * build proto * build proto * fix core package * Gazelle * Fixed all the tests * Fixed static test * Comment out spec test for now * One more skip * fix-roundRobinSync (#3862) * Starting but need new seed function * Revert initial sync * Updated Proposer Slashing * Fixed all tests * Lint * Update inclusion reward * Fill randao mixes with eth1 data hash * Test * Fixing test part1 * All tests passing * One last test * Updated config * Build proto * Proper skip message * Conflict and fmt * Removed crosslinks and shards. Built * Format and gazelle * Fixed all the block package tests * Fixed all the helper tests * All epoch package tests pass * All core package tests pass * Fixed operation tests * Started fixing rpc test * RPC tests passed! * Fixed all init sync tests * All tests pass * Fixed blockchain tests * Lint * Lint * Preston's feedback * Starting * Remove container * Fixed block spec tests * All passing except for block_processing test * Failing block processing test * Starting * Add AggregateAndProof * All mainnet test passes * Unskip block util tests * Slot processing spec test V0.9 (#3912) * Starting * Add AggregateAndProof * Unskip slot processing mainnet test * Unskip minimal spec test for finalization (#3920) * Remove outdated interop tests (#3922) * Rm outdated interop tests * Rm test runner * Gazelle * Update validator to use proposer slot (#3919) * Fix committee assignment (#3931) * Replace shard with committee index (#3930) * Conflict * Clean up (#3933) * Remove shard filter in db (#3936) * Remove lightouse compatibility test (#3939) * Update Committee Cache for v0.9 (#3948) * Updated committee cache * Removed shuffled indices cache * Started testing run time * Lint * Fixed test * Safeguard against nil head state * address edge case * add test * Fixed TestRoundRobinSync by doubling the epochs * Unskip TestProtoCompatability (#3958) * Unskip TestProtoCompatability * Update WORKSPACE * Fix minimal config (#3959) * fix minimal configs * fix hardcoded value in test * Simplify verify att time (#3961) * update readme for deposit contract, regen bindings for vyper 0.1.0b12 (#3963) * update readme for deposit contract, regen bindings * medium * Check nil base state (#3964) * Copy Block When Receiving it From Sync (#3966) * copy block * clone for other service methods too * Change logging of Bitfield (#3956) * change logging of bits * preston's review * Unskip Beacon Server Test (#3962) * run test till the end * fix up proto message types * fmt * resolve broken tests * better error handling * fixing new logic to use archived proposer info * fix up logic * clip using the max effective balance * broken build fix with num arg mismatch * amend archive * archival logic changed * rename test * archive both proposer and attester seeds * page size 100 * further experiments * further experimentation, archivedProposerIndex seems wrong * test passes * rem log * fix broken test * fix test * gaz * fix imports * ethapis * setup request/response types for the committees * list beacon committees impl * beacon committees fetch from archive * full list beacon committees implementation * list beacon committees added more useful fields * actually paginate * attester server split into subpackage * attester impl split up successfully * validator cleaned up * all packages isolated * include proposer * proper naming * test fix * proper viz * naming * resolved timeout due to config values * init use minimal * added all subfiles * subfile split and gazelle * shards * validator folder * cleanup val * shay feedback * initial pagination tests passing * paginated tests pass * fix bug regarding total count * pagination tests pass * adding final test, archive * archive test works * regen protos for archival * resolve broken test * test pass * broken archive test * rem helpers * gaz * fix kv test * useful gRPC error code standards * format * resolved bad test * test resolution * ux improvements and bug fixes * complete * comments * Update beacon-chain/archiver/service.go * Update beacon-chain/rpc/beacon/committees.go * elim bad test * preston feedback |
||
---|---|---|
.github | ||
.well-known | ||
beacon-chain | ||
contracts | ||
docs | ||
proto | ||
scripts | ||
shared | ||
slasher | ||
third_party | ||
tools | ||
validator | ||
.bazelrc | ||
.buildkite-bazelrc | ||
.codecov.yml | ||
.dockerignore | ||
.gitattributes | ||
.gitignore | ||
.golangci.yml | ||
.travis.yml | ||
BUILD.bazel | ||
CONTRIBUTING.md | ||
interop.Dockerfile | ||
INTEROP.md | ||
LICENSE.md | ||
nogo_config.json | ||
PULL_REQUEST_TEMPLATE.md | ||
README.md | ||
renovate.json | ||
service-account.json.enc | ||
TESTNET.md | ||
VERSION | ||
WORKSPACE |
Prysm: Ethereum 'Serenity' 2.0 Go Implementation
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
- Installation
- Running an Ethereum 2.0 Beacon Node
- Staking ETH: Running a Validator Client
- Testing Prysm
- Contributing
- License
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 UNIX operating system (MacOS included)
Installation
Build via Docker
- Ensure you are running the most recent version of Docker by issuing the command:
docker -v
- 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
- Open a terminal window. Ensure you are running the most recent version of Bazel by issuing the command:
bazel version
- Clone this repository and enter the directory:
git clone https://github.com/prysmaticlabs/prysm
cd prysm
- 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.
- Build the configuration for the Prysm testnet by issuing the commands:
bazel build --define ssz=minimal //beacon-chain:beacon-chain
bazel build --define ssz=minimal //validator:validator
The binaries will be built in an architecture-dependent subdirectory of bazel-bin
, and are supplied as part of Bazel's build process. To fetch the location, issue the command:
$ bazel build --define ssz=minimal //beacon-chain:beacon-chain
...
Target //beacon-chain:beacon-chain up-to-date:
bazel-bin/beacon-chain/linux_amd64_stripped/beacon-chain
...
In the example above, the beacon chain binary has been created in bazel-bin/beacon-chain/linux_amd64_stripped/beacon-chain
.
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:
To start your beacon node, issue the following command:
docker run -v $HOME/prysm-data:/data -p 4000:4000 \
--name beacon-node \
gcr.io/prysmaticlabs/prysm/beacon-chain:latest \
--no-genesis-delay \
--datadir=/data
(Optional) If you want to enable gRPC, then run this command instead of the one above:
docker run -v $HOME/prysm-data:/data -p 4000:4000 -p 7000:7000 \
--name beacon-node \
gcr.io/prysmaticlabs/prysm/beacon-chain:latest \
--datadir=/data \
--no-genesis-delay \
--grpc-gateway-port=7000
You can stop the beacon node using Ctrl+c
or with the following command:
docker stop beacon-node
To restart the beacon node, issue the command:
docker start -ai beacon-node
To delete a corrupted container, issue the command:
docker rm beacon-node
To recreate a deleted container and refresh the chain database, issue the start command with an additional --force-clear-db
parameter:
docker run -it -v $HOME/prysm-data:/data -p 4000:4000 --name beacon-node \
gcr.io/prysmaticlabs/prysm/beacon-chain:latest \
--datadir=/data \
--force-clear-db
Docker on Windows:
-
You will need to share the local drive you wish to mount to to container (e.g. C:).
- Enter Docker settings (right click the tray icon)
- Click 'Shared Drives'
- Select a drive to share
- Click 'Apply'
-
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 thatC:
is your prior-selected shared Drive. -
To run the beacon node, issue the command:
docker run -it -v c:/tmp/prysm-data:/data -p 4000:4000 gcr.io/prysmaticlabs/prysm/beacon-chain:latest --datadir=/data
Running via Bazel
- To start your Beacon Node with Bazel, issue the command:
bazel run //beacon-chain -- --datadir=/tmp/prysm-data
This will sync up the Beacon Node with the latest head block in the network. Note that the beacon node must be completely synced before attempting to initialise a validator client, otherwise the validator will not be able to complete the deposit and funds will be lost.
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
- 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 the 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.