diff --git a/.github/actions/monerod-download/action.yml b/.github/actions/monerod-download/action.yml index c323d927..0df30230 100644 --- a/.github/actions/monerod-download/action.yml +++ b/.github/actions/monerod-download/action.yml @@ -29,7 +29,7 @@ runs: steps: - name: Monero Daemon Cache id: cache-monerod - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | monerod @@ -48,6 +48,7 @@ runs: "Windows X86") FILE=monero-win-x86-${{ inputs.version }}.zip ;; "Linux X64") FILE=monero-linux-x64-${{ inputs.version }}.tar.bz2 ;; "Linux X86") FILE=monero-linux-x86-${{ inputs.version }}.tar.bz2 ;; + "Linux ARM64") FILE=monero-linux-armv8-${{ inputs.version }}.tar.bz2 ;; "macOS X64") FILE=monero-mac-x64-${{ inputs.version }}.tar.bz2 ;; "macOS ARM64") FILE=monero-mac-armv8-${{ inputs.version }}.tar.bz2 ;; *) exit 1 ;; diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f39a4075..33d477ed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -87,7 +87,9 @@ jobs: os: [ windows-2022, # EOL = 2026-10-13 | <https://endoflife.date/windows-server> macos-15, # EOL = 2027-09-16 | <https://endoflife.date/macos> - ubuntu-22.04 # EOL = 2027-04-01 | <https://endoflife.date/ubuntu> + macos-13, # EOL = 2025-10-24 | For x64. + ubuntu-22.04, # EOL = 2027-04-01 | <https://endoflife.date/ubuntu> + ubuntu-22.04-arm, ] steps: @@ -133,4 +135,4 @@ jobs: - name: Hack Check run: | cargo install cargo-hack --locked - cargo hack --workspace check --feature-powerset --no-dev-deps \ No newline at end of file + cargo hack --workspace check --feature-powerset --no-dev-deps diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..0400e23d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,112 @@ +name: Release Builds + +on: + workflow_dispatch: + inputs: + commit: + description: 'Commit to build' + required: true + type: string + +env: + # Show colored output in CI. + CARGO_TERM_COLOR: always + # The folder used to store release files - this will be uploaded. + ARCHIVE: "__ARCHIVE" + +jobs: + build: + strategy: + matrix: + os: [ + windows-2022, # EOL = 2026-10-13 | <https://endoflife.date/windows-server> + macos-15, # EOL = 2027-09-16 | <https://endoflife.date/macos> + macos-13, # EOL = 2025-10-24 | For x64. + ubuntu-22.04, # EOL = 2027-04-01 | <https://endoflife.date/ubuntu> + ubuntu-22.04-arm, + ] + + runs-on: ${{ matrix.os }} + + defaults: + run: + shell: bash + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + ref: ${{ inputs.commit }} + + - name: Install Rust + uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + + - name: Build + run: cargo build --release --package cuprated + + - name: Generate Archives + run: | + set -e -o pipefail # Exit on failures + umask 0022 # 755 permissions + export TZ=UTC # UTC timezone + + # Reset archive directory in-case. + rm -rf ${{ env.ARCHIVE }} + mkdir -p ${{ env.ARCHIVE }} + ARCHIVE=$(realpath ${{ env.ARCHIVE }}) + VERSION=$(grep version binaries/cuprated/Cargo.toml | grep -oE [0-9]+.[0-9]+.[0-9]+) + + # All archives have these files. + cp LICENSE-AGPL target/release/LICENSE + cp binaries/cuprated/config/Cuprated.toml target/release/ + + OS=${{ matrix.os }} + + # Generate archives for Linux. + if [ "$RUNNER_OS" == "Linux" ]; then + # FIXME: <https://github.com/Cuprate/cuprate/issues/396> + # cp binaries/cuprated/cuprated.service target/release/ + cd target/release + + if [ "$OS" == "ubuntu-22.04" ]; then + NAME="cuprated-${VERSION}-linux-x64.tar.gz" + else + NAME="cuprated-${VERSION}-linux-arm64.tar.gz" + fi + + # FIXME: #396 + # tar -czpf "$ARCHIVE/$NAME" cuprated LICENSE Cuprated.toml cuprated.service + tar -czpf "$ARCHIVE/$NAME" cuprated LICENSE Cuprated.toml + fi + + # Generate archives for macOS. + if [ "$RUNNER_OS" == "macOS" ]; then + cd target/release + + if [ "$OS" == "macos-15" ]; then + NAME="cuprated-${VERSION}-macos-arm64.tar.gz" + else + NAME="cuprated-${VERSION}-macos-x64.tar.gz" + fi + + tar -czpf "$ARCHIVE/$NAME" cuprated LICENSE Cuprated.toml + fi + + # Generate archives for Windows. + if [ "$RUNNER_OS" == "Windows" ]; then + mv target/release/cuprated.exe target/release/ + cd target/release + + NAME="cuprated-${VERSION}-windows-x64.zip" + powershell Compress-Archive -LiteralPath cuprated.exe, LICENSE, Cuprated.toml -DestinationPath "$ARCHIVE/$NAME" + fi + + - name: Archive + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.os }} + compression-level: 0 + path: ${{ env.ARCHIVE }}/** diff --git a/.gitignore b/.gitignore index 3c385b68..0b5a1346 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ target/ .vscode monerod books/*/book +fast_sync_hashes.bin diff --git a/README.md b/README.md index da14a9e9..eebe9297 100644 --- a/README.md +++ b/README.md @@ -57,11 +57,11 @@ For crate (library) documentation, see: <https://doc.cuprate.org>. This site hol ## Contributing -See [`CONTRIBUTING.md`](CONTRIBUTING.md). +See [`CONTRIBUTING.md`](misc/CONTRIBUTING.md). ## Security -Cuprate has a responsible vulnerability disclosure policy, see [`SECURITY.md`](SECURITY.md). +Cuprate has a responsible vulnerability disclosure policy, see [`SECURITY.md`](misc/SECURITY.md). ## License diff --git a/consensus/fast-sync/src/create.rs b/consensus/fast-sync/src/create.rs index 349d6a29..376e2407 100644 --- a/consensus/fast-sync/src/create.rs +++ b/consensus/fast-sync/src/create.rs @@ -71,11 +71,8 @@ async fn main() { drop(read_handle); - write( - "data/fast_sync_hashes.bin", - hashes_of_hashes.concat().as_slice(), - ) - .expect("Could not write file"); + write("fast_sync_hashes.bin", hashes_of_hashes.concat().as_slice()) + .expect("Could not write file"); println!("Generated hashes up to block height {height}"); } diff --git a/misc/ENVIRONMENT-ADVICE.md b/misc/ENVIRONMENT_ADVICE.md similarity index 100% rename from misc/ENVIRONMENT-ADVICE.md rename to misc/ENVIRONMENT_ADVICE.md diff --git a/misc/FAST_SYNC_HASHES.md b/misc/FAST_SYNC_HASHES.md new file mode 100644 index 00000000..50770797 --- /dev/null +++ b/misc/FAST_SYNC_HASHES.md @@ -0,0 +1,21 @@ +# Fast sync hashes +Cuprate has a binary that generate `fast-sync` hashes and puts them into a binary blob file. + +The code that does so is located at [`consensus/fast-sync`](https://github.com/Cuprate/cuprate/blob/main/consensus/fast-sync). + +To create the hashes, you need a fully synced database generated from `cuprated`. + +After that, build the binary that generates `fast-sync` hashes: +```bash +cargo build --release --package cuprate-fast-sync +``` + +Run the binary: +```bash +./target/release/create-fs-file --height $HEIGHT +``` +where `$HEIGHT` is the top blockchain height. + +The generated `fast_sync_hashes.bin` file should be in the current directory. + +This should be moved to `binaries/cuprated/src/blockchain/fast_sync/fast_sync_hashes.bin`. \ No newline at end of file diff --git a/misc/README.md b/misc/README.md new file mode 100644 index 00000000..2d920331 --- /dev/null +++ b/misc/README.md @@ -0,0 +1,2 @@ +## Misc +Any miscellaneous files, such as documents, GPG keys, assets, etc. diff --git a/misc/RELEASE_CHECKLIST.md b/misc/RELEASE_CHECKLIST.md new file mode 100644 index 00000000..9048d43c --- /dev/null +++ b/misc/RELEASE_CHECKLIST.md @@ -0,0 +1,34 @@ +# Cuprate release check-list +This is a template checklist used to track releases. + +The scheme for release file name is `$BINARY-$VERSION-$OS-$ARCH.$EXTENSION`, for example, `cuprated-0.0.1-linux-x64.tar.gz`. + +--- + +- Changelog + - [ ] Relevant changes added to `misc/changelogs/cuprated/$VERSION.md` +- Fast sync + - [ ] Update hashes, see `misc/FAST_SYNC_HASHES.md` +- User Book + - [ ] Update necessary documentation + - [ ] Book title reflects `cuprated`'s version +- `cuprated` + - [ ] Killswitch timestamp updated +- Repository + - [ ] Decide specific commit + - [ ] Create draft release + - [ ] Create version tag + - [ ] Build CI binaries +- `cuprated` testing + - Full-sync from scratch + - [ ] x64 Windows + - [ ] x64 Linux + - [ ] ARM64 macOS + - [ ] ARM64 Linux +- Release + - [ ] Add binaries to release + - [ ] Publish `Cuprate/user-book` + - [ ] Release +- Release announcements + - [ ] Reddit + - [ ] Matrix diff --git a/misc/changelogs/README.md b/misc/changelogs/README.md new file mode 100644 index 00000000..1e24a899 --- /dev/null +++ b/misc/changelogs/README.md @@ -0,0 +1,2 @@ +# Changelogs +This directory holds changelog files for binaries/libraries. \ No newline at end of file diff --git a/misc/changelogs/cuprated/0.0.1.md b/misc/changelogs/cuprated/0.0.1.md new file mode 100644 index 00000000..eb509f79 --- /dev/null +++ b/misc/changelogs/cuprated/0.0.1.md @@ -0,0 +1,32 @@ +# cuprated 0.0.1 Molybdenite (2025-03-12) +Cuprate is an alternative and independent Monero node implementation that is focused on being fast, user-friendly, and backwards compatible with [`monerod`](https://github.com/monero-project/monero). + +This is the first release of the Cuprate node, `cuprated`. + +To get started, see: <https://user.cuprate.org>. + +For an FAQ on Cuprate, see: <https://user.cuprate.org/#faq>. + +## Downloads +For convenience, The following binaries are produced using GitHub CI in a non-reproducible way; it is highly recommended to build `cuprated` from source instead, see <https://user.cuprate.org/getting-started/source>. + +| OS | Architecture | Download | +|---------|--------------|----------| +| Linux | x64 | <https://github.com/Cuprate/cuprate/releases/download/cuprated-0.0.1/cuprated-0.0.1-linux-x64.tar.gz> +| Linux | ARM64 | <https://github.com/Cuprate/cuprate/releases/download/cuprated-0.0.1/cuprated-0.0.1-linux-arm64.tar.gz> +| macOS | x64 | <https://github.com/Cuprate/cuprate/releases/download/cuprated-0.0.1/cuprated-0.0.1-macos-x64.tar.gz> +| macOS | ARM64 | <https://github.com/Cuprate/cuprate/releases/download/cuprated-0.0.1/cuprated-0.0.1-macos-arm64.tar.gz> +| Windows | x64 | <https://github.com/Cuprate/cuprate/releases/download/cuprated-0.0.1/cuprated-0.0.1-windows-x64.zip> + +## Contributors +Thank you to everyone who directly contributed to this release: + +- @Asurar0 +- @Boog900 +- @dimalinux +- @hinto-janai +- @jomuel +- @kayabaNerve +- @SyntheticBird45 + +There are other contributors that are not listed here, thank you to them as well. \ No newline at end of file