Skip to content
Merged
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
46 changes: 46 additions & 0 deletions .github/ISSUE_TEMPLATE/0_bug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
name: 🐛 Bug Report
about: Submit a bug report if something isn't working
title: "[Bug]"
labels: bug
---

## 🐛 Bug Report

<!--
What's the bug you found?
How serious is it and what is affected?

To report a security issue, please email security@aleo.org.
-->

(Write your description here)

## Steps to Reproduce

<!--
How do I reproduce this issue?
Are there error messages or stack traces that would help?
-->

#### Command or code snippet

```
# Add steps here
```

#### Error output

```
// Paste the output here
```

## Expected Behavior

(Write what you expected to happen here)

## Your Environment

- <!-- aleo-devnode version -->
- <!-- Rust version -->
- <!-- OS -->
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/1_feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: 🚀 Feature Request
about: Submit a new feature request
title: "[Feature]"
labels: feature
---

## 🚀 Feature Request

<!--
What feature would you like to see in aleo-devnode?
-->

(Write your description here)

## Motivation

<!--
Why should this be added?
Is this related to a problem you're hitting?
Link any relevant issues or PRs.
-->

(Write your motivation here)

## Implementation

<!--
What would need to change?
Are you willing to open a pull request?
-->

(Write your implementation ideas here)
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: ❓ Discord Support
url: https://discord.gg/aleo
about: For quick questions or technical troubleshooting, ask in our Discord.
11 changes: 11 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## Motivation

(Describe why this change is needed)

## Test Plan

(Describe how you verified your changes)

## Related PRs

(Link any related PRs here)
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: cargo
directory: "/"
schedule:
interval: weekly
time: "10:00"
open-pull-requests-limit: 10
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: CI

on:
push:
branches: [main]
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
RUST_BACKTRACE: 1

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Install libclang
run: sudo apt-get update -qq && sudo apt-get install -y libclang-dev
- name: Verify Cargo.lock exists
run: test -f Cargo.lock || (echo "::error::Cargo.lock is missing" && exit 1)
- name: Run tests
run: cargo test --locked
159 changes: 159 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
name: Release

on:
push:
tags: ['v[0-9]*']
workflow_dispatch:
inputs:
tag:
description: "Release tag (e.g. v0.2.0). Creates the git tag if it does not already exist."
required: true

env:
RUST_BACKTRACE: 0

jobs:
prepare:
name: Prepare Release
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
tag: ${{ steps.resolve.outputs.tag }}
version: ${{ steps.resolve.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Resolve Tag and Version
id: resolve
run: |
TAG="${{ github.event.inputs.tag || github.ref_name }}"
VERSION="${TAG#v}"
TOML_VERSION="$(grep '^version' Cargo.toml | head -1 | sed 's/.*= *"\(.*\)"/\1/')"
if [ "$VERSION" != "$TOML_VERSION" ]; then
echo "::error::Tag version ($VERSION) does not match Cargo.toml version ($TOML_VERSION)"
exit 1
fi
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"

- name: Ensure Tag Exists
run: |
TAG="${{ steps.resolve.outputs.tag }}"
if git rev-parse "refs/tags/$TAG" >/dev/null 2>&1; then
echo "Tag $TAG already exists"
else
git tag "$TAG"
git push origin "$TAG"
fi

build:
name: Build (${{ matrix.target }})
needs: prepare
strategy:
fail-fast: true
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-apple-darwin
os: macos-14-large
- target: aarch64-apple-darwin
os: macos-latest
- target: x86_64-pc-windows-msvc
os: windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.prepare.outputs.tag }}

- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt

- name: Add aarch64 target
if: matrix.target == 'aarch64-apple-darwin'
run: rustup target add aarch64-apple-darwin

- uses: Swatinem/rust-cache@v2

- name: Install libclang (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update -qq && sudo apt-get install -y libclang-dev

- name: Install LLVM (Windows)
if: runner.os == 'Windows'
uses: KyleMayes/install-llvm-action@v1
with:
version: "11"
directory: ${{ runner.temp }}/llvm

- name: Set LIBCLANG_PATH (Windows)
if: runner.os == 'Windows'
run: echo "LIBCLANG_PATH=${{ runner.temp }}/llvm/lib" >> $GITHUB_ENV

- name: Verify Cargo.lock exists
shell: bash
run: test -f Cargo.lock || (echo "::error::Cargo.lock is missing" && exit 1)

- name: Build
shell: bash
run: |
TARGET_FLAG=""
if [ "${{ matrix.target }}" = "aarch64-apple-darwin" ]; then
TARGET_FLAG="--target aarch64-apple-darwin"
fi
cargo build --release --locked $TARGET_FLAG
env:
CARGO_NET_GIT_FETCH_WITH_CLI: true

- name: Package (Unix)
if: runner.os != 'Windows'
run: |
TAG="${{ needs.prepare.outputs.tag }}"
if [ "${{ matrix.target }}" = "aarch64-apple-darwin" ]; then
BIN="target/aarch64-apple-darwin/release/aleo-devnode"
else
BIN="target/release/aleo-devnode"
fi
strip "$BIN"
ARCHIVE="aleo-devnode-${TAG}-${{ matrix.target }}.zip"
zip -j "$ARCHIVE" "$BIN"
echo "ARCHIVE=$ARCHIVE" >> "$GITHUB_ENV"

- name: Package (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$tag = "${{ needs.prepare.outputs.tag }}"
$archive = "aleo-devnode-${tag}-${{ matrix.target }}.zip"
Compress-Archive -Path target/release/aleo-devnode.exe -DestinationPath $archive
echo "ARCHIVE=$archive" >> $env:GITHUB_ENV

- uses: actions/upload-artifact@v4
with:
name: release-${{ matrix.target }}
path: ${{ env.ARCHIVE }}

release:
name: Publish Release
needs: [prepare, build]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
pattern: release-*
merge-multiple: true

- uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.prepare.outputs.tag }}
name: "v${{ needs.prepare.outputs.version }}"
files: "*.zip"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ tower-http = { version = "0.6.0", features = ["cors", "trace"] }
tower_governor = "0.8"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt"] }

[dev-dependencies]
tempfile = "3"
16 changes: 16 additions & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# https://github.com/rust-lang/rustfmt/blob/master/Configurations.md

# Stable configurations
edition = "2024"
max_width = 120
merge_derives = true
use_field_init_shorthand = true
use_small_heuristics = "Max"
use_try_shorthand = true
imports_layout = "HorizontalVertical"
imports_granularity = "Crate"
overflow_delimited_expr = true

# Nightly configurations
reorder_impl_items = true
style_edition = "2024"
2 changes: 1 addition & 1 deletion src/rest/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ use axum::{
response::Response,
routing::{get, post},
};
use std::path::PathBuf;
use axum_extra::response::ErasedJson;
use std::path::PathBuf;

use parking_lot::Mutex;
use std::{
Expand Down
Loading
Loading