Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
476 commits
Select commit Hold shift + click to select a range
67e7191
Renamed 430
thewhaleking Sep 10, 2025
ae9134b
Merge branch 'devnet-ready' into fix/thewhaleking/correct-symbols-bytes
thewhaleking Sep 10, 2025
f6f3fd5
Bump spec version
thewhaleking Sep 10, 2025
fe056c6
Spec bump
gztensor Sep 10, 2025
2f43928
Spec bump
gztensor Sep 10, 2025
0775ae5
Merge branch 'devnet-ready' into feat/subsubnets
gztensor Sep 10, 2025
bcc1c10
Merge pull request #2017 from opentensor/feat/hyperparams-set-rate-limit
sam0x17 Sep 10, 2025
7d72ece
Merge branch 'devnet-ready' into feat/subsubnets
gztensor Sep 10, 2025
d55e68c
Spec bump
gztensor Sep 10, 2025
02cf4eb
Spec bump
gztensor Sep 10, 2025
7f989fa
Merge branch 'devnet-ready' into fix/immune-uids
gztensor Sep 10, 2025
7e7252f
Merge pull request #1984 from opentensor/feat/subsubnets
sam0x17 Sep 10, 2025
bf3c278
Merge branch 'devnet-ready' into trim_uids
l0r1s Sep 10, 2025
a027ba7
fix rate limit + call_index
l0r1s Sep 10, 2025
b2b9636
refacto to handle subsubnet when trimming uids
l0r1s Sep 10, 2025
20ef94a
fixed tests
l0r1s Sep 10, 2025
a3acec8
improve logic
JohnReedV Sep 10, 2025
16c59e7
set toolchain version
Sep 11, 2025
2670fe8
set prev runner SubtensorCI
Sep 11, 2025
8eb1a1b
add --profile minimal to toolchain install
Sep 11, 2025
6d04f4d
Merge branch 'devnet-ready' into refactor-evm-test
open-junius Sep 11, 2025
c006192
debug
Sep 11, 2025
d77c2b1
refactor the method
open-junius Sep 11, 2025
629cedb
commit Cargo.lock
open-junius Sep 11, 2025
915b002
cargo fix
open-junius Sep 11, 2025
d3b0299
fix type
open-junius Sep 11, 2025
24471de
Merge pull request #2043 from opentensor/feat/roman/localnet-docker-i…
sam0x17 Sep 11, 2025
5789b9e
extend workflow
Sep 11, 2025
70199d9
extend .dockerignore
Sep 11, 2025
fe64109
try to use cache for step `Build and push Docker image`
Sep 11, 2025
3e92151
Merge pull request #2044 from opentensor/feat/roman/gh-workflow-and-d…
sam0x17 Sep 11, 2025
45bf58d
trigger ci
l0r1s Sep 11, 2025
9dd4ad7
Merge pull request #2034 from opentensor/fix/immune-uids
sam0x17 Sep 11, 2025
31fc0f2
added umbrella crate package to workspace
l0r1s Sep 11, 2025
442fa3d
upgrade pallet-proxy
l0r1s Sep 11, 2025
4291357
upgrade pallet-utility
l0r1s Sep 11, 2025
383956c
lower hyperparameter rate limit to 2 tempos
sam0x17 Sep 11, 2025
4fb2b0d
fix missing block provider
l0r1s Sep 11, 2025
d012527
fix issues
l0r1s Sep 11, 2025
59045c9
cargo fmt
l0r1s Sep 11, 2025
6eedf4b
fix linting
l0r1s Sep 11, 2025
44fc6bf
Corrected #99
thewhaleking Sep 11, 2025
4b7731b
fix linting 2
l0r1s Sep 11, 2025
cb07050
fix linting 3
l0r1s Sep 11, 2025
b23a2ac
fix linting 4
l0r1s Sep 11, 2025
8d1dc41
allow setting storage based on tempos
sam0x17 Sep 11, 2025
7d24770
make hyperparameter specific
sam0x17 Sep 11, 2025
e1f7897
emissions fix
0xcacti Sep 12, 2025
4b1ad57
handle panic
0xcacti Sep 12, 2025
943c29c
Sign associate evm key extrinsic by coldkey
ales-otf Sep 12, 2025
949fdcb
trigger ci
l0r1s Sep 12, 2025
59349c3
Symbols <= 128 restored
thewhaleking Sep 12, 2025
0d2dee4
Rename tempos -> epochs
ales-otf Sep 12, 2025
47abea0
Merge branch 'devnet-ready' into fix/weights-mismatch
l0r1s Sep 12, 2025
a3fbfec
move back to safe_div_or
0xcacti Sep 12, 2025
8596025
Merge branch 'devnet-ready' into fix/thewhaleking/correct-symbols-bytes
thewhaleking Sep 12, 2025
bb7d9c3
Bump spec version
thewhaleking Sep 12, 2025
9927560
Merge pull request #2054 from opentensor/feat/coldkey-sign-associate-…
sam0x17 Sep 12, 2025
a602599
Merge branch 'devnet-ready' into trim_uids
l0r1s Sep 12, 2025
12dcb91
fmt
0xcacti Sep 12, 2025
b54ca79
fix get_immune_owner_hotkeys
l0r1s Sep 12, 2025
b0f963b
Refactor TransactionType
ales-otf Sep 12, 2025
cdfccff
Test hyperparams updates rate limited independently
ales-otf Sep 12, 2025
e700fed
Reformat
ales-otf Sep 12, 2025
cc5eedd
Fix admin-utils benchmarks
ales-otf Sep 12, 2025
c368318
Update localnet patch
ales-otf Sep 12, 2025
85eb7ef
Merge pull request #2051 from 0xcacti/emissions-fix
sam0x17 Sep 12, 2025
b654eaf
add migrate_network_lock_reduction_interval
JohnReedV Sep 14, 2025
101785a
Update weights in admin-utils
ales-otf Sep 15, 2025
8fd27c4
Merge branch 'devnet-ready' into dtao-subnet-deregistration
JohnReedV Sep 15, 2025
52b4cef
Make set_admin_freeze_window and set_owner_hparam_rate_limit Pays::Yes
ales-otf Sep 15, 2025
d9fb4d2
fix merge
JohnReedV Sep 15, 2025
b796bb6
auto-update benchmark weights
github-actions[bot] Sep 15, 2025
1ce6b0f
Merge remote-tracking branch 'origin/devnet-ready' into refactor-evm-…
sam0x17 Sep 15, 2025
62c7192
Merge pull request #2055 from opentensor/fix/pallet-admin-benches
sam0x17 Sep 15, 2025
37a2ed0
Merge remote-tracking branch 'origin/devnet-ready' into refactor-evm-…
sam0x17 Sep 15, 2025
084407c
Merge branch 'devnet-ready' into trim_uids
l0r1s Sep 15, 2025
506f9cc
Merge branch 'devnet-ready' into fix/weights-mismatch
l0r1s Sep 15, 2025
2ce716b
MinAllowedUids to 64
l0r1s Sep 15, 2025
f0e3a11
Fix subsubnet rate limiting and add tests
gztensor Sep 15, 2025
69e41a3
Merge pull request #2042 from opentensor/refactor-evm-test
sam0x17 Sep 15, 2025
00d83cb
Merge pull request #2060 from opentensor/fix/subsubnet-rate-limits
sam0x17 Sep 15, 2025
cca14ab
Merge branch 'devnet-ready' into trim_uids
l0r1s Sep 15, 2025
a051137
extract rate limit
l0r1s Sep 15, 2025
ac5d6b3
fix benchmarks
l0r1s Sep 15, 2025
ce11f6b
migrate_restore_subnet_locked
JohnReedV Sep 15, 2025
ef3c344
Merge branch 'devnet-ready' into dtao-subnet-deregistration
JohnReedV Sep 15, 2025
e3e377f
Remove owner hparam to epochs migration
ales-otf Sep 15, 2025
13b23fd
clear new subsubnet maps
JohnReedV Sep 15, 2025
25e7402
Resolve git conflicts
ales-otf Sep 16, 2025
6fd4520
rebase PR
open-junius Sep 16, 2025
d38f34a
bump version
open-junius Sep 16, 2025
a313461
Merge pull request #2048 from opentensor/sam-change-hyperparameter-ra…
l0r1s Sep 16, 2025
746cc61
Merge branch 'devnet-ready' into trim_uids
l0r1s Sep 16, 2025
56c3109
Merge pull request #1936 from opentensor/add-remove-stake
sam0x17 Sep 16, 2025
aa4a23e
fix benchmarks
l0r1s Sep 16, 2025
5da86f1
cargo fmt
l0r1s Sep 16, 2025
5f496dc
Merge branch 'devnet-ready' into fix/weights-mismatch
l0r1s Sep 16, 2025
65d7ef7
Merge branch 'devnet-ready' into feat/recycle-from-burn-uid
camfairchild Sep 16, 2025
92ac0cf
add burn subnet alpha helper and TODOs
camfairchild Sep 16, 2025
0a3be2d
use helpers for recycle/burn in coinbase
camfairchild Sep 16, 2025
261ef5a
auto-update benchmark weights
github-actions[bot] Sep 16, 2025
60834c8
add NetworkRegistrationStartBlock
JohnReedV Sep 16, 2025
66acda6
Merge branch 'devnet-ready' into dtao-subnet-deregistration
JohnReedV Sep 16, 2025
1005c97
clippy
JohnReedV Sep 16, 2025
eb11106
remove unused
JohnReedV Sep 16, 2025
01c90a7
Merge pull request #2037 from opentensor/fix/thewhaleking/correct-sym…
sam0x17 Sep 16, 2025
d7dcbd8
8 day NetworkLockReductionInterval
JohnReedV Sep 16, 2025
b6a5750
clippy
JohnReedV Sep 16, 2025
97efc75
Merge branch 'devnet-ready' into trim_uids
l0r1s Sep 16, 2025
f516593
fix rate limit
l0r1s Sep 16, 2025
d794795
auto-update benchmark weights
github-actions[bot] Sep 17, 2025
4a281de
Merge branch 'devnet-ready' into more-storage-query-test
open-junius Sep 17, 2025
ece47af
Merge pull request #1998 from opentensor/trim_uids
sam0x17 Sep 17, 2025
db6f47e
Merge pull request #2049 from opentensor/fix/weights-mismatch
sam0x17 Sep 17, 2025
ca98071
Merge pull request #1922 from opentensor/more-storage-query-test
sam0x17 Sep 17, 2025
ebdfe22
Merge branch 'devnet-ready' into dtao-subnet-deregistration
JohnReedV Sep 17, 2025
f7fc197
Rename subsubnets to mechanisms
gztensor Sep 17, 2025
7f40539
Set mechanism limit to 2
gztensor Sep 17, 2025
0d421e5
Rename submetagraph to mechagraph in RPC calls
gztensor Sep 17, 2025
ab23480
continue on error
JohnReedV Sep 17, 2025
4ce7b38
clippy
JohnReedV Sep 17, 2025
978c40c
Merge pull request #1685 from opentensor/dtao-subnet-deregistration
sam0x17 Sep 17, 2025
d79c235
fix typos, clpy
camfairchild Sep 17, 2025
c19acee
use helper in burn ext
camfairchild Sep 17, 2025
1d4c5cf
rename burn_tokens -> recycle_tao
camfairchild Sep 17, 2025
9e81d6e
Merge branch 'devnet-ready' into feat/recycle-from-burn-uid
camfairchild Sep 17, 2025
0472cfe
add rate limit and admin utils call
camfairchild Sep 17, 2025
3faf211
Rename subsubnet extrinsics to _mechanism_
gztensor Sep 17, 2025
542964d
fix references
camfairchild Sep 17, 2025
32cd5a4
add decode derive, fixes
camfairchild Sep 17, 2025
0ffb346
remove Ok from setter
camfairchild Sep 17, 2025
c674274
remove return value
camfairchild Sep 17, 2025
95080b9
Merge pull request #2063 from opentensor/fix/subsubnet-rename-to-mech…
sam0x17 Sep 17, 2025
94ae8df
Merge pull request #2064 from opentensor/feat/recycle-from-burn-uid
sam0x17 Sep 17, 2025
ff26cbc
remove migrate_restore_subnet_locked
JohnReedV Sep 17, 2025
8272532
set locked balances for 65-128
JohnReedV Sep 17, 2025
7628080
Merge pull request #2065 from opentensor/dereg-remove-lock-migration
sam0x17 Sep 17, 2025
9945e3d
initial
Sep 18, 2025
de54e3c
add install_build_env.sh and install rust if required
Sep 18, 2025
1f5a3e1
opps sudo
Sep 18, 2025
7a7eda7
changing the runner for a quick test
Sep 18, 2025
f4374d9
sudo
Sep 18, 2025
66e6c7e
sudo for self-hosted runner + install ca-certificates
Sep 18, 2025
e28d777
replace runners
Sep 18, 2025
aed1973
export PATH="$HOME/.cargo/bin:$PATH"
Sep 18, 2025
365dedc
add certificate in the end
Sep 18, 2025
7dd0e05
no so much power
Sep 18, 2025
e3b45cc
type-ccx33
Sep 18, 2025
3efe19a
cax41
Sep 18, 2025
1df420d
diff logic for id: vars
Sep 18, 2025
a287983
equal
Sep 18, 2025
a23a86c
add `Reconstruct target layout` step
Sep 18, 2025
4682d55
cleanup
Sep 18, 2025
f1248a5
add WARNING
Sep 18, 2025
efd2eaa
$GITHUB_ENV -> GITHUB_OUTPUT
Sep 18, 2025
58a6a6b
add build to publish
Sep 18, 2025
3cff711
debug. where is the folder? :D
Sep 18, 2025
de351bf
boom paths refactoring
Sep 18, 2025
916be53
more
Sep 18, 2025
51ba708
use the entire path
Sep 18, 2025
79afca5
missed `build`
Sep 18, 2025
6ca2698
Download path
Sep 18, 2025
5bb5cfb
replace verify order
Sep 18, 2025
d79637c
ubuntu-latest runner for last step
Sep 18, 2025
74d7508
Update dispatches.rs
JohnReedV Sep 18, 2025
4f66cec
bump spec
JohnReedV Sep 18, 2025
babd79e
temporarily disable cache + Verify the binaries was produced
Sep 18, 2025
4520bdf
auto-update benchmark weights
github-actions[bot] Sep 18, 2025
e03cb4f
del path from Download
Sep 18, 2025
9746aa7
path: .
Sep 18, 2025
45cc051
${{ github.workspace }}
Sep 18, 2025
85d1e4e
ops old debug
Sep 18, 2025
37f7b28
Cleanup math: Remove recursion, indexing, assertions, and zipping. Fi…
gztensor Sep 18, 2025
29414e5
Cleanup code comments
gztensor Sep 18, 2025
93cb2da
Add a test for mismatching sizes of LastUpdate vector and Weights mat…
gztensor Sep 18, 2025
d7f0626
debug in docker
Sep 18, 2025
2af0fb2
bc of .dockerignore
Sep 18, 2025
34de39f
small correct
Sep 18, 2025
57c37d9
small correct
Sep 18, 2025
e684763
Remove remaining asserts in the codebase
gztensor Sep 18, 2025
0f75c1b
Fix LastUpdate update in add_neuron
gztensor Sep 18, 2025
17b7adf
prepare cross-platform artifacts
Sep 18, 2025
fe103e6
Revert bad rename for SubnetNotExists error
gztensor Sep 18, 2025
8cf762e
Spec bump
gztensor Sep 18, 2025
a75994c
try step 1
Sep 18, 2025
d5d0922
Merge remote-tracking branch 'origin/feat/roman/improve-localnet-work…
Sep 18, 2025
788e04b
step 2
Sep 18, 2025
c71d3ec
step 3
Sep 19, 2025
5332da9
step 4 - TRIPLE instead of arch
Sep 19, 2025
59da9cc
ops - missed /
Sep 19, 2025
b43c96c
check TARGETARCH and TARGETOS
Sep 19, 2025
a230878
check TARGETARCH in debug
Sep 19, 2025
8b3d120
auto-update benchmark weights
github-actions[bot] Sep 19, 2025
e0c8250
Merge pull request #2068 from opentensor/fix-dispatches-merge
JohnReedV Sep 19, 2025
ef564ed
Merge remote-tracking branch 'origin/devnet-ready' into fix/safe-math
sam0x17 Sep 19, 2025
3b3dccc
map required binaries for the specific architecture
Sep 19, 2025
d5d4ca5
making logic clear
Sep 19, 2025
9b050eb
wrong path in Download all binary artifacts
Sep 19, 2025
7c62b8f
Add error logging where runtime asserts were removed
gztensor Sep 19, 2025
828a824
Merge branch 'fix/safe-math' of github.com:opentensor/subtensor into …
gztensor Sep 19, 2025
f17472f
Merge pull request #2069 from opentensor/fix/safe-math
sam0x17 Sep 19, 2025
f7be5c6
dockerfile cleanup
Sep 19, 2025
3d58527
Merge branch 'devnet-ready' into feat/roman/improve-localnet-workflow
Sep 19, 2025
202fbf5
more debug
Sep 19, 2025
0a92c54
change Listing
Sep 19, 2025
b304de1
more info
Sep 19, 2025
df94f25
wrong name
Sep 19, 2025
90fae2a
fix path
Sep 19, 2025
1b978b2
cleanup
Sep 19, 2025
e0d43b0
use powerful runners
Sep 19, 2025
f6707e5
overkill for setup
Sep 19, 2025
aa3956a
arm dead
Sep 19, 2025
4988df3
build_and_publish
Sep 19, 2025
ba51d4a
add source "$HOME/.cargo/env"
Sep 20, 2025
9cbd950
update runners
Sep 20, 2025
8d32d04
SubtensorCI for arm build (test)
Sep 20, 2025
9358fb0
ubuntu-24.04-arm for arm build
Sep 20, 2025
7cd0807
cax41
Sep 20, 2025
9479d89
convet a to t
JohnReedV Sep 21, 2025
2b0a5f6
fix comments
JohnReedV Sep 21, 2025
1cff425
ubuntu-24.04-arm
Sep 21, 2025
4432db3
ubuntu-latest
Sep 21, 2025
68d3ad7
Let's try skipping dependency installation and check the image.
Sep 21, 2025
8e5a11c
Let's try skipping dependency installation and check the image.
Sep 21, 2025
d0db135
[self-hosted, type-ccx43]
Sep 21, 2025
b27d926
we have more ccx33 tagged runners
Sep 21, 2025
6b847c4
remove cache from Build and push Docker image
Sep 21, 2025
68af1e8
cleanup and comments
Sep 21, 2025
3fde7dc
Merge pull request #2067 from opentensor/feat/roman/improve-localnet-…
sam0x17 Sep 21, 2025
a4341fc
netuid => netuid_index
JohnReedV Sep 22, 2025
d6b3529
bump spec
JohnReedV Sep 22, 2025
773f591
remove unnecessary type conversion
JohnReedV Sep 22, 2025
731be2c
Remove unnecessary error logging, improve log searching patterns for …
gztensor Sep 23, 2025
a490a0c
Spec bump
gztensor Sep 23, 2025
98ef9f6
add stake instead of swap
JohnReedV Sep 23, 2025
b2041c5
clippy
JohnReedV Sep 23, 2025
47120ba
bump spec
JohnReedV Sep 23, 2025
7579124
Merge pull request #2073 from opentensor/fix-netuid-index-selective-m…
JohnReedV Sep 23, 2025
e8cdc1c
blank commit
JohnReedV Sep 23, 2025
dda8b24
test_dissolve_v3_green_path_refund_tao_stake_alpha
JohnReedV Sep 23, 2025
ac358c6
Merge pull request #2076 from opentensor/fix/remove-unnecessary-error…
sam0x17 Sep 23, 2025
91e9959
add clear_protocol_liquidity
JohnReedV Sep 23, 2025
cd1ba14
remove back check
JohnReedV Sep 23, 2025
8621e16
Update tests.rs
JohnReedV Sep 23, 2025
2d1fed5
use root
JohnReedV Sep 24, 2025
09a0287
Update impls.rs
JohnReedV Sep 24, 2025
321f198
bump spec
JohnReedV Sep 24, 2025
44cf573
Merge branch 'devnet-ready' into convert-a-to-t-during-LP-dissolution
JohnReedV Sep 24, 2025
3a266cb
Merge pull request #2071 from opentensor/convert-a-to-t-during-LP-dis…
sam0x17 Sep 24, 2025
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
22 changes: 21 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
# IDE/Editor configs
.devcontainer
.github
.vscode
.idea
*.swp
*.swo

# Build artifacts
target/
*.pyc
*.pyo
*.pyd
__pycache__/

# Git-related
.git
.gitignore

# CI/CD
.github
.dockerignore
.gitattributes

# Dockerfiles
Dockerfile
Dockerfile-localnet
13 changes: 1 addition & 12 deletions .github/workflows/check-bittensor-e2e-tests.yml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ jobs:

build-image-with-current-branch:
needs: check-label
if: needs.check-label.outputs.skip-bittensor-e2e-tests == 'false'
runs-on: [self-hosted, type-ccx33]
steps:
- name: Checkout code
Expand Down Expand Up @@ -211,12 +212,6 @@ jobs:
- name: Retag Docker Image
run: docker tag localnet ghcr.io/opentensor/subtensor-localnet:devnet-ready

# - name: Run tests
# working-directory: ${{ github.workspace }}/btcli
# run: |
# source ${{ github.workspace }}/venv/bin/activate
# uv run pytest ${{ matrix.test-file }} -s

- name: Run with retry
working-directory: ${{ github.workspace }}/btcli
run: |
Expand Down Expand Up @@ -311,12 +306,6 @@ jobs:
- name: Retag Docker Image
run: docker tag localnet ghcr.io/opentensor/subtensor-localnet:devnet-ready

# - name: Run tests
# working-directory: ${{ github.workspace }}/bittensor
# run: |
# source ${{ github.workspace }}/venv/bin/activate
# uv run pytest ${{ matrix.test-file }} -s

- name: Run with retry
working-directory: ${{ github.workspace }}/bittensor
run: |
Expand Down
145 changes: 122 additions & 23 deletions .github/workflows/docker-localnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
workflow_dispatch:
inputs:
branch-or-tag:
description: "Branch or tag to use for the Docker image tag and ref to checkout (optional)"
description: "The branch or tag to use as the Docker image tag (optional)."
required: false
default: ""
push:
Expand All @@ -15,7 +15,7 @@ on:
- main
- testnet
- devnet

concurrency:
group: docker-localnet-${{ github.ref }}
cancel-in-progress: true
Expand All @@ -27,29 +27,130 @@ permissions:
security-events: write

jobs:
publish:
runs-on: [self-hosted, type-ccx53, type-ccx43, type-ccx33]

setup:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.vars.outputs.tag }}
ref: ${{ steps.vars.outputs.ref }}
latest_tag: ${{ steps.vars.outputs.latest_tag }}
steps:
- name: Determine Docker tag and ref
id: tag
id: vars
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "ref=${{ github.head_ref }}" >> $GITHUB_OUTPUT
echo "tag=${{ github.base_ref }}" >> $GITHUB_OUTPUT
else
tag="${{ github.event.inputs.branch-or-tag || github.ref_name }}"
echo "ref=${{ github.ref_name }}" >> $GITHUB_OUTPUT
echo "tag=$tag" >> $GITHUB_OUTPUT
fi

if [[ "$tag" != "devnet-ready" ]]; then
echo "latest_tag=true" >> $GITHUB_OUTPUT
else
echo "latest_tag=false" >> $GITHUB_OUTPUT
fi

# build artifacts for fast-runtime and non-fast-runtime
artifacts:
name: Node • ${{ matrix.runtime }} • ${{ matrix.platform.arch }}
needs: setup
strategy:
matrix:
platform:
# triple names used `in scripts/install_prebuilt_binaries.sh` file
- runner: [self-hosted, type-ccx33]
triple: x86_64-unknown-linux-gnu
arch: amd64
- runner: [ubuntu-24.04-arm]
triple: aarch64-unknown-linux-gnu
arch: arm64

runtime: ["fast-runtime", "non-fast-runtime"]

runs-on: ${{ matrix.platform.runner }}

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ needs.setup.outputs.ref }}

- name: Install Rust + dependencies
run: |
chmod +x ./scripts/install_build_env.sh
./scripts/install_build_env.sh

- name: Add Rust target triple
run: |
source "$HOME/.cargo/env"
rustup target add ${{ matrix.platform.triple }}

- name: Patch limits for local run
run: |
branch_or_tag="${{ github.event.inputs.branch-or-tag || github.ref_name }}"
echo "Determined branch or tag: $branch_or_tag"
echo "tag=$branch_or_tag" >> $GITHUB_ENV
echo "ref=$branch_or_tag" >> $GITHUB_ENV

# Check if this is a tagged release (not devnet-ready/devnet/testnet)
if [[ "$branch_or_tag" != "devnet-ready" ]]; then
echo "latest_tag=true" >> $GITHUB_ENV
chmod +x ./scripts/localnet_patch.sh
./scripts/localnet_patch.sh

- name: Build binaries
run: |
export PATH="$HOME/.cargo/bin:$PATH"
export CARGO_BUILD_TARGET="${{ matrix.platform.triple }}"

if [ "${{ matrix.runtime }}" = "fast-runtime" ]; then
./scripts/localnet.sh --build-only
else
echo "latest_tag=false" >> $GITHUB_ENV
./scripts/localnet.sh False --build-only
fi

# use `ci_target` name bc .dockerignore excludes `target`
- name: Prepare artifacts for upload
run: |
RUNTIME="${{ matrix.runtime }}"
TRIPLE="${{ matrix.platform.triple }}"

mkdir -p build/ci_target/${RUNTIME}/${TRIPLE}/release/
cp -v target/${RUNTIME}/${TRIPLE}/release/node-subtensor \
build/ci_target/${RUNTIME}/${TRIPLE}/release/

mkdir -p build/ci_target/${RUNTIME}/${TRIPLE}/release/wbuild/node-subtensor-runtime/
cp -v target/${RUNTIME}/${TRIPLE}/release/wbuild/node-subtensor-runtime/node_subtensor_runtime.compact.compressed.wasm \
build/ci_target/${RUNTIME}/${TRIPLE}/release/wbuild/node-subtensor-runtime/

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: binaries-${{ matrix.platform.triple }}-${{ matrix.runtime }}
path: build/
if-no-files-found: error

# Collect all artifacts and publish them to docker repo
docker:
needs: [setup, artifacts]
runs-on: [self-hosted, type-ccx33]
defaults:
run:
working-directory: ${{ github.workspace }}

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ env.ref }}
ref: ${{ needs.setup.outputs.ref }}

- name: Download all binary artifacts
uses: actions/download-artifact@v5
with:
pattern: binaries-*
path: build/
merge-multiple: true

- name: Show current Git branch
run: |
echo "==============================="
echo "Current Git branch:"
git rev-parse --abbrev-ref HEAD
echo "==============================="

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand All @@ -64,18 +165,16 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Patch non-fast-block node
run: |
chmod +x ./scripts/localnet_patch.sh
./scripts/localnet_patch.sh

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile-localnet
build-args: |
BUILT_IN_CI="Boom shakalaka"

push: true
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/${{ github.repository }}-localnet:${{ env.tag }}
${{ env.latest_tag == 'true' && format('ghcr.io/{0}-localnet:latest', github.repository) || '' }}
ghcr.io/${{ github.repository }}-localnet:${{ needs.setup.outputs.tag }}
${{ needs.setup.outputs.latest_tag == 'true' && format('ghcr.io/{0}-localnet:latest', github.repository) || '' }}
Loading
Loading