Thanks for your contribution to Lodestar. It's people like you that push the Ethereum ecosystem forward.
- Run
lerna bootstrap
oryarn install
to install dependencies - NOTE: By default the spec tests (5GB) will be installed with other dependencies. If you would like to avoid downloading the spec tests, instead run
yarn install --ignore-optional
.
- Run
lerna run test:spec-min
for minimal spec tests - Run
lerna run test:spec-main
for mainnet spec tests - Run
lerna run test:unit
for unit tests - Run
lerna run test:e2e
for end-to-end tests - Run
lerna run test
to run all tests
The docker-compose file requires that a .env
file be present in this directory. The default.env
file provides a template and can be copied .env
:
cp default.env .env
Beacon node only
docker-compose up -d
Beacon node and validator
First, you must have keystores and their secrets available locally at ./keystores
and ./secrets
docker-compose -f docker-compose.yml -f docker-compose.validator.yml up -d
Dockerized metrics + local beacon node
docker-compose -f docker/docker-compose.local.yml up -d
Development
Development image will have the basic packages and current (source) directory mapped to /usr/app
to map your code. Start development container (command: tail -f anything doesn't let container shut down) and you can exec into the dev shell.
docker-compose -f docker-compose.yml -f development.yml up -d beacon_node
sudo docker exec -it $(sudo docker ps |grep lodestar:dev|awk '{print $1}') /bin/bash
Now install and build the lodestar codebase.
yarn install
Run the code as beacon or validator (or both opening two seperate shells)
ts-node packages/lodestar-cli/src/index.ts ...
Unsure where to begin contributing to Lodestar? Here are some ideas!
- See any typos? See any verbiage that should be changed or updated? Go for it! Github makes it easy to make contributions right from the browser.
- Look through our outstanding unassigned issues. (hint: look for issues labeled "good first issue")
- Join our discord chat!
Create a new issue! Select the type of issue that best fits, and please fill out as much of the information as you can.
- Make sure you're familiar with our contribution guidelines (this document!)
- Create your own fork of this repo
- Make your changes in your local fork
- If you've made a code change, make sure to lint and test your changes (
yarn lint
andyarn test:unit
) - Make a pull request! We review PRs on a regular basis.
- You may be asked to sign a Contributor License Agreement (CLA). We make it relatively painless with CLA-bot.
We're currently experimenting with hosting the majority of lodestar packages and support packages in this repository as a monorepo. We're using Lerna to manage the packages. See packages/ for a list of packages hosted in this repo.
- PRs should usually only update a single package (in our monorepo) at a time
- Many module class constructors have the following signature:
(options, dependencies)
- eg:
public constructor(opts: IExampleOptions, {db, logger}: IExampleModules)
- eg:
- Modules should be designed to "do one thing and do it well"
- Consider the interface of a module -- events included, and make sure it is coherent
- Make sure your code is properly linted
- use an IDE that will show linter errors/warnings
- run
yarn lint
from the command line - common rules:
- Functions and variables should be
camelCase
, classes should bePascalCase
, constants should beUPPERCASE_WITH_UNDERSCORES
. - Use
"
instead of'
- All functions should have types declared for all parameters and return value
- All interfaces should be prefixed with a
I
- eg:
IMyInterface
- eg:
- You probably shouldn't be using Typescript's
any
- Private class properties should not be prefixed with a
_
- eg:
private dirty;
, notprivate _dirty;
- eg:
- Functions and variables should be
- Make sure that your code is properly type checked:
- use an IDE that will show type errors
- run
yarn check-types
from the command line
- Make sure that the tests are still passing:
- run
yarn test:unit
from the command line
- run
Come chat with us on discord!