mirror of
https://github.com/AtHeartEngineering/lodestar.git
synced 2026-01-09 21:38:03 -05:00
* docs: update readme * docs: update security * docs: update readme * docs: update contributing * docs: update contributing * docs: update security * docs: add new packages to readme
4.8 KiB
4.8 KiB
Contribution Guidlines
Thanks for your contribution to Lodestar. It's people like you that push the Ethereum ecosystem forward.
Prerequisites
Getting Started
- ⚙️ Run
lerna bootstraporyarn installto install dependencies. - ⚙️ Run
yarn buildto build lib from source. - 📦 A
lodestarbinary will be bundled in./packages/cli/bin. - 💻 Run
./lodestar --helpto get a list of available commands and argurments.
Tests
- 🧪 Run
lerna run test:spec-minfor minimal spec tests. - 🧪 Run
lerna run test:spec-mainfor mainnet spec tests. - 🧪 Run
lerna run test:unitfor unit tests. - 🧪 Run
lerna run test:e2efor end-to-end tests. - 🧪 Run
lerna run testto run all tests.
Docker
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
First-time Contributor?
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!
Reporting a bug?
- 🗒️ Create a new issue! Select the type of issue that best fits, and please fill out as much of the information as you can.
Contribution process
- Make sure you're familiar with our contribution guidelines (this document)!
- Create your own fork of this repository.
- Make your changes in your local fork.
- If you've made a code change, make sure to lint and test your changes (
yarn lintandyarn 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.
Lodestar Monorepo
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.
Style Guide
- Pull requests should usually only update a single package (in our monorepo) at a time
- prefix your PR title with the module you are working on, e.g.:
validator: foo bar buz
- prefix your PR title with the module you are working on, e.g.:
- Many module class constructors have the following signature:
(options, dependencies)- e.g.:
public constructor(opts: IExampleOptions, {db, logger}: IExampleModules)
- e.g.:
- 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 lintfrom 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- e.g.:
IMyInterface
- e.g.:
- You shouldn't be using TypeScript's
any - Private class properties should not be prefixed with a
_- e.g.:
private dirty;, notprivate _dirty;
- e.g.:
- 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-typesfrom the command line
- Make sure that the tests are still passing:
- run
yarn test:unitfrom the command line
- run
Community
Come chat with us on Discord and join our public weekly planning meetings!