Skip to content

Commit 52af54e

Browse files
committed
initial commit
built on: https://github.com/krypdkat/qubicbob big thanks to @krypdkat for open sourcing qubicbob!!!
0 parents  commit 52af54e

File tree

123 files changed

+35930
-0
lines changed

Some content is hidden

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

123 files changed

+35930
-0
lines changed

.dockerignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
build/
2+
.git/
3+
*.o
4+
*.a
5+
*.so
6+
.vscode/
7+
.idea/

.github/workflows/ci.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: CI
2+
on:
3+
push:
4+
branches: [ "**" ]
5+
pull_request:
6+
branches: [ "**" ]
7+
jobs:
8+
build-linux:
9+
uses: ./.github/workflows/linux-build.yml
10+
with:
11+
configuration: Release

.github/workflows/linux-build.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
name: Bob-Linux
7+
8+
on:
9+
workflow_call:
10+
inputs:
11+
configuration:
12+
description: "Build configuration"
13+
required: true
14+
default: "Release"
15+
type: string
16+
build_dir:
17+
description: "Build directory"
18+
required: false
19+
default: "build"
20+
type: string
21+
22+
permissions:
23+
contents: read
24+
25+
jobs:
26+
build:
27+
runs-on: ubuntu-latest
28+
outputs:
29+
artifact-path: ${{ steps.build.outputs.path }}
30+
steps:
31+
# Checkout source
32+
- name: Checkout repository
33+
uses: actions/checkout@v4
34+
35+
# Install dependencies
36+
- name: Install CMake and dependencies
37+
run: |
38+
sudo apt update -y;
39+
wget https://apt.llvm.org/llvm.sh; chmod +x llvm.sh; sudo ./llvm.sh 20;
40+
sudo apt install vim net-tools tmux cmake git libjsoncpp-dev build-essential cmake uuid-dev libhiredis-dev zlib1g-dev unzip -y;
41+
42+
# Configure the project
43+
- name: Configure with CMake
44+
run: |
45+
cmake -S . -B ${{ inputs.build_dir }} \
46+
-DCMAKE_BUILD_TYPE=${{ inputs.configuration }} \
47+
-DCMAKE_C_COMPILER=clang-20 \
48+
-DCMAKE_CXX_COMPILER=clang++-20
49+
50+
# Build the project
51+
- name: Build with Make
52+
run: cmake --build ${{ inputs.build_dir }} --config ${{ inputs.configuration }} -- -j$(nproc)
53+
54+
# Upload build artifacts
55+
- name: Upload build artifacts
56+
uses: actions/upload-artifact@v4
57+
with:
58+
name: BobLinuxBuild-${{ inputs.configuration }}
59+
path: |
60+
${{ inputs.build_dir }}

.github/workflows/release.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Release
2+
on:
3+
push:
4+
tags: ["*"]
5+
6+
env:
7+
RELEASE_BUILD_DIR: "build"
8+
BUILD_CONFIGURATION: "Release"
9+
10+
jobs:
11+
build-linux:
12+
uses: ./.github/workflows/linux-build.yml
13+
with:
14+
configuration: Release
15+
build_dir: build
16+
17+
publish-linux:
18+
needs: build-linux
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Download Linux build artifact
22+
uses: actions/download-artifact@v4
23+
with:
24+
name: BobLinuxBuild-${{ env.BUILD_CONFIGURATION }}
25+
path: ${{ env.RELEASE_BUILD_DIR }}
26+
27+
- name: Create release package
28+
uses: softprops/action-gh-release@v2
29+
with:
30+
name: "BOB ${{ github.ref_name }}"
31+
body: "Automated release of Bob version ${{ github.ref_name }}"
32+
files: ${{ env.RELEASE_BUILD_DIR }}/bob
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.idea/*
2+
build/*
3+
cmake-build-*

ANATOMY_OF_BOB.MD

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# The anatomy of BOB
2+
3+
## Core Processors
4+
5+
The core of BOB consists of four main processors dedicated to syncing and verifying network data.
6+
7+
* **Thread #1: Tick Data Requester**
8+
* This thread constantly queries the network for new tick data, votes, and transactions.
9+
* It performs a pre-check to ensure data sufficiency (e.g., 451+ votes agree to execute the same tick, or 226+ votes agree on an empty tick).
10+
11+
* **Thread #2: Logging Event Requester**
12+
* This thread queries the network for logging and event data on a per-tick basis, adhering to the Qubic logging event protocol.
13+
* It first requests the `logId` range for each transaction within a tick and then fetches all associated logging data for that tick.
14+
15+
* **Thread #3: Data Integrity Verifier**
16+
* This thread verifies the integrity of all data collected by the threads above.
17+
* As logging events represent the most primitive actions in Qubic, they are used to reconstruct and validate the Spectrum and Universe every tick.
18+
19+
* **Thread #4: Indexer**
20+
* After the data has been successfully verified, this thread indexes it to ensure it is easily searchable.
21+
22+
---
23+
24+
## Additional Modules
25+
26+
Beside the core processors, BOB also features two optional modules that can be disabled without halting its functionality.
27+
28+
* **TCP Server**
29+
* This server mimics the behavior of a core baremetal for critical request/response cycles (e.g., requests for `tickData`, `votes`, `transactions`).
30+
* Its purpose is to help strengthen the existing network.
31+
32+
* **REST API Server**
33+
* This server provides a developer-friendly interface for builders to access all the indexed data mentioned above.

0 commit comments

Comments
 (0)