Skip to content

Commit 9f4e935

Browse files
authored
Merge Development 0.2.0
Development 0.2.0
2 parents a32eade + ab26b23 commit 9f4e935

File tree

204 files changed

+24689
-30408
lines changed

Some content is hidden

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

204 files changed

+24689
-30408
lines changed

.github/workflows/c-cpp.yml

+31-52
Original file line numberDiff line numberDiff line change
@@ -14,100 +14,79 @@ jobs:
1414
setup:
1515
runs-on: ubuntu-latest
1616

17-
container:
17+
container:
1818
image: debian:bookworm
1919

2020
steps:
2121
- name: Checkout repository
22-
uses: actions/checkout@v2
23-
22+
uses: actions/checkout@v4
23+
2424
- name: Update apt-get
2525
run: apt-get update
2626

2727
- name: Install project dependencies
28-
run: DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential cmake tmux clang-tidy autoconf libtool pkg-config libabsl-dev libboost-all-dev libc-ares-dev libcrypto++-dev libgrpc-dev libgrpc++-dev librocksdb-dev libscrypt-dev libsnappy-dev libssl-dev zlib1g-dev openssl protobuf-compiler protobuf-compiler-grpc libprotobuf-dev git doxygen
28+
run: DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential cmake tmux clang-tidy autoconf libtool pkg-config libabsl-dev libboost-all-dev libc-ares-dev libcrypto++-dev libgrpc-dev libgrpc++-dev librocksdb-dev libscrypt-dev libsnappy-dev libssl-dev zlib1g-dev openssl protobuf-compiler protobuf-compiler-grpc libprotobuf-dev git doxygen curl unzip
2929

3030
- name: Print GCC version
3131
run: gcc --version
3232

3333
- name: Install CA certificates
3434
run: apt-get install -y ca-certificates
3535

36-
build:
36+
build_test_and_analyse:
3737
needs: setup
3838
runs-on: ubuntu-latest
3939

4040
container:
4141
image: debian:bookworm
42-
42+
env:
43+
# https://docs.sonarqube.org/latest/analysis/scan/sonarscanner/
44+
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
4345
steps:
4446
- name: Checkout repository
45-
uses: actions/checkout@v2
47+
uses: actions/checkout@v4
4648

4749
- name: Update apt-get
4850
run: apt-get update
4951

5052
- name: Install project dependencies
51-
run: DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential cmake tmux clang-tidy autoconf libtool pkg-config libabsl-dev libboost-all-dev libc-ares-dev libcrypto++-dev libgrpc-dev libgrpc++-dev librocksdb-dev libscrypt-dev libsnappy-dev libssl-dev zlib1g-dev openssl protobuf-compiler protobuf-compiler-grpc libprotobuf-dev git
52-
53-
- name: Configure CMake
54-
run: cmake -S . -B build
55-
56-
- name: Build with CMake
57-
run: cmake --build build || cat build/deps/src/ethash-stamp/ethash-configure-*.log
53+
run: DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential cmake tmux clang-tidy autoconf libtool pkg-config libabsl-dev libboost-all-dev libc-ares-dev libcrypto++-dev libgrpc-dev libgrpc++-dev librocksdb-dev libscrypt-dev libsnappy-dev libssl-dev zlib1g-dev openssl protobuf-compiler protobuf-compiler-grpc libprotobuf-dev git curl unzip gcovr
5854

59-
- name: Upload build artifacts
60-
uses: actions/upload-artifact@v2
61-
with:
62-
name: build
63-
path: build
55+
- name: Install sonar-scanner and build-wrapper
56+
uses: SonarSource/sonarcloud-github-c-cpp@v2
6457

65-
test:
66-
needs: build
67-
runs-on: ubuntu-latest
58+
- name: Configure CMake
59+
run: cmake -S . -B build -DSONARQUBE_ANALYSIS=ON -DDEBUG=OFF
6860

69-
container:
70-
image: debian:bookworm
61+
- name: Build with SonarQube BuildWrapper + CMake
62+
run: build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build build/ --config Release -- -j $(nproc)
7163

72-
steps:
73-
- name: Checkout repository
74-
uses: actions/checkout@v2
75-
76-
- name: Download build artifacts
77-
uses: actions/download-artifact@v2
78-
with:
79-
name: build
80-
path: build
81-
82-
- name: Update apt-get
83-
run: apt-get update
84-
85-
- name: Install project dependencies
86-
run: DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential cmake tmux clang-tidy autoconf libtool pkg-config libabsl-dev libboost-all-dev libc-ares-dev libcrypto++-dev libgrpc-dev libgrpc++-dev librocksdb-dev libscrypt-dev libsnappy-dev libssl-dev zlib1g-dev openssl protobuf-compiler protobuf-compiler-grpc libprotobuf-dev git
87-
8864
- name: Give execute permissions
8965
run: chmod +x ./build/orbitersdkd-tests
9066

9167
- name: Run Catch2 Tests
92-
working-directory: build
93-
run: ./orbitersdkd-tests -d yes
68+
run: ./build/orbitersdkd-tests -d yes
69+
70+
- name: Collect coverage into one XML report
71+
run: |
72+
gcovr --gcov-ignore-parse-errors --sonarqube > coverage.xml
9473
74+
- name: Run SonarQube Scanner
75+
env:
76+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
77+
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
78+
run: |
79+
sonar-scanner --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" --define sonar.coverageReportPaths=coverage.xml
9580
documentation:
96-
needs: test
81+
needs: build_test_and_analyse
9782
runs-on: ubuntu-latest
9883

9984
container:
10085
image: debian:bookworm
10186

10287
steps:
10388
- name: Checkout repository
104-
uses: actions/checkout@v2
105-
106-
- name: Download build artifacts
107-
uses: actions/download-artifact@v2
108-
with:
109-
name: build
110-
path: build
89+
uses: actions/checkout@v4
11190

11291
- name : Update apt-get
11392
run: apt-get update
@@ -121,7 +100,7 @@ jobs:
121100
doxygen Doxyfile
122101
123102
- name: Publish Documentation
124-
uses: actions/upload-artifact@v2
103+
uses: actions/upload-artifact@v4
125104
with:
126105
name: Documentation
127-
path: docs
106+
path: docs

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
ABI/
22
build/
3+
testdump/
34
debug.txt
5+
debug.log
46
log.txt
57
*.o
68
*.gch

CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@ if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
1717
endif()
1818

1919
# Project data
20-
project(orbitersdk VERSION 0.1.2 DESCRIPTION "Sparq subnet")
20+
project(orbitersdk VERSION 0.2.0 DESCRIPTION "Sparq subnet")
2121
set(CMAKE_CXX_STANDARD 23)
2222
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
2323
set(CMAKE_CXX_EXTENSIONS OFF)
2424
SET(DEBUG ON CACHE BOOL "Debug mode")
2525
if(DEBUG)
2626
set(CMAKE_CXX_FLAGS "-O0 -g -fsanitize=address -fno-inline -fno-eliminate-unused-debug-types -fstack-protector -Werror=unused-variable") # Provides faster compile time.
27+
elseif(SONARQUBE_ANALYSIS)
28+
set(CMAKE_CXX_FLAGS "-O0 -g --coverage")
2729
else()
2830
set(CMAKE_CXX_FLAGS "-O2 -Werror=unused-variable")
2931
endif()

Dockerfile

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Copyright (c) [2023-2024] [Sparq Network]
2+
# This software is distributed under the MIT License.
3+
# See the LICENSE.txt file in the project root for more information.
4+
15
# Start from a base Debian image
26
FROM debian:bookworm
37

@@ -47,4 +51,4 @@ CMD nohup unison -repeat 1 /orbitersdk-volume /orbitersdk-cpp -auto -batch \
4751
-ignore 'Name {*.o}' \
4852
-ignore 'Name {*.gch}' \
4953
> /dev/null 2>&1 & \
50-
/bin/bash
54+
/bin/bash

Doxyfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ WARN_NO_PARAMDOC = NO
864864
# Possible values are: NO, YES and FAIL_ON_WARNINGS.
865865
# The default value is: NO.
866866

867-
WARN_AS_ERROR = FAIL_ON_WARNINGS
867+
WARN_AS_ERROR = NO
868868

869869
# The WARN_FORMAT tag determines the format of the warning messages that doxygen
870870
# can produce. The string should contain the $file, $line, and $text tags, which
@@ -995,7 +995,7 @@ RECURSIVE = YES
995995
# Note that relative paths are relative to the directory from which doxygen is
996996
# run.
997997

998-
EXCLUDE = "src/libs" "src/utils/json.hpp" "src/utils/meta_all.hpp" "src/utils/options.cpp"
998+
EXCLUDE = "src/libs" "src/libs/json.hpp" "src/libs/meta_all.hpp" "src/utils/options.cpp"
999999

10001000
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
10011001
# directories that are symbolic links (a Unix file system feature) are excluded

README.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,12 @@ Note that, when re-deploying, if your wallet or RPC client keeps track of accoun
112112
The deployed chain will have the following information by default:
113113

114114
* ChainID: **808080**
115-
* Owner: **0x00dead00665771855a34155f5e7405489df2c3c6**
116-
* Owner Private Key: **0xe89ef6409c467285bcae9f80ab1cfeb3487cfe61ab28fb7d36443e1daa0c2867**
117-
* Owner Initial Balance: **1000000000000000000000 wei**
115+
* Chain Owner: **0x00dead00665771855a34155f5e7405489df2c3c6**
116+
* Chain Owner Private Key: **0xe89ef6409c467285bcae9f80ab1cfeb3487cfe61ab28fb7d36443e1daa0c2867**
117+
* Chain Owner Initial Balance: **1000000000000000000000 wei**
118+
* Genesis Private Key: **0x4d48bdf34d65ef2bed2e4ee9020a7d3162b494ac31d3088153425f286f3d3c8c**
119+
* Genesis Address: **0x00dead001ae76ac3d3f282ffb8481becdee17357**
120+
* Genesis Timestamp: **1656356646000000**
118121
* ContractManager Address: **0x0001cb47ea6d8b55fe44fdd6b1bdb579efb43e61**
119122
* rdPoS Address: **0xb23aa52dbeda59277ab8a962c69f5971f22904cf**
120123
* Default RPC URL: **http://127.0.0.1:8090**

docker-compose.yml

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Copyright (c) [2023-2024] [Sparq Network]
2+
# This software is distributed under the MIT License.
3+
# See the LICENSE.txt file in the project root for more information.
4+
15
version: '3'
26

37
services:

0 commit comments

Comments
 (0)