Skip to content

Commit a8d9358

Browse files
Update project configuration and dependencies
Add .dockerignore and .github workflows for CI/CD. Update requirements to replace Flask with FastAPI and include .pytest_cache in .gitignore. Create pyproject.toml for Black code formatting configuration.
1 parent e2d4306 commit a8d9358

19 files changed

+695
-193
lines changed

.dockerignore

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Git
2+
.git
3+
.gitignore
4+
.github
5+
6+
# Python
7+
__pycache__/
8+
*.py[cod]
9+
*$py.class
10+
*.so
11+
.Python
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
28+
# Virtual Environment
29+
venv/
30+
ENV/
31+
env/
32+
33+
# IDE
34+
.idea/
35+
.vscode/
36+
*.swp
37+
*.swo
38+
39+
# Testing
40+
.coverage
41+
htmlcov/
42+
.tox/
43+
.pytest_cache/
44+
45+
# Project specific
46+
*.log
47+
data/
48+
wallets/
49+
*.db
50+
.env
51+
.env.*
52+
53+
# Docker
54+
Dockerfile
55+
docker-compose.yml
56+
.docker/

.github/CONTRIBUTING.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# Contributing to RavenChain
2+
3+
First off, thank you for considering contributing to RavenChain! It's people like you that make RavenChain such a great tool.
4+
5+
## Code of Conduct
6+
7+
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code.
8+
9+
## How Can I Contribute?
10+
11+
### Reporting Bugs
12+
13+
Before creating bug reports, please check the issue list as you might find out that you don't need to create one. When you are creating a bug report, please include as many details as possible:
14+
15+
* Use a clear and descriptive title
16+
* Describe the exact steps which reproduce the problem
17+
* Provide specific examples to demonstrate the steps
18+
* Describe the behavior you observed after following the steps
19+
* Explain which behavior you expected to see instead and why
20+
* Include details about your configuration and environment
21+
22+
### Suggesting Enhancements
23+
24+
Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion, please include:
25+
26+
* A clear and descriptive title
27+
* A detailed description of the proposed functionality
28+
* Explain why this enhancement would be useful
29+
* List any additional requirements
30+
31+
### Pull Requests
32+
33+
* Fill in the required template
34+
* Follow the Python style guides
35+
* Include appropriate test cases
36+
* Update documentation as needed
37+
38+
## Development Process
39+
40+
1. Fork the repo
41+
2. Create a new branch (`git checkout -b feature/amazing-feature`)
42+
3. Make your changes
43+
4. Run the tests (`pytest`)
44+
5. Format your code (`black .`)
45+
6. Commit your changes (`git commit -m 'Add some amazing feature'`)
46+
7. Push to the branch (`git push origin feature/amazing-feature`)
47+
8. Open a Pull Request
48+
49+
### Local Development Setup
50+
51+
```bash
52+
# Clone the repository
53+
git clone https://github.com/yourusername/ravenchain.git
54+
cd ravenchain
55+
56+
# Ensure you have Python 3.13+ installed
57+
python --version
58+
59+
# Create a virtual environment
60+
python -m venv venv
61+
source venv/bin/activate # On Windows: venv\Scripts\activate
62+
63+
# Install dependencies
64+
pip install -e ".[dev]"
65+
```
66+
67+
### Testing
68+
69+
```bash
70+
# Run all tests
71+
pytest
72+
73+
# Run specific test file
74+
pytest tests/test_specific.py
75+
76+
# Run with coverage
77+
pytest --cov=ravenchain
78+
```
79+
80+
## Style Guide
81+
82+
This project uses:
83+
* Black for code formatting
84+
* isort for import sorting
85+
* pylint for code quality
86+
87+
## Documentation
88+
89+
* Use docstrings for all public modules, functions, classes, and methods
90+
* Follow Google style for docstrings
91+
* Keep the README.md up to date
92+
93+
## Blockchain-Specific Guidelines
94+
95+
When contributing to RavenChain, please consider:
96+
97+
### Security
98+
* All cryptographic operations must be thoroughly reviewed
99+
* Avoid introducing new dependencies without careful consideration
100+
* Always validate input data
101+
102+
### Performance
103+
* Consider the impact of changes on block validation speed
104+
* Test with realistic blockchain sizes
105+
* Profile code changes that might impact performance
106+
107+
### Consensus
108+
* Changes to consensus rules require extensive discussion
109+
* Backward compatibility must be considered
110+
* Document any changes to the protocol
111+
112+
## Questions?
113+
114+
Feel free to open an issue with your question or contact the maintainers directly.

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
name: Bug Report
3+
about: Create a report to help us improve RavenChain
4+
title: '[BUG] '
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
**Describe the Bug**
10+
A clear and concise description of what the bug is.
11+
12+
**To Reproduce**
13+
Steps to reproduce the behavior:
14+
1. Initialize blockchain with '...'
15+
2. Create transaction '....'
16+
3. Mine block '....'
17+
4. See error
18+
19+
**Expected Behavior**
20+
A clear and concise description of what you expected to happen.
21+
22+
**Error Messages**
23+
If applicable, add the full error traceback or error messages you received.
24+
25+
**Environment:**
26+
- OS: [e.g. Ubuntu 20.04, Windows 11]
27+
- Python Version: [e.g. 3.8.10]
28+
- RavenChain Version: [e.g. 1.0.0]
29+
30+
**Additional Context**
31+
Add any other context about the problem here. For example:
32+
- Network configuration if running in distributed mode
33+
- Block or transaction data that caused the issue
34+
- Node configuration
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
name: Feature Request
3+
about: Suggest an idea for RavenChain
4+
title: '[FEATURE] '
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
**Is your feature request related to a problem? Please describe.**
10+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
11+
12+
**Describe the solution you'd like**
13+
A clear and concise description of what you want to happen. Consider:
14+
- How would this feature be used?
15+
- What components of the blockchain would it affect?
16+
- Are there security implications?
17+
18+
**Describe alternatives you've considered**
19+
A clear and concise description of any alternative solutions or features you've considered.
20+
21+
**Implementation Details (optional)**
22+
If you have thoughts on how this could be implemented:
23+
- Required changes to existing components
24+
- New components needed
25+
- Potential impact on performance/security
26+
- Required protocol changes
27+
28+
**Additional context**
29+
Add any other context or screenshots about the feature request here.

.github/SECURITY.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
Use this section to tell people about which versions of RavenChain are currently being supported with security updates.
6+
7+
| Version | Supported |
8+
| ------- | ------------------ |
9+
| 1.0.x | :white_check_mark: |
10+
| < 1.0 | :x: |
11+
12+
## Reporting a Vulnerability
13+
14+
We take the security of RavenChain seriously. If you believe you have found a security vulnerability, please report it to us as described below.
15+
16+
**Please do not report security vulnerabilities through public GitHub issues.**
17+
18+
Instead, please report them via email to [email protected]. You should receive a response within 48 hours. If for some reason you do not, please follow up via email to ensure we received your original message.
19+
20+
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
21+
22+
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
23+
* Full paths of source file(s) related to the manifestation of the issue
24+
* The location of the affected source code (tag/branch/commit or direct URL)
25+
* Any special configuration required to reproduce the issue
26+
* Step-by-step instructions to reproduce the issue
27+
* Proof-of-concept or exploit code (if possible)
28+
* Impact of the issue, including how an attacker might exploit the issue
29+
30+
This information will help us triage your report more quickly.
31+
32+
## Preferred Languages
33+
We prefer all communications to be in English.
34+
35+
## Security Update Process
36+
1. The security team will acknowledge your email within 48 hours.
37+
2. The team will investigate and update you on the status of the vulnerability.
38+
3. If confirmed, we will work on a fix and determine a disclosure date.
39+
4. Once a fix is ready, we will release a security update.
40+
41+
## Bug Bounty Program
42+
Currently, we do not have a bug bounty program.

.github/pull_request_template.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
## Description
2+
Please include a summary of the changes and which issue is fixed. Also include relevant motivation and context.
3+
4+
Fixes # (issue)
5+
6+
## Type of change
7+
Please delete options that are not relevant.
8+
9+
- [ ] Bug fix (non-breaking change which fixes an issue)
10+
- [ ] New feature (non-breaking change which adds functionality)
11+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
12+
- [ ] Documentation update
13+
- [ ] Performance improvement
14+
15+
## How Has This Been Tested?
16+
Please describe the tests that you ran to verify your changes:
17+
18+
- [ ] Unit Tests
19+
- [ ] Integration Tests
20+
- [ ] Performance Tests (if applicable)
21+
22+
## Checklist:
23+
- [ ] My code follows the style guidelines of this project
24+
- [ ] I have performed a self-review of my own code
25+
- [ ] I have commented my code, particularly in hard-to-understand areas
26+
- [ ] I have made corresponding changes to the documentation
27+
- [ ] My changes generate no new warnings
28+
- [ ] I have added tests that prove my fix is effective or that my feature works
29+
- [ ] New and existing unit tests pass locally with my changes
30+
- [ ] Any dependent changes have been merged and published in downstream modules
31+
32+
## Security Considerations
33+
- [ ] My changes do not introduce any security vulnerabilities
34+
- [ ] I have considered the impact on consensus mechanisms
35+
- [ ] I have reviewed cryptographic implementations (if applicable)

.github/workflows/black.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Black Code Formatting
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v3
17+
with:
18+
python-version: '3.13'
19+
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install black
24+
25+
- name: Check Black formatting
26+
run: |
27+
black --check .

.github/workflows/tests.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Python Tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: [3.11, 3.12, "3.13"]
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v3
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install -e .
28+
pip install pytest
29+
30+
- name: Run tests
31+
run: |
32+
pytest tests/

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ wheels/
1919
*.egg-info/
2020
.installed.cfg
2121
*.egg
22+
.pytest_cache/
2223

2324
# Virtual Environment
2425
venv/

0 commit comments

Comments
 (0)