Skip to content
Open
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
52 changes: 38 additions & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,52 @@
# Contributing to Rustchain

[![Bounties](https://img.shields.io/github/issues/Scottcjn/rustchain-bounties/bounty?label=open%20bounties&color=brightgreen)](https://github.com/Scottcjn/rustchain-bounties/issues?q=is%3Aissue+is%3Aopen+label%3Abounty)
[![RTC Pool](https://img.shields.io/badge/RTC%20Pool-5%2C900%2B%20RTC-gold)](https://github.com/Scottcjn/rustchain-bounties/issues?q=is%3Aissue+is%3Aopen+label%3Abounty)

Thank you for your interest in contributing to Rustchain! Every contribution helps build a stronger Proof-of-Antiquity blockchain ecosystem.

**All contributions earn RTC tokens** — browse [open bounties](https://github.com/Scottcjn/rustchain-bounties/issues?q=is%3Aissue+is%3Aopen+label%3Abounty) to find paid tasks.

## 🚀 Quick Start

1. **Fork** the repository
2. **Clone** your fork locally
3. **Create a branch** for your changes (`git checkout -b feature/my-contribution`)
4. **Make your changes** and test them
5. **Commit** with a clear message
6. **Push** to your fork and open a **Pull Request**
1. **Browse bounties**: Check [open bounties](https://github.com/Scottcjn/rustchain-bounties/issues?q=is%3Aissue+is%3Aopen+label%3Abounty) for paid tasks
2. **Claim**: Comment "I would like to work on this" on an issue
3. **Fork** the repository
4. **Clone** your fork locally
5. **Create a branch** for your changes (`git checkout -b feature/my-contribution`)
6. **Make your changes** and test them
7. **Commit** with a clear message
8. **Push** to your fork and open a **Pull Request**
9. **Get paid**: RTC tokens sent after merge!

### 💬 Need Help?

- **Discord**: [Join our server](https://discord.gg/VqVVS2CW9Q) for real-time help
- **GitHub Issues**: Ask questions on the bounty issue
- **First time?** Comment on any bounty and we'll help you set up an RTC wallet

## 💰 Earning RTC Tokens

All merged contributions earn RTC tokens! See the bounty tiers:
All merged contributions earn RTC tokens! **Reference rate: 1 RTC = $0.10 USD**

### Bounty Tiers

| Tier | Reward (RTC) | USD Value | Examples |
| ---- | ------ | ------ | -------- |
| Micro | 1-10 RTC | $0.10-$1.00 | Typo fix, small docs, simple test, star bounty |
| Standard | 10-50 RTC | $1-$5 | Feature, refactor, new endpoint, tutorial |
| Major | 50-200 RTC | $5-$20 | Security fix, consensus improvement, integration |
| Critical | 200-500 RTC | $20-$50 | Vulnerability patch, protocol upgrade, red team |

### How to Claim Bounties

| Tier | Reward | Examples |
| ---- | ------ | -------- |
| Micro | 1-10 RTC | Typo fix, small docs, simple test |
| Standard | 20-50 RTC | Feature, refactor, new endpoint |
| Major | 75-100 RTC | Security fix, consensus improvement |
| Critical | 100-150 RTC | Vulnerability patch, protocol upgrade |
1. Find an [open bounty](https://github.com/Scottcjn/rustchain-bounties/issues?q=is%3Aissue+is%3Aopen+label%3Abounty)
2. Comment: **"I would like to work on this"**
3. Complete the work per acceptance criteria
4. Submit PR or proof links
5. Receive RTC after verification

Browse [open bounties](https://github.com/Scottcjn/rustchain-bounties/issues) to find tasks with specific RTC rewards.
**Wallet setup**: RTC wallets are simple string names (e.g., `my-cool-wallet`). First-time contributors: comment on any bounty and we'll help you get started!

## 📋 Types of Contributions

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

[![Total Paid](https://img.shields.io/badge/Total%20Paid-22%2C756%20RTC-gold)](BOUNTY_LEDGER.md)

[Browse All Bounties](https://github.com/Scottcjn/rustchain-bounties/issues?q=is%3Aissue+is%3Aopen+label%3Abounty) · [Easy Bounties](https://github.com/Scottcjn/rustchain-bounties/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) · [Red Team](https://github.com/Scottcjn/rustchain-bounties/issues?q=is%3Aissue+is%3Aopen+label%3Ared-team) · [Payout Ledger](BOUNTY_LEDGER.md) · [What is RustChain?](https://github.com/Scottcjn/RustChain)
[Browse All Bounties](https://github.com/Scottcjn/rustchain-bounties/issues?q=is%3Aissue+is%3Aopen+label%3Abounty) · [Easy Bounties](https://github.com/Scottcjn/rustchain-bounties/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) · [Red Team](https://github.com/Scottcjn/rustchain-bounties/issues?q=is%3Aissue+is%3Aopen+label%3Ared-team) · [Payout Ledger](BOUNTY_LEDGER.md) · [Contributing Guide](CONTRIBUTING.md) · [What is RustChain?](https://github.com/Scottcjn/RustChain)

</div>

Expand Down Expand Up @@ -76,6 +76,7 @@ Once verified, RTC is sent to your wallet. First time? We will help you set one
| **RustChain** | [github.com/Scottcjn/RustChain](https://github.com/Scottcjn/RustChain) |
| **Block Explorer** | [50.28.86.131/explorer](https://50.28.86.131/explorer) |
| **Traction Report** | [Q1 2026 Developer Traction](https://github.com/Scottcjn/RustChain/blob/main/docs/DEVELOPER_TRACTION_Q1_2026.md) |
| **Contributing Guide** | [CONTRIBUTING.md](CONTRIBUTING.md) |
| **Discord** | [discord.gg/VqVVS2CW9Q](https://discord.gg/VqVVS2CW9Q) |
| **Wallet Setup** | Comment on any bounty and we will help |

Expand Down
251 changes: 251 additions & 0 deletions docs/POSTMAN_COLLECTION_GUIDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,251 @@
# RustChain Postman Collection Guide

## Overview

This Postman Collection provides a complete set of API requests for testing and interacting with the RustChain blockchain platform. The collection is generated from the official OpenAPI 3.0 specification and includes pre-configured tests, environment variables, and authentication setup.

## Installation

### Step 1: Import the Collection

1. Open Postman
2. Click **Import** (top left)
3. Select `RustChain_Postman_Collection.json`
4. Click **Import**

### Step 2: Configure Environment Variables

The collection uses the following variables:

| Variable | Default Value | Description |
|----------|--------------|-------------|
| `base_url` | `https://api.rustchain.org/v1` | Production API endpoint |
| `testnet_url` | `https://testnet-api.rustchain.org/v1` | Testnet API endpoint |
| `api_key` | (empty) | Your API key for authenticated requests |
| `wallet_address` | (empty) | Wallet address for balance/transaction queries |
| `block_number` | `1` | Block number for block queries |
| `limit` | `20` | Pagination limit for list endpoints |
| `offset` | `0` | Pagination offset for list endpoints |

### Step 3: Set Up Authentication

The collection supports two authentication methods:

#### API Key Authentication (Default)
- Header: `X-API-Key: {{api_key}}`
- Set your API key in the `api_key` environment variable

#### Bearer Token Authentication
- Header: `Authorization: Bearer <JWT_TOKEN>`
- Replace the auth type in specific requests as needed

## Collection Structure

### 📁 System
System health and status endpoints.

- **Health Check** - Verify node health and version
- Method: `GET /health`
- Response: Status, version, timestamp

### 📁 Blockchain
Blockchain data endpoints.

- **Get Current Epoch** - Retrieve current epoch information
- Method: `GET /epoch`
- Response: Epoch number, block height, timestamp

- **Get Block by Number** - Fetch specific block details
- Method: `GET /block/{block_number}`
- Parameters: `block_number` (path)
- Response: Block hash, transactions, miner info

### 📁 Mining
Mining-related endpoints.

- **List Miners** - Get active miners on the network
- Method: `GET /api/miners`
- Parameters: `limit`, `offset` (query)
- Response: Array of miners with address, hashrate, blocks mined

### 📁 Wallet
Wallet and transaction endpoints.

- **Get Wallet Balance** - Check wallet balance
- Method: `GET /wallet/balance`
- Parameters: `address` (query, required)
- Response: Balance in RTC and wei

- **List Transactions** - Get transaction history
- Method: `GET /transactions`
- Parameters: `address` (required), `limit` (query)
- Response: Array of transactions with hash, from, to, value, timestamp

### 📁 Attestation
Attestation-related endpoints.

- **Submit Attestation** - Submit new attestation to network
- Method: `POST /attest/submit`
- Body: JSON with `data` and `signature`
- Response: Transaction hash and status

## Usage Examples

### Example 1: Check Node Health

```bash
curl -X GET "https://api.rustchain.org/v1/health"
```

Expected Response:
```json
{
"status": "healthy",
"version": "1.0.0",
"timestamp": 1640000000
}
```

### Example 2: Get Wallet Balance

1. Set `wallet_address` variable to your wallet address
2. Send request to **Get Wallet Balance**
3. View balance in RTC and wei

### Example 3: Submit Attestation

1. Prepare your attestation data and signature
2. Update the request body with your data:
```json
{
"data": {
"type": "your_attestation_type",
"payload": "your_payload"
},
"signature": "0x_your_signature"
}
```
3. Send POST request
4. Receive transaction hash

## Automated Tests

Each request includes built-in test scripts that validate:
- ✅ HTTP status code (200)
- ✅ Required response fields exist
- ✅ Data type correctness
- ✅ Expected value ranges

### Running Tests

1. Select the collection or folder
2. Click **Runner** (bottom left)
3. Configure iterations and delay
4. Click **Run**

### Test Results

Tests will show:
- ✅ Passed tests (green)
- ❌ Failed tests (red)
- ⏱️ Response times
- 📊 Response sizes

## Environment Switching

### Production
```json
{
"base_url": "https://api.rustchain.org/v1"
}
```

### Testnet
```json
{
"base_url": "https://testnet-api.rustchain.org/v1"
}
```

To switch environments:
1. Click environment selector (top right)
2. Choose **Production** or **Testnet**
3. Variables update automatically

## Troubleshooting

### Issue: 401 Unauthorized
**Solution:** Set your API key in the `api_key` variable

### Issue: 404 Not Found
**Solution:**
- Verify `base_url` is correct
- Check that the endpoint path matches the API version

### Issue: 400 Bad Request
**Solution:**
- Verify required parameters are set
- Check request body JSON syntax
- Ensure wallet addresses are valid format

### Issue: Tests Failing
**Solution:**
- Check response structure matches expected schema
- Verify API endpoint is returning valid JSON
- Review test script for custom validation logic

## Advanced Usage

### Collection Variables

Use collection variables for dynamic values:
```javascript
// In pre-request script
pm.collectionVariables.set("last_block", pm.response.json().number);
```

### Chaining Requests

Use response data in subsequent requests:
```javascript
// In test script
var jsonData = pm.response.json();
pm.collectionVariables.set("tx_hash", jsonData.tx_hash);
```

### Custom Test Scripts

Add custom validations in the **Tests** tab:
```javascript
pm.test("Balance is positive", function () {
var jsonData = pm.response.json();
pm.expect(parseFloat(jsonData.balance)).to.be.above(0);
});
```

## API Reference

For complete API documentation, see:
- [OpenAPI Specification](./openapi.yaml)
- [API Reference](./API_REFERENCE.md)

## Support

- **Issues:** https://github.com/Scottcjn/rustchain-bounties/issues
- **Documentation:** https://rustchain.org/docs
- **Community:** Discord/Telegram channels

## Version History

| Version | Date | Changes |
|---------|------|---------|
| 1.0.0 | 2026-03-13 | Initial release from OpenAPI 3.0 spec |

## License

MIT License - See [LICENSE](../LICENSE) for details.

---

**Generated from OpenAPI 3.0 Specification**
**Compatible with Postman v8.0+**
Loading