Skip to content

Commit

Permalink
Refactor and improve local development doc
Browse files Browse the repository at this point in the history
  • Loading branch information
ermyas committed Jan 2, 2024
1 parent 88e2e37 commit 1767efb
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 44 deletions.
4 changes: 3 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ If you want to contribute code or documentation to the project, please follow th
1. Code review
1. All code changes will be reviewed by the project maintainers. The maintainers may ask for additional changes, and once the changes have been approved, they will be merged into the main branch.

All code changes must be thoroughly tested. Please ensure that your tests cover all new functionality and edge cases.
**Testing**: All code changes must be thoroughly tested. Please ensure that your tests cover all new functionality and edge cases. Use the [forge coverage tool](https://book.getfoundry.sh/reference/forge/forge-coverage) to ensure that changes have adequate code coverage.

**License**: By contributing to the project, you agree that your contributions will be licensed under the project's [LICENSE](https://github.com/MultiMessageAggregation/multibridge/blob/main/LICENSE).
31 changes: 31 additions & 0 deletions DEVELOP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Local Development
**Pre-requisites:**
- Install the [Foundry](https://github.com/foundry-rs/foundry) toolkit.
- Clone repository:
```sh
$ git clone https://github.com/MultiMessageAggregation/multibridge
```
**Step 1:** Install required forge submodules

```sh
$ forge install
```

**Step 2:** Build the project

```sh
$ forge build
```

**Step 3:** Run Tests

To run the tests, you will need a local fork of Ethereum, Polygon, and BSC mainnet states. To accomplish this, you must specify RPC endpoints for each of these networks. You can obtain RPC endpoints to use for Ethereum and Polygon, from Alchemy, Infura, or other infrastructure providers. For BSC, you can choose from a list of public RPC endpoints available [here](https://docs.bscscan.com/misc-tools-and-utilities/public-rpc-nodes).

To set the RPC endpoints, make a copy of the `.env.sample` file and name it `.env`. The file contains a list of parameter names (e.g. `ETH_FORK_URL`) that correspond to each network. Set the respective values of each of these parameters to the RPC endpoints you wish to use.

Once you have set these values, you can run both the unit and integration tests using the following command:

```sh
$ forge test
```
**note:** We use [pigeon](https://github.com/exp-table/pigeon/tree/docs) to simulate the cross-chain behavior on forked mainnets.
47 changes: 4 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,46 +50,6 @@ The Uniswap DAO wants to send a governance action message to a remote chain for

![Illustration of ](https://314948482-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyWOfgotvwuIBhzylK0ud%2Fuploads%2FYrd16Z8BdyejNqvCF5eO%2FScreenshot%202023-09-25%20at%207.57.32%20pm.png?alt=media&token=eb3ef911-1f44-4657-b234-8acbd55ddf1c)


## Local Development
**Pre-requisites:**
- Install the [Foundry](https://github.com/foundry-rs/foundry) toolkit.

**Step 1:** Clone the repository

```sh
$ git clone https://github.com/MultiMessageAggregation/multibridge
```

**note:** Please make sure [foundry](https://github.com/foundry-rs/foundry) is installed to proceed further.

**Step 2:** Install required forge submodules

```sh
$ forge install
```

**Step 3:** Compile

```sh
$ forge build
```

**Step 4:** Run Tests

To run the tests, you will need a local fork of Ethereum, Polygon, and BSC mainnet states. To accomplish this, you must specify RPC endpoints for each of these networks. You can obtain RPC endpoints to use for Ethereum and Polygon, from Alchemy, Infura, or other infrastructure providers. For BSC, you can choose from a list of public RPC endpoints available [here](https://docs.bscscan.com/misc-tools-and-utilities/public-rpc-nodes).

To set the RPC endpoints, make a copy of the `.env.sample` file and name it `.env`. The file contains a list of parameter names (e.g. `ETH_FORK_URL`) that correspond to each network. Set the respective values of each of these parameters to the RPC endpoints you wish to use.

Once you have set these values, you can run both the unit and integration tests using the following command:

```sh

```sh
$ forge test
```
**note:** We use [pigeon](https://github.com/exp-table/pigeon/tree/docs) to simulate the cross-chain behavior on forked mainnets.

## Contracts
```
src
Expand Down Expand Up @@ -136,8 +96,9 @@ src
└── Types.sol
```

## License
By contributing to the project, you agree that your contributions will be licensed under the project's [LICENSE](https://github.com/MultiMessageAggregation/multibridge/blob/main/LICENSE).

## Development
Refer to the [Development Guide](./DEVELOP.md) for instructions on how to set up a development environment and run tests.

## Contributing
Thank you for your interest in contributing to MMA! We welcome all contributions that improve our project. Please refer to our [Contributing Guidelines](./CONTRIBUTING.md) for more information.
Thank you for your interest in contributing to MMA! Please refer to our [Contributing Guidelines](./CONTRIBUTING.md) for more information. By contributing to the project, you agree that your contributions will be licensed under the project's [LICENSE](./LICENSE).

0 comments on commit 1767efb

Please sign in to comment.