Giter VIP home page Giter VIP logo

prysm's Introduction

Prysmatic Labs Ethereum Serenity Implementation

Build status

This is the main repository for the Go implementation of the Ethereum 2.0 Serenity Prysmatic Labs.

Before you begin, check out our official documentation portal and join our active chat room on Discord or Gitter below:

Discord Gitter

Also, read our Roadmap Reference Implementation Doc. This doc provides a background on the milestones we aim for the project to achieve.

Table of Contents

Join Our Testnet

You can now participate in our public testnet release for Ethereum 2.0 phase 0. Visit prylabs.net ๐Ÿ’Ž to participate!

Installing Prysm

Installation Options

You can either choose to run our system via:

  • Our latest release (Easiest)
  • Using Docker (Recommended)
  • Using Our Build Tool, Bazel

Fetching via Docker (Recommended)

Docker is a convenient way to run Prysm, as all you need to do is fetch the latest images:

docker pull gcr.io/prysmaticlabs/prysm/validator:latest
docker pull gcr.io/prysmaticlabs/prysm/beacon-chain:latest

Build Via Bazel

First, clone our repository:

git clone https://github.com/prysmaticlabs/prysm

Download the Bazel build tool by Google here and ensure it works by typing:

bazel version

Bazel manages all of the dependencies for you (including go and necessary compilers) so you are all set to build prysm. Then, build both parts of our system: a beacon chain node implementation, and a validator client:

bazel build //beacon-chain:beacon-chain
bazel build //validator:validator

Prysm Main Components

Prysm ships with two important components: a beacon node and a validator client. The beacon node is the server that performs the heavy lifting of Ethereum 2.0., A validator client is another piece of software that securely connects to the beacon node and allows you to stake 3.2 Goerli ETH in order to secure the network. You'll be mostly interacting with the validator client to manage your stake. Another critical component of Ethereum 2.0 is the Validator Deposit Contract, which is a smart contract deployed on the Ethereum 1.0 chain which can be used for current holders of ETH to do a one-way transfer into Ethereum 2.0.

Running an Ethereum 2.0 Beacon Node

With Docker

Docker on Linux/Mac:

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 tray icon)
    2. Click Shared Drives
    3. Select Drive to share
    4. Click Apply
  2. You will next need to create a folder in the drive to use as your data directory (Docker will not create this if it does not exist). For the purposes of these instructions, C: is shared, and we created the /tmp/prysm-data/ directory within. This path must be used for the local data directory for chain data for the Beacon Node, and when creating an account and keystore for the validator, and when running the validator.

  3. Run the beacon node (Docker CLI in Windows seems to have trouble ingesting with escapes and new lines, so keep it on one line):

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

With Bazel

To start your beacon node with bazel:

bazel run //beacon-chain -- --clear-db --datadir=/tmp/prysm-data

This will sync you up with the latest head block in the network, and then you'll have a ready beacon node. The chain will then be waiting for you to deposit 3.2 Goerli ETH into the Validator Deposit Contract before your validator can become active! Now, you'll need to create a validator client to connect to this node and stake 3.2 Goerli ETH to participate as a validator in Ethereum 2.0's Proof of Stake system.

Staking ETH: Running a Validator Client

Once your beacon node is up, you'll need to attach a validator client as a separate process. Each validator represents 3.2 Goerli ETH being staked in the system, so you can spin up as many as you want to have more at stake in the network

Activating Your Validator: Depositing 3.2 Goerli ETH

Using your validator deposit data from the previous step, use the instructions in https://alpha.prylabs.net/participate to deposit.

It'll take a while for the nodes in the network to process your deposit, but once you're active, your validator will begin doing its responsibility! In your validator client, you'll be able to frequently see your validator balance as it goes up. If you ever go offline for a while, you'll start gradually losing your deposit until you get kicked out of the system. Congratulations, you are now running Ethereum 2.0 Phase 0 :).

Testing

To run the unit tests of our system do:

bazel test //...

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

golangci-lint run

Contributing

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

nyancat

License

GNU General Public License v3.0

prysm's People

Contributors

0xkiwi avatar 3ach avatar arku avatar atoulme avatar cyberbono3 avatar danielschonfeld avatar enriquefynn avatar fgimenez avatar gitter-badger avatar houjieth avatar jerryfireman avatar jgimeno avatar kaidiren avatar kushagrasharma avatar masonmahaffey avatar mmjahanara avatar nisdas avatar prestonvanloon avatar puthranps avatar ramisra avatar rauljordan avatar renovate-bot avatar renovate[bot] avatar roveneliah avatar s1na avatar shayzluf avatar skillful-alex avatar terencechain avatar wemeetagain avatar wildmolasses avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.