-
Install prerequisites:
- Rust toolchain (stable)
wasm32-unknown-unknown
target:rustup target add wasm32-unknown-unknown
- Bitcoin Core (for testing)
-
Clone and build:
git clone https://github.com/sandshrewmetaprotocols/metashrew cd metashrew cargo build
runtime/
: Core WASM runtime and database interfacememshrew/
: Mempool tracking servicerockshrew/
: Main indexer binaryrockshrew-runtime/
: Indexer-specific runtime extensionsrockshrew-view/
: View function handlerrockshrew-mono/
: Combined indexer and view server
-
Create a feature branch:
git checkout -b feature-name
-
Make your changes, ensuring:
- Tests are added for new functionality
- Documentation is updated if needed
- Code follows existing style (run
cargo fmt
) - No new clippy warnings:
cargo clippy
-
Test your changes:
cargo test --all
-
Commit with clear messages:
component: brief change description Longer explanation if needed
- Ensure all tests pass and code is formatted
- Update relevant documentation
- Create PR with clear description of changes
- Address review feedback
- Maintain clean commit history (rebase if needed)
- Follow rustfmt defaults
- Use meaningful variable names
- Add comments for complex logic
- Keep functions focused and reasonably sized
- Prefer standard library solutions where possible
- Unit tests go alongside the code in the same file
- Integration tests go in
tests/
directories - Test both success and error cases
- Mock external services where appropriate
Feel free to:
- Open an issue for discussion
- Ask in existing relevant issues
- Contact maintainers directly
By contributing, you agree that your contributions will be licensed under the project's license.