Skip to content

Commit 61b2278

Browse files
authored
Merge branch 'main' into 907
2 parents 79407f8 + 3e27b8c commit 61b2278

File tree

180 files changed

+14114
-5944
lines changed

Some content is hidden

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

180 files changed

+14114
-5944
lines changed

.cursorrules

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
when using cursor rules, show two emojis that are related to the task at hand also give a confidence score 1-100
12
{
23
"urlModules": {
34
"website/urls.py": "blt/urls.py"
@@ -7,3 +8,11 @@
78
use tailwind only
89
for anything with color, make it the red color we use which is #e74c3c
910

11+
always use poetry and not pip
12+
if you don't fix somethign on the first try, add debugging to the code and try again
13+
14+
if you are unsure of something, ask the user for clarification
15+
16+
if you are not sure about the user's intent, ask the user for clarification
17+
18+
dont include exceptions in error messages but be very detailed in text what the error is - don't do this: messages.error(request, f"Error: {str(e)}")

.github/workflows/ci-cd.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212

1313
env:
1414
FORCE_COLOR: 1
15+
POETRY_CACHE_DIR: ~/.cache/pypoetry
1516

1617
concurrency:
1718
cancel-in-progress: true
@@ -29,7 +30,7 @@ jobs:
2930
- uses: actions/checkout@v4
3031

3132
- name: Cache pre-commit hooks
32-
uses: actions/cache@v3
33+
uses: actions/cache@v4
3334
with:
3435
path: ~/.cache/pre-commit
3536
key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
@@ -46,11 +47,15 @@ jobs:
4647
run: echo "POETRY_CACHE_DIR=$(poetry config cache-dir)" >> $GITHUB_ENV
4748

4849
- name: Cache Poetry dependencies
49-
uses: actions/cache@v3
50+
uses: actions/cache@v4
5051
with:
51-
path: ${{ env.POETRY_CACHE_DIR }}
52-
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
52+
path: |
53+
~/.cache/pypoetry
54+
~/.cache/pip
55+
.venv
56+
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}-${{ hashFiles('**/pyproject.toml') }}
5357
restore-keys: |
58+
${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}-
5459
${{ runner.os }}-poetry-
5560
5661
- name: Print memory usage
@@ -131,11 +136,13 @@ jobs:
131136
with:
132137
languages: ${{ steps.set-matrix.outputs.languages }}
133138

134-
- uses: github/codeql-action/autobuild@v2
139+
- uses: github/codeql-action/autobuild@v3
135140
if: ${{ steps.set-matrix.outputs.languages != '' }}
136141

137-
- uses: github/codeql-action/analyze@v2
142+
- uses: github/codeql-action/analyze@v3
138143
if: ${{ steps.set-matrix.outputs.languages != '' }}
144+
with:
145+
category: "/language:${{ matrix.language }}"
139146

140147
- name: Print memory usage
141148
run: free -h
@@ -164,14 +171,12 @@ jobs:
164171
- run: poetry run python manage.py collectstatic --noinput
165172
- name: Run tests
166173
run: poetry run xvfb-run --auto-servernum python manage.py test -v 3 --failfast
167-
- name: Print memory usage
168-
run: free -h
169174

170175
docker-test:
171176
runs-on: ubuntu-latest
172177
steps:
173178
- name: Checkout code
174-
uses: actions/checkout@v3
179+
uses: actions/checkout@v4
175180

176181
- name: Set up Docker
177182
run: |

.github/workflows/enforce-issue-number-in-description.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
name: Validate PR Closing Issues
2-
31
on:
42
pull_request:
53
types:
@@ -16,7 +14,11 @@ permissions:
1614
jobs:
1715
validate_pr_closing_issues:
1816
runs-on: ubuntu-latest
19-
if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]' && github.actor != 'dependabot'
17+
if: >
18+
github.actor != 'dependabot[bot]'
19+
&& github.actor != 'dependabot-preview[bot]'
20+
&& github.actor != 'dependabot'
21+
&& github.actor != github.repository_owner
2022
steps:
2123
- name: Validate PR closing issues with GraphQL
2224
env:
@@ -58,18 +60,13 @@ jobs:
5860
}
5961
}')
6062
61-
# echo "GraphQL Query: $QUERY"
62-
6363
# Make the GraphQL API request
6464
RESPONSE=$(curl -s -X POST \
6565
--location 'https://api.github.com/graphql' \
6666
-H "Authorization: bearer $GITHUB_TOKEN" \
6767
-H "Content-Type: application/json" \
6868
--data "$QUERY")
6969
70-
# echo "GraphQL Response:"
71-
# echo "$RESPONSE"
72-
7370
# Check for errors in the response
7471
ERRORS=$(echo "$RESPONSE" | jq -r '.errors')
7572
if [[ "$ERRORS" != "null" ]]; then
@@ -86,4 +83,4 @@ jobs:
8683
fi
8784
8885
echo "Closing issues found: $CLOSING_ISSUES"
89-
echo "PR description is valid with referenced closing issues."
86+
echo "PR description is valid with referenced closing issues."

.github/workflows/qodo.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
on:
2+
pull_request:
3+
types: [opened, reopened, ready_for_review]
4+
issue_comment:
5+
jobs:
6+
pr_agent_job:
7+
if: ${{ github.event.sender.type != 'Bot' }}
8+
runs-on: ubuntu-latest
9+
permissions:
10+
issues: write
11+
pull-requests: write
12+
contents: write
13+
name: Run pr agent on every pull request, respond to user comments
14+
steps:
15+
- name: PR Agent action step
16+
id: pragent
17+
uses: qodo-ai/pr-agent@main
18+
env:
19+
OPENAI_KEY: ${{ secrets.OPENAI_KEY }}
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.pre-commit-config.yaml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,17 @@ repos:
3232
- id: djlint
3333
args:
3434
- --reformat
35-
- --lint
35+
- --lint
36+
37+
- repo: local
38+
hooks:
39+
- id: django-test
40+
name: Django Tests
41+
entry: bash -c 'if [ -z "$GITHUB_ACTIONS" ]; then poetry run python manage.py test --failfast; fi'
42+
language: system
43+
types: [python]
44+
pass_filenames: false
45+
always_run: true
46+
verbose: true
47+
48+
fail_fast: true

Aptfile

Lines changed: 0 additions & 1 deletion
This file was deleted.

BACON/mainnet-1-ip-131/bitcoin.conf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
server=1
2+
#change the rpcuser and rpcpassword to your own
3+
rpcuser=bitcoin
4+
rpcpassword=bitcoin
5+
blockfilterindex=1
6+
txindex=1
7+
listen=1
8+
rpcallowip=0.0.0.0/0
9+
rpcport=8332
10+
rpcbind=0.0.0.0:8332
11+
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[Unit]
2+
Description=Bitcoin Core Mainnet
3+
After=network.target
4+
5+
[Service]
6+
User=bitcoin
7+
Group=bitcoin
8+
WorkingDirectory=/blockchain/bitcoin/data
9+
Type=simple
10+
ExecStart=/opt/bitcoin/28.1/bin/bitcoind -conf=/blockchain/bitcoin/data/bitcoin.conf
11+
Restart=on-failure
12+
RestartSec=5
13+
MemoryMax=1500M
14+
CPUQuota=75%
15+
16+
[Install]
17+
WantedBy=multi-user.target

BACON/ord-api.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import subprocess
2+
3+
from flask import Flask, jsonify, request
4+
5+
app = Flask(__name__)
6+
7+
ORD_PATH = "/usr/local/bin/ord"
8+
YAML_FILE_PATH = "/blockchain/ord-flask-server/tmp-split.yaml"
9+
10+
11+
@app.route("/send-bacon-tokens", methods=["POST"])
12+
def send_bacon_tokens():
13+
# Extract YAML content from request
14+
yaml_content = request.json.get("yaml_content")
15+
16+
if not yaml_content:
17+
return jsonify({"success": False, "error": "YAML content missing"}), 400
18+
19+
# Write YAML to a temporary file
20+
with open(YAML_FILE_PATH, "w") as file:
21+
file.write(yaml_content)
22+
# change the ip
23+
command = [
24+
"sudo",
25+
ORD_PATH,
26+
"--bitcoin-rpc-username=bitcoin",
27+
"--bitcoin-rpc-password=bitcoin",
28+
"--bitcoin-rpc-url=http://bitcoin-node-ip:18443",
29+
"-r",
30+
"wallet",
31+
"--server-url=http://ord-server-ip:9001",
32+
"--name=ord",
33+
"split",
34+
f"--splits={YAML_FILE_PATH}",
35+
"--fee-rate=1",
36+
]
37+
38+
try:
39+
result = subprocess.run(command, capture_output=True, text=True, check=True)
40+
return jsonify({"success": True, "output": result.stdout})
41+
except subprocess.CalledProcessError as e:
42+
return jsonify({"success": False, "error": e.stderr})
43+
44+
45+
if __name__ == "__main__":
46+
app.run(host="0.0.0.0", port=9002)
File renamed without changes.

0 commit comments

Comments
 (0)