Skip to content

Commit 05d73e4

Browse files
committed
docs: reorganize project structure and simplify README
- Simplify and restructure README for better readability - Reduced from 164 to 113 lines - Added Quick Start section with installation and run commands - Added clear Project Structure visualization - Simplified VRF Parameters and API Endpoints sections - Add standard open-source documentation files - Create LICENSE file (MIT License) - Add CONTRIBUTING.md with contribution guidelines - Add CODE_OF_CONDUCT.md (Contributor Covenant v2.1) - Add SECURITY.md with security policy and best practices - Organize all docs in docs/ folder - Add .gitignore for Go projects - Exclude build artifacts, IDE files, and sensitive data - Protect account/keyring files from accidental commits - Update project structure - Move documentation files to docs/ directory - Keep all code files and folder names unchanged - Maintain backward compatibility
1 parent b200024 commit 05d73e4

File tree

6 files changed

+573
-33
lines changed

6 files changed

+573
-33
lines changed

.gitignore

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Binaries for programs and plugins
2+
*.exe
3+
*.exe~
4+
*.dll
5+
*.so
6+
*.dylib
7+
8+
# Test binary, built with `go test -c`
9+
*.test
10+
11+
# Output of the go coverage tool
12+
*.out
13+
14+
# Dependency directories
15+
vendor/
16+
17+
# Go workspace file
18+
go.work
19+
20+
# IDE and editor files
21+
.idea/
22+
.vscode/
23+
*.swp
24+
*.swo
25+
*~
26+
.DS_Store
27+
28+
# Account and keyring files (sensitive)
29+
accounts/
30+
*.info
31+
*.address
32+
*.key
33+
34+
# Environment variables
35+
.env
36+
.env.local
37+
.env.*.local
38+
39+
# Build artifacts
40+
bin/
41+
dist/
42+
build/
43+
44+
# Logs
45+
*.log
46+
logs/
47+
48+
# Temporary files
49+
tmp/
50+
temp/
51+
*.tmp
52+
53+
# OS files
54+
Thumbs.db
55+
.DS_Store
56+
57+
# Local configuration
58+
config.local.*
59+
*.local
60+

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Aakash
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
22+

README.md

Lines changed: 84 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,113 @@
11
# ⚙️ VRFCall — Client for VRFChain Blockchain
22

3-
**VRFCall** is a lightweight client application designed to **interact with the [VRFChain](https://github.com/aakash4dev/vrfchain)** blockchain.
4-
It enables external systems, scripts, or services to call and manage on-chain VRF operations such as generating and verifying verifiable random numbers.
3+
**VRFCall** is a lightweight client application for interacting with the [VRFChain](https://github.com/aakash4dev/vrfchain) blockchain to generate and verify verifiable random numbers.
54

65
---
76

8-
## 🔗 Purpose
7+
## 🚀 Quick Start
98

10-
* Acts as an **interface** between users or external applications and the VRFChain blockchain.
11-
* Handles communication with the blockchain’s REST/gRPC endpoints.
12-
* Simplifies the process of calling:
9+
### Prerequisites
1310

14-
* `CreateVerifiableRandomNumber`
15-
* `VerifyNumber`
11+
- Go 1.22+
12+
- VRFChain node running (Tendermint RPC: `http://localhost:26657`, REST API: `http://localhost:1317`)
13+
14+
### Installation
15+
16+
```bash
17+
git clone https://github.com/aakash4dev/vrfcall.git
18+
cd vrfcall
19+
go mod download
20+
```
21+
22+
### Run
23+
24+
```bash
25+
go run main.go
26+
```
27+
28+
The application will:
29+
1. Check/create admin account
30+
2. Verify account balance (needs ≥3 tokens)
31+
3. Generate verifiable random number
32+
4. Retrieve and verify the random number
33+
34+
---
35+
36+
## 📁 Project Structure
37+
38+
```
39+
vrfcall/
40+
├── main.go # Application entry point
41+
├── chain/ # Blockchain interaction functions
42+
│ ├── checkBalance.chain.go
43+
│ ├── createAccount.chain.go
44+
│ ├── PostGeneratePsudoRandomNumber.go
45+
│ ├── GetPsudoRandomNumber.go
46+
│ └── GetVerifyRandomNumber.go
47+
├── config/ # Configuration and connection setup
48+
│ └── chain.go
49+
├── accounts/ # Keyring and account data (auto-generated)
50+
└── docs/ # Additional documentation
51+
├── CONTRIBUTING.md
52+
├── CODE_OF_CONDUCT.md
53+
└── SECURITY.md
54+
```
1655

1756
---
1857

19-
## 🧩 Use Case
58+
## 🔌 Configuration
2059

21-
Use **VRFCall** when you want to:
60+
Default connection settings (in `config/chain.go`):
2261

23-
* Connect off-chain systems (like servers or DApps) with your VRF-enabled blockchain.
24-
* Automate random number generation and verification requests.
25-
* Integrate VRF-based randomness into external workflows or applications.
62+
- **Tendermint RPC**: `http://localhost:26657`
63+
- **REST API**: `http://localhost:1317`
64+
- **Address Prefix**: `cosmos`
65+
- **Gas Limit**: `70000000`
66+
67+
To modify, edit `config/chain.go`.
2668

2769
---
2870

29-
## 🧠 Works With
71+
## 📋 VRF Parameters
72+
73+
The client sends `MsgCreateVerifiableRandomNumber` with:
3074

31-
| Component | Description |
32-
| -------------- | --------------------------------------------------------- |
33-
| **VRFChain** | Core blockchain implementing Verifiable Random Functions |
34-
| **VRFCall** | Client layer to send transactions and queries to VRFChain |
35-
| **Ignite CLI** | Used to serve and run the blockchain node |
75+
| Parameter | Description |
76+
| ----------- | ------------------------------------ |
77+
| `Creator` | Sender's blockchain address |
78+
| `Shaseed` | SHA256 hash of seed data (32 bytes) |
79+
| `Publickey` | ECDSA public key (JSON-marshaled) |
80+
| `R`, `S` | ECDSA signature components (64 bytes)|
81+
| `Maxrange` | Maximum range for random number |
82+
83+
**Seed Data** includes: `LatestPod`, `StationID`, `NumberOfPodSubmitters`, `LatestStationBlockNumber`, `LatestStationBlockHash`, `Sender`.
3684

3785
---
3886

39-
## 🏗️ Example Flow (Conceptual)
87+
## 🌐 API Endpoints
4088

41-
```
42-
[App / Script] ─▶ [VRFCall] ─▶ [VRFChain Node]
43-
│ │
44-
│ ├── POST /CreateVerifiableRandomNumber
45-
│ └── GET /VerifyNumber
46-
47-
Receives verified randomness ✅
48-
```
89+
- **POST** `MsgCreateVerifiableRandomNumber` - Generate random number
90+
- **GET** `/aakash4dev/verifiablerandomnumber/vrf/getpsudorandomnumber` - Get random number
91+
- **GET** `/aakash4dev/verifiablerandomnumber/vrf/verify_random_number/{shaSeed}/{maxRange}` - Verify number
4992

5093
---
5194

52-
## 📜 License
95+
## 📚 Documentation
5396

54-
Licensed under the [MIT License](LICENSE).
97+
- [docs/CONTRIBUTING.md](docs/CONTRIBUTING.md) - Contribution guidelines
98+
- [docs/CODE_OF_CONDUCT.md](docs/CODE_OF_CONDUCT.md) - Code of conduct
99+
- [docs/SECURITY.md](docs/SECURITY.md) - Security policy
100+
- [LICENSE](LICENSE) - MIT License
55101

56102
---
57103

58104
## 👨‍💻 Author
59105

60-
**Aakash**
61-
[🌐 aakash4dev.com](https://aakash4dev.com)
62-
[X (Twitter)](https://x.com/aakash4dev)[LinkedIn](https://linkedin.com/in/aakash4dev)
106+
**Aakash**
107+
[🌐 aakash4dev.com](https://aakash4dev.com)[X](https://x.com/aakash4dev)[LinkedIn](https://linkedin.com/in/aakash4dev)
108+
109+
---
110+
111+
## 📜 License
112+
113+
Licensed under the [MIT License](LICENSE).

docs/CODE_OF_CONDUCT.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8+
9+
## Our Standards
10+
11+
### Examples of Behavior that Contributes to a Positive Environment
12+
13+
- ✅ Using welcoming and inclusive language
14+
- ✅ Being respectful of differing viewpoints and experiences
15+
- ✅ Gracefully accepting constructive criticism
16+
- ✅ Focusing on what is best for the community
17+
- ✅ Showing empathy towards other community members
18+
19+
### Examples of Unacceptable Behavior
20+
21+
- ❌ The use of sexualized language or imagery, and sexual attention or advances
22+
- ❌ Trolling, insulting/derogatory comments, and personal or political attacks
23+
- ❌ Public or private harassment
24+
- ❌ Publishing others' private information without explicit permission
25+
- ❌ Other conduct which could reasonably be considered inappropriate in a professional setting
26+
27+
## Enforcement Responsibilities
28+
29+
Project maintainers are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
32+
33+
## Scope
34+
35+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
36+
37+
## Enforcement
38+
39+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the project maintainer responsible for enforcement. All complaints will be reviewed and investigated promptly and fairly.
40+
41+
All project maintainers are obligated to respect the privacy and security of the reporter of any incident.
42+
43+
## Enforcement Guidelines
44+
45+
Project maintainers will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
46+
47+
### 1. Correction
48+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
49+
50+
**Consequence**: A private, written warning from project maintainers, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
51+
52+
### 2. Warning
53+
**Community Impact**: A violation through a single incident or series of actions.
54+
55+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
56+
57+
### 3. Temporary Ban
58+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
59+
60+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
61+
62+
### 4. Permanent Ban
63+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
64+
65+
**Consequence**: A permanent ban from any sort of public interaction within the community.
66+
67+
## Attribution
68+
69+
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.1, available at https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
70+
71+
For answers to common questions about this code of conduct, see https://www.contributor-covenant.org/faq
72+

0 commit comments

Comments
 (0)