Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
mjovanc committed Apr 11, 2024
0 parents commit 11ae88d
Show file tree
Hide file tree
Showing 120 changed files with 24,518 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Bug report
about: Our code behaves incorrectly?
title: ''
labels: bug
assignees: ''

---

<!--
**Double-check**
* Is this *really* a bug?
- If the behavior is documented, but you disagree with it, please do file an issue, but as a "Design consideration," not a "Bug report."
- If you don't understand why something behaves the way it does, consider asking on [Discord](https://discord.gg/VTgsTGS9b7).
* Is the problem not in some third-party library, not in [Kryptokrona](https://github.com/kryptokrona/issues)?
* Maybe you're using some ancient version, and the problem doesn't happen with the latest releases of the compiler and the library?
-->

**Describe the bug**

What happened? What should have happened instead?

**Provide a Reproducer**

* If possible, please provide information about when the issue reproduces.
* If you are not ready to reveal any details publicly, we are open to discussing the details privately.
* If you really can't provide any details, please do still open an issue. This may prompt other people to chime in with their reproducers.
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: Kryptokrona Discord
url: https://discord.gg/VTgsTGS9b7
about: Please ask and answer usage-related questions here.
44 changes: 44 additions & 0 deletions .github/ISSUE_TEMPLATE/design_considerations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
name: Design considerations
about: We didn't think things through?
title: ''
labels: design
assignees: ''

---

<!--
This is a place for issue reports that are not exactly bugs (wrong unintentional behavior), it's for raising issue regarding software architecture/design.
**Double-check**
* If the behavior is strange, surprising, and undocumented, it could be a good idea to file a "Bug report" instead.
* Is this still relevant with the latest version of Kryptokrona? We could have changed this already.
* Maybe there are good reasons for the existing behavior. Please try searching for existing discussions of the problem.
-->

**What do we have now?**

Preferably with specific code examples.

**What should be instead?**

Preferably with specific code examples.

**Why?**

The upsides of your proposal.
* Who would benefit from this and how?
- Would it be possible to cover new use cases?
- Would some code become clearer?
- Would the specific source become conceptually simpler?
- etc.

**Why not?**

The downsides of your proposal that you already see.
* Is this a breaking change?
* Are there use cases that are better solved by what we have now?
* Does some code become less clear after this change?
* etc.
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Feature request
about: We're missing something?
title: ''
labels: enhancement
assignees: ''

---

<!--
**Double-check**
* Maybe this feature is already here?
- Did you check the latest version of Kryptokrona?
- Maybe it's in a form you didn't expect? Consider asking on [Discord](https://discord.gg/VTgsTGS9b7). The community will likely come up with some code that solves your need, and faster than it would take us to answer the issue!
* Do you actually *need* this feature?
* Is the specific functionality in Kryptokrona the best place for this feature? Maybe it would be better suited for some third-party library?
-->

**Use case**

Explain what *specifically* you are trying to do and why.
90 changes: 90 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# This is the new workflow replacing 'master-ci.yml' for the C++ -> Rust transition

name: build

on:
push:
branches:
- rust # change this to master later
pull_request:
branches:
- rust # change this to master later
paths-ignore:
- "**/README.md"
- "**/LICENSE"
- "**/SECURITY.md"
- "**/.gitignore"
- "**/resources/**"
- "**/.github/ISSUE_TEMPLATE/**"

jobs:
build:
name: build ${{ matrix.config.name }} (${{ matrix.config.arch }})
runs-on: ${{ matrix.config.os }}

strategy:
fail-fast: true
matrix:
config:
- {
name: "macos 14",
os: macos-latest,
args: "aarch64-apple-darwin",
arch: arm64,
}
- {
name: "macos 14",
os: macos-latest,
args: "x86_64-apple-darwin",
arch: x86_64,
}
- {
name: "ubuntu 22.04",
os: ubuntu-22.04,
args: "x86_64-unknown-linux-gnu",
arch: x86_64,
}
- {
name: "ubuntu 20.04",
os: ubuntu-20.04,
args: "x86_64-unknown-linux-gnu",
arch: x86_64,
}
# we will add ubuntu and windows here once we get macos working

steps:
- uses: actions/checkout@v3

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable

- name: Install macOS Dependencies
if: startsWith(matrix.config.name, 'macos')
run: |
rustup target add ${{ matrix.config.args }}
brew install protobuf
- name: Install Ubuntu Dependencies
if: startsWith(matrix.config.name, 'ubuntu')
run: |
rustup target add ${{ matrix.config.args }}
sudo apt install protobuf-compiler
- name: Cache Cargo Dependencies
uses: actions/cache@v2
with:
path: |
~/.cargo
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Run Clippy
run: cargo clippy --all-features --target ${{ matrix.config.args }}

- name: Build Project
run: cargo build --release --target ${{ matrix.config.args }}

#- name: Run Tests
# run: cargo test --release --target ${{ matrix.config.args }}
160 changes: 160 additions & 0 deletions .github/workflows/master-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
name: Kryptokrona Master Pipeline

env:
GITHUB_REGISTRY: "ghcr.io"
GITHUB_OWNER: "kryptokrona"
GITHUB_DOCKER_IMAGE: "kryptokrona"

on:
push:
branches:
- master

jobs:
build:
name: "Build: ${{ matrix.config.name }} / ${{ matrix.config.platform }}"
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: true
matrix:
config:
- {
name: "Ubuntu 20.04 GCC",
artifact: "kryptokrona-ubuntu-20",
os: ubuntu-20.04,
cc: "gcc",
cxx: "g++",
platform: x64,
}
- {
name: "Ubuntu 22.04 GCC",
artifact: "kryptokrona-ubuntu-22",
os: ubuntu-22.04,
cc: "gcc",
cxx: "g++",
platform: x64,
}
steps:
- uses: actions/checkout@v2

- name: "Install ${{ matrix.config.name }} Dependencies "
if: matrix.config.os == 'ubuntu-20.04'
run: |
sudo apt-get update
sudo apt-get install -y build-essential libboost-dev libboost-all-dev libssl-dev libffi-dev python3-dev gcc-11 g++-11 git cmake librocksdb-dev cron rpcbind libboost-system1.71.0 libboost-filesystem1.71.0 libboost-thread1.71.0 libboost-date-time1.71.0 libboost-chrono1.71.0 libboost-regex1.71.0 libboost-serialization1.71.0 libboost-program-options1.71.0 libicu66
- name: "Install ${{ matrix.config.name }} Dependencies "
if: matrix.config.os == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y build-essential libboost-dev libboost-all-dev libssl-dev libffi-dev python3-dev gcc-11 g++-11 git cmake librocksdb-dev cron rpcbind libboost-system1.74.0 libboost-filesystem1.74.0 libboost-thread1.74.0 libboost-date-time1.74.0 libboost-chrono1.74.0 libboost-regex1.74.0 libboost-serialization1.74.0 libboost-program-options1.74.0 libicu70
- name: mkdir build
if: ${{ contains(matrix.config.name, 'ubuntu') }}
run: mkdir build

- name: Build Ubuntu Target
if: ${{ contains(matrix.config.name, 'ubuntu') }}
run: |
cmake -DBoost_ARCHITECTURE=-x64 ..
make
working-directory: build

- name: Upload Ubuntu Artifact
if: ${{ contains(matrix.config.name, 'ubuntu') }}
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.config.artifact }}
path: |
build/src/kryptokronad
build/src/xkrwallet
build/src/kryptokrona-service
build/src/miner
build/src/wallet-api
docker-testnet:
name: Build and Publish Docker Image for testnet
runs-on: ubuntu-22.04
needs: [build]
steps:
- uses: actions/checkout@v2
- uses: benjlevesque/[email protected]

- name: Log into registry ghcr.io
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GHCR_PAT }}

- name: Build Docker
run: |
docker build -t $GITHUB_REGISTRY/$GITHUB_OWNER/$GITHUB_DOCKER_IMAGE-testnet:${{ env.SHA }} -f Dockerfile.test . --no-cache
- name: Tag Image
run: |
docker tag $GITHUB_REGISTRY/$GITHUB_OWNER/$GITHUB_DOCKER_IMAGE-testnet:${{ env.SHA }} $GITHUB_REGISTRY/$GITHUB_OWNER/$GITHUB_DOCKER_IMAGE-testnet:latest
docker tag $GITHUB_REGISTRY/$GITHUB_OWNER/$GITHUB_DOCKER_IMAGE-testnet:${{ env.SHA }} mjovanc/$GITHUB_DOCKER_IMAGE-testnet:${{ env.SHA }}
docker tag $GITHUB_REGISTRY/$GITHUB_OWNER/$GITHUB_DOCKER_IMAGE-testnet:${{ env.SHA }} mjovanc/$GITHUB_DOCKER_IMAGE-testnet:latest
- name: Publish Docker to GitHub Repository
run: |
docker push $GITHUB_REGISTRY/$GITHUB_OWNER/$GITHUB_DOCKER_IMAGE-testnet:${{ env.SHA }}
docker push $GITHUB_REGISTRY/$GITHUB_OWNER/$GITHUB_DOCKER_IMAGE-testnet:latest
- uses: actions/checkout@v2
- name: Login into Docker Hub
env:
DOCKER_HUB_USER: ${{secrets.DOCKER_HUB_USER}}
DOCKER_HUB_PASSWORD: ${{secrets.DOCKER_HUB_PASSWORD}}
run: |
docker login -u $DOCKER_HUB_USER -p $DOCKER_HUB_PASSWORD
- name: Publish Docker to Docker Hub
run: |
docker push mjovanc/$GITHUB_DOCKER_IMAGE-testnet:${{ env.SHA }}
docker push mjovanc/$GITHUB_DOCKER_IMAGE-testnet:latest
docker-mainnet:
name: Build and Publish Docker Image for main-net
runs-on: ubuntu-22.04
needs: [build]
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v2
- uses: benjlevesque/[email protected]

- name: Log into registry ghcr.io
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GHCR_PAT }}

- name: Build Docker
run: |
docker build -t $GITHUB_REGISTRY/$GITHUB_OWNER/$GITHUB_DOCKER_IMAGE:${{ env.SHA }} . --no-cache
- name: Tag Image
run: |
docker tag $GITHUB_REGISTRY/$GITHUB_OWNER/$GITHUB_DOCKER_IMAGE:${{ env.SHA }} $GITHUB_REGISTRY/$GITHUB_OWNER/$GITHUB_DOCKER_IMAGE:latest
docker tag $GITHUB_REGISTRY/$GITHUB_OWNER/$GITHUB_DOCKER_IMAGE:${{ env.SHA }} mjovanc/$GITHUB_DOCKER_IMAGE:${{ env.SHA }}
docker tag $GITHUB_REGISTRY/$GITHUB_OWNER/$GITHUB_DOCKER_IMAGE:${{ env.SHA }} mjovanc/$GITHUB_DOCKER_IMAGE:latest
- name: Publish Docker to GitHub Repository
run: |
docker push $GITHUB_REGISTRY/$GITHUB_OWNER/$GITHUB_DOCKER_IMAGE:${{ env.SHA }}
docker push $GITHUB_REGISTRY/$GITHUB_OWNER/$GITHUB_DOCKER_IMAGE:latest
- uses: actions/checkout@v2
- name: Login into Docker Hub
env:
DOCKER_HUB_USER: ${{secrets.DOCKER_HUB_USER}}
DOCKER_HUB_PASSWORD: ${{secrets.DOCKER_HUB_PASSWORD}}
run: |
docker login -u $DOCKER_HUB_USER -p $DOCKER_HUB_PASSWORD
- name: Publish Docker to Docker Hub
run: |
docker push mjovanc/$GITHUB_DOCKER_IMAGE:${{ env.SHA }}
docker push mjovanc/$GITHUB_DOCKER_IMAGE:latest
Loading

0 comments on commit 11ae88d

Please sign in to comment.