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
- To run spec tests, you will need git lfs installed, then execute
git submodule foreach git lfs pull
to download the spec tests submodule- NOTE: The spec tests submodule is HUGE, uses ~5GB
- 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
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!