Skip to content

Commit cd17874

Browse files
committed
EpicChain-CPP-Engine - EpicChain Lab's
0 parents commit cd17874

File tree

186 files changed

+79417
-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.

186 files changed

+79417
-0
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: C/C++ CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
11+
testEmscriptenNode:
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: docker://trzeci/emscripten:latest
18+
19+
- name: make vendor_js
20+
run: make vendor_js
21+
22+
- name: Make using emscripten image
23+
run: docker run -v $(pwd):/src trzeci/emscripten make js
24+
25+
- name: Make run_js basic test
26+
run: make run_js
27+
28+
testEmscriptenWeb:
29+
30+
runs-on: ubuntu-latest
31+
32+
strategy:
33+
matrix:
34+
node-version: [12.x]
35+
36+
steps:
37+
- uses: actions/checkout@v2
38+
- uses: docker://trzeci/emscripten:latest
39+
40+
- name: make vendor_js
41+
run: make vendor_js
42+
43+
- name: npm run build
44+
uses: actions/setup-node@v1
45+
with:
46+
node-version: ${{ matrix.node-version }}
47+
- run: cd ./packages/lib-neopt-core-js/ && npm install
48+
- run: cd ./packages/lib-neopt-core-js/ && npm run build
49+
50+
- name: run npm start for starting an express server with nohup
51+
run: cd ./packages/lib-neopt-core-js/ && nohup npm run serve &
52+
53+
- name: run install for test
54+
run: cd ./packages/lib-neopt-core-js/tests && npm install
55+
56+
- name: run bundle test on server
57+
run: cd ./packages/lib-neopt-core-js/tests && npm test
58+
59+
testC:
60+
61+
runs-on: ubuntu-latest
62+
63+
steps:
64+
- uses: actions/checkout@v2
65+
66+
- name: make vendor_cpp
67+
run: make vendor_cpp
68+
69+
- name: make
70+
run: make
71+
72+
- name: make test
73+
run: make test

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build/

.gitmodules

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[submodule "libs/libcrypton"]
2+
path = libs/libcrypton
3+
url = https://github.com/NeoResearch/libcrypton.git
4+
[submodule "libs/csbiginteger-cpp"]
5+
path = libs/csbiginteger-cpp
6+
url = https://github.com/NeoResearch/csbiginteger-cpp
7+
[submodule "libs/lib/node_modules/csBigInteger.js"]
8+
path = libs/lib/node_modules/csBigInteger.js
9+
url = https://github.com/NeoResearch/csBigInteger.js.git
10+
[submodule "libs/csbiginteger-js"]
11+
path = libs/csbiginteger-js
12+
url = https://github.com/NeoResearch/csbiginteger-js.git

.vscode/c_cpp_properties.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"configurations": [
3+
{
4+
"name": "Linux",
5+
"includePath": [
6+
"${workspaceFolder}/**",
7+
"${workspaceFolder}/libs/**",
8+
"${workspaceFolder}/src/**",
9+
"${workspaceFolder}/tests/**"
10+
],
11+
"defines": [],
12+
"compilerPath": "/usr/bin/g++",
13+
"cStandard": "c11",
14+
"cppStandard": "c++17",
15+
"intelliSenseMode": "gcc-x64",
16+
"compilerArgs": [
17+
"-fconcepts"
18+
]
19+
}
20+
],
21+
"version": 4
22+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"folders": [
3+
{
4+
"path": ".."
5+
}
6+
],
7+
"settings": {
8+
"files.associations": {
9+
"*.tcc": "cpp",
10+
"deque": "cpp",
11+
"list": "cpp",
12+
"string": "cpp",
13+
"unordered_map": "cpp",
14+
"vector": "cpp",
15+
"system_error": "cpp",
16+
"array": "cpp",
17+
"string_view": "cpp",
18+
"initializer_list": "cpp",
19+
"optional": "cpp",
20+
"functional": "cpp",
21+
"iosfwd": "cpp",
22+
"iterator": "cpp",
23+
"limits": "cpp"
24+
}
25+
}
26+
}

.vscode/settings.json

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
{
2+
"[cpp]": {
3+
"editor.tabSize": 3,
4+
"editor.detectIndentation": false
5+
},
6+
"C_Cpp.intelliSenseEngine": "Tag Parser",
7+
"C_Cpp.clang_format_fallbackStyle": "{ BasedOnStyle : Mozilla , ColumnLimit : 0, IndentWidth: 3, AccessModifierOffset: -3}",
8+
"testMate.cpp.test.executables": "{tests,build,Build,BUILD,out,Out,OUT}/**/*{test,Test,TEST}*",
9+
"files.exclude": {
10+
"**/.git": true,
11+
"**/.svn": true,
12+
"**/.hg": true,
13+
"**/CVS": true,
14+
"**/.DS_Store": true,
15+
"**/.disabled": true,
16+
"libs/libcrypton/libopenssl/**" : true,
17+
"libs/libcrypton/thirdparty/**" : true,
18+
"libs/csbiginteger-cpp/src/*.cpp" : true,
19+
"libs/csbiginteger-cpp/src/dotnet/**" : true
20+
},
21+
"files.associations": {
22+
"type_traits": "cpp",
23+
"array": "cpp",
24+
"atomic": "cpp",
25+
"*.tcc": "cpp",
26+
"bitset": "cpp",
27+
"cctype": "cpp",
28+
"chrono": "cpp",
29+
"clocale": "cpp",
30+
"cmath": "cpp",
31+
"condition_variable": "cpp",
32+
"cstdarg": "cpp",
33+
"cstddef": "cpp",
34+
"cstdint": "cpp",
35+
"cstdio": "cpp",
36+
"cstdlib": "cpp",
37+
"cstring": "cpp",
38+
"ctime": "cpp",
39+
"cwchar": "cpp",
40+
"cwctype": "cpp",
41+
"deque": "cpp",
42+
"forward_list": "cpp",
43+
"list": "cpp",
44+
"unordered_map": "cpp",
45+
"unordered_set": "cpp",
46+
"vector": "cpp",
47+
"exception": "cpp",
48+
"algorithm": "cpp",
49+
"functional": "cpp",
50+
"iterator": "cpp",
51+
"map": "cpp",
52+
"memory": "cpp",
53+
"memory_resource": "cpp",
54+
"numeric": "cpp",
55+
"optional": "cpp",
56+
"random": "cpp",
57+
"ratio": "cpp",
58+
"regex": "cpp",
59+
"set": "cpp",
60+
"string": "cpp",
61+
"string_view": "cpp",
62+
"system_error": "cpp",
63+
"tuple": "cpp",
64+
"utility": "cpp",
65+
"fstream": "cpp",
66+
"future": "cpp",
67+
"initializer_list": "cpp",
68+
"iomanip": "cpp",
69+
"iosfwd": "cpp",
70+
"iostream": "cpp",
71+
"istream": "cpp",
72+
"limits": "cpp",
73+
"mutex": "cpp",
74+
"new": "cpp",
75+
"ostream": "cpp",
76+
"sstream": "cpp",
77+
"stdexcept": "cpp",
78+
"streambuf": "cpp",
79+
"thread": "cpp",
80+
"cinttypes": "cpp",
81+
"typeinfo": "cpp",
82+
"variant": "cpp",
83+
"coroutine": "cpp",
84+
"shared_mutex": "cpp",
85+
"compare": "cpp",
86+
"concepts": "cpp",
87+
"ranges": "cpp",
88+
"bit": "cpp",
89+
"hash_map": "cpp",
90+
"hash_set": "cpp",
91+
"complex": "cpp",
92+
"valarray": "cpp"
93+
}
94+
}

.vscode/tasks.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558
3+
// for the documentation about the tasks.json format
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"label": "debug",
8+
"type": "shell",
9+
"command": "(cd tests && make test)",
10+
"group": {
11+
"kind": "build",
12+
"isDefault": true
13+
},
14+
"problemMatcher": [
15+
"$gcc"
16+
]
17+
},
18+
{
19+
"label": "make test",
20+
"type": "shell",
21+
"command": "(cd tests && make test)",
22+
"group": {
23+
"kind": "build",
24+
"isDefault": true
25+
},
26+
"problemMatcher": [
27+
"$gcc"
28+
]
29+
}
30+
]
31+
}

README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# EpicChain-CPP-Engine
2+
3+
## Overview
4+
5+
**EpicChain-CPP-Engine** is the C++ core engine for the EpicChain blockchain platform. It provides a foundational implementation of the blockchain's core functionalities and is designed to work seamlessly with the EpicChain ecosystem, including integrations with JavaScript-based tools and libraries.
6+
7+
## Getting Started
8+
9+
### Cloning the Repository
10+
11+
To get started, clone the repository and initialize submodules:
12+
13+
```bash
14+
git clone https://github.com/epicchain/EpicChain-CPP-Engine.git
15+
cd EpicChain-CPP-Engine
16+
git submodule update --init --recursive
17+
git submodule update --recursive
18+
```
19+
20+
### Building and Testing
21+
22+
**EpicChain-CPP-Engine** is in the prototype stage but is already quite advanced. To build and test the C++ and JavaScript implementations:
23+
24+
- **For C++ Implementation**:
25+
- Build the project by running:
26+
```bash
27+
make
28+
```
29+
- Run the built application:
30+
```bash
31+
./build/app_main
32+
```
33+
34+
- **For JavaScript Implementation**:
35+
- Build and run the tests by executing:
36+
```bash
37+
make jstest
38+
```
39+
- This command will build everything and run `node_test.js`.
40+
41+
## Dependencies
42+
43+
**EpicChain-CPP-Engine** relies on several key external libraries:
44+
45+
- **BigInteger Library**:
46+
- **C++**: Uses [csBigInteger-cpp](https://github.com/neoresearch/csBigInteger-cpp), which depends on GNU MP (GMP) or optionally Mono BigInteger.
47+
- **JavaScript**: Utilizes [csBigInteger.js](https://github.com/neoresearch/csBigInteger.js), which uses [bn.js](https://github.com/indutny/bn.js).
48+
49+
- **Cryptography Library**:
50+
- **C++**: Incorporates [libcrypton](https://github.com/neoresearch/libcrypton), which uses OpenSSL or optionally Crypto++ from Wei Dai.
51+
- **JavaScript**: Employs [crypto-js](https://github.com/brix/crypto-js) for SHA256 and may use [elliptic](https://github.com/indutny/elliptic) for elliptic curve operations.
52+
53+
## Contributing
54+
55+
Contributions are welcome! Please refer to the [Contribution Guidelines](CONTRIBUTING.md) for details on how to contribute to the project.
56+
57+
## License
58+
59+
This project is licensed under the [MIT License](LICENSE).
60+
61+
## Contact
62+
63+
For questions or further information, please reach out to us at [support@epic-chain.org](mailto:support@epic-chain.org).
64+

libs/cpp-base64/LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright © 2004-2017 by René Nyffenegger
2+
3+
This source code is provided 'as-is', without any express or implied
4+
warranty. In no event will the author be held liable for any damages
5+
arising from the use of this software.
6+
7+
Permission is granted to anyone to use this software for any purpose,
8+
including commercial applications, and to alter it and redistribute it
9+
freely, subject to the following restrictions:
10+
11+
1. The origin of this source code must not be misrepresented; you must not
12+
claim that you wrote the original source code. If you use this source code
13+
in a product, an acknowledgment in the product documentation would be
14+
appreciated but is not required.
15+
16+
2. Altered source versions must be plainly marked as such, and must not be
17+
misrepresented as being the original source code.
18+
19+
3. This notice may not be removed or altered from any source distribution.

0 commit comments

Comments
 (0)