Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update contributing info #4

Merged
merged 1 commit into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Development

To get started with working on the codebase, use the following steps prepare your local environment:

```bash
# clone the github repo and navigate into the folder
git clone https://github.com/ApeWorX/evmchains.git
cd evmchains

# create and load a virtual environment
python3 -m venv venv
source venv/bin/activate

# install evmchains into the virtual environment
python setup.py install

# install the developer dependencies (-e is interactive mode)
pip install -e .'[dev]'
```

## Pre-Commit Hooks

We use [`pre-commit`](https://pre-commit.com/) hooks to simplify linting and ensure consistent formatting among contributors.
Use of `pre-commit` is not a requirement, but is highly recommended.

Install `pre-commit` locally from the root folder:

```bash
pip install pre-commit
pre-commit install
```

Committing will now automatically run the local hooks and ensure that your commit passes all lint checks.

## Pull Requests

Pull requests are welcomed! Please adhere to the following:

- Ensure your pull request passes our linting checks
- Include test cases for any new functionality
- Include any relevant documentation updates

It's a good idea to make pull requests early on.
A pull request represents the start of a discussion, and doesn't necessarily need to be the final, finished submission.

If you are opening a work-in-progress pull request to verify that it passes CI tests, please consider
[marking it as a draft](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests#draft-pull-requests).

Join the ApeWorX [Discord](https://discord.gg/apeworx) if you have any questions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,13 @@ assert chain.chainId == 1

Please see the [contributing guide](CONTRIBUTING.md) to learn more how to contribute to this project.
Comments, questions, criticisms and pull requests are welcomed.

### Adding Chains

To add a chain to the metadata, please open a pull request with the following changes:

- Update `CHAIN_IDS` in `scripts/update.py` with the chain IDs you want to add
- Run `python scripts/update.py`
- Submit a PR with the updated script and updated `evmchain/chains.py` metdata file

**Do not edit `evmchain/chains.py` manually.** Any manual changes are likely to be overwritten later.
2 changes: 1 addition & 1 deletion scripts/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def fetch_chains() -> Dict[str, Dict[str, Chain]]:

def write_chain_const(chains: Dict[str, Dict[str, Chain]]):
"""Write the file with Python constant"""
file_str = "# This file is auto-generated by scripts/update_rpc.py\n"
file_str = "# This file is auto-generated by scripts/update.py\n"
file_str += f"# {stamp()}\n"
file_str += "# Do not edit this file directly.\n"
file_str += "from typing import Any, Dict\n\n"
Expand Down
Loading