Skip to content

Commit b840888

Browse files
committed
first commit
0 parents  commit b840888

72 files changed

Lines changed: 14398 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.bandit

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[bandit]
2+
# Configuration file for Bandit security scanner
3+
# See: https://bandit.readthedocs.io/en/latest/configuration/index.html
4+
5+
exclude_dirs = ['/tests', '/test', '/.venv', '/venv', '.git']
6+
tests =
7+
skips = B104,B311
8+
9+
# Suppress B104 (hardcoded_bind_all_interfaces)
10+
# 0.0.0.0 is intentional for server services (stratum proxy, dashboard)
11+
# These are server-side network services, not client connections
12+
# Binding to all interfaces is the correct behavior for public-facing services
13+
#
14+
# Suppress B311 (blacklist_random)
15+
# Used only for backoff jitter timing, not cryptographic purposes
16+
# Safe for non-security use cases

.dependabot.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
version: 2
2+
updates:
3+
# Enable version updates for Python dependencies
4+
- package-ecosystem: "pip"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
day: "monday"
9+
time: "03:00"
10+
open-pull-requests-limit: 5
11+
reviewers:
12+
- "cdonnachie"
13+
labels:
14+
- "dependencies"
15+
- "security"
16+
commit-message:
17+
prefix: "chore(deps):"
18+
include: "scope"
19+
pull-request-branch-name:
20+
separator: "/"
21+
22+
# Enable version updates for Docker images
23+
- package-ecosystem: "docker"
24+
directory: "/"
25+
schedule:
26+
interval: "weekly"
27+
day: "monday"
28+
time: "03:00"
29+
open-pull-requests-limit: 3
30+
reviewers:
31+
- "cdonnachie"
32+
labels:
33+
- "dependencies"
34+
- "docker"
35+
commit-message:
36+
prefix: "chore(docker):"
37+
include: "scope"
38+
39+
# Enable version updates for GitHub Actions
40+
- package-ecosystem: "github-actions"
41+
directory: "/"
42+
schedule:
43+
interval: "weekly"
44+
day: "monday"
45+
time: "03:30"
46+
open-pull-requests-limit: 5
47+
reviewers:
48+
- "cdonnachie"
49+
labels:
50+
- "dependencies"
51+
- "github-actions"
52+
commit-message:
53+
prefix: "chore(ci):"
54+
include: "scope"

.dockerignore

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Docker and build files
2+
docker-compose.yml
3+
docker-compose.override.yml
4+
.dockerignore
5+
6+
# Don't ignore Dockerfiles and binaries - they're needed for builds
7+
!Dockerfile*
8+
!binaries/
9+
10+
# Environment files
11+
.env
12+
.env.local
13+
.env.production
14+
15+
# Python
16+
__pycache__/
17+
*.py[cod]
18+
*$py.class
19+
*.so
20+
.Python
21+
build/
22+
develop-eggs/
23+
dist/
24+
downloads/
25+
eggs/
26+
.eggs/
27+
lib/
28+
lib64/
29+
parts/
30+
sdist/
31+
var/
32+
wheels/
33+
*.egg-info/
34+
.installed.cfg
35+
*.egg
36+
37+
# Logs and history
38+
*.log
39+
submit_history/
40+
logs/
41+
42+
# IDE
43+
.vscode/
44+
.idea/
45+
*.swp
46+
*.swo
47+
48+
# OS
49+
.DS_Store
50+
Thumbs.db
51+
52+
# Blockchain data
53+
avian-data/
54+
55+
# Backup files
56+
*.bak
57+
*.backup
58+
*.old

.env.example

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# ============================================================================
2+
# Avian Stratum Proxy - Dual Algorithm Configuration
3+
# ============================================================================
4+
# Supports both X16RT (GPU) and MinotaurX (CPU) algorithms running simultaneously
5+
# Copy this file: cp .env.example .env (or copy .env.example .env on Windows)
6+
# ============================================================================
7+
8+
# Avian Configuration
9+
AVN_RPC_USER=avian_user
10+
AVN_RPC_PASS=change_this_secure_password
11+
AVN_RPC_PORT=7896
12+
AVN_P2P_PORT=7895
13+
14+
# Avian Build Configuration (Docker only)
15+
AVIAN_VERSION=master
16+
17+
# Network Selection (mainnet or testnet)
18+
# Data is stored separately per network, so you can switch without losing sync
19+
NETWORK=mainnet
20+
TESTNET=false
21+
22+
# Stratum Proxy Configuration - Dual Ports
23+
STRATUM_PORT_X16RT=54321 # GPU mining (X16RT)
24+
STRATUM_PORT_MINOTAURX=54322 # CPU mining (MinotaurX)
25+
PROXY_SIGNATURE=/avian-stratum-proxy/
26+
27+
# === Static Share Difficulty (when VarDiff is disabled) ===
28+
# GPU (X16RT) recommended: 1.0
29+
# CPU (MinotaurX) recommended: 0.001
30+
STATIC_SHARE_DIFFICULTY_X16RT=1.0
31+
STATIC_SHARE_DIFFICULTY_MINOTAURX=0.001
32+
33+
# === Variable Difficulty (VarDiff) Settings ===
34+
# RECOMMENDED - auto-adjusts to your hashrate
35+
ENABLE_VARDIFF=true
36+
37+
# Target 15 seconds between shares
38+
VARDIFF_TARGET_SHARE_TIME=15.0
39+
40+
# GPU (X16RT) difficulty bounds
41+
VARDIFF_MIN_DIFFICULTY=0.1 # Low floor for slower GPUs
42+
VARDIFF_MAX_DIFFICULTY=1000000.0 # For large GPU farms
43+
VARDIFF_START_DIFFICULTY=1.0 # Start moderate, adjust quickly
44+
45+
# CPU (MinotaurX) difficulty bounds
46+
VARDIFF_MIN_DIFFICULTY_CPU=0.0001 # Very low for CPUs
47+
VARDIFF_MAX_DIFFICULTY_CPU=10.0 # CPUs are much slower
48+
VARDIFF_START_DIFFICULTY_CPU=0.001 # Starting point for CPUs
49+
50+
# Responsive retargeting
51+
VARDIFF_RETARGET_SHARES=20
52+
VARDIFF_RETARGET_TIME=300.0
53+
54+
# Step size clamps
55+
VARDIFF_UP_STEP=2.0
56+
VARDIFF_DOWN_STEP=0.5
57+
58+
# EMA smoothing
59+
VARDIFF_EMA_ALPHA=0.3
60+
61+
# Inactivity handling
62+
VARDIFF_INACTIVITY_LOWER=90.0
63+
VARDIFF_INACTIVITY_MULTIPLES=6.0
64+
VARDIFF_INACTIVITY_DROP_FACTOR=0.5
65+
66+
# Persistence - separate state files per algorithm
67+
VARDIFF_STATE_PATH_X16RT=data/vardiff_state_x16rt.json
68+
VARDIFF_STATE_PATH_MINOTAURX=data/vardiff_state_minotaurx.json
69+
VARDIFF_WARM_START_MINUTES=60
70+
VARDIFF_CHAIN_HEADROOM=0.9
71+
72+
# ZMQ Configuration
73+
ENABLE_ZMQ=true
74+
AVN_ZMQ_ENDPOINT=tcp://avian:28332
75+
AVN_ZMQ_PORT=28332
76+
77+
# Logging (INFO recommended for production, DEBUG for troubleshooting)
78+
LOG_LEVEL=INFO
79+
SHOW_JOBS=false
80+
81+
# Web Dashboard (optional)
82+
ENABLE_DASHBOARD=true
83+
DASHBOARD_PORT=8080
84+
85+
# Database (optional - for statistics tracking)
86+
ENABLE_DATABASE=true
87+
88+
# Notifications (uncomment and configure to receive block alerts)
89+
#DISCORD_WEBHOOK_URL=
90+
#TELEGRAM_BOT_TOKEN=
91+
#TELEGRAM_CHAT_ID=
92+
93+
94+
# Web Dashboard
95+
ENABLE_DASHBOARD=true
96+
DASHBOARD_PORT=8080
97+
ENABLE_DATABASE=true

.github/CODE_OF_CONDUCT.md

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, religion, or sexual identity
10+
and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
- Demonstrating empathy and kindness toward other people
21+
- Being respectful of differing opinions, viewpoints, and experiences
22+
- Giving and gracefully accepting constructive feedback
23+
- Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
- Focusing on what is best not just for us as individuals, but for the
26+
overall community
27+
28+
Examples of unacceptable behavior include:
29+
30+
- The use of sexualized language or imagery, and sexual attention or
31+
advances of any kind
32+
- Trolling, insulting or derogatory comments, and personal or political attacks
33+
- Public or private harassment
34+
- Publishing others' private information, such as a physical or email
35+
address, without their explicit permission
36+
- Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards of
42+
acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
45+
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
50+
51+
## Scope
52+
53+
This Code of Conduct applies within all community spaces, and also applies when
54+
an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official e-mail address,
56+
posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement at
63+
[@cdonnachie](https://github.com/cdonnachie).
64+
All complaints will be reviewed and investigated promptly and fairly.
65+
66+
All community leaders are obligated to respect the privacy and security of the
67+
reporter of any incident.
68+
69+
## Enforcement Guidelines
70+
71+
Community leaders will follow these Community Impact Guidelines in determining
72+
the consequences for any action they deem in violation of this Code of Conduct:
73+
74+
### 1. Correction
75+
76+
**Community Impact**: Use of inappropriate language or other behavior deemed
77+
unprofessional or unwelcome in the community.
78+
79+
**Consequence**: A private, written warning from community leaders, providing
80+
clarity around the nature of the violation and an explanation of why the
81+
behavior was inappropriate. A public apology may be requested.
82+
83+
### 2. Warning
84+
85+
**Community Impact**: A violation through a single incident or series
86+
of actions.
87+
88+
**Consequence**: A warning with consequences for continued behavior. No
89+
interaction with the people involved, including unsolicited interaction with
90+
those enforcing the Code of Conduct, for a specified period of time. This
91+
includes avoiding interactions in community spaces as well as external channels
92+
like social media. Violating these terms may lead to a temporary or
93+
permanent ban.
94+
95+
### 3. Temporary Ban
96+
97+
**Community Impact**: A serious violation of community standards, including
98+
sustained inappropriate behavior.
99+
100+
**Consequence**: A temporary ban from any sort of interaction or public
101+
communication with the community for a specified period of time. No public or
102+
private interaction with the people involved, including unsolicited interaction
103+
with those enforcing the Code of Conduct, is allowed during this period.
104+
Violating these terms may lead to a permanent ban.
105+
106+
### 4. Permanent Ban
107+
108+
**Community Impact**: Demonstrating a pattern of violation of community
109+
standards, including sustained inappropriate behavior, harassment of an
110+
individual, or aggression toward or disparagement of classes of individuals.
111+
112+
**Consequence**: A permanent ban from any sort of public interaction within
113+
the community.
114+
115+
## Attribution
116+
117+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118+
version 2.0, available at
119+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120+
121+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
122+
enforcement ladder](https://github.com/mozilla/diversity).
123+
124+
[homepage]: https://www.contributor-covenant.org
125+
126+
For answers to common questions about this code of conduct, see the FAQ at
127+
https://www.contributor-covenant.org/faq. Translations are available at
128+
https://www.contributor-covenant.org/translations.

0 commit comments

Comments
 (0)