mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-16 00:55:49 +00:00
Compare commits
350 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7c66747d27 | ||
|
|
cdd37a2a05 | ||
|
|
c66be3e6cf | ||
|
|
70779f6850 | ||
|
|
525aaecbca | ||
|
|
9d3cd718e4 | ||
|
|
656e9fe180 | ||
|
|
8aa617d972 | ||
|
|
711608e652 | ||
|
|
bc9773eb45 | ||
|
|
bea9610440 | ||
|
|
375af87a86 | ||
|
|
1502e6e2cd | ||
|
|
593677ee82 | ||
|
|
8f58687091 | ||
|
|
c7e6803956 | ||
|
|
6faaa91850 | ||
|
|
d66d960d59 | ||
|
|
18235067af | ||
|
|
3eb8aa8b80 | ||
|
|
b9903bbcc4 | ||
|
|
48803a48af | ||
|
|
1b9387eddc | ||
|
|
34ca457132 | ||
|
|
df60e46750 | ||
|
|
e7e672c3f8 | ||
|
|
4d5459d041 | ||
|
|
59f5844381 | ||
|
|
a07a729e3d | ||
|
|
b65e279db6 | ||
|
|
1ddc966b31 | ||
|
|
1a8eb5e6e3 | ||
|
|
6a8180c967 | ||
|
|
eb57679085 | ||
|
|
297def5ed3 | ||
|
|
a01cadbfd5 | ||
|
|
11ca9a946c | ||
|
|
f326f019bf | ||
|
|
90326bf756 | ||
|
|
255bf829ca | ||
|
|
0623a40f02 | ||
|
|
a529b218f3 | ||
|
|
c0cb389b20 | ||
|
|
8f82b62e0d | ||
|
|
dc213a4fab | ||
|
|
06e87e0f6a | ||
|
|
c2a08a1f26 | ||
|
|
df02eb125f | ||
|
|
0c13676d5f | ||
|
|
74e6ed1af3 | ||
|
|
72377e7bf2 | ||
|
|
5b085a75fd | ||
|
|
61389a8bef | ||
|
|
bd97e59254 | ||
|
|
95ecf296ad | ||
|
|
b7e0306d0a | ||
|
|
a9ee802240 | ||
|
|
d23d37fcfd | ||
|
|
289bc0afd9 | ||
|
|
c5dc00af74 | ||
|
|
d49b486224 | ||
|
|
417cfc2fb0 | ||
|
|
febbe14e6d | ||
|
|
44514930f9 | ||
|
|
dc778536ed | ||
|
|
18584ef2fd | ||
|
|
416ce35d73 | ||
|
|
7c12f01358 | ||
|
|
5a4654a0da | ||
|
|
89766c5f21 | ||
|
|
4ec11e692b | ||
|
|
d02f0e11c5 | ||
|
|
e28989638d | ||
|
|
915fe31274 | ||
|
|
db720a59e4 | ||
|
|
72752b1ee0 | ||
|
|
c663f1f62b | ||
|
|
d54f6278bb | ||
|
|
fc04336caa | ||
|
|
47376a0cc3 | ||
|
|
45aa0142a6 | ||
|
|
e3acb61d57 | ||
|
|
8fa33795a3 | ||
|
|
b1c9b134dc | ||
|
|
ae9930b87d | ||
|
|
aaa601841c | ||
|
|
8ca2d98496 | ||
|
|
ad805eb95b | ||
|
|
eb17325cbe | ||
|
|
b00787e161 | ||
|
|
81e7ec859d | ||
|
|
6f6179abb4 | ||
|
|
32a26a65d9 | ||
|
|
daccb5b4c0 | ||
|
|
cf97dcb992 | ||
|
|
6746b863b3 | ||
|
|
bf013c02ad | ||
|
|
fbedfb25ae | ||
|
|
9e877a929e | ||
|
|
e0eae9725b | ||
|
|
3083983fee | ||
|
|
5050b366d9 | ||
|
|
f0c237e001 | ||
|
|
970711f1fd | ||
|
|
19018e8959 | ||
|
|
7edfbbd8bd | ||
|
|
d36024394d | ||
|
|
35e0ab4280 | ||
|
|
ef60ac8348 | ||
|
|
0c47cfad6f | ||
|
|
eb6b79bed7 | ||
|
|
eaff0d30fb | ||
|
|
fae9f9b24b | ||
|
|
5d44998368 | ||
|
|
a145759d1e | ||
|
|
e2a42184b9 | ||
|
|
00a4c3a478 | ||
|
|
0320d2169e | ||
|
|
da26d11593 | ||
|
|
90aa3c75a7 | ||
|
|
1197e49068 | ||
|
|
b6ed50eb03 | ||
|
|
8c78c83d05 | ||
|
|
a5c4684273 | ||
|
|
2bbf0eb588 | ||
|
|
6095f55bf1 | ||
|
|
f64bd54093 | ||
|
|
bc91fd740f | ||
|
|
4a9bd7ed6d | ||
|
|
1ca8898703 | ||
|
|
8a25f32824 | ||
|
|
d9d001dffd | ||
|
|
bdfafa0b58 | ||
|
|
2266b04dd8 | ||
|
|
c50d166c23 | ||
|
|
de43d43560 | ||
|
|
f954faada6 | ||
|
|
9f75f2d522 | ||
|
|
cf70ecbd6d | ||
|
|
2a298469be | ||
|
|
3be668b343 | ||
|
|
2027f642ec | ||
|
|
9376d81d0d | ||
|
|
54e5d5fc35 | ||
|
|
b8552abcea | ||
|
|
3fb60a89a3 | ||
|
|
15b0ae5bf0 | ||
|
|
33b396c7b4 | ||
|
|
ea145d12c7 | ||
|
|
0d17dd8228 | ||
|
|
af5f28cbf8 | ||
|
|
234b754038 | ||
|
|
c231adf324 | ||
|
|
7a088a5280 | ||
|
|
96bbabbd2e | ||
|
|
e37c108195 | ||
|
|
53df35eef3 | ||
|
|
1061b01ab3 | ||
|
|
aee422e819 | ||
|
|
324667b877 | ||
|
|
10d73655bc | ||
|
|
96f11c786e | ||
|
|
9202197354 | ||
|
|
d78a396525 | ||
|
|
cd27b5f2bd | ||
|
|
78bc2727f7 | ||
|
|
8b58e93a2e | ||
|
|
3752234161 | ||
|
|
bf75094224 | ||
|
|
8d59c7dd40 | ||
|
|
a1fd579756 | ||
|
|
b9943d3746 | ||
|
|
b5502a49c3 | ||
|
|
7bd5d51e4e | ||
|
|
d4d937c37b | ||
|
|
2f0231025f | ||
|
|
f1a9e8840f | ||
|
|
2c559116fb | ||
|
|
4bedbd1d39 | ||
|
|
433feade5d | ||
|
|
10e4608ce0 | ||
|
|
ff3d2e7c29 | ||
|
|
7822a28c87 | ||
|
|
dcba79be48 | ||
|
|
2a7c573dec | ||
|
|
22cc9a254a | ||
|
|
09ae9168ca | ||
|
|
9eb9b8f631 | ||
|
|
6298daba1a | ||
|
|
2eb1c6a396 | ||
|
|
7717056cf2 | ||
|
|
9fd5cd303d | ||
|
|
04ff6249d5 | ||
|
|
fa9ecae2d6 | ||
|
|
62d2b76fa8 | ||
|
|
d95aab1139 | ||
|
|
80c2302fd3 | ||
|
|
38f954fd46 | ||
|
|
14b2f27c3e | ||
|
|
a2a37a928a | ||
|
|
c10c0be11b | ||
|
|
34ee4ca0cb | ||
|
|
30fd45890b | ||
|
|
36fe1966c3 | ||
|
|
1bb99e5d3c | ||
|
|
430802c1cf | ||
|
|
9106a06579 | ||
|
|
79e69da364 | ||
|
|
73116297aa | ||
|
|
8579eb0c19 | ||
|
|
9c8caddc5a | ||
|
|
2913847925 | ||
|
|
cf8438fe1d | ||
|
|
6d82fb83a0 | ||
|
|
207e1730e9 | ||
|
|
f0424fe7dd | ||
|
|
2e456a835d | ||
|
|
ab9039e77d | ||
|
|
9932a19139 | ||
|
|
64e4a89470 | ||
|
|
9d89d4c188 | ||
|
|
b2bf2b6e6b | ||
|
|
3b33318dc8 | ||
|
|
85307b29d0 | ||
|
|
95426efb8a | ||
|
|
3e2b568ef9 | ||
|
|
a06525649d | ||
|
|
b4699c3b46 | ||
|
|
27d978b891 | ||
|
|
f91b568069 | ||
|
|
06bd16c928 | ||
|
|
c0a0b79d2d | ||
|
|
1d5d902d28 | ||
|
|
f284a19246 | ||
|
|
735b8b7d48 | ||
|
|
a2e1a7a84d | ||
|
|
c138338358 | ||
|
|
e7eba93666 | ||
|
|
93ea4b2f4f | ||
|
|
5776c2ebe5 | ||
|
|
8defb4cd28 | ||
|
|
d358495f02 | ||
|
|
38dd2d6677 | ||
|
|
80bd107e57 | ||
|
|
68286df23d | ||
|
|
d494d7a725 | ||
|
|
36be4856fd | ||
|
|
c47b4f3667 | ||
|
|
fe129e8e4f | ||
|
|
0a1fb4e6ca | ||
|
|
7e97bfce10 | ||
|
|
49409dbf27 | ||
|
|
c3227a67ec | ||
|
|
a4a46a491f | ||
|
|
c11037fd27 | ||
|
|
114981f774 | ||
|
|
27543170d0 | ||
|
|
b0a39c5f86 | ||
|
|
4fbb1699be | ||
|
|
319f29da8d | ||
|
|
70bacb349e | ||
|
|
012bbcfe36 | ||
|
|
f74b469e68 | ||
|
|
55dc7a252e | ||
|
|
b015623128 | ||
|
|
c76a124d14 | ||
|
|
74d96ff4bd | ||
|
|
44fe0e1fc4 | ||
|
|
78245a072c | ||
|
|
1fd1c34112 | ||
|
|
0dae22adf2 | ||
|
|
746181cb33 | ||
|
|
4b9d3ca7de | ||
|
|
54da532ace | ||
|
|
4159b02753 | ||
|
|
42a068ab5e | ||
|
|
6f7d413d88 | ||
|
|
1aaafeb57b | ||
|
|
6dd3d825c8 | ||
|
|
02ccdeb94e | ||
|
|
7b192945eb | ||
|
|
28ed2b9e69 | ||
|
|
24b17c6de9 | ||
|
|
6eb93e9f8a | ||
|
|
8173d1f643 | ||
|
|
b29812e40b | ||
|
|
183dcd08d9 | ||
|
|
deea16e14f | ||
|
|
e96a719724 | ||
|
|
8e38d8e6f0 | ||
|
|
a0b862bbf7 | ||
|
|
434e2f4cbf | ||
|
|
cb0572d66e | ||
|
|
5c8e072b7f | ||
|
|
e39c452f31 | ||
|
|
1bb294afbc | ||
|
|
5def79e93c | ||
|
|
f072469409 | ||
|
|
4a444f7d60 | ||
|
|
ab77444fa3 | ||
|
|
57ffc58613 | ||
|
|
8c386ae07e | ||
|
|
cba6b4a749 | ||
|
|
64191a4b13 | ||
|
|
9bd6b249ce | ||
|
|
bec6c626d8 | ||
|
|
7ddf856d58 | ||
|
|
a3915fa5c4 | ||
|
|
17abca1caa | ||
|
|
f239050054 | ||
|
|
76a6956138 | ||
|
|
cf5ca9a5cf | ||
|
|
77ec62e9c8 | ||
|
|
a3f2196d4e | ||
|
|
d89c158a77 | ||
|
|
ef53197e1f | ||
|
|
8707c15b9c | ||
|
|
0b4e34b03b | ||
|
|
6968da153c | ||
|
|
03c809371a | ||
|
|
d282b0bf85 | ||
|
|
efa615a5e3 | ||
|
|
068db1f48b | ||
|
|
afacbe2a3a | ||
|
|
f8a0ef8f87 | ||
|
|
e1a2939f89 | ||
|
|
95da398e7d | ||
|
|
52adcc73d9 | ||
|
|
dbde686a97 | ||
|
|
1129110be3 | ||
|
|
a26a175957 | ||
|
|
795de3a75a | ||
|
|
8116b569c7 | ||
|
|
2bba79138f | ||
|
|
a8d481c2a5 | ||
|
|
85fc1e8235 | ||
|
|
ab4102a632 | ||
|
|
4ae2f06be4 | ||
|
|
831e03ad2a | ||
|
|
ab9f3fa42a | ||
|
|
13b8359de6 | ||
|
|
660d9c1602 | ||
|
|
b1d47c65d4 | ||
|
|
271e79095b | ||
|
|
6c268a3e9c | ||
|
|
e5ff70f606 | ||
|
|
801b1580f5 | ||
|
|
707868be33 | ||
|
|
9b9f34f881 | ||
|
|
7724cca384 |
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -22,7 +22,7 @@ assignees: ''
|
||||
|
||||
## Environment
|
||||
<!--Please describe your environment setup (such as Ubuntu 18.04 with Boost 1.70).-->
|
||||
<!-- If you are using a formal release, please use the version returned by './rippled --version' as the verison number-->
|
||||
<!-- If you are using a formal release, please use the version returned by './rippled --version' as the version number-->
|
||||
<!-- If you are working off of develop, please add the git hash via 'git rev-parse HEAD'-->
|
||||
|
||||
## Supporting Files
|
||||
|
||||
3
.github/ISSUE_TEMPLATE/config.yml
vendored
3
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -3,9 +3,6 @@ contact_links:
|
||||
- name: XRP Ledger Documentation
|
||||
url: https://xrpl.org/
|
||||
about: All things about XRPL
|
||||
- name: General question for the community
|
||||
url: https://forum.xpring.io/c/community/
|
||||
about: Please ask and answer questions here.
|
||||
- name: Security bug bounty program
|
||||
url: https://ripple.com/bug-bounty/
|
||||
about: Please report security-relevant bugs in our software here.
|
||||
|
||||
55
.github/pull_request_template.md
vendored
Normal file
55
.github/pull_request_template.md
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
<!--
|
||||
This PR template helps you to write a good pull request description.
|
||||
Please feel free to include additional useful information even beyond what is requested below.
|
||||
-->
|
||||
|
||||
## High Level Overview of Change
|
||||
|
||||
<!--
|
||||
Please include a summary of the changes.
|
||||
This may be a direct input to the release notes.
|
||||
If too broad, please consider splitting into multiple PRs.
|
||||
If a relevant task or issue, please link it here.
|
||||
-->
|
||||
|
||||
### Context of Change
|
||||
|
||||
<!--
|
||||
Please include the context of a change.
|
||||
If a bug fix, when was the bug introduced? What was the behavior?
|
||||
If a new feature, why was this architecture chosen? What were the alternatives?
|
||||
If a refactor, how is this better than the previous implementation?
|
||||
|
||||
If there is a spec or design document for this feature, please link it here.
|
||||
-->
|
||||
|
||||
### Type of Change
|
||||
|
||||
<!--
|
||||
Please check [x] relevant options, delete irrelevant ones.
|
||||
-->
|
||||
|
||||
- [ ] Bug fix (non-breaking change which fixes an issue)
|
||||
- [ ] New feature (non-breaking change which adds functionality)
|
||||
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
||||
- [ ] Refactor (non-breaking change that only restructures code)
|
||||
- [ ] Tests (You added tests for code that already exists, or your new feature included in this PR)
|
||||
- [ ] Documentation Updates
|
||||
- [ ] Release
|
||||
|
||||
<!--
|
||||
## Before / After
|
||||
If relevant, use this section for an English description of the change at a technical level.
|
||||
If this change affects an API, examples should be included here.
|
||||
-->
|
||||
|
||||
<!--
|
||||
## Test Plan
|
||||
If helpful, please describe the tests that you ran to verify your changes and provide instructions so that others can reproduce.
|
||||
This section may not be needed if your change includes thoroughly commented unit tests.
|
||||
-->
|
||||
|
||||
<!--
|
||||
## Future Tasks
|
||||
For future tasks related to PR.
|
||||
-->
|
||||
35
.github/workflows/clang-format.yml
vendored
35
.github/workflows/clang-format.yml
vendored
@@ -23,5 +23,38 @@ jobs:
|
||||
- name: Format src/test
|
||||
run: find src/test -type f \( -name '*.cpp' -o -name '*.h' -o -name '*.ipp' \) -print0 | xargs -0 clang-format-${CLANG_VERSION} -i
|
||||
- name: Check for differences
|
||||
run: git diff --exit-code
|
||||
id: assert
|
||||
run: |
|
||||
set -o pipefail
|
||||
git diff --exit-code | tee "clang-format.patch"
|
||||
- name: Upload patch
|
||||
if: failure() && steps.assert.outcome == 'failure'
|
||||
uses: actions/upload-artifact@v2
|
||||
continue-on-error: true
|
||||
with:
|
||||
name: clang-format.patch
|
||||
if-no-files-found: ignore
|
||||
path: clang-format.patch
|
||||
- name: What happened?
|
||||
if: failure() && steps.assert.outcome == 'failure'
|
||||
env:
|
||||
PREAMBLE: |
|
||||
If you are reading this, you are looking at a failed Github Actions
|
||||
job. That means you pushed one or more files that did not conform
|
||||
to the formatting specified in .clang-format. That may be because
|
||||
you neglected to run 'git clang-format' or 'clang-format' before
|
||||
committing, or that your version of clang-format has an
|
||||
incompatibility with the one on this
|
||||
machine, which is:
|
||||
SUGGESTION: |
|
||||
|
||||
To fix it, you can do one of two things:
|
||||
1. Download and apply the patch generated as an artifact of this
|
||||
job to your repo, commit, and push.
|
||||
2. Run 'git-clang-format --extensions c,cpp,h,cxx,ipp develop'
|
||||
in your repo, commit, and push.
|
||||
run: |
|
||||
echo "${PREAMBLE}"
|
||||
clang-format-${CLANG_VERSION} --version
|
||||
echo "${SUGGESTION}"
|
||||
exit 1
|
||||
|
||||
49
.github/workflows/levelization.yml
vendored
Normal file
49
.github/workflows/levelization.yml
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
name: levelization
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
check:
|
||||
runs-on: ubuntu-18.04
|
||||
env:
|
||||
CLANG_VERSION: 10
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Check levelization
|
||||
run: Builds/levelization/levelization.sh
|
||||
- name: Check for differences
|
||||
id: assert
|
||||
run: |
|
||||
set -o pipefail
|
||||
git diff --exit-code | tee "levelization.patch"
|
||||
- name: Upload patch
|
||||
if: failure() && steps.assert.outcome == 'failure'
|
||||
uses: actions/upload-artifact@v2
|
||||
continue-on-error: true
|
||||
with:
|
||||
name: levelization.patch
|
||||
if-no-files-found: ignore
|
||||
path: levelization.patch
|
||||
- name: What happened?
|
||||
if: failure() && steps.assert.outcome == 'failure'
|
||||
env:
|
||||
MESSAGE: |
|
||||
If you are reading this, you are looking at a failed Github
|
||||
Actions job. That means you changed the dependency relationships
|
||||
between the modules in rippled. That may be an improvement or a
|
||||
regression. This check doesn't judge.
|
||||
|
||||
A rule of thumb, though, is that if your changes caused
|
||||
something to be removed from loops.txt, that's probably an
|
||||
improvement. If something was added, it's probably a regression.
|
||||
|
||||
To fix it, you can do one of two things:
|
||||
1. Download and apply the patch generated as an artifact of this
|
||||
job to your repo, commit, and push.
|
||||
2. Run './Builds/levelization/levelization.sh' in your repo,
|
||||
commit, and push.
|
||||
|
||||
See Builds/levelization/README.md for more info.
|
||||
run: |
|
||||
echo "${MESSAGE}"
|
||||
exit 1
|
||||
8
.gitignore
vendored
8
.gitignore
vendored
@@ -37,6 +37,12 @@ Release/*.*
|
||||
*.gcda
|
||||
*.gcov
|
||||
|
||||
# Levelization checking
|
||||
Builds/levelization/results/rawincludes.txt
|
||||
Builds/levelization/results/paths.txt
|
||||
Builds/levelization/results/includes/
|
||||
Builds/levelization/results/includedby/
|
||||
|
||||
# Ignore tmp directory.
|
||||
tmp
|
||||
|
||||
@@ -98,3 +104,5 @@ Builds/VisualStudio2015/*.sdf
|
||||
CMakeSettings.json
|
||||
compile_commands.json
|
||||
.clangd
|
||||
packages
|
||||
pkg_out
|
||||
|
||||
119
.travis.yml
119
.travis.yml
@@ -21,9 +21,7 @@ services:
|
||||
- docker
|
||||
|
||||
stages:
|
||||
- windep-ssl
|
||||
- windep-grpc
|
||||
- windep-libarchive
|
||||
- windep-vcpkg
|
||||
- windep-boost
|
||||
- build
|
||||
|
||||
@@ -38,9 +36,9 @@ env:
|
||||
- NIH_CACHE_ROOT=${CACHE_DIR}/nih_c
|
||||
- PARALLEL_TESTS=true
|
||||
# this is NOT used by linux container based builds (which already have boost installed)
|
||||
- BOOST_URL='https://dl.bintray.com/boostorg/release/1.70.0/source/boost_1_70_0.tar.bz2'
|
||||
- BOOST_URL='https://boostorg.jfrog.io/artifactory/main/release/1.75.0/source/boost_1_75_0.tar.gz'
|
||||
# Alternate dowload location
|
||||
- BOOST_URL2='https://downloads.sourceforge.net/project/boost/boost/1.70.0/boost_1_70_0.tar.bz2?r=&ts=1594393912&use_mirror=newcontinuum'
|
||||
- BOOST_URL2='https://downloads.sourceforge.net/project/boost/boost/1.75.0/boost_1_75_0.tar.bz2?r=&ts=1594393912&use_mirror=newcontinuum'
|
||||
# Travis downloader doesn't seem to have updated certs. Using this option
|
||||
# introduces obvious security risks, but they're Travis's risks.
|
||||
# Note that this option is only used if the "normal" build fails.
|
||||
@@ -51,6 +49,14 @@ env:
|
||||
- CCACHE_NOHASHDIR=true
|
||||
- CCACHE_DIR=${CACHE_DIR}/ccache
|
||||
|
||||
before_install:
|
||||
- export NUM_PROCESSORS=$(nproc)
|
||||
- echo "NUM PROC is ${NUM_PROCESSORS}"
|
||||
- if [ "$(uname)" = "Linux" ] ; then docker pull ${DOCKER_IMAGE}; fi
|
||||
- if [ "${MATRIX_EVAL}" != "" ] ; then eval "${MATRIX_EVAL}"; fi
|
||||
- if [ "${CMAKE_ADD}" != "" ] ; then export CMAKE_EXTRA_ARGS="${CMAKE_EXTRA_ARGS} ${CMAKE_ADD}"; fi
|
||||
- bin/ci/ubuntu/travis-cache-start.sh
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
allow_failures:
|
||||
@@ -64,11 +70,10 @@ matrix:
|
||||
# allow the rest of the builds to continue. They may succeed if the
|
||||
# dependency is already cached. These do not need to be retried if
|
||||
# _any_ of the Windows builds succeed.
|
||||
- stage: windep-ssl
|
||||
- stage: windep-grpc
|
||||
- stage: windep-libarchive
|
||||
- stage: windep-vcpkg
|
||||
- stage: windep-boost
|
||||
|
||||
# https://docs.travis-ci.com/user/build-config-yaml#usage-of-yaml-anchors-and-aliases
|
||||
include:
|
||||
# debug builds
|
||||
- &linux
|
||||
@@ -90,6 +95,13 @@ matrix:
|
||||
env:
|
||||
- MATRIX_EVAL="CC=clang-8 && CXX=clang++-8"
|
||||
- BUILD_TYPE=Debug
|
||||
- <<: *linux
|
||||
compiler: clang-8
|
||||
name: reporting, clang-8, debug
|
||||
env:
|
||||
- MATRIX_EVAL="CC=clang-8 && CXX=clang++-8"
|
||||
- BUILD_TYPE=Debug
|
||||
- CMAKE_ADD="-Dreporting=ON"
|
||||
# coverage builds
|
||||
- <<: *linux
|
||||
if: commit_message !~ /travis_run_/ OR commit_message =~ /travis_run_linux/ OR commit_message =~ /travis_run_cov/
|
||||
@@ -111,6 +123,25 @@ matrix:
|
||||
- CMAKE_ADD="-Dcoverage=ON"
|
||||
- TARGET=coverage_report
|
||||
- SKIP_TESTS=true
|
||||
# test-free builds
|
||||
- <<: *linux
|
||||
if: commit_message !~ /travis_run_/ OR commit_message =~ /travis_run_linux/
|
||||
compiler: gcc-8
|
||||
name: no-tests-unity, gcc-8
|
||||
env:
|
||||
- MATRIX_EVAL="CC=gcc-8 && CXX=g++-8"
|
||||
- BUILD_TYPE=Debug
|
||||
- CMAKE_ADD="-Dtests=OFF"
|
||||
- SKIP_TESTS=true
|
||||
- <<: *linux
|
||||
if: commit_message !~ /travis_run_/ OR commit_message =~ /travis_run_linux/
|
||||
compiler: clang-8
|
||||
name: no-tests-non-unity, clang-8
|
||||
env:
|
||||
- MATRIX_EVAL="CC=clang-8 && CXX=clang++-8"
|
||||
- BUILD_TYPE=Debug
|
||||
- CMAKE_ADD="-Dtests=OFF -Dunity=OFF"
|
||||
- SKIP_TESTS=true
|
||||
# nounity
|
||||
- <<: *linux
|
||||
if: commit_message !~ /travis_run_/ OR commit_message =~ /travis_run_linux/ OR commit_message =~ /travis_run_nounity/
|
||||
@@ -226,30 +257,24 @@ matrix:
|
||||
- BUILD_TYPE=Debug
|
||||
- NINJA_BUILD=false
|
||||
# misc alternative compilers
|
||||
- <<: *linux
|
||||
compiler: gcc-7
|
||||
name: gcc-7
|
||||
env:
|
||||
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
|
||||
- BUILD_TYPE=Debug
|
||||
- <<: *linux
|
||||
compiler: gcc-9
|
||||
name: gcc-9
|
||||
env:
|
||||
- MATRIX_EVAL="CC=gcc-9 && CXX=g++-9"
|
||||
- BUILD_TYPE=Debug
|
||||
- <<: *linux
|
||||
compiler: clang-7
|
||||
name: clang-7
|
||||
env:
|
||||
- MATRIX_EVAL="CC=clang-7 && CXX=clang++-7"
|
||||
- BUILD_TYPE=Debug
|
||||
- <<: *linux
|
||||
compiler: clang-9
|
||||
name: clang-9
|
||||
name: clang-9, debug
|
||||
env:
|
||||
- MATRIX_EVAL="CC=clang-9 && CXX=clang++-9"
|
||||
- BUILD_TYPE=Debug
|
||||
- <<: *linux
|
||||
compiler: clang-9
|
||||
name: clang-9, release
|
||||
env:
|
||||
- MATRIX_EVAL="CC=clang-9 && CXX=clang++-9"
|
||||
- BUILD_TYPE=Release
|
||||
# verify build with min version of cmake
|
||||
- <<: *linux
|
||||
compiler: gcc-8
|
||||
@@ -257,7 +282,7 @@ matrix:
|
||||
env:
|
||||
- MATRIX_EVAL="CC=gcc-8 && CXX=g++-8"
|
||||
- BUILD_TYPE=Debug
|
||||
- CMAKE_EXE=/opt/local/cmake-3.9/bin/cmake
|
||||
- CMAKE_EXE=/opt/local/cmake/bin/cmake
|
||||
- SKIP_TESTS=true
|
||||
# validator keys project as subproj of rippled
|
||||
- <<: *linux
|
||||
@@ -274,15 +299,15 @@ matrix:
|
||||
if: commit_message !~ /travis_run_/ OR commit_message =~ /travis_run_mac/
|
||||
stage: build
|
||||
os: osx
|
||||
osx_image: xcode10.3
|
||||
name: xcode10, debug
|
||||
osx_image: xcode13.1
|
||||
name: xcode13.1, debug
|
||||
env:
|
||||
# put NIH in non-cache location since it seems to
|
||||
# cause failures when homebrew updates
|
||||
- NIH_CACHE_ROOT=${TRAVIS_BUILD_DIR}/nih_c
|
||||
- BLD_CONFIG=Debug
|
||||
- TEST_EXTRA_ARGS=""
|
||||
- BOOST_ROOT=${CACHE_DIR}/boost_1_70_0
|
||||
- BOOST_ROOT=${CACHE_DIR}/boost_1_75_0
|
||||
- >-
|
||||
CMAKE_ADD="
|
||||
-DBOOST_ROOT=${BOOST_ROOT}/_INSTALLED_
|
||||
@@ -313,7 +338,7 @@ matrix:
|
||||
- travis_wait ${MAX_TIME_MIN} cmake --build . --parallel --verbose
|
||||
- ./rippled --unittest --quiet --unittest-log --unittest-jobs ${NUM_PROCESSORS} ${TEST_EXTRA_ARGS}
|
||||
- <<: *macos
|
||||
name: xcode10, release
|
||||
name: xcode13.1, release
|
||||
before_script:
|
||||
- export BLD_CONFIG=Release
|
||||
- export CMAKE_EXTRA_ARGS="${CMAKE_EXTRA_ARGS} -Dassert=ON"
|
||||
@@ -322,8 +347,8 @@ matrix:
|
||||
before_script:
|
||||
- export TEST_EXTRA_ARGS="--unittest-ipv6"
|
||||
- <<: *macos
|
||||
osx_image: xcode11.2
|
||||
name: xcode11, debug
|
||||
osx_image: xcode13.1
|
||||
name: xcode13.1, debug
|
||||
# windows
|
||||
- &windows
|
||||
if: commit_message !~ /travis_run_/ OR commit_message =~ /travis_run_win/
|
||||
@@ -336,41 +361,34 @@ matrix:
|
||||
- NIH_CACHE_ROOT=${TRAVIS_BUILD_DIR}/nih_c
|
||||
- VCPKG_DEFAULT_TRIPLET="x64-windows-static"
|
||||
- MATRIX_EVAL="CC=cl.exe && CXX=cl.exe"
|
||||
- BOOST_ROOT=${CACHE_DIR}/boost_1_70
|
||||
- BOOST_ROOT=${CACHE_DIR}/boost_1_75
|
||||
- >-
|
||||
CMAKE_ADD="
|
||||
-DCMAKE_PREFIX_PATH=${BOOST_ROOT}/_INSTALLED_
|
||||
-DBOOST_ROOT=${BOOST_ROOT}/_INSTALLED_
|
||||
-DBoost_ROOT=${BOOST_ROOT}/_INSTALLED_
|
||||
-DBoost_DIR=${BOOST_ROOT}/_INSTALLED_/lib/cmake/Boost-1.70.0
|
||||
-DBoost_DIR=${BOOST_ROOT}/_INSTALLED_/lib/cmake/Boost-1.75.0
|
||||
-DBoost_COMPILER=vc141
|
||||
-DCMAKE_VERBOSE_MAKEFILE=ON
|
||||
-DCMAKE_TOOLCHAIN_FILE=${VCPKG_DIR}/scripts/buildsystems/vcpkg.cmake
|
||||
-DVCPKG_TARGET_TRIPLET=x64-windows-static"
|
||||
stage: windep-ssl
|
||||
name: prereq-ssl
|
||||
stage: windep-vcpkg
|
||||
name: prereq-vcpkg
|
||||
install:
|
||||
- choco upgrade cmake.install
|
||||
- choco install ninja visualstudio2017-workload-vctools -y
|
||||
script:
|
||||
- df -h
|
||||
- env
|
||||
- travis_wait ${MAX_TIME_MIN} bin/sh/install-vcpkg.sh openssl
|
||||
- <<: *windows
|
||||
stage: windep-grpc
|
||||
name: prereq-grpc
|
||||
script:
|
||||
- travis_wait ${MAX_TIME_MIN} bin/sh/install-vcpkg.sh grpc
|
||||
- <<: *windows
|
||||
stage: windep-libarchive
|
||||
name: prereq-libarchive
|
||||
script:
|
||||
- travis_wait ${MAX_TIME_MIN} bin/sh/install-vcpkg.sh libarchive[lz4]
|
||||
# TBD consider rocksdb via vcpkg if/when we can build with the
|
||||
# vcpkg version
|
||||
# - travis_wait ${MAX_TIME_MIN} bin/sh/install-vcpkg.sh rocksdb[snappy,lz4,zlib]
|
||||
- <<: *windows
|
||||
stage: windep-boost
|
||||
name: prereq-boost
|
||||
name: prereq-keep-boost
|
||||
install:
|
||||
- choco upgrade cmake.install
|
||||
- choco install ninja visualstudio2017-workload-vctools -y
|
||||
@@ -390,8 +408,8 @@ matrix:
|
||||
- mkdir -p build.ms && cd build.ms
|
||||
- cmake -G Ninja ${CMAKE_EXTRA_ARGS} -DCMAKE_BUILD_TYPE=${BLD_CONFIG} ..
|
||||
- travis_wait ${MAX_TIME_MIN} cmake --build . --parallel --verbose
|
||||
# override num procs to force single unit test job
|
||||
- export NUM_PROCESSORS=1
|
||||
# override num procs to force fewer unit test jobs
|
||||
- export NUM_PROCESSORS=2
|
||||
- travis_wait ${MAX_TIME_MIN} ./rippled.exe --unittest --quiet --unittest-log --unittest-jobs ${NUM_PROCESSORS}
|
||||
- <<: *windows-bld
|
||||
name: windows, release
|
||||
@@ -401,11 +419,12 @@ matrix:
|
||||
name: windows, visual studio, debug
|
||||
script:
|
||||
- mkdir -p build.ms && cd build.ms
|
||||
- export CMAKE_EXTRA_ARGS="${CMAKE_EXTRA_ARGS} -DCMAKE_GENERATOR_TOOLSET=host=x64"
|
||||
- cmake -G "Visual Studio 15 2017 Win64" ${CMAKE_EXTRA_ARGS} ..
|
||||
- export DESTDIR=${PWD}/_installed_
|
||||
- travis_wait ${MAX_TIME_MIN} cmake --build . --parallel --verbose --config ${BLD_CONFIG} --target install
|
||||
# override num procs to force single unit test job
|
||||
- export NUM_PROCESSORS=1
|
||||
# override num procs to force fewer unit test jobs
|
||||
- export NUM_PROCESSORS=2
|
||||
- >-
|
||||
travis_wait ${MAX_TIME_MIN} "./_installed_/Program Files/rippled/bin/rippled.exe" --unittest --quiet --unittest-log --unittest-jobs ${NUM_PROCESSORS}
|
||||
- <<: *windows-bld
|
||||
@@ -437,15 +456,5 @@ cache:
|
||||
directories:
|
||||
- $CACHE_DIR
|
||||
|
||||
before_install:
|
||||
# NUM_PROCESSORS was set to 1 due to problems in parallel launch of unit tests on Mac platform
|
||||
- if [ "$(uname)" = "Darwin" ] ; then export NUM_PROCESSORS=1; else export NUM_PROCESSORS=$(nproc); fi
|
||||
- echo "NUM PROC is ${NUM_PROCESSORS}"
|
||||
- if [ "$(uname)" = "Linux" ] ; then docker pull ${DOCKER_IMAGE}; fi
|
||||
- if [ "${MATRIX_EVAL}" != "" ] ; then eval "${MATRIX_EVAL}"; fi
|
||||
- if [ "${CMAKE_ADD}" != "" ] ; then export CMAKE_EXTRA_ARGS="${CMAKE_EXTRA_ARGS} ${CMAKE_ADD}"; fi
|
||||
- bin/ci/ubuntu/travis-cache-start.sh
|
||||
|
||||
notifications:
|
||||
email: false
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ endif ()
|
||||
find_dependency (Boost 1.70
|
||||
COMPONENTS
|
||||
chrono
|
||||
container
|
||||
context
|
||||
coroutine
|
||||
date_time
|
||||
@@ -44,7 +45,7 @@ if (static OR APPLE OR MSVC)
|
||||
set (OPENSSL_USE_STATIC_LIBS ON)
|
||||
endif ()
|
||||
set (OPENSSL_MSVC_STATIC_RT ON)
|
||||
find_dependency (OpenSSL 1.0.2 REQUIRED)
|
||||
find_dependency (OpenSSL 1.1.1 REQUIRED)
|
||||
find_dependency (ZLIB)
|
||||
find_dependency (date)
|
||||
if (TARGET ZLIB::ZLIB)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,78 +1,79 @@
|
||||
#[===================================================================[
|
||||
docs target (optional)
|
||||
#]===================================================================]
|
||||
|
||||
find_package (Doxygen)
|
||||
if (NOT TARGET Doxygen::doxygen)
|
||||
message (STATUS "doxygen executable not found -- skipping docs target")
|
||||
return ()
|
||||
endif ()
|
||||
|
||||
set (doxygen_output_directory "${CMAKE_BINARY_DIR}/docs")
|
||||
set (doxygen_include_path "${CMAKE_CURRENT_SOURCE_DIR}/src")
|
||||
set (doxygen_index_file "${doxygen_output_directory}/html/index.html")
|
||||
set (doxyfile "${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile")
|
||||
|
||||
file (GLOB_RECURSE doxygen_input
|
||||
docs/*.md
|
||||
src/ripple/*.h
|
||||
src/ripple/*.cpp
|
||||
src/ripple/*.md
|
||||
src/test/*.h
|
||||
src/test/*.md
|
||||
Builds/*/README.md)
|
||||
list (APPEND doxygen_input
|
||||
README.md
|
||||
RELEASENOTES.md
|
||||
src/README.md)
|
||||
set (dependencies "${doxygen_input}" "${doxyfile}")
|
||||
|
||||
function (verbose_find_path variable name)
|
||||
# find_path sets a CACHE variable, so don't try using a "local" variable.
|
||||
find_path (${variable} "${name}" ${ARGN})
|
||||
if (NOT ${variable})
|
||||
message (WARNING "could not find ${name}")
|
||||
else ()
|
||||
message (STATUS "found ${name}: ${${variable}}/${name}")
|
||||
if (tests)
|
||||
find_package (Doxygen)
|
||||
if (NOT TARGET Doxygen::doxygen)
|
||||
message (STATUS "doxygen executable not found -- skipping docs target")
|
||||
return ()
|
||||
endif ()
|
||||
endfunction ()
|
||||
|
||||
verbose_find_path (doxygen_plantuml_jar_path plantuml.jar PATH_SUFFIXES share/plantuml)
|
||||
verbose_find_path (doxygen_dot_path dot)
|
||||
|
||||
# https://en.cppreference.com/w/Cppreference:Archives
|
||||
# https://stackoverflow.com/questions/60822559/how-to-move-a-file-download-from-configure-step-to-build-step
|
||||
set (download_script "${CMAKE_BINARY_DIR}/docs/download-cppreference.cmake")
|
||||
file (WRITE
|
||||
"${download_script}"
|
||||
"file (DOWNLOAD \
|
||||
http://upload.cppreference.com/mwiki/images/b/b2/html_book_20190607.zip \
|
||||
${CMAKE_BINARY_DIR}/docs/cppreference.zip \
|
||||
EXPECTED_HASH MD5=82b3a612d7d35a83e3cb1195a63689ab \
|
||||
)\n \
|
||||
execute_process ( \
|
||||
COMMAND \"${CMAKE_COMMAND}\" -E tar -xf cppreference.zip \
|
||||
)\n"
|
||||
)
|
||||
set (tagfile "${CMAKE_BINARY_DIR}/docs/cppreference-doxygen-web.tag.xml")
|
||||
add_custom_command (
|
||||
OUTPUT "${tagfile}"
|
||||
COMMAND "${CMAKE_COMMAND}" -P "${download_script}"
|
||||
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/docs"
|
||||
)
|
||||
set (doxygen_tagfiles "${tagfile}=http://en.cppreference.com/w/")
|
||||
|
||||
add_custom_command (
|
||||
OUTPUT "${doxygen_index_file}"
|
||||
COMMAND "${CMAKE_COMMAND}" -E env
|
||||
"DOXYGEN_OUTPUT_DIRECTORY=${doxygen_output_directory}"
|
||||
"DOXYGEN_INCLUDE_PATH=${doxygen_include_path}"
|
||||
"DOXYGEN_TAGFILES=${doxygen_tagfiles}"
|
||||
"DOXYGEN_PLANTUML_JAR_PATH=${doxygen_plantuml_jar_path}"
|
||||
"DOXYGEN_DOT_PATH=${doxygen_dot_path}"
|
||||
"${DOXYGEN_EXECUTABLE}" "${doxyfile}"
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
DEPENDS "${dependencies}" "${tagfile}")
|
||||
add_custom_target (docs
|
||||
DEPENDS "${doxygen_index_file}"
|
||||
SOURCES "${dependencies}")
|
||||
|
||||
set (doxygen_output_directory "${CMAKE_BINARY_DIR}/docs")
|
||||
set (doxygen_include_path "${CMAKE_CURRENT_SOURCE_DIR}/src")
|
||||
set (doxygen_index_file "${doxygen_output_directory}/html/index.html")
|
||||
set (doxyfile "${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile")
|
||||
|
||||
file (GLOB_RECURSE doxygen_input
|
||||
docs/*.md
|
||||
src/ripple/*.h
|
||||
src/ripple/*.cpp
|
||||
src/ripple/*.md
|
||||
src/test/*.h
|
||||
src/test/*.md
|
||||
Builds/*/README.md)
|
||||
list (APPEND doxygen_input
|
||||
README.md
|
||||
RELEASENOTES.md
|
||||
src/README.md)
|
||||
set (dependencies "${doxygen_input}" "${doxyfile}")
|
||||
|
||||
function (verbose_find_path variable name)
|
||||
# find_path sets a CACHE variable, so don't try using a "local" variable.
|
||||
find_path (${variable} "${name}" ${ARGN})
|
||||
if (NOT ${variable})
|
||||
message (WARNING "could not find ${name}")
|
||||
else ()
|
||||
message (STATUS "found ${name}: ${${variable}}/${name}")
|
||||
endif ()
|
||||
endfunction ()
|
||||
|
||||
verbose_find_path (doxygen_plantuml_jar_path plantuml.jar PATH_SUFFIXES share/plantuml)
|
||||
verbose_find_path (doxygen_dot_path dot)
|
||||
|
||||
# https://en.cppreference.com/w/Cppreference:Archives
|
||||
# https://stackoverflow.com/questions/60822559/how-to-move-a-file-download-from-configure-step-to-build-step
|
||||
set (download_script "${CMAKE_BINARY_DIR}/docs/download-cppreference.cmake")
|
||||
file (WRITE
|
||||
"${download_script}"
|
||||
"file (DOWNLOAD \
|
||||
http://upload.cppreference.com/mwiki/images/b/b2/html_book_20190607.zip \
|
||||
${CMAKE_BINARY_DIR}/docs/cppreference.zip \
|
||||
EXPECTED_HASH MD5=82b3a612d7d35a83e3cb1195a63689ab \
|
||||
)\n \
|
||||
execute_process ( \
|
||||
COMMAND \"${CMAKE_COMMAND}\" -E tar -xf cppreference.zip \
|
||||
)\n"
|
||||
)
|
||||
set (tagfile "${CMAKE_BINARY_DIR}/docs/cppreference-doxygen-web.tag.xml")
|
||||
add_custom_command (
|
||||
OUTPUT "${tagfile}"
|
||||
COMMAND "${CMAKE_COMMAND}" -P "${download_script}"
|
||||
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/docs"
|
||||
)
|
||||
set (doxygen_tagfiles "${tagfile}=http://en.cppreference.com/w/")
|
||||
|
||||
add_custom_command (
|
||||
OUTPUT "${doxygen_index_file}"
|
||||
COMMAND "${CMAKE_COMMAND}" -E env
|
||||
"DOXYGEN_OUTPUT_DIRECTORY=${doxygen_output_directory}"
|
||||
"DOXYGEN_INCLUDE_PATH=${doxygen_include_path}"
|
||||
"DOXYGEN_TAGFILES=${doxygen_tagfiles}"
|
||||
"DOXYGEN_PLANTUML_JAR_PATH=${doxygen_plantuml_jar_path}"
|
||||
"DOXYGEN_DOT_PATH=${doxygen_dot_path}"
|
||||
"${DOXYGEN_EXECUTABLE}" "${doxyfile}"
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
DEPENDS "${dependencies}" "${tagfile}")
|
||||
add_custom_target (docs
|
||||
DEPENDS "${doxygen_index_file}"
|
||||
SOURCES "${dependencies}")
|
||||
endif ()
|
||||
|
||||
@@ -16,9 +16,6 @@ target_compile_definitions (opts
|
||||
BOOST_BEAST_ALLOW_DEPRECATED
|
||||
BOOST_FILESYSTEM_DEPRECATED
|
||||
>
|
||||
$<$<BOOL:${beast_hashers}>:
|
||||
USE_BEAST_HASHER
|
||||
>
|
||||
$<$<BOOL:${beast_no_unit_test_inline}>:BEAST_NO_UNIT_TEST_INLINE=1>
|
||||
$<$<BOOL:${beast_disable_autolink}>:BEAST_DONT_AUTOLINK_TO_WIN32_LIBRARIES=1>
|
||||
$<$<BOOL:${single_io_service_thread}>:RIPPLE_SINGLE_IO_SERVICE_THREAD=1>)
|
||||
|
||||
@@ -48,12 +48,15 @@ if (is_root_project)
|
||||
Builds/containers/centos-builder/Dockerfile
|
||||
Builds/containers/centos-builder/centos_setup.sh
|
||||
Builds/containers/centos-builder/extras.sh
|
||||
Builds/containers/shared/build_deps.sh
|
||||
Builds/containers/shared/rippled.service
|
||||
Builds/containers/shared/update_sources.sh
|
||||
Builds/containers/shared/update-rippled.sh
|
||||
Builds/containers/shared/update_sources.sh
|
||||
Builds/containers/shared/rippled.service
|
||||
Builds/containers/shared/rippled-reporting.service
|
||||
Builds/containers/shared/build_deps.sh
|
||||
Builds/containers/packaging/rpm/rippled.spec
|
||||
Builds/containers/packaging/rpm/build_rpm.sh
|
||||
Builds/containers/packaging/rpm/50-rippled.preset
|
||||
Builds/containers/packaging/rpm/50-rippled-reporting.preset
|
||||
bin/getRippledInfo
|
||||
)
|
||||
exclude_from_default (rpm_container)
|
||||
@@ -86,7 +89,7 @@ if (is_root_project)
|
||||
add_custom_target (dpkg_container
|
||||
docker build
|
||||
--pull
|
||||
--build-arg DIST_TAG=16.04
|
||||
--build-arg DIST_TAG=18.04
|
||||
--build-arg GIT_COMMIT=${commit_hash}
|
||||
-t rippled-dpkg-builder:${container_label}
|
||||
$<$<BOOL:${dpkg_cache_from}>:--cache-from=${dpkg_cache_from}>
|
||||
@@ -96,28 +99,40 @@ if (is_root_project)
|
||||
USES_TERMINAL
|
||||
COMMAND_EXPAND_LISTS
|
||||
SOURCES
|
||||
Builds/containers/packaging/dpkg/debian/rippled-reporting.links
|
||||
Builds/containers/packaging/dpkg/debian/copyright
|
||||
Builds/containers/packaging/dpkg/debian/rules
|
||||
Builds/containers/packaging/dpkg/debian/rippled-reporting.install
|
||||
Builds/containers/packaging/dpkg/debian/rippled-reporting.postinst
|
||||
Builds/containers/packaging/dpkg/debian/rippled.links
|
||||
Builds/containers/packaging/dpkg/debian/rippled.prerm
|
||||
Builds/containers/packaging/dpkg/debian/rippled.postinst
|
||||
Builds/containers/packaging/dpkg/debian/rippled-dev.install
|
||||
Builds/containers/packaging/dpkg/debian/dirs
|
||||
Builds/containers/packaging/dpkg/debian/rippled.postrm
|
||||
Builds/containers/packaging/dpkg/debian/rippled.conffiles
|
||||
Builds/containers/packaging/dpkg/debian/compat
|
||||
Builds/containers/packaging/dpkg/debian/source/format
|
||||
Builds/containers/packaging/dpkg/debian/source/local-options
|
||||
Builds/containers/packaging/dpkg/debian/README.Debian
|
||||
Builds/containers/packaging/dpkg/debian/rippled.install
|
||||
Builds/containers/packaging/dpkg/debian/rippled.preinst
|
||||
Builds/containers/packaging/dpkg/debian/docs
|
||||
Builds/containers/packaging/dpkg/debian/control
|
||||
Builds/containers/packaging/dpkg/debian/rippled-reporting.dirs
|
||||
Builds/containers/packaging/dpkg/build_dpkg.sh
|
||||
Builds/containers/ubuntu-builder/Dockerfile
|
||||
Builds/containers/ubuntu-builder/ubuntu_setup.sh
|
||||
bin/getRippledInfo
|
||||
Builds/containers/shared/install_cmake.sh
|
||||
Builds/containers/shared/install_boost.sh
|
||||
Builds/containers/shared/update-rippled.sh
|
||||
Builds/containers/shared/update_sources.sh
|
||||
Builds/containers/shared/build_deps.sh
|
||||
Builds/containers/shared/rippled.service
|
||||
Builds/containers/shared/update_sources.sh
|
||||
Builds/containers/shared/update-rippled.sh
|
||||
Builds/containers/packaging/dpkg/build_dpkg.sh
|
||||
Builds/containers/packaging/dpkg/debian/README.Debian
|
||||
Builds/containers/packaging/dpkg/debian/conffiles
|
||||
Builds/containers/packaging/dpkg/debian/control
|
||||
Builds/containers/packaging/dpkg/debian/copyright
|
||||
Builds/containers/packaging/dpkg/debian/dirs
|
||||
Builds/containers/packaging/dpkg/debian/docs
|
||||
Builds/containers/packaging/dpkg/debian/rippled-dev.install
|
||||
Builds/containers/packaging/dpkg/debian/rippled.install
|
||||
Builds/containers/packaging/dpkg/debian/rippled.links
|
||||
Builds/containers/packaging/dpkg/debian/rippled.postinst
|
||||
Builds/containers/packaging/dpkg/debian/rippled.postrm
|
||||
Builds/containers/packaging/dpkg/debian/rippled.preinst
|
||||
Builds/containers/packaging/dpkg/debian/rippled.prerm
|
||||
Builds/containers/packaging/dpkg/debian/rules
|
||||
bin/getRippledInfo
|
||||
Builds/containers/shared/rippled-reporting.service
|
||||
Builds/containers/shared/rippled-logrotate
|
||||
Builds/containers/shared/update-rippled-cron
|
||||
)
|
||||
exclude_from_default (dpkg_container)
|
||||
add_custom_target (dpkg
|
||||
@@ -187,4 +202,3 @@ if (is_root_project)
|
||||
message (STATUS "docker NOT found -- won't be able to build containers for packaging")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
|
||||
@@ -39,14 +39,14 @@ endif ()
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES ".*Clang") # both Clang and AppleClang
|
||||
set (is_clang TRUE)
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND
|
||||
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)
|
||||
message (FATAL_ERROR "This project requires clang 7 or later")
|
||||
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0)
|
||||
message (FATAL_ERROR "This project requires clang 8 or later")
|
||||
endif ()
|
||||
# TODO min AppleClang version check ?
|
||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
set (is_gcc TRUE)
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)
|
||||
message (FATAL_ERROR "This project requires GCC 7 or later")
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0)
|
||||
message (FATAL_ERROR "This project requires GCC 8 or later")
|
||||
endif ()
|
||||
endif ()
|
||||
if (CMAKE_GENERATOR STREQUAL "Xcode")
|
||||
|
||||
@@ -4,15 +4,14 @@
|
||||
|
||||
option (assert "Enables asserts, even in release builds" OFF)
|
||||
|
||||
option (reporting "Build rippled with reporting mode enabled" OFF)
|
||||
|
||||
option (tests "Build tests" ON)
|
||||
|
||||
option (unity "Creates a build using UNITY support in cmake. This is the default" ON)
|
||||
if (unity)
|
||||
if (CMAKE_VERSION VERSION_LESS 3.16)
|
||||
message (WARNING "unity option only supported for with cmake 3.16+ (please upgrade)")
|
||||
set (unity OFF CACHE BOOL "unity only available for cmake 3.16+" FORCE)
|
||||
else ()
|
||||
if (NOT is_ci)
|
||||
set (CMAKE_UNITY_BUILD_BATCH_SIZE 15 CACHE STRING "")
|
||||
endif ()
|
||||
if (NOT is_ci)
|
||||
set (CMAKE_UNITY_BUILD_BATCH_SIZE 15 CACHE STRING "")
|
||||
endif ()
|
||||
endif ()
|
||||
if (is_gcc OR is_clang)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
option (validator_keys "Enables building of validator-keys-tool as a separate target (imported via FetchContent)" OFF)
|
||||
|
||||
if (validator_keys AND CMAKE_VERSION VERSION_GREATER_EQUAL 3.11)
|
||||
if (validator_keys)
|
||||
git_branch (current_branch)
|
||||
# default to tracking VK develop branch unless we are on master/release
|
||||
if (NOT (current_branch STREQUAL "master" OR current_branch STREQUAL "release"))
|
||||
@@ -20,5 +20,3 @@ if (validator_keys AND CMAKE_VERSION VERSION_GREATER_EQUAL 3.11)
|
||||
endif ()
|
||||
add_subdirectory (${validator_keys_src_SOURCE_DIR} ${CMAKE_BINARY_DIR}/validator-keys)
|
||||
endif ()
|
||||
|
||||
|
||||
|
||||
@@ -2,51 +2,52 @@
|
||||
NIH dep: boost
|
||||
#]===================================================================]
|
||||
|
||||
if ((NOT DEFINED BOOST_ROOT) AND (DEFINED ENV{BOOST_ROOT}))
|
||||
set (BOOST_ROOT $ENV{BOOST_ROOT})
|
||||
endif ()
|
||||
file (TO_CMAKE_PATH "${BOOST_ROOT}" BOOST_ROOT)
|
||||
if (WIN32 OR CYGWIN)
|
||||
if((NOT DEFINED BOOST_ROOT) AND(DEFINED ENV{BOOST_ROOT}))
|
||||
set(BOOST_ROOT $ENV{BOOST_ROOT})
|
||||
endif()
|
||||
file(TO_CMAKE_PATH "${BOOST_ROOT}" BOOST_ROOT)
|
||||
if(WIN32 OR CYGWIN)
|
||||
# Workaround for MSVC having two boost versions - x86 and x64 on same PC in stage folders
|
||||
if (DEFINED BOOST_ROOT)
|
||||
if (IS_DIRECTORY ${BOOST_ROOT}/stage64/lib)
|
||||
set (BOOST_LIBRARYDIR ${BOOST_ROOT}/stage64/lib)
|
||||
elseif (IS_DIRECTORY ${BOOST_ROOT}/stage/lib)
|
||||
set (BOOST_LIBRARYDIR ${BOOST_ROOT}/stage/lib)
|
||||
elseif (IS_DIRECTORY ${BOOST_ROOT}/lib)
|
||||
set (BOOST_LIBRARYDIR ${BOOST_ROOT}/lib)
|
||||
else ()
|
||||
if(DEFINED BOOST_ROOT)
|
||||
if(IS_DIRECTORY ${BOOST_ROOT}/stage64/lib)
|
||||
set(BOOST_LIBRARYDIR ${BOOST_ROOT}/stage64/lib)
|
||||
elseif(IS_DIRECTORY ${BOOST_ROOT}/stage/lib)
|
||||
set(BOOST_LIBRARYDIR ${BOOST_ROOT}/stage/lib)
|
||||
elseif(IS_DIRECTORY ${BOOST_ROOT}/lib)
|
||||
set(BOOST_LIBRARYDIR ${BOOST_ROOT}/lib)
|
||||
else()
|
||||
message(WARNING "Did not find expected boost library dir. "
|
||||
"Defaulting to ${BOOST_ROOT}")
|
||||
set (BOOST_LIBRARYDIR ${BOOST_ROOT})
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
message (STATUS "BOOST_ROOT: ${BOOST_ROOT}")
|
||||
message (STATUS "BOOST_LIBRARYDIR: ${BOOST_LIBRARYDIR}")
|
||||
set(BOOST_LIBRARYDIR ${BOOST_ROOT})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
message(STATUS "BOOST_ROOT: ${BOOST_ROOT}")
|
||||
message(STATUS "BOOST_LIBRARYDIR: ${BOOST_LIBRARYDIR}")
|
||||
|
||||
# uncomment the following as needed to debug FindBoost issues:
|
||||
#set (Boost_DEBUG ON)
|
||||
#set(Boost_DEBUG ON)
|
||||
|
||||
#[=========================================================[
|
||||
boost dynamic libraries don't trivially support @rpath
|
||||
linking right now (cmake's default), so just force
|
||||
static linking for macos, or if requested on linux by flag
|
||||
#]=========================================================]
|
||||
if (static)
|
||||
set (Boost_USE_STATIC_LIBS ON)
|
||||
endif ()
|
||||
set (Boost_USE_MULTITHREADED ON)
|
||||
if (static AND NOT APPLE)
|
||||
set (Boost_USE_STATIC_RUNTIME ON)
|
||||
else ()
|
||||
set (Boost_USE_STATIC_RUNTIME OFF)
|
||||
endif ()
|
||||
if(static)
|
||||
set(Boost_USE_STATIC_LIBS ON)
|
||||
endif()
|
||||
set(Boost_USE_MULTITHREADED ON)
|
||||
if(static AND NOT APPLE)
|
||||
set(Boost_USE_STATIC_RUNTIME ON)
|
||||
else()
|
||||
set(Boost_USE_STATIC_RUNTIME OFF)
|
||||
endif()
|
||||
# TBD:
|
||||
# Boost_USE_DEBUG_RUNTIME: When ON, uses Boost libraries linked against the
|
||||
find_package (Boost 1.70 REQUIRED
|
||||
find_package(Boost 1.70 REQUIRED
|
||||
COMPONENTS
|
||||
chrono
|
||||
container
|
||||
context
|
||||
coroutine
|
||||
date_time
|
||||
@@ -56,19 +57,20 @@ find_package (Boost 1.70 REQUIRED
|
||||
system
|
||||
thread)
|
||||
|
||||
add_library (ripple_boost INTERFACE)
|
||||
add_library (Ripple::boost ALIAS ripple_boost)
|
||||
if (is_xcode)
|
||||
target_include_directories (ripple_boost BEFORE INTERFACE ${Boost_INCLUDE_DIRS})
|
||||
target_compile_options (ripple_boost INTERFACE --system-header-prefix="boost/")
|
||||
else ()
|
||||
target_include_directories (ripple_boost SYSTEM BEFORE INTERFACE ${Boost_INCLUDE_DIRS})
|
||||
add_library(ripple_boost INTERFACE)
|
||||
add_library(Ripple::boost ALIAS ripple_boost)
|
||||
if(is_xcode)
|
||||
target_include_directories(ripple_boost BEFORE INTERFACE ${Boost_INCLUDE_DIRS})
|
||||
target_compile_options(ripple_boost INTERFACE --system-header-prefix="boost/")
|
||||
else()
|
||||
target_include_directories(ripple_boost SYSTEM BEFORE INTERFACE ${Boost_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
target_link_libraries (ripple_boost
|
||||
target_link_libraries(ripple_boost
|
||||
INTERFACE
|
||||
Boost::boost
|
||||
Boost::chrono
|
||||
Boost::container
|
||||
Boost::coroutine
|
||||
Boost::date_time
|
||||
Boost::filesystem
|
||||
@@ -76,28 +78,19 @@ target_link_libraries (ripple_boost
|
||||
Boost::regex
|
||||
Boost::system
|
||||
Boost::thread)
|
||||
if (Boost_COMPILER)
|
||||
target_link_libraries (ripple_boost INTERFACE Boost::disable_autolinking)
|
||||
endif ()
|
||||
if (san AND is_clang)
|
||||
# TODO: gcc does not support -fsanitize-blacklist...can we do something else
|
||||
if(Boost_COMPILER)
|
||||
target_link_libraries(ripple_boost INTERFACE Boost::disable_autolinking)
|
||||
endif()
|
||||
if(san AND is_clang)
|
||||
# TODO: gcc does not support -fsanitize-blacklist...can we do something else
|
||||
# for gcc ?
|
||||
if (NOT Boost_INCLUDE_DIRS AND TARGET Boost::headers)
|
||||
get_target_property (Boost_INCLUDE_DIRS Boost::headers INTERFACE_INCLUDE_DIRECTORIES)
|
||||
endif ()
|
||||
if(NOT Boost_INCLUDE_DIRS AND TARGET Boost::headers)
|
||||
get_target_property(Boost_INCLUDE_DIRS Boost::headers INTERFACE_INCLUDE_DIRECTORIES)
|
||||
endif()
|
||||
message(STATUS "Adding [${Boost_INCLUDE_DIRS}] to sanitizer blacklist")
|
||||
file (WRITE ${CMAKE_CURRENT_BINARY_DIR}/san_bl.txt "src:${Boost_INCLUDE_DIRS}/*")
|
||||
target_compile_options (opts
|
||||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/san_bl.txt "src:${Boost_INCLUDE_DIRS}/*")
|
||||
target_compile_options(opts
|
||||
INTERFACE
|
||||
# ignore boost headers for sanitizing
|
||||
-fsanitize-blacklist=${CMAKE_CURRENT_BINARY_DIR}/san_bl.txt)
|
||||
endif ()
|
||||
|
||||
# workaround for xcode 10.2 and boost < 1.69
|
||||
# once we require Boost 1.69 or higher, this can be removed
|
||||
# see: https://github.com/boostorg/asio/commit/43874d5
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" AND
|
||||
CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0.1.10010043 AND
|
||||
Boost_VERSION LESS 106900)
|
||||
target_compile_definitions (opts INTERFACE BOOST_ASIO_HAS_STD_STRING_VIEW)
|
||||
endif ()
|
||||
endif()
|
||||
|
||||
@@ -969,7 +969,7 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret)
|
||||
set(_Boost_WAVE_DEPENDENCIES filesystem serialization thread chrono date_time atomic)
|
||||
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
|
||||
endif()
|
||||
if(NOT Boost_VERSION_STRING VERSION_LESS 1.71.0)
|
||||
if(NOT Boost_VERSION_STRING VERSION_LESS 1.77.0)
|
||||
message(WARNING "New Boost version may have incorrect or missing dependencies and imported targets")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -125,7 +125,7 @@ if (local_libarchive)
|
||||
--build .
|
||||
--config $<CONFIG>
|
||||
--target archive_static
|
||||
$<$<VERSION_GREATER_EQUAL:${CMAKE_VERSION},3.12>:--parallel ${ep_procs}>
|
||||
--parallel ${ep_procs}
|
||||
$<$<BOOL:${is_multiconfig}>:
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -E copy
|
||||
|
||||
@@ -43,7 +43,7 @@ else()
|
||||
--build .
|
||||
--config $<CONFIG>
|
||||
--target lz4_static
|
||||
$<$<VERSION_GREATER_EQUAL:${CMAKE_VERSION},3.12>:--parallel ${ep_procs}>
|
||||
--parallel ${ep_procs}
|
||||
$<$<BOOL:${is_multiconfig}>:
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -E copy
|
||||
|
||||
@@ -8,35 +8,19 @@
|
||||
|
||||
if (is_root_project) # NuDB not needed in the case of xrpl_core inclusion build
|
||||
add_library (nudb INTERFACE)
|
||||
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.11)
|
||||
FetchContent_Declare(
|
||||
nudb_src
|
||||
GIT_REPOSITORY https://github.com/CPPAlliance/NuDB.git
|
||||
GIT_TAG 2.0.3
|
||||
)
|
||||
FetchContent_GetProperties(nudb_src)
|
||||
if(NOT nudb_src_POPULATED)
|
||||
message (STATUS "Pausing to download NuDB...")
|
||||
FetchContent_Populate(nudb_src)
|
||||
endif()
|
||||
else ()
|
||||
ExternalProject_Add (nudb_src
|
||||
PREFIX ${nih_cache_path}
|
||||
GIT_REPOSITORY https://github.com/CPPAlliance/NuDB.git
|
||||
GIT_TAG 2.0.3
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_COMMAND ""
|
||||
TEST_COMMAND ""
|
||||
INSTALL_COMMAND ""
|
||||
)
|
||||
ExternalProject_Get_Property (nudb_src SOURCE_DIR)
|
||||
set (nudb_src_SOURCE_DIR "${SOURCE_DIR}")
|
||||
file (MAKE_DIRECTORY ${nudb_src_SOURCE_DIR}/include)
|
||||
add_dependencies (nudb nudb_src)
|
||||
endif ()
|
||||
FetchContent_Declare(
|
||||
nudb_src
|
||||
GIT_REPOSITORY https://github.com/CPPAlliance/NuDB.git
|
||||
GIT_TAG 2.0.5
|
||||
)
|
||||
FetchContent_GetProperties(nudb_src)
|
||||
if(NOT nudb_src_POPULATED)
|
||||
message (STATUS "Pausing to download NuDB...")
|
||||
FetchContent_Populate(nudb_src)
|
||||
endif()
|
||||
|
||||
file(TO_CMAKE_PATH "${nudb_src_SOURCE_DIR}" nudb_src_SOURCE_DIR)
|
||||
# specify as system includes so as to avoid warnings
|
||||
# specify as system includes so as to avoid warnings
|
||||
target_include_directories (nudb SYSTEM INTERFACE ${nudb_src_SOURCE_DIR}/include)
|
||||
target_link_libraries (nudb
|
||||
INTERFACE
|
||||
|
||||
@@ -22,7 +22,7 @@ if (static)
|
||||
set (OPENSSL_USE_STATIC_LIBS ON)
|
||||
endif ()
|
||||
set (OPENSSL_MSVC_STATIC_RT ON)
|
||||
find_package (OpenSSL 1.0.2 REQUIRED)
|
||||
find_package (OpenSSL 1.1.1 REQUIRED)
|
||||
target_link_libraries (ripple_libs
|
||||
INTERFACE
|
||||
OpenSSL::SSL
|
||||
|
||||
70
Builds/CMake/deps/Postgres.cmake
Normal file
70
Builds/CMake/deps/Postgres.cmake
Normal file
@@ -0,0 +1,70 @@
|
||||
if(reporting)
|
||||
find_package(PostgreSQL)
|
||||
if(NOT PostgreSQL_FOUND)
|
||||
message("find_package did not find postgres")
|
||||
find_library(postgres NAMES pq libpq libpq-dev pq-dev postgresql-devel)
|
||||
find_path(libpq-fe NAMES libpq-fe.h PATH_SUFFIXES postgresql pgsql include)
|
||||
|
||||
if(NOT libpq-fe_FOUND OR NOT postgres_FOUND)
|
||||
message("No system installed Postgres found. Will build")
|
||||
add_library(postgres SHARED IMPORTED GLOBAL)
|
||||
add_library(pgport SHARED IMPORTED GLOBAL)
|
||||
add_library(pgcommon SHARED IMPORTED GLOBAL)
|
||||
ExternalProject_Add(postgres_src
|
||||
PREFIX ${nih_cache_path}
|
||||
GIT_REPOSITORY https://github.com/postgres/postgres.git
|
||||
GIT_TAG master
|
||||
CONFIGURE_COMMAND ./configure --without-readline > /dev/null
|
||||
BUILD_COMMAND ${CMAKE_COMMAND} -E env --unset=MAKELEVEL make
|
||||
UPDATE_COMMAND ""
|
||||
BUILD_IN_SOURCE 1
|
||||
INSTALL_COMMAND ""
|
||||
BUILD_BYPRODUCTS
|
||||
<BINARY_DIR>/src/interfaces/libpq/${ep_lib_prefix}pq.a
|
||||
<BINARY_DIR>/src/common/${ep_lib_prefix}pgcommon.a
|
||||
<BINARY_DIR>/src/port/${ep_lib_prefix}pgport.a
|
||||
LOG_BUILD TRUE
|
||||
)
|
||||
ExternalProject_Get_Property (postgres_src SOURCE_DIR)
|
||||
ExternalProject_Get_Property (postgres_src BINARY_DIR)
|
||||
|
||||
set (postgres_src_SOURCE_DIR "${SOURCE_DIR}")
|
||||
file (MAKE_DIRECTORY ${postgres_src_SOURCE_DIR})
|
||||
list(APPEND INCLUDE_DIRS
|
||||
${SOURCE_DIR}/src/include
|
||||
${SOURCE_DIR}/src/interfaces/libpq
|
||||
)
|
||||
set_target_properties(postgres PROPERTIES
|
||||
IMPORTED_LOCATION
|
||||
${BINARY_DIR}/src/interfaces/libpq/${ep_lib_prefix}pq.a
|
||||
INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${INCLUDE_DIRS}"
|
||||
)
|
||||
set_target_properties(pgcommon PROPERTIES
|
||||
IMPORTED_LOCATION
|
||||
${BINARY_DIR}/src/common/${ep_lib_prefix}pgcommon.a
|
||||
INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${INCLUDE_DIRS}"
|
||||
)
|
||||
set_target_properties(pgport PROPERTIES
|
||||
IMPORTED_LOCATION
|
||||
${BINARY_DIR}/src/port/${ep_lib_prefix}pgport.a
|
||||
INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${INCLUDE_DIRS}"
|
||||
)
|
||||
add_dependencies(postgres postgres_src)
|
||||
add_dependencies(pgcommon postgres_src)
|
||||
add_dependencies(pgport postgres_src)
|
||||
file(TO_CMAKE_PATH "${postgres_src_SOURCE_DIR}" postgres_src_SOURCE_DIR)
|
||||
target_link_libraries(ripple_libs INTERFACE postgres pgcommon pgport)
|
||||
else()
|
||||
message("Found system installed Postgres via find_libary")
|
||||
target_include_directories(ripple_libs INTERFACE ${libpq-fe})
|
||||
target_link_libraries(ripple_libs INTERFACE ${postgres})
|
||||
endif()
|
||||
else()
|
||||
message("Found system installed Postgres via find_package")
|
||||
target_include_directories(ripple_libs INTERFACE ${PostgreSQL_INCLUDE_DIRS})
|
||||
target_link_libraries(ripple_libs INTERFACE ${PostgreSQL_LIBRARIES})
|
||||
endif()
|
||||
endif()
|
||||
@@ -9,9 +9,21 @@ if (static)
|
||||
set (Protobuf_USE_STATIC_LIBS ON)
|
||||
endif ()
|
||||
find_package (Protobuf 3.8)
|
||||
if (local_protobuf OR NOT Protobuf_FOUND)
|
||||
if (is_multiconfig)
|
||||
set(protobuf_protoc_lib ${Protobuf_PROTOC_LIBRARIES})
|
||||
else ()
|
||||
string(TOUPPER ${CMAKE_BUILD_TYPE} upper_cmake_build_type)
|
||||
set(protobuf_protoc_lib ${Protobuf_PROTOC_LIBRARY_${upper_cmake_build_type}})
|
||||
endif ()
|
||||
if (local_protobuf OR NOT (Protobuf_FOUND AND Protobuf_PROTOC_EXECUTABLE AND protobuf_protoc_lib))
|
||||
include (GNUInstallDirs)
|
||||
message (STATUS "using local protobuf build.")
|
||||
set(protobuf_reqs Protobuf_PROTOC_EXECUTABLE protobuf_protoc_lib)
|
||||
foreach(lib ${protobuf_reqs})
|
||||
if(NOT ${lib})
|
||||
message(STATUS "Couldn't find ${lib}")
|
||||
endif()
|
||||
endforeach()
|
||||
if (WIN32)
|
||||
# protobuf prepends lib even on windows
|
||||
set (pbuf_lib_pre "lib")
|
||||
@@ -53,7 +65,7 @@ if (local_protobuf OR NOT Protobuf_FOUND)
|
||||
${CMAKE_COMMAND}
|
||||
--build .
|
||||
--config $<CONFIG>
|
||||
$<$<VERSION_GREATER_EQUAL:${CMAKE_VERSION},3.12>:--parallel ${ep_procs}>
|
||||
--parallel ${ep_procs}
|
||||
TEST_COMMAND ""
|
||||
INSTALL_COMMAND
|
||||
${CMAKE_COMMAND} -E env --unset=DESTDIR ${CMAKE_COMMAND} --build . --config $<CONFIG> --target install
|
||||
|
||||
@@ -8,7 +8,7 @@ set_target_properties (rocksdb_lib
|
||||
|
||||
option (local_rocksdb "use local build of rocksdb." OFF)
|
||||
if (NOT local_rocksdb)
|
||||
find_package (RocksDB 6.7 QUIET CONFIG)
|
||||
find_package (RocksDB 6.27 QUIET CONFIG)
|
||||
if (TARGET RocksDB::rocksdb)
|
||||
message (STATUS "Found RocksDB using config.")
|
||||
get_target_property (_rockslib_l RocksDB::rocksdb IMPORTED_LOCATION_DEBUG)
|
||||
@@ -40,7 +40,7 @@ if (NOT local_rocksdb)
|
||||
# TBD if there is some way to extract transitive deps..then:
|
||||
#set (RocksDB_USE_STATIC ON)
|
||||
else ()
|
||||
find_package (RocksDB 6.7 MODULE)
|
||||
find_package (RocksDB 6.27 MODULE)
|
||||
if (ROCKSDB_FOUND)
|
||||
if (RocksDB_LIBRARY_DEBUG)
|
||||
set_target_properties (rocksdb_lib PROPERTIES IMPORTED_LOCATION_DEBUG ${RocksDB_LIBRARY_DEBUG})
|
||||
@@ -60,10 +60,10 @@ if (local_rocksdb)
|
||||
ExternalProject_Add (rocksdb
|
||||
PREFIX ${nih_cache_path}
|
||||
GIT_REPOSITORY https://github.com/facebook/rocksdb.git
|
||||
GIT_TAG v6.7.3
|
||||
GIT_TAG v6.27.3
|
||||
PATCH_COMMAND
|
||||
# only used by windows build
|
||||
${CMAKE_COMMAND} -E copy
|
||||
${CMAKE_COMMAND} -E copy_if_different
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Builds/CMake/rocks_thirdparty.inc
|
||||
<SOURCE_DIR>/thirdparty.inc
|
||||
COMMAND
|
||||
@@ -96,9 +96,13 @@ if (local_rocksdb)
|
||||
-Dlz4_FOUND=ON
|
||||
-USNAPPY_*
|
||||
-Usnappy_*
|
||||
-USnappy_*
|
||||
-Dsnappy_INCLUDE_DIRS=$<JOIN:$<TARGET_PROPERTY:snappy_lib,INTERFACE_INCLUDE_DIRECTORIES>,::>
|
||||
-Dsnappy_LIBRARIES=$<IF:$<CONFIG:Debug>,$<TARGET_PROPERTY:snappy_lib,IMPORTED_LOCATION_DEBUG>,$<TARGET_PROPERTY:snappy_lib,IMPORTED_LOCATION_RELEASE>>
|
||||
-Dsnappy_FOUND=ON
|
||||
-DSnappy_INCLUDE_DIRS=$<JOIN:$<TARGET_PROPERTY:snappy_lib,INTERFACE_INCLUDE_DIRECTORIES>,::>
|
||||
-DSnappy_LIBRARIES=$<IF:$<CONFIG:Debug>,$<TARGET_PROPERTY:snappy_lib,IMPORTED_LOCATION_DEBUG>,$<TARGET_PROPERTY:snappy_lib,IMPORTED_LOCATION_RELEASE>>
|
||||
-DSnappy_FOUND=ON
|
||||
-DWITH_MD_LIBRARY=OFF
|
||||
-DWITH_RUNTIME_DEBUG=$<IF:$<CONFIG:Debug>,ON,OFF>
|
||||
-DFAIL_ON_WARNINGS=OFF
|
||||
@@ -132,7 +136,7 @@ if (local_rocksdb)
|
||||
${CMAKE_COMMAND}
|
||||
--build .
|
||||
--config $<CONFIG>
|
||||
$<$<VERSION_GREATER_EQUAL:${CMAKE_VERSION},3.12>:--parallel ${ep_procs}>
|
||||
--parallel ${ep_procs}
|
||||
$<$<BOOL:${is_multiconfig}>:
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -E copy
|
||||
|
||||
@@ -42,7 +42,7 @@ else()
|
||||
${CMAKE_COMMAND}
|
||||
--build .
|
||||
--config $<CONFIG>
|
||||
$<$<VERSION_GREATER_EQUAL:${CMAKE_VERSION},3.12>:--parallel ${ep_procs}>
|
||||
--parallel ${ep_procs}
|
||||
$<$<BOOL:${is_multiconfig}>:
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -E copy
|
||||
|
||||
@@ -113,7 +113,7 @@ else()
|
||||
${CMAKE_COMMAND}
|
||||
--build .
|
||||
--config $<CONFIG>
|
||||
$<$<VERSION_GREATER_EQUAL:${CMAKE_VERSION},3.12>:--parallel ${ep_procs}>
|
||||
--parallel ${ep_procs}
|
||||
$<$<BOOL:${is_multiconfig}>:
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -E copy
|
||||
|
||||
@@ -56,7 +56,7 @@ else()
|
||||
${CMAKE_COMMAND}
|
||||
--build .
|
||||
--config $<CONFIG>
|
||||
$<$<VERSION_GREATER_EQUAL:${CMAKE_VERSION},3.12>:--parallel ${ep_procs}>
|
||||
--parallel ${ep_procs}
|
||||
$<$<BOOL:${is_multiconfig}>:
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -E copy
|
||||
|
||||
167
Builds/CMake/deps/cassandra.cmake
Normal file
167
Builds/CMake/deps/cassandra.cmake
Normal file
@@ -0,0 +1,167 @@
|
||||
if(reporting)
|
||||
find_library(cassandra NAMES cassandra)
|
||||
if(NOT cassandra)
|
||||
|
||||
message("System installed Cassandra cpp driver not found. Will build")
|
||||
|
||||
find_library(zlib NAMES zlib1g-dev zlib-devel zlib z)
|
||||
if(NOT zlib)
|
||||
message("zlib not found. will build")
|
||||
add_library(zlib STATIC IMPORTED GLOBAL)
|
||||
ExternalProject_Add(zlib_src
|
||||
PREFIX ${nih_cache_path}
|
||||
GIT_REPOSITORY https://github.com/madler/zlib.git
|
||||
GIT_TAG master
|
||||
INSTALL_COMMAND ""
|
||||
BUILD_BYPRODUCTS <BINARY_DIR>/${ep_lib_prefix}z.a
|
||||
LOG_BUILD TRUE
|
||||
LOG_CONFIGURE TRUE
|
||||
)
|
||||
|
||||
|
||||
ExternalProject_Get_Property (zlib_src SOURCE_DIR)
|
||||
ExternalProject_Get_Property (zlib_src BINARY_DIR)
|
||||
set (zlib_src_SOURCE_DIR "${SOURCE_DIR}")
|
||||
file (MAKE_DIRECTORY ${zlib_src_SOURCE_DIR}/include)
|
||||
|
||||
set_target_properties (zlib PROPERTIES
|
||||
IMPORTED_LOCATION
|
||||
${BINARY_DIR}/${ep_lib_prefix}z.a
|
||||
INTERFACE_INCLUDE_DIRECTORIES
|
||||
${SOURCE_DIR}/include)
|
||||
add_dependencies(zlib zlib_src)
|
||||
|
||||
file(TO_CMAKE_PATH "${zlib_src_SOURCE_DIR}" zlib_src_SOURCE_DIR)
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
|
||||
find_library(krb5 NAMES krb5-dev libkrb5-dev)
|
||||
|
||||
if(NOT krb5)
|
||||
message("krb5 not found. will build")
|
||||
add_library(krb5 STATIC IMPORTED GLOBAL)
|
||||
ExternalProject_Add(krb5_src
|
||||
PREFIX ${nih_cache_path}
|
||||
GIT_REPOSITORY https://github.com/krb5/krb5.git
|
||||
GIT_TAG master
|
||||
UPDATE_COMMAND ""
|
||||
CONFIGURE_COMMAND autoreconf src && CFLAGS=-fcommon ./src/configure --enable-static --disable-shared > /dev/null
|
||||
BUILD_IN_SOURCE 1
|
||||
BUILD_COMMAND make
|
||||
INSTALL_COMMAND ""
|
||||
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/${ep_lib_prefix}krb5.a
|
||||
LOG_BUILD TRUE
|
||||
)
|
||||
|
||||
ExternalProject_Get_Property (krb5_src SOURCE_DIR)
|
||||
ExternalProject_Get_Property (krb5_src BINARY_DIR)
|
||||
set (krb5_src_SOURCE_DIR "${SOURCE_DIR}")
|
||||
file (MAKE_DIRECTORY ${krb5_src_SOURCE_DIR}/include)
|
||||
|
||||
set_target_properties (krb5 PROPERTIES
|
||||
IMPORTED_LOCATION
|
||||
${BINARY_DIR}/lib/${ep_lib_prefix}krb5.a
|
||||
INTERFACE_INCLUDE_DIRECTORIES
|
||||
${SOURCE_DIR}/include)
|
||||
add_dependencies(krb5 krb5_src)
|
||||
|
||||
file(TO_CMAKE_PATH "${krb5_src_SOURCE_DIR}" krb5_src_SOURCE_DIR)
|
||||
endif()
|
||||
|
||||
|
||||
find_library(libuv1 NAMES uv1 libuv1 liubuv1-dev libuv1:amd64)
|
||||
|
||||
|
||||
if(NOT libuv1)
|
||||
message("libuv1 not found, will build")
|
||||
add_library(libuv1 STATIC IMPORTED GLOBAL)
|
||||
ExternalProject_Add(libuv_src
|
||||
PREFIX ${nih_cache_path}
|
||||
GIT_REPOSITORY https://github.com/libuv/libuv.git
|
||||
GIT_TAG v1.x
|
||||
INSTALL_COMMAND ""
|
||||
BUILD_BYPRODUCTS <BINARY_DIR>/${ep_lib_prefix}uv_a.a
|
||||
LOG_BUILD TRUE
|
||||
LOG_CONFIGURE TRUE
|
||||
)
|
||||
|
||||
ExternalProject_Get_Property (libuv_src SOURCE_DIR)
|
||||
ExternalProject_Get_Property (libuv_src BINARY_DIR)
|
||||
set (libuv_src_SOURCE_DIR "${SOURCE_DIR}")
|
||||
file (MAKE_DIRECTORY ${libuv_src_SOURCE_DIR}/include)
|
||||
|
||||
set_target_properties (libuv1 PROPERTIES
|
||||
IMPORTED_LOCATION
|
||||
${BINARY_DIR}/${ep_lib_prefix}uv_a.a
|
||||
INTERFACE_INCLUDE_DIRECTORIES
|
||||
${SOURCE_DIR}/include)
|
||||
add_dependencies(libuv1 libuv_src)
|
||||
|
||||
file(TO_CMAKE_PATH "${libuv_src_SOURCE_DIR}" libuv_src_SOURCE_DIR)
|
||||
endif()
|
||||
|
||||
add_library (cassandra STATIC IMPORTED GLOBAL)
|
||||
ExternalProject_Add(cassandra_src
|
||||
PREFIX ${nih_cache_path}
|
||||
GIT_REPOSITORY https://github.com/datastax/cpp-driver.git
|
||||
GIT_TAG master
|
||||
CMAKE_ARGS
|
||||
-DLIBUV_ROOT_DIR=${BINARY_DIR}
|
||||
-DLIBUV_LIBARY=${BINARY_DIR}/libuv_a.a
|
||||
-DLIBUV_INCLUDE_DIR=${SOURCE_DIR}/include
|
||||
-DCASS_BUILD_STATIC=ON
|
||||
-DCASS_BUILD_SHARED=OFF
|
||||
-DOPENSSL_ROOT_DIR=/opt/local/openssl
|
||||
INSTALL_COMMAND ""
|
||||
BUILD_BYPRODUCTS <BINARY_DIR>/${ep_lib_prefix}cassandra_static.a
|
||||
LOG_BUILD TRUE
|
||||
LOG_CONFIGURE TRUE
|
||||
)
|
||||
|
||||
ExternalProject_Get_Property (cassandra_src SOURCE_DIR)
|
||||
ExternalProject_Get_Property (cassandra_src BINARY_DIR)
|
||||
set (cassandra_src_SOURCE_DIR "${SOURCE_DIR}")
|
||||
file (MAKE_DIRECTORY ${cassandra_src_SOURCE_DIR}/include)
|
||||
|
||||
set_target_properties (cassandra PROPERTIES
|
||||
IMPORTED_LOCATION
|
||||
${BINARY_DIR}/${ep_lib_prefix}cassandra_static.a
|
||||
INTERFACE_INCLUDE_DIRECTORIES
|
||||
${SOURCE_DIR}/include)
|
||||
add_dependencies(cassandra cassandra_src)
|
||||
|
||||
if(NOT libuv1)
|
||||
ExternalProject_Add_StepDependencies(cassandra_src build libuv1)
|
||||
target_link_libraries(cassandra INTERFACE libuv1)
|
||||
else()
|
||||
target_link_libraries(cassandra INTERFACE ${libuv1})
|
||||
endif()
|
||||
if(NOT krb5)
|
||||
|
||||
ExternalProject_Add_StepDependencies(cassandra_src build krb5)
|
||||
target_link_libraries(cassandra INTERFACE krb5)
|
||||
else()
|
||||
target_link_libraries(cassandra INTERFACE ${krb5})
|
||||
endif()
|
||||
|
||||
if(NOT zlib)
|
||||
ExternalProject_Add_StepDependencies(cassandra_src build zlib)
|
||||
target_link_libraries(cassandra INTERFACE zlib)
|
||||
else()
|
||||
target_link_libraries(cassandra INTERFACE ${zlib})
|
||||
endif()
|
||||
|
||||
file(TO_CMAKE_PATH "${cassandra_src_SOURCE_DIR}" cassandra_src_SOURCE_DIR)
|
||||
target_link_libraries(ripple_libs INTERFACE cassandra)
|
||||
else()
|
||||
message("Found system installed cassandra cpp driver")
|
||||
|
||||
find_path(cassandra_includes NAMES cassandra.h REQUIRED)
|
||||
target_link_libraries (ripple_libs INTERFACE ${cassandra})
|
||||
target_include_directories(ripple_libs INTERFACE ${cassandra_includes})
|
||||
endif()
|
||||
|
||||
exclude_if_included (cassandra)
|
||||
endif()
|
||||
@@ -9,41 +9,10 @@
|
||||
|
||||
find_package (date QUIET)
|
||||
if (NOT TARGET date::date)
|
||||
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.14)
|
||||
FetchContent_Declare(
|
||||
hh_date_src
|
||||
GIT_REPOSITORY https://github.com/HowardHinnant/date.git
|
||||
GIT_TAG fc4cf092f9674f2670fb9177edcdee870399b829
|
||||
)
|
||||
FetchContent_MakeAvailable(hh_date_src)
|
||||
else ()
|
||||
ExternalProject_Add (hh_date_src
|
||||
PREFIX ${nih_cache_path}
|
||||
GIT_REPOSITORY https://github.com/HowardHinnant/date.git
|
||||
GIT_TAG fc4cf092f9674f2670fb9177edcdee870399b829
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_COMMAND ""
|
||||
TEST_COMMAND ""
|
||||
INSTALL_COMMAND ""
|
||||
)
|
||||
ExternalProject_Get_Property (hh_date_src SOURCE_DIR)
|
||||
set (hh_date_src_SOURCE_DIR "${SOURCE_DIR}")
|
||||
file (MAKE_DIRECTORY ${hh_date_src_SOURCE_DIR}/include)
|
||||
add_library (date_interface INTERFACE)
|
||||
add_library (date::date ALIAS date_interface)
|
||||
add_dependencies (date_interface hh_date_src)
|
||||
file (TO_CMAKE_PATH "${hh_date_src_SOURCE_DIR}" hh_date_src_SOURCE_DIR)
|
||||
target_include_directories (date_interface
|
||||
SYSTEM INTERFACE
|
||||
$<BUILD_INTERFACE:${hh_date_src_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include>)
|
||||
install (
|
||||
FILES
|
||||
${hh_date_src_SOURCE_DIR}/include/date/date.h
|
||||
DESTINATION include/date)
|
||||
install (TARGETS date_interface
|
||||
EXPORT RippleExports
|
||||
INCLUDES DESTINATION include)
|
||||
endif ()
|
||||
FetchContent_Declare(
|
||||
hh_date_src
|
||||
GIT_REPOSITORY https://github.com/HowardHinnant/date.git
|
||||
GIT_TAG fc4cf092f9674f2670fb9177edcdee870399b829
|
||||
)
|
||||
FetchContent_MakeAvailable(hh_date_src)
|
||||
endif ()
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ else ()
|
||||
${CMAKE_COMMAND}
|
||||
--build .
|
||||
--config $<CONFIG>
|
||||
$<$<VERSION_GREATER_EQUAL:${CMAKE_VERSION},3.12>:--parallel ${ep_procs}>
|
||||
--parallel ${ep_procs}
|
||||
TEST_COMMAND ""
|
||||
INSTALL_COMMAND
|
||||
${CMAKE_COMMAND} -E env --unset=DESTDIR ${CMAKE_COMMAND} --build . --config $<CONFIG> --target install
|
||||
@@ -169,7 +169,7 @@ else ()
|
||||
${CMAKE_COMMAND}
|
||||
--build .
|
||||
--config $<CONFIG>
|
||||
$<$<VERSION_GREATER_EQUAL:${CMAKE_VERSION},3.12>:--parallel ${ep_procs}>
|
||||
--parallel ${ep_procs}
|
||||
TEST_COMMAND ""
|
||||
INSTALL_COMMAND
|
||||
${CMAKE_COMMAND} -E env --unset=DESTDIR ${CMAKE_COMMAND} --build . --config $<CONFIG> --target install
|
||||
@@ -211,6 +211,7 @@ else ()
|
||||
-DCMAKE_DEBUG_POSTFIX=_d
|
||||
$<$<NOT:$<BOOL:${is_multiconfig}>>:-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}>
|
||||
-DgRPC_BUILD_TESTS=OFF
|
||||
-DgRPC_BENCHMARK_PROVIDER=""
|
||||
-DgRPC_BUILD_CSHARP_EXT=OFF
|
||||
-DgRPC_MSVC_STATIC_RUNTIME=ON
|
||||
-DgRPC_INSTALL=OFF
|
||||
@@ -236,7 +237,7 @@ else ()
|
||||
${CMAKE_COMMAND}
|
||||
--build .
|
||||
--config $<CONFIG>
|
||||
$<$<VERSION_GREATER_EQUAL:${CMAKE_VERSION},3.12>:--parallel ${ep_procs}>
|
||||
--parallel ${ep_procs}
|
||||
$<$<BOOL:${is_multiconfig}>:
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -E copy
|
||||
|
||||
@@ -1,4 +1,71 @@
|
||||
#include "build_version.h"
|
||||
const char* rocksdb_build_git_sha = "rocksdb_build_git_sha: N/A";
|
||||
const char* rocksdb_build_git_date = "rocksdb_build_git_date: N/A";
|
||||
const char* rocksdb_build_compile_date = "N/A";
|
||||
// Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "rocksdb/version.h"
|
||||
#include "util/string_util.h"
|
||||
|
||||
// The build script may replace these values with real values based
|
||||
// on whether or not GIT is available and the platform settings
|
||||
static const std::string rocksdb_build_git_sha = "rocksdb_build_git_sha:@GIT_SHA@";
|
||||
static const std::string rocksdb_build_git_tag = "rocksdb_build_git_tag:@GIT_TAG@";
|
||||
#define HAS_GIT_CHANGES @GIT_MOD@
|
||||
#if HAS_GIT_CHANGES == 0
|
||||
// If HAS_GIT_CHANGES is 0, the GIT date is used.
|
||||
// Use the time the branch/tag was last modified
|
||||
static const std::string rocksdb_build_date = "rocksdb_build_date:@GIT_DATE@";
|
||||
#else
|
||||
// If HAS_GIT_CHANGES is > 0, the branch/tag has modifications.
|
||||
// Use the time the build was created.
|
||||
static const std::string rocksdb_build_date = "rocksdb_build_date:@BUILD_DATE@";
|
||||
#endif
|
||||
|
||||
namespace ROCKSDB_NAMESPACE {
|
||||
static void AddProperty(std::unordered_map<std::string, std::string> *props, const std::string& name) {
|
||||
size_t colon = name.find(":");
|
||||
if (colon != std::string::npos && colon > 0 && colon < name.length() - 1) {
|
||||
// If we found a "@:", then this property was a build-time substitution that failed. Skip it
|
||||
size_t at = name.find("@", colon);
|
||||
if (at != colon + 1) {
|
||||
// Everything before the colon is the name, after is the value
|
||||
(*props)[name.substr(0, colon)] = name.substr(colon + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static std::unordered_map<std::string, std::string>* LoadPropertiesSet() {
|
||||
auto * properties = new std::unordered_map<std::string, std::string>();
|
||||
AddProperty(properties, rocksdb_build_git_sha);
|
||||
AddProperty(properties, rocksdb_build_git_tag);
|
||||
AddProperty(properties, rocksdb_build_date);
|
||||
return properties;
|
||||
}
|
||||
|
||||
const std::unordered_map<std::string, std::string>& GetRocksBuildProperties() {
|
||||
static std::unique_ptr<std::unordered_map<std::string, std::string>> props(LoadPropertiesSet());
|
||||
return *props;
|
||||
}
|
||||
|
||||
std::string GetRocksVersionAsString(bool with_patch) {
|
||||
std::string version = ToString(ROCKSDB_MAJOR) + "." + ToString(ROCKSDB_MINOR);
|
||||
if (with_patch) {
|
||||
return version + "." + ToString(ROCKSDB_PATCH);
|
||||
} else {
|
||||
return version;
|
||||
}
|
||||
}
|
||||
|
||||
std::string GetRocksBuildInfoAsString(const std::string& program, bool verbose) {
|
||||
std::string info = program + " (RocksDB) " + GetRocksVersionAsString(true);
|
||||
if (verbose) {
|
||||
for (const auto& it : GetRocksBuildProperties()) {
|
||||
info.append("\n ");
|
||||
info.append(it.first);
|
||||
info.append(": ");
|
||||
info.append(it.second);
|
||||
}
|
||||
}
|
||||
return info;
|
||||
}
|
||||
} // namespace ROCKSDB_NAMESPACE
|
||||
|
||||
|
||||
@@ -1,13 +1,30 @@
|
||||
# This patches unsigned-types.h in the soci official sources
|
||||
# so as to remove type range check exceptions that cause
|
||||
# us trouble when using boost::optional to select int values
|
||||
|
||||
# Some versions of CMake erroneously patch external projects on every build.
|
||||
# If the patch makes no changes, skip it. This workaround can be
|
||||
# removed once we stop supporting vulnerable versions of CMake.
|
||||
# https://gitlab.kitware.com/cmake/cmake/-/issues/21086
|
||||
file (STRINGS include/soci/unsigned-types.h sourcecode)
|
||||
# Delete the .patched file if it exists, so it doesn't end up duplicated.
|
||||
# Trying to remove a file that does not exist is not a problem.
|
||||
file (REMOVE include/soci/unsigned-types.h.patched)
|
||||
foreach (line_ ${sourcecode})
|
||||
if (line_ MATCHES "^[ \\t]+throw[ ]+soci_error[ ]*\\([ ]*\"Value outside of allowed.+$")
|
||||
set (line_ "//${CMAKE_MATCH_0}")
|
||||
endif ()
|
||||
file (APPEND include/soci/unsigned-types.h.patched "${line_}\n")
|
||||
endforeach ()
|
||||
execute_process( COMMAND ${CMAKE_COMMAND} -E compare_files
|
||||
include/soci/unsigned-types.h include/soci/unsigned-types.h.patched
|
||||
RESULT_VARIABLE compare_result
|
||||
)
|
||||
if( compare_result EQUAL 0)
|
||||
message(DEBUG "The soci source and patch files are identical. Make no changes.")
|
||||
file (REMOVE include/soci/unsigned-types.h.patched)
|
||||
return()
|
||||
endif()
|
||||
file (RENAME include/soci/unsigned-types.h include/soci/unsigned-types.h.orig)
|
||||
file (RENAME include/soci/unsigned-types.h.patched include/soci/unsigned-types.h)
|
||||
# also fix Boost.cmake so that it just returns when we override the Boost_FOUND var
|
||||
|
||||
@@ -16,7 +16,7 @@ need these software components
|
||||
|-----------|-----------------------|
|
||||
| [Visual Studio 2017](README.md#install-visual-studio-2017)| 15.5.4 |
|
||||
| [Git for Windows](README.md#install-git-for-windows)| 2.16.1 |
|
||||
| [OpenSSL Library](README.md#install-openssl) | 1.0.2n |
|
||||
| [OpenSSL Library](README.md#install-openssl) | 1.1.1L |
|
||||
| [Boost library](README.md#build-boost) | 1.70.0 |
|
||||
| [CMake for Windows](README.md#optional-install-cmake-for-windows)* | 3.12 |
|
||||
|
||||
@@ -50,17 +50,19 @@ Windows is mandatory for running the unit tests.
|
||||
|
||||
### Install OpenSSL
|
||||
|
||||
[Download OpenSSL.](http://slproweb.com/products/Win32OpenSSL.html) There will
|
||||
four `Win64` bit variants available, you want the non-light `v1.0` line. As of
|
||||
this writing, you **should** select
|
||||
[Download the latest version of
|
||||
OpenSSL.](http://slproweb.com/products/Win32OpenSSL.html) There will
|
||||
several `Win64` bit variants available, you want the non-light
|
||||
`v1.1` line. As of this writing, you **should** select
|
||||
|
||||
* Win64 OpenSSL v1.0.2n.
|
||||
* Win64 OpenSSL v1.1.1L
|
||||
|
||||
and should **not** select
|
||||
|
||||
* Win64 OpenSSL v1.0.2n light
|
||||
* Win64 OpenSSL v1.1.0g
|
||||
* Win64 OpenSSL v1.1.0g light
|
||||
* Anything with "Win32" in the name
|
||||
* Anything with "light" in the name
|
||||
* Anything with "EXPERIMENTAL" in the name
|
||||
* Anything in the 3.0 line - rippled won't currently build with this version.
|
||||
|
||||
Run the installer, and choose an appropriate location for your OpenSSL
|
||||
installation. In this guide we use `C:\lib\OpenSSL-Win64` as the destination
|
||||
@@ -146,7 +148,7 @@ If you receive an error about not having the "correct access rights" make sure
|
||||
you have Github ssh keys, as described above.
|
||||
|
||||
For a stable release, choose the `master` branch or one of the tagged releases
|
||||
listed on [rippled's GitHub page](https://github.com/ripple/rippled/releases).
|
||||
listed on [rippled's GitHub page](https://github.com/ripple/rippled/releases).
|
||||
|
||||
```
|
||||
git checkout master
|
||||
@@ -175,7 +177,7 @@ To begin, simply:
|
||||
cloned rippled folder.
|
||||
2. Right-click on `CMakeLists.txt` in the **Solution Explorer - Folder View** to
|
||||
generate a `CMakeSettings.json` file. A sample settings file is provided
|
||||
[here](/Builds/VisualStudio2017/CMakeSettings-example.json). Customize the
|
||||
[here](/Builds/VisualStudio2017/CMakeSettings-example.json). Customize the
|
||||
settings for `BOOST_ROOT`, `OPENSSL_ROOT` to match the install paths if they
|
||||
differ from those in the file.
|
||||
4. Select either the `x64-Release` or `x64-Debug` configuration from the
|
||||
@@ -214,14 +216,14 @@ execute the following commands within your `rippled` cloned repository:
|
||||
```
|
||||
mkdir build\cmake
|
||||
cd build\cmake
|
||||
cmake ..\.. -G"Visual Studio 15 2017 Win64" -DBOOST_ROOT="C:\lib\boost_1_70_0" -DOPENSSL_ROOT="C:\lib\OpenSSL-Win64"
|
||||
cmake ..\.. -G"Visual Studio 15 2017 Win64" -DBOOST_ROOT="C:\lib\boost_1_70_0" -DOPENSSL_ROOT="C:\lib\OpenSSL-Win64" -DCMAKE_GENERATOR_TOOLSET=host=x64
|
||||
```
|
||||
Now launch Visual Studio 2017 and select **File | Open | Project/Solution**.
|
||||
Navigate to the `build\cmake` folder created above and select the `rippled.sln`
|
||||
file. You can then choose whether to build the `Debug` or `Release` solution
|
||||
configuration.
|
||||
|
||||
The executable will be in
|
||||
The executable will be in
|
||||
```
|
||||
.\build\cmake\Release\rippled.exe
|
||||
```
|
||||
@@ -233,21 +235,24 @@ These paths are relative to your cloned git repository.
|
||||
|
||||
# Unity/No-Unity Builds
|
||||
|
||||
The rippled build system defaults to using [unity source files](http://onqtam.com/programming/2018-07-07-unity-builds/)
|
||||
to improve build times. In some cases it might be desirable to disable the unity build and compile
|
||||
individual translation units. Here is how you can switch to a "no-unity" build configuration:
|
||||
The rippled build system defaults to using
|
||||
[unity source files](http://onqtam.com/programming/2018-07-07-unity-builds/)
|
||||
to improve build times. In some cases it might be desirable to disable the
|
||||
unity build and compile individual translation units. Here is how you can
|
||||
switch to a "no-unity" build configuration:
|
||||
|
||||
## Visual Studio Integrated CMake
|
||||
|
||||
Edit your `CmakeSettings.json` (described above) by adding `-Dunity=OFF` to the `cmakeCommandArgs` entry
|
||||
for each build configuration.
|
||||
|
||||
Edit your `CmakeSettings.json` (described above) by adding `-Dunity=OFF`
|
||||
to the `cmakeCommandArgs` entry for each build configuration.
|
||||
|
||||
## Standalone CMake Builds
|
||||
|
||||
When running cmake to generate the Visual Studio project files, add `-Dunity=OFF` to the
|
||||
command line options passed to cmake.
|
||||
When running cmake to generate the Visual Studio project files, add
|
||||
`-Dunity=OFF` to the command line options passed to cmake.
|
||||
|
||||
**Note:** you will need to re-run the cmake configuration step anytime you want to switch between unity/no-unity builds.
|
||||
**Note:** you will need to re-run the cmake configuration step anytime you
|
||||
want to switch between unity/no-unity builds.
|
||||
|
||||
# Unit Test (Recommended)
|
||||
|
||||
|
||||
@@ -23,6 +23,6 @@ time cmake \
|
||||
-Dcontainer_label="${container_tag}" \
|
||||
-Dhave_package_container=ON \
|
||||
-DCMAKE_VERBOSE_MAKEFILE=ON \
|
||||
-Dunity=OFF \
|
||||
-G Ninja ../..
|
||||
time cmake --build . --target ${pkgtype} -- -v
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env sh
|
||||
set -ex
|
||||
set -e
|
||||
# used as a before/setup script for docker steps in gitlab-ci
|
||||
# expects to be run in standard alpine/dind image
|
||||
echo $(nproc)
|
||||
@@ -13,4 +13,3 @@ apk add \
|
||||
pip3 install awscli
|
||||
# list curdir contents to build log:
|
||||
ls -la
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
# can be overridden by project or group variables as needed.
|
||||
variables:
|
||||
# these containers are built manually using the rippled
|
||||
# cmake build (container targets) and tagged/pushed so they
|
||||
# cmake build (container targets) and tagged/pushed so they
|
||||
# can be used here
|
||||
RPM_CONTAINER_TAG: "2020-02-10"
|
||||
RPM_CONTAINER_NAME: "rippled-rpm-builder"
|
||||
@@ -44,14 +44,16 @@ stages:
|
||||
- . ./Builds/containers/gitlab-ci/docker_alpine_setup.sh
|
||||
variables:
|
||||
docker_driver: overlay2
|
||||
DOCKER_TLS_CERTDIR: ""
|
||||
image:
|
||||
name: docker:latest
|
||||
name: artifactory.ops.ripple.com/docker:latest
|
||||
services:
|
||||
# workaround for TLS issues - consider going back
|
||||
# back to unversioned `dind` when issues are resolved
|
||||
- docker:18-dind
|
||||
- name: artifactory.ops.ripple.com/docker:stable-dind
|
||||
alias: docker
|
||||
tags:
|
||||
- docker-4xlarge
|
||||
- 4xlarge
|
||||
|
||||
.only_primary_template: &only_primary
|
||||
only:
|
||||
@@ -111,7 +113,7 @@ rpm_sign:
|
||||
dependencies:
|
||||
- rpm_build
|
||||
image:
|
||||
name: centos:7
|
||||
name: artifactory.ops.ripple.com/centos:7
|
||||
<<: *only_primary
|
||||
before_script:
|
||||
- |
|
||||
@@ -140,7 +142,7 @@ dpkg_sign:
|
||||
dependencies:
|
||||
- dpkg_build
|
||||
image:
|
||||
name: ubuntu:18.04
|
||||
name: artifactory.ops.ripple.com/ubuntu:18.04
|
||||
<<: *only_primary
|
||||
before_script:
|
||||
- |
|
||||
@@ -179,47 +181,39 @@ centos_7_smoketest:
|
||||
- rpm_build
|
||||
- rpm_sign
|
||||
image:
|
||||
name: centos:7
|
||||
name: artifactory.ops.ripple.com/centos:7
|
||||
<<: *run_local_smoketest
|
||||
|
||||
fedora_29_smoketest:
|
||||
# TODO: Remove "allow_failure" when tests fixed
|
||||
rocky_8_smoketest:
|
||||
stage: smoketest
|
||||
dependencies:
|
||||
- rpm_build
|
||||
- rpm_sign
|
||||
image:
|
||||
name: fedora:29
|
||||
name: rockylinux/rockylinux:8
|
||||
<<: *run_local_smoketest
|
||||
allow_failure: true
|
||||
|
||||
fedora_28_smoketest:
|
||||
fedora_34_smoketest:
|
||||
stage: smoketest
|
||||
dependencies:
|
||||
- rpm_build
|
||||
- rpm_sign
|
||||
image:
|
||||
name: fedora:28
|
||||
name: artifactory.ops.ripple.com/fedora:34
|
||||
<<: *run_local_smoketest
|
||||
allow_failure: true
|
||||
|
||||
fedora_27_smoketest:
|
||||
fedora_35_smoketest:
|
||||
stage: smoketest
|
||||
dependencies:
|
||||
- rpm_build
|
||||
- rpm_sign
|
||||
image:
|
||||
name: fedora:27
|
||||
<<: *run_local_smoketest
|
||||
|
||||
## this one is not LTS, but we
|
||||
## get some extra coverage by including it
|
||||
## consider dropping it when 20.04 is ready
|
||||
ubuntu_20_smoketest:
|
||||
stage: smoketest
|
||||
dependencies:
|
||||
- dpkg_build
|
||||
- dpkg_sign
|
||||
image:
|
||||
name: ubuntu:20.04
|
||||
name: artifactory.ops.ripple.com/fedora:35
|
||||
<<: *run_local_smoketest
|
||||
allow_failure: true
|
||||
|
||||
ubuntu_18_smoketest:
|
||||
stage: smoketest
|
||||
@@ -227,25 +221,54 @@ ubuntu_18_smoketest:
|
||||
- dpkg_build
|
||||
- dpkg_sign
|
||||
image:
|
||||
name: ubuntu:18.04
|
||||
name: artifactory.ops.ripple.com/ubuntu:18.04
|
||||
<<: *run_local_smoketest
|
||||
|
||||
ubuntu_16_smoketest:
|
||||
ubuntu_20_smoketest:
|
||||
stage: smoketest
|
||||
dependencies:
|
||||
- dpkg_build
|
||||
- dpkg_sign
|
||||
image:
|
||||
name: ubuntu:16.04
|
||||
name: artifactory.ops.ripple.com/ubuntu:20.04
|
||||
<<: *run_local_smoketest
|
||||
|
||||
# TODO: remove "allow_failure" when 22.04 released in 4/2022...
|
||||
ubuntu_22_smoketest:
|
||||
stage: smoketest
|
||||
dependencies:
|
||||
- dpkg_build
|
||||
- dpkg_sign
|
||||
image:
|
||||
name: artifactory.ops.ripple.com/ubuntu:22.04
|
||||
<<: *run_local_smoketest
|
||||
allow_failure: true
|
||||
|
||||
debian_9_smoketest:
|
||||
stage: smoketest
|
||||
dependencies:
|
||||
- dpkg_build
|
||||
- dpkg_sign
|
||||
image:
|
||||
name: debian:9
|
||||
name: artifactory.ops.ripple.com/debian:9
|
||||
<<: *run_local_smoketest
|
||||
|
||||
debian_10_smoketest:
|
||||
stage: smoketest
|
||||
dependencies:
|
||||
- dpkg_build
|
||||
- dpkg_sign
|
||||
image:
|
||||
name: artifactory.ops.ripple.com/debian:10
|
||||
<<: *run_local_smoketest
|
||||
|
||||
debian_11_smoketest:
|
||||
stage: smoketest
|
||||
dependencies:
|
||||
- dpkg_build
|
||||
- dpkg_sign
|
||||
image:
|
||||
name: artifactory.ops.ripple.com/debian:11
|
||||
<<: *run_local_smoketest
|
||||
|
||||
#########################################################################
|
||||
@@ -263,7 +286,7 @@ debian_9_smoketest:
|
||||
verify_head_signed:
|
||||
stage: verify_sig
|
||||
image:
|
||||
name: ubuntu:latest
|
||||
name: artifactory.ops.ripple.com/ubuntu:latest
|
||||
<<: *only_primary
|
||||
script:
|
||||
- . ./Builds/containers/gitlab-ci/verify_head_commit.sh
|
||||
@@ -281,14 +304,16 @@ tag_bld_images:
|
||||
stage: tag_images
|
||||
variables:
|
||||
docker_driver: overlay2
|
||||
DOCKER_TLS_CERTDIR: ""
|
||||
image:
|
||||
name: docker:19.03.8
|
||||
name: artifactory.ops.ripple.com/docker:latest
|
||||
services:
|
||||
# workaround for TLS issues - consider going back
|
||||
# back to unversioned `dind` when issues are resolved
|
||||
- docker:18-dind
|
||||
- name: artifactory.ops.ripple.com/docker:stable-dind
|
||||
alias: docker
|
||||
tags:
|
||||
- docker-large
|
||||
- large
|
||||
dependencies:
|
||||
- rpm_sign
|
||||
- dpkg_sign
|
||||
@@ -311,7 +336,7 @@ push_test:
|
||||
DEB_REPO: "rippled-deb-test-mirror"
|
||||
RPM_REPO: "rippled-rpm-test-mirror"
|
||||
image:
|
||||
name: alpine:latest
|
||||
name: artifactory.ops.ripple.com/alpine:latest
|
||||
artifacts:
|
||||
paths:
|
||||
- files.info
|
||||
@@ -336,44 +361,59 @@ centos_7_verify_repo_test:
|
||||
variables:
|
||||
RPM_REPO: "rippled-rpm-test-mirror"
|
||||
image:
|
||||
name: centos:7
|
||||
name: artifactory.ops.ripple.com/centos:7
|
||||
dependencies:
|
||||
- rpm_sign
|
||||
<<: *only_primary
|
||||
<<: *run_repo_smoketest
|
||||
|
||||
fedora_29_verify_repo_test:
|
||||
rocky_8_verify_repo_test:
|
||||
stage: verify_from_test
|
||||
variables:
|
||||
RPM_REPO: "rippled-rpm-test-mirror"
|
||||
image:
|
||||
name: fedora:29
|
||||
name: rockylinux/rockylinux:8
|
||||
dependencies:
|
||||
- rpm_sign
|
||||
<<: *only_primary
|
||||
<<: *run_repo_smoketest
|
||||
allow_failure: true
|
||||
|
||||
fedora_28_verify_repo_test:
|
||||
fedora_34_verify_repo_test:
|
||||
stage: verify_from_test
|
||||
variables:
|
||||
RPM_REPO: "rippled-rpm-test-mirror"
|
||||
image:
|
||||
name: fedora:28
|
||||
name: artifactory.ops.ripple.com/fedora:34
|
||||
dependencies:
|
||||
- rpm_sign
|
||||
<<: *only_primary
|
||||
<<: *run_repo_smoketest
|
||||
allow_failure: true
|
||||
|
||||
fedora_27_verify_repo_test:
|
||||
fedora_35_verify_repo_test:
|
||||
stage: verify_from_test
|
||||
variables:
|
||||
RPM_REPO: "rippled-rpm-test-mirror"
|
||||
image:
|
||||
name: fedora:27
|
||||
name: artifactory.ops.ripple.com/fedora:35
|
||||
dependencies:
|
||||
- rpm_sign
|
||||
<<: *only_primary
|
||||
<<: *run_repo_smoketest
|
||||
allow_failure: true
|
||||
|
||||
ubuntu_18_verify_repo_test:
|
||||
stage: verify_from_test
|
||||
variables:
|
||||
DISTRO: "bionic"
|
||||
DEB_REPO: "rippled-deb-test-mirror"
|
||||
image:
|
||||
name: artifactory.ops.ripple.com/ubuntu:18.04
|
||||
dependencies:
|
||||
- dpkg_sign
|
||||
<<: *only_primary
|
||||
<<: *run_repo_smoketest
|
||||
|
||||
ubuntu_20_verify_repo_test:
|
||||
stage: verify_from_test
|
||||
@@ -381,35 +421,25 @@ ubuntu_20_verify_repo_test:
|
||||
DISTRO: "focal"
|
||||
DEB_REPO: "rippled-deb-test-mirror"
|
||||
image:
|
||||
name: ubuntu:20.04
|
||||
name: artifactory.ops.ripple.com/ubuntu:20.04
|
||||
dependencies:
|
||||
- dpkg_sign
|
||||
<<: *only_primary
|
||||
<<: *run_repo_smoketest
|
||||
|
||||
ubuntu_18_verify_repo_test:
|
||||
# TODO: remove "allow_failure" when 22.04 released in 4/2022...
|
||||
ubuntu_22_verify_repo_test:
|
||||
stage: verify_from_test
|
||||
variables:
|
||||
DISTRO: "bionic"
|
||||
DISTRO: "jammy"
|
||||
DEB_REPO: "rippled-deb-test-mirror"
|
||||
image:
|
||||
name: ubuntu:18.04
|
||||
dependencies:
|
||||
- dpkg_sign
|
||||
<<: *only_primary
|
||||
<<: *run_repo_smoketest
|
||||
|
||||
ubuntu_16_verify_repo_test:
|
||||
stage: verify_from_test
|
||||
variables:
|
||||
DISTRO: "xenial"
|
||||
DEB_REPO: "rippled-deb-test-mirror"
|
||||
image:
|
||||
name: ubuntu:16.04
|
||||
name: artifactory.ops.ripple.com/ubuntu:22.04
|
||||
dependencies:
|
||||
- dpkg_sign
|
||||
<<: *only_primary
|
||||
<<: *run_repo_smoketest
|
||||
allow_failure: true
|
||||
|
||||
debian_9_verify_repo_test:
|
||||
stage: verify_from_test
|
||||
@@ -417,7 +447,31 @@ debian_9_verify_repo_test:
|
||||
DISTRO: "stretch"
|
||||
DEB_REPO: "rippled-deb-test-mirror"
|
||||
image:
|
||||
name: debian:9
|
||||
name: artifactory.ops.ripple.com/debian:9
|
||||
dependencies:
|
||||
- dpkg_sign
|
||||
<<: *only_primary
|
||||
<<: *run_repo_smoketest
|
||||
|
||||
debian_10_verify_repo_test:
|
||||
stage: verify_from_test
|
||||
variables:
|
||||
DISTRO: "buster"
|
||||
DEB_REPO: "rippled-deb-test-mirror"
|
||||
image:
|
||||
name: artifactory.ops.ripple.com/debian:10
|
||||
dependencies:
|
||||
- dpkg_sign
|
||||
<<: *only_primary
|
||||
<<: *run_repo_smoketest
|
||||
|
||||
debian_11_verify_repo_test:
|
||||
stage: verify_from_test
|
||||
variables:
|
||||
DISTRO: "bullseye"
|
||||
DEB_REPO: "rippled-deb-test-mirror"
|
||||
image:
|
||||
name: artifactory.ops.ripple.com/debian:11
|
||||
dependencies:
|
||||
- dpkg_sign
|
||||
<<: *only_primary
|
||||
@@ -435,7 +489,7 @@ debian_9_verify_repo_test:
|
||||
wait_before_push_prod:
|
||||
stage: wait_approval_prod
|
||||
image:
|
||||
name: alpine:latest
|
||||
name: artifactory.ops.ripple.com/alpine:latest
|
||||
<<: *only_primary
|
||||
script:
|
||||
- echo "proceeding to next stage"
|
||||
@@ -456,7 +510,7 @@ push_prod:
|
||||
DEB_REPO: "rippled-deb"
|
||||
RPM_REPO: "rippled-rpm"
|
||||
image:
|
||||
name: alpine:latest
|
||||
name: artifactory.ops.ripple.com/alpine:latest
|
||||
stage: push_to_prod
|
||||
artifacts:
|
||||
paths:
|
||||
@@ -482,44 +536,59 @@ centos_7_verify_repo_prod:
|
||||
variables:
|
||||
RPM_REPO: "rippled-rpm"
|
||||
image:
|
||||
name: centos:7
|
||||
name: artifactory.ops.ripple.com/centos:7
|
||||
dependencies:
|
||||
- rpm_sign
|
||||
<<: *only_primary
|
||||
<<: *run_repo_smoketest
|
||||
|
||||
fedora_29_verify_repo_prod:
|
||||
stage: verify_from_prod
|
||||
rocky_8_verify_repo_test:
|
||||
stage: verify_from_test
|
||||
variables:
|
||||
RPM_REPO: "rippled-rpm"
|
||||
RPM_REPO: "rippled-rpm-test-mirror"
|
||||
image:
|
||||
name: fedora:29
|
||||
name: rockylinux/rockylinux:8
|
||||
dependencies:
|
||||
- rpm_sign
|
||||
<<: *only_primary
|
||||
<<: *run_repo_smoketest
|
||||
allow_failure: true
|
||||
|
||||
fedora_28_verify_repo_prod:
|
||||
fedora_34_verify_repo_prod:
|
||||
stage: verify_from_prod
|
||||
variables:
|
||||
RPM_REPO: "rippled-rpm"
|
||||
image:
|
||||
name: fedora:28
|
||||
name: artifactory.ops.ripple.com/fedora:34
|
||||
dependencies:
|
||||
- rpm_sign
|
||||
<<: *only_primary
|
||||
<<: *run_repo_smoketest
|
||||
allow_failure: true
|
||||
|
||||
fedora_27_verify_repo_prod:
|
||||
fedora_35_verify_repo_prod:
|
||||
stage: verify_from_prod
|
||||
variables:
|
||||
RPM_REPO: "rippled-rpm"
|
||||
image:
|
||||
name: fedora:27
|
||||
name: artifactory.ops.ripple.com/fedora:35
|
||||
dependencies:
|
||||
- rpm_sign
|
||||
<<: *only_primary
|
||||
<<: *run_repo_smoketest
|
||||
allow_failure: true
|
||||
|
||||
ubuntu_18_verify_repo_prod:
|
||||
stage: verify_from_prod
|
||||
variables:
|
||||
DISTRO: "bionic"
|
||||
DEB_REPO: "rippled-deb"
|
||||
image:
|
||||
name: artifactory.ops.ripple.com/ubuntu:18.04
|
||||
dependencies:
|
||||
- dpkg_sign
|
||||
<<: *only_primary
|
||||
<<: *run_repo_smoketest
|
||||
|
||||
ubuntu_20_verify_repo_prod:
|
||||
stage: verify_from_prod
|
||||
@@ -527,35 +596,25 @@ ubuntu_20_verify_repo_prod:
|
||||
DISTRO: "focal"
|
||||
DEB_REPO: "rippled-deb"
|
||||
image:
|
||||
name: ubuntu:20.04
|
||||
name: artifactory.ops.ripple.com/ubuntu:20.04
|
||||
dependencies:
|
||||
- dpkg_sign
|
||||
<<: *only_primary
|
||||
<<: *run_repo_smoketest
|
||||
|
||||
ubuntu_18_verify_repo_prod:
|
||||
# TODO: remove "allow_failure" when 22.04 released in 4/2022...
|
||||
ubuntu_22_verify_repo_prod:
|
||||
stage: verify_from_prod
|
||||
variables:
|
||||
DISTRO: "bionic"
|
||||
DISTRO: "jammy"
|
||||
DEB_REPO: "rippled-deb"
|
||||
image:
|
||||
name: ubuntu:18.04
|
||||
dependencies:
|
||||
- dpkg_sign
|
||||
<<: *only_primary
|
||||
<<: *run_repo_smoketest
|
||||
|
||||
ubuntu_16_verify_repo_prod:
|
||||
stage: verify_from_prod
|
||||
variables:
|
||||
DISTRO: "xenial"
|
||||
DEB_REPO: "rippled-deb"
|
||||
image:
|
||||
name: ubuntu:16.04
|
||||
name: artifactory.ops.ripple.com/ubuntu:22.04
|
||||
dependencies:
|
||||
- dpkg_sign
|
||||
<<: *only_primary
|
||||
<<: *run_repo_smoketest
|
||||
allow_failure: true
|
||||
|
||||
debian_9_verify_repo_prod:
|
||||
stage: verify_from_prod
|
||||
@@ -563,7 +622,31 @@ debian_9_verify_repo_prod:
|
||||
DISTRO: "stretch"
|
||||
DEB_REPO: "rippled-deb"
|
||||
image:
|
||||
name: debian:9
|
||||
name: artifactory.ops.ripple.com/debian:9
|
||||
dependencies:
|
||||
- dpkg_sign
|
||||
<<: *only_primary
|
||||
<<: *run_repo_smoketest
|
||||
|
||||
debian_10_verify_repo_prod:
|
||||
stage: verify_from_prod
|
||||
variables:
|
||||
DISTRO: "buster"
|
||||
DEB_REPO: "rippled-deb"
|
||||
image:
|
||||
name: artifactory.ops.ripple.com/debian:10
|
||||
dependencies:
|
||||
- dpkg_sign
|
||||
<<: *only_primary
|
||||
<<: *run_repo_smoketest
|
||||
|
||||
debian_11_verify_repo_prod:
|
||||
stage: verify_from_prod
|
||||
variables:
|
||||
DISTRO: "bullseye"
|
||||
DEB_REPO: "rippled-deb"
|
||||
image:
|
||||
name: artifactory.ops.ripple.com/debian:11
|
||||
dependencies:
|
||||
- dpkg_sign
|
||||
<<: *only_primary
|
||||
@@ -583,7 +666,7 @@ get_prod_hashes:
|
||||
DEB_REPO: "rippled-deb"
|
||||
RPM_REPO: "rippled-rpm"
|
||||
image:
|
||||
name: alpine:latest
|
||||
name: artifactory.ops.ripple.com/alpine:latest
|
||||
stage: get_final_hashes
|
||||
artifacts:
|
||||
paths:
|
||||
@@ -618,5 +701,3 @@ build_ubuntu_container:
|
||||
script:
|
||||
- . ./Builds/containers/gitlab-ci/build_container.sh dpkg
|
||||
allow_failure: true
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env sh
|
||||
set -ex
|
||||
set -e
|
||||
action=$1
|
||||
filter=$2
|
||||
|
||||
@@ -15,15 +15,17 @@ cd build/dpkg/packages
|
||||
CURLARGS="-sk -X${action} -urippled:${ARTIFACTORY_DEPLOY_KEY_RIPPLED}"
|
||||
RIPPLED_PKG=$(ls rippled_*.deb)
|
||||
RIPPLED_DEV_PKG=$(ls rippled-dev_*.deb)
|
||||
RIPPLED_REPORTING_PKG=$(ls rippled-reporting_*.deb)
|
||||
RIPPLED_DBG_PKG=$(ls rippled-dbgsym_*.deb)
|
||||
RIPPLED_REPORTING_DBG_PKG=$(ls rippled-reporting-dbgsym_*.deb)
|
||||
# TODO - where to upload src tgz?
|
||||
RIPPLED_SRC=$(ls rippled_*.orig.tar.gz)
|
||||
DEB_MATRIX=";deb.component=${COMPONENT};deb.architecture=amd64"
|
||||
for dist in stretch buster xenial bionic disco focal ; do
|
||||
for dist in stretch buster bullseye bionic focal jammy; do
|
||||
DEB_MATRIX="${DEB_MATRIX};deb.distribution=${dist}"
|
||||
done
|
||||
echo "{ \"debs\": {" > "${TOPDIR}/files.info"
|
||||
for deb in ${RIPPLED_PKG} ${RIPPLED_DEV_PKG} ${RIPPLED_DBG_PKG} ; do
|
||||
for deb in ${RIPPLED_PKG} ${RIPPLED_DEV_PKG} ${RIPPLED_DBG_PKG} ${RIPPLED_REPORTING_PKG} ${RIPPLED_REPORTING_DBG_PKG}; do
|
||||
# first item doesn't get a comma separator
|
||||
if [ $deb != $RIPPLED_PKG ] ; then
|
||||
echo "," >> "${TOPDIR}/files.info"
|
||||
@@ -48,10 +50,11 @@ cd build/rpm/packages
|
||||
RIPPLED_PKG=$(ls rippled-[0-9]*.x86_64.rpm)
|
||||
RIPPLED_DEV_PKG=$(ls rippled-devel*.rpm)
|
||||
RIPPLED_DBG_PKG=$(ls rippled-debuginfo*.rpm)
|
||||
RIPPLED_REPORTING_PKG=$(ls rippled-reporting*.rpm)
|
||||
# TODO - where to upload src rpm ?
|
||||
RIPPLED_SRC=$(ls rippled-[0-9]*.src.rpm)
|
||||
echo "\"rpms\": {" >> "${TOPDIR}/files.info"
|
||||
for rpm in ${RIPPLED_PKG} ${RIPPLED_DEV_PKG} ${RIPPLED_DBG_PKG} ; do
|
||||
for rpm in ${RIPPLED_PKG} ${RIPPLED_DEV_PKG} ${RIPPLED_DBG_PKG} ${RIPPLED_REPORTING_PKG}; do
|
||||
# first item doesn't get a comma separator
|
||||
if [ $rpm != $RIPPLED_PKG ] ; then
|
||||
echo "," >> "${TOPDIR}/files.info"
|
||||
@@ -88,4 +91,3 @@ JSON
|
||||
)
|
||||
curl ${SLACK_NOTIFY_URL} --data-urlencode "${CONTENT}"
|
||||
fi
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env sh
|
||||
set -ex
|
||||
set -e
|
||||
install_from=$1
|
||||
use_private=${2:-0} # this option not currently needed by any CI scripts,
|
||||
# reserved for possible future use
|
||||
@@ -16,7 +16,7 @@ case ${ID} in
|
||||
ubuntu|debian)
|
||||
pkgtype="dpkg"
|
||||
;;
|
||||
fedora|centos|rhel|scientific)
|
||||
fedora|centos|rhel|scientific|rocky)
|
||||
pkgtype="rpm"
|
||||
;;
|
||||
*)
|
||||
@@ -51,7 +51,7 @@ if [ "${pkgtype}" = "dpkg" ] ; then
|
||||
elif [ "${install_from}" = "local" ] ; then
|
||||
# cached pkg install
|
||||
updateWithRetry
|
||||
apt-get -y install libprotobuf-dev libssl-dev
|
||||
apt-get -y install libprotobuf-dev libprotoc-dev protobuf-compiler libssl-dev
|
||||
rm -f build/dpkg/packages/rippled-dbgsym*.*
|
||||
dpkg --no-debsig -i build/dpkg/packages/*.deb
|
||||
else
|
||||
@@ -61,7 +61,11 @@ if [ "${pkgtype}" = "dpkg" ] ; then
|
||||
else
|
||||
yum -y update
|
||||
if [ "${install_from}" = "repo" ] ; then
|
||||
yum -y install yum-utils coreutils util-linux
|
||||
pkgs=("yum-utils coreutils util-linux")
|
||||
if [ "$ID" = "rocky" ]; then
|
||||
pkgs="${pkgs[@]/coreutils}"
|
||||
fi
|
||||
yum install -y $pkgs
|
||||
REPOFILE="/etc/yum.repos.d/artifactory.repo"
|
||||
echo "[Artifactory]" > ${REPOFILE}
|
||||
echo "name=Artifactory" >> ${REPOFILE}
|
||||
@@ -76,7 +80,12 @@ else
|
||||
yum -y install ${rpm_version_release}
|
||||
elif [ "${install_from}" = "local" ] ; then
|
||||
# cached pkg install
|
||||
yum install -y yum-utils openssl-static zlib-static
|
||||
pkgs=("yum-utils openssl-static zlib-static")
|
||||
if [ "$ID" = "rocky" ]; then
|
||||
sed -i 's/enabled=0/enabled=1/g' /etc/yum.repos.d/Rocky-PowerTools.repo
|
||||
pkgs="${pkgs[@]/openssl-static}"
|
||||
fi
|
||||
yum install -y $pkgs
|
||||
rm -f build/rpm/packages/rippled-debug*.rpm
|
||||
rm -f build/rpm/packages/*.src.rpm
|
||||
rpm -i build/rpm/packages/*.rpm
|
||||
@@ -95,5 +104,3 @@ fi
|
||||
# run unit tests
|
||||
/opt/ripple/bin/rippled --unittest --unittest-jobs $(nproc)
|
||||
/opt/ripple/bin/validator-keys --unittest
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env sh
|
||||
set -ex
|
||||
set -e
|
||||
docker login -u rippled \
|
||||
-p ${ARTIFACTORY_DEPLOY_KEY_RIPPLED} "${ARTIFACTORY_HUB}"
|
||||
# this gives us rippled_version :
|
||||
@@ -19,4 +19,3 @@ for label in ${rippled_version} latest ; do
|
||||
docker push \
|
||||
"${ARTIFACTORY_HUB}/${DPKG_CONTAINER_NAME}:${label}_${CI_COMMIT_REF_SLUG}"
|
||||
done
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ set -ex
|
||||
# make sure pkg source files are up to date with repo
|
||||
cd /opt/rippled_bld/pkg
|
||||
cp -fpru rippled/Builds/containers/packaging/dpkg/debian/. debian/
|
||||
cp -fpu rippled/Builds/containers/shared/rippled.service debian/
|
||||
cp -fpu rippled/Builds/containers/shared/rippled*.service debian/
|
||||
cp -fpu rippled/Builds/containers/shared/update_sources.sh .
|
||||
source update_sources.sh
|
||||
|
||||
@@ -52,14 +52,15 @@ rc=$?; if [[ $rc != 0 ]]; then
|
||||
error "error building dpkg"
|
||||
fi
|
||||
cd ..
|
||||
ls -latr
|
||||
|
||||
# copy artifacts
|
||||
cp rippled-dev_${RIPPLED_DPKG_FULL_VERSION}_amd64.deb ${PKG_OUTDIR}
|
||||
cp rippled-reporting_${RIPPLED_DPKG_FULL_VERSION}_amd64.deb ${PKG_OUTDIR}
|
||||
cp rippled_${RIPPLED_DPKG_FULL_VERSION}_amd64.deb ${PKG_OUTDIR}
|
||||
cp rippled_${RIPPLED_DPKG_FULL_VERSION}.dsc ${PKG_OUTDIR}
|
||||
# dbgsym suffix is ddeb under newer debuild, but just deb under earlier
|
||||
cp rippled-dbgsym_${RIPPLED_DPKG_FULL_VERSION}_amd64.* ${PKG_OUTDIR}
|
||||
cp rippled-reporting-dbgsym_${RIPPLED_DPKG_FULL_VERSION}_amd64.* ${PKG_OUTDIR}
|
||||
cp rippled_${RIPPLED_DPKG_FULL_VERSION}_amd64.changes ${PKG_OUTDIR}
|
||||
cp rippled_${RIPPLED_DPKG_FULL_VERSION}_amd64.build ${PKG_OUTDIR}
|
||||
cp rippled_${RIPPLED_DPKG_VERSION}.orig.tar.gz ${PKG_OUTDIR}
|
||||
@@ -81,15 +82,20 @@ DEB_SHA256=$(cat shasums | \
|
||||
grep "rippled_${RIPPLED_DPKG_VERSION}-1_amd64.deb" | cut -d " " -f 1)
|
||||
DBG_SHA256=$(cat shasums | \
|
||||
grep "rippled-dbgsym_${RIPPLED_DPKG_VERSION}-1_amd64.*" | cut -d " " -f 1)
|
||||
REPORTING_DBG_SHA256=$(cat shasums | \
|
||||
grep "rippled-reporting-dbgsym_${RIPPLED_DPKG_VERSION}-1_amd64.*" | cut -d " " -f 1)
|
||||
DEV_SHA256=$(cat shasums | \
|
||||
grep "rippled-dev_${RIPPLED_DPKG_VERSION}-1_amd64.deb" | cut -d " " -f 1)
|
||||
REPORTING_SHA256=$(cat shasums | \
|
||||
grep "rippled-reporting_${RIPPLED_DPKG_VERSION}-1_amd64.deb" | cut -d " " -f 1)
|
||||
SRC_SHA256=$(cat shasums | \
|
||||
grep "rippled_${RIPPLED_DPKG_VERSION}.orig.tar.gz" | cut -d " " -f 1)
|
||||
echo "deb_sha256=${DEB_SHA256}" >> ${PKG_OUTDIR}/build_vars
|
||||
echo "dbg_sha256=${DBG_SHA256}" >> ${PKG_OUTDIR}/build_vars
|
||||
echo "dev_sha256=${DEV_SHA256}" >> ${PKG_OUTDIR}/build_vars
|
||||
echo "reporting_sha256=${REPORTING_SHA256}" >> ${PKG_OUTDIR}/build_vars
|
||||
echo "reporting_dbg_sha256=${REPORTING_DBG_SHA256}" >> ${PKG_OUTDIR}/build_vars
|
||||
echo "src_sha256=${SRC_SHA256}" >> ${PKG_OUTDIR}/build_vars
|
||||
echo "rippled_version=${RIPPLED_VERSION}" >> ${PKG_OUTDIR}/build_vars
|
||||
echo "dpkg_version=${RIPPLED_DPKG_VERSION}" >> ${PKG_OUTDIR}/build_vars
|
||||
echo "dpkg_full_version=${RIPPLED_DPKG_FULL_VERSION}" >> ${PKG_OUTDIR}/build_vars
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
9
|
||||
10
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
opt/ripple/etc/rippled.cfg
|
||||
opt/ripple/etc/validators.txt
|
||||
etc/logrotate.d/rippled
|
||||
@@ -12,10 +12,16 @@ Multi-Arch: foreign
|
||||
Depends: ${misc:Depends}, ${shlibs:Depends}
|
||||
Description: rippled daemon
|
||||
|
||||
Package: rippled-reporting
|
||||
Architecture: any
|
||||
Multi-Arch: foreign
|
||||
Depends: ${misc:Depends}, ${shlibs:Depends}
|
||||
Description: rippled reporting daemon
|
||||
|
||||
Package: rippled-dev
|
||||
Section: devel
|
||||
Recommends: rippled (= ${binary:Version})
|
||||
Architecture: any
|
||||
Multi-Arch: same
|
||||
Depends: ${misc:Depends}, ${shlibs:Depends}, libprotobuf-dev, libssl-dev
|
||||
Depends: ${misc:Depends}, ${shlibs:Depends}, libprotobuf-dev, libprotoc-dev, protobuf-compiler
|
||||
Description: development files for applications using xrpl core library (serialize + sign)
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
README.md
|
||||
LICENSE
|
||||
LICENSE.md
|
||||
RELEASENOTES.md
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
/var/log/rippled-reporting/
|
||||
/var/lib/rippled-reporting/
|
||||
/etc/systemd/system/rippled-reporting.service.d/
|
||||
@@ -0,0 +1,8 @@
|
||||
bld/rippled-reporting/rippled-reporting opt/rippled-reporting/bin
|
||||
cfg/rippled-reporting.cfg opt/rippled-reporting/etc
|
||||
debian/tmp/opt/rippled-reporting/etc/validators.txt opt/rippled-reporting/etc
|
||||
|
||||
opt/rippled-reporting/bin/update-rippled-reporting.sh
|
||||
opt/rippled-reporting/bin/getRippledReportingInfo
|
||||
opt/rippled-reporting/etc/update-rippled-reporting-cron
|
||||
etc/logrotate.d/rippled-reporting
|
||||
@@ -0,0 +1,3 @@
|
||||
opt/rippled-reporting/etc/rippled-reporting.cfg etc/opt/rippled-reporting/rippled-reporting.cfg
|
||||
opt/rippled-reporting/etc/validators.txt etc/opt/rippled-reporting/validators.txt
|
||||
opt/rippled-reporting/bin/rippled-reporting usr/local/bin/rippled-reporting
|
||||
@@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
USER_NAME=rippled-reporting
|
||||
GROUP_NAME=rippled-reporting
|
||||
case "$1" in
|
||||
configure)
|
||||
id -u $USER_NAME >/dev/null 2>&1 || \
|
||||
adduser --system --quiet \
|
||||
--home /nonexistent --no-create-home \
|
||||
--disabled-password \
|
||||
--group "$GROUP_NAME"
|
||||
chown -R $USER_NAME:$GROUP_NAME /var/log/rippled-reporting/
|
||||
chown -R $USER_NAME:$GROUP_NAME /var/lib/rippled-reporting/
|
||||
chmod 755 /var/log/rippled-reporting/
|
||||
chmod 755 /var/lib/rippled-reporting/
|
||||
chown -R $USER_NAME:$GROUP_NAME /opt/rippled-reporting
|
||||
|
||||
;;
|
||||
|
||||
abort-upgrade|abort-remove|abort-deconfigure)
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "postinst called with unknown argument \`$1'" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,2 @@
|
||||
/opt/ripple/etc/rippled.cfg
|
||||
/opt/ripple/etc/validators.txt
|
||||
@@ -5,4 +5,4 @@ opt/ripple/bin/getRippledInfo
|
||||
opt/ripple/etc/rippled.cfg
|
||||
opt/ripple/etc/validators.txt
|
||||
opt/ripple/etc/update-rippled-cron
|
||||
etc/logrotate.d/rippled
|
||||
etc/logrotate.d/rippled
|
||||
@@ -11,32 +11,51 @@ export CXXFLAGS:=$(subst -Werror=format-security,,$(CXXFLAGS))
|
||||
%:
|
||||
dh $@ --with systemd
|
||||
|
||||
override_dh_systemd_start:
|
||||
dh_systemd_start --no-restart-on-upgrade
|
||||
|
||||
override_dh_auto_configure:
|
||||
env
|
||||
rm -rf bld
|
||||
mkdir -p bld
|
||||
cd bld && \
|
||||
cmake .. -G Ninja \
|
||||
rm -rf bld && mkdir -p bld/rippled
|
||||
cd bld/rippled && \
|
||||
cmake ../.. -G Ninja \
|
||||
-DCMAKE_INSTALL_PREFIX=/opt/ripple \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_UNITY_BUILD_BATCH_SIZE=10 \
|
||||
-Dstatic=ON \
|
||||
-Dunity=OFF \
|
||||
-Dvalidator_keys=ON \
|
||||
-DCMAKE_VERBOSE_MAKEFILE=ON
|
||||
-Dunity=OFF \
|
||||
-DCMAKE_VERBOSE_MAKEFILE=OFF
|
||||
|
||||
|
||||
cmake -S . \
|
||||
-B bld/rippled-reporting \
|
||||
-G Ninja \
|
||||
-DCMAKE_INSTALL_PREFIX=/opt/rippled-reporting \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-Dstatic=ON \
|
||||
-Dunity=OFF \
|
||||
-DCMAKE_VERBOSE_MAKEFILE=OFF \
|
||||
-Dreporting=ON
|
||||
|
||||
override_dh_auto_build:
|
||||
cd bld && \
|
||||
cmake --build . --target rippled --target validator-keys --parallel -- -v
|
||||
cmake --build bld/rippled --target rippled --target validator-keys --parallel
|
||||
cmake --build bld/rippled-reporting --target rippled --parallel
|
||||
|
||||
override_dh_auto_install:
|
||||
cd bld && DESTDIR=../debian/tmp cmake --build . --target install -- -v
|
||||
install -D bld/validator-keys/validator-keys debian/tmp/opt/ripple/bin/validator-keys
|
||||
cmake --install bld/rippled --prefix debian/tmp/opt/ripple
|
||||
install -D bld/rippled/validator-keys/validator-keys debian/tmp/opt/ripple/bin/validator-keys
|
||||
install -D Builds/containers/shared/update-rippled.sh debian/tmp/opt/ripple/bin/update-rippled.sh
|
||||
install -D bin/getRippledInfo debian/tmp/opt/ripple/bin/getRippledInfo
|
||||
install -D Builds/containers/shared/update-rippled-cron debian/tmp/opt/ripple/etc/update-rippled-cron
|
||||
install -D Builds/containers/shared/rippled-logrotate debian/tmp/etc/logrotate.d/rippled
|
||||
rm -rf debian/tmp/opt/ripple/lib64/cmake/date
|
||||
rm -rf bld
|
||||
rm -rf bld_vl
|
||||
|
||||
mkdir -p debian/tmp/opt/rippled-reporting/etc
|
||||
cp cfg/validators-example.txt debian/tmp/opt/rippled-reporting/etc/validators.txt
|
||||
install -D bld/rippled/validator-keys/validator-keys debian/tmp/opt/rippled-reporting/bin/validator-keys
|
||||
|
||||
sed -E 's/rippled?/rippled-reporting/g' Builds/containers/shared/update-rippled.sh > debian/tmp/opt/rippled-reporting/bin/update-rippled-reporting.sh
|
||||
sed -E 's/rippled?/rippled-reporting/g' bin/getRippledInfo > debian/tmp/opt/rippled-reporting/bin/getRippledReportingInfo
|
||||
sed -E 's/rippled?/rippled-reporting/g' Builds/containers/shared/update-rippled-cron > debian/tmp/opt/rippled-reporting/etc/update-rippled-reporting-cron
|
||||
sed -E 's/rippled?/rippled-reporting/g' Builds/containers/shared/rippled-logrotate > debian/tmp/etc/logrotate.d/rippled-reporting
|
||||
@@ -0,0 +1 @@
|
||||
enable rippled-reporting.service
|
||||
@@ -30,8 +30,8 @@ fi
|
||||
|
||||
cd /opt/rippled_bld/pkg/rippled
|
||||
if [[ -n $(git status --porcelain) ]]; then
|
||||
git status
|
||||
error "Unstaged changes in this repo - please commit first"
|
||||
git status
|
||||
error "Unstaged changes in this repo - please commit first"
|
||||
fi
|
||||
git archive --format tar.gz --prefix rippled/ -o ../rpmbuild/SOURCES/rippled.tar.gz HEAD
|
||||
# TODO include validator-keys sources
|
||||
@@ -54,18 +54,22 @@ cp ./rpmbuild/SRPMS/* ${PKG_OUTDIR}
|
||||
RPM_MD5SUM=$(rpm -q --queryformat '%{SIGMD5}\n' -p ./rpmbuild/RPMS/x86_64/rippled-[0-9]*.rpm 2>/dev/null)
|
||||
DBG_MD5SUM=$(rpm -q --queryformat '%{SIGMD5}\n' -p ./rpmbuild/RPMS/x86_64/rippled-debuginfo*.rpm 2>/dev/null)
|
||||
DEV_MD5SUM=$(rpm -q --queryformat '%{SIGMD5}\n' -p ./rpmbuild/RPMS/x86_64/rippled-devel*.rpm 2>/dev/null)
|
||||
REP_MD5SUM=$(rpm -q --queryformat '%{SIGMD5}\n' -p ./rpmbuild/RPMS/x86_64/rippled-reporting*.rpm 2>/dev/null)
|
||||
SRC_MD5SUM=$(rpm -q --queryformat '%{SIGMD5}\n' -p ./rpmbuild/SRPMS/*.rpm 2>/dev/null)
|
||||
|
||||
RPM_SHA256="$(sha256sum ./rpmbuild/RPMS/x86_64/rippled-[0-9]*.rpm | awk '{ print $1}')"
|
||||
DBG_SHA256="$(sha256sum ./rpmbuild/RPMS/x86_64/rippled-debuginfo*.rpm | awk '{ print $1}')"
|
||||
REP_SHA256="$(sha256sum ./rpmbuild/RPMS/x86_64/rippled-reporting*.rpm | awk '{ print $1}')"
|
||||
DEV_SHA256="$(sha256sum ./rpmbuild/RPMS/x86_64/rippled-devel*.rpm | awk '{ print $1}')"
|
||||
SRC_SHA256="$(sha256sum ./rpmbuild/SRPMS/*.rpm | awk '{ print $1}')"
|
||||
|
||||
echo "rpm_md5sum=$RPM_MD5SUM" > ${PKG_OUTDIR}/build_vars
|
||||
echo "rep_md5sum=$REP_MD5SUM" >> ${PKG_OUTDIR}/build_vars
|
||||
echo "dbg_md5sum=$DBG_MD5SUM" >> ${PKG_OUTDIR}/build_vars
|
||||
echo "dev_md5sum=$DEV_MD5SUM" >> ${PKG_OUTDIR}/build_vars
|
||||
echo "src_md5sum=$SRC_MD5SUM" >> ${PKG_OUTDIR}/build_vars
|
||||
echo "rpm_sha256=$RPM_SHA256" >> ${PKG_OUTDIR}/build_vars
|
||||
echo "rep_sha256=$REP_SHA256" >> ${PKG_OUTDIR}/build_vars
|
||||
echo "dbg_sha256=$DBG_SHA256" >> ${PKG_OUTDIR}/build_vars
|
||||
echo "dev_sha256=$DEV_SHA256" >> ${PKG_OUTDIR}/build_vars
|
||||
echo "src_sha256=$SRC_SHA256" >> ${PKG_OUTDIR}/build_vars
|
||||
@@ -73,4 +77,3 @@ echo "rippled_version=$RIPPLED_VERSION" >> ${PKG_OUTDIR}/build_vars
|
||||
echo "rpm_version=$RIPPLED_RPM_VERSION" >> ${PKG_OUTDIR}/build_vars
|
||||
echo "rpm_file_name=$tar_file" >> ${PKG_OUTDIR}/build_vars
|
||||
echo "rpm_version_release=$RPM_VERSION_RELEASE" >> ${PKG_OUTDIR}/build_vars
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
%define rpm_release %(echo $RPM_RELEASE)
|
||||
%define rpm_patch %(echo $RPM_PATCH)
|
||||
%define _prefix /opt/ripple
|
||||
|
||||
Name: rippled
|
||||
# Dashes in Version extensions must be converted to underscores
|
||||
Version: %{rippled_version}
|
||||
@@ -20,34 +21,46 @@ rippled
|
||||
%package devel
|
||||
Summary: Files for development of applications using xrpl core library
|
||||
Group: Development/Libraries
|
||||
Requires: openssl-static, zlib-static
|
||||
Requires: zlib-static
|
||||
|
||||
%description devel
|
||||
core library for development of standalone applications that sign transactions.
|
||||
|
||||
%package reporting
|
||||
Summary: Reporting Server for rippled
|
||||
|
||||
%description reporting
|
||||
History server for XRP Ledger
|
||||
|
||||
%prep
|
||||
%setup -c -n rippled
|
||||
|
||||
%build
|
||||
cd rippled
|
||||
mkdir -p bld.release
|
||||
cd bld.release
|
||||
cmake .. -G Ninja -DCMAKE_INSTALL_PREFIX=%{_prefix} -DCMAKE_BUILD_TYPE=Release -DCMAKE_UNITY_BUILD_BATCH_SIZE=10 -Dstatic=true -DCMAKE_VERBOSE_MAKEFILE=ON -Dvalidator_keys=ON
|
||||
cmake --build . --parallel --target rippled --target validator-keys -- -v
|
||||
mkdir -p bld.rippled
|
||||
pushd bld.rippled
|
||||
cmake .. -G Ninja -DCMAKE_INSTALL_PREFIX=%{_prefix} -DCMAKE_BUILD_TYPE=Release -Dunity=OFF -Dstatic=true -DCMAKE_VERBOSE_MAKEFILE=OFF -Dvalidator_keys=ON
|
||||
cmake --build . --parallel $(nproc) --target rippled --target validator-keys
|
||||
popd
|
||||
|
||||
mkdir -p bld.rippled-reporting
|
||||
cd bld.rippled-reporting
|
||||
cmake .. -G Ninja -DCMAKE_INSTALL_PREFIX=%{_prefix}-reporting -DCMAKE_BUILD_TYPE=Release -Dunity=OFF -Dstatic=true -DCMAKE_VERBOSE_MAKEFILE=OFF -Dreporting=ON
|
||||
cmake --build . --parallel $(nproc) --target rippled
|
||||
|
||||
%pre
|
||||
test -e /etc/pki/tls || { mkdir -p /etc/pki; ln -s /usr/lib/ssl /etc/pki/tls; }
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
DESTDIR=$RPM_BUILD_ROOT cmake --build rippled/bld.release --target install -- -v
|
||||
DESTDIR=$RPM_BUILD_ROOT cmake --build rippled/bld.rippled --target install -- -v
|
||||
rm -rf ${RPM_BUILD_ROOT}/%{_prefix}/lib64/cmake/date
|
||||
install -d ${RPM_BUILD_ROOT}/etc/opt/ripple
|
||||
install -d ${RPM_BUILD_ROOT}/usr/local/bin
|
||||
ln -s %{_prefix}/etc/rippled.cfg ${RPM_BUILD_ROOT}/etc/opt/ripple/rippled.cfg
|
||||
ln -s %{_prefix}/etc/validators.txt ${RPM_BUILD_ROOT}/etc/opt/ripple/validators.txt
|
||||
ln -s %{_prefix}/bin/rippled ${RPM_BUILD_ROOT}/usr/local/bin/rippled
|
||||
install -D rippled/bld.release/validator-keys/validator-keys ${RPM_BUILD_ROOT}%{_bindir}/validator-keys
|
||||
install -D rippled/bld.rippled/validator-keys/validator-keys ${RPM_BUILD_ROOT}%{_bindir}/validator-keys
|
||||
install -D ./rippled/Builds/containers/shared/rippled.service ${RPM_BUILD_ROOT}/usr/lib/systemd/system/rippled.service
|
||||
install -D ./rippled/Builds/containers/packaging/rpm/50-rippled.preset ${RPM_BUILD_ROOT}/usr/lib/systemd/system-preset/50-rippled.preset
|
||||
install -D ./rippled/Builds/containers/shared/update-rippled.sh ${RPM_BUILD_ROOT}%{_bindir}/update-rippled.sh
|
||||
@@ -57,7 +70,27 @@ install -D ./rippled/Builds/containers/shared/rippled-logrotate ${RPM_BUILD_ROOT
|
||||
install -d $RPM_BUILD_ROOT/var/log/rippled
|
||||
install -d $RPM_BUILD_ROOT/var/lib/rippled
|
||||
|
||||
# reporting mode
|
||||
%define _prefix /opt/rippled-reporting
|
||||
mkdir -p ${RPM_BUILD_ROOT}/etc/opt/rippled-reporting/
|
||||
install -D rippled/bld.rippled-reporting/rippled-reporting ${RPM_BUILD_ROOT}%{_bindir}/rippled-reporting
|
||||
install -D ./rippled/cfg/rippled-reporting.cfg ${RPM_BUILD_ROOT}%{_prefix}/etc/rippled-reporting.cfg
|
||||
install -D ./rippled/cfg/validators-example.txt ${RPM_BUILD_ROOT}%{_prefix}/etc/validators.txt
|
||||
install -D ./rippled/Builds/containers/packaging/rpm/50-rippled-reporting.preset ${RPM_BUILD_ROOT}/usr/lib/systemd/system-preset/50-rippled-reporting.preset
|
||||
ln -s %{_prefix}/bin/rippled-reporting ${RPM_BUILD_ROOT}/usr/local/bin/rippled-reporting
|
||||
ln -s %{_prefix}/etc/rippled-reporting.cfg ${RPM_BUILD_ROOT}/etc/opt/rippled-reporting/rippled-reporting.cfg
|
||||
ln -s %{_prefix}/etc/validators.txt ${RPM_BUILD_ROOT}/etc/opt/rippled-reporting/validators.txt
|
||||
install -d $RPM_BUILD_ROOT/var/log/rippled-reporting
|
||||
install -d $RPM_BUILD_ROOT/var/lib/rippled-reporting
|
||||
install -D ./rippled/Builds/containers/shared/rippled-reporting.service ${RPM_BUILD_ROOT}/usr/lib/systemd/system/rippled-reporting.service
|
||||
sed -E 's/rippled?/rippled-reporting/g' ./rippled/Builds/containers/shared/update-rippled.sh > ${RPM_BUILD_ROOT}%{_bindir}/update-rippled-reporting.sh
|
||||
sed -E 's/rippled?/rippled-reporting/g' ./rippled/bin/getRippledInfo > ${RPM_BUILD_ROOT}%{_bindir}/getRippledReportingInfo
|
||||
sed -E 's/rippled?/rippled-reporting/g' ./rippled/Builds/containers/shared/update-rippled-cron > ${RPM_BUILD_ROOT}%{_prefix}/etc/update-rippled-reporting-cron
|
||||
sed -E 's/rippled?/rippled-reporting/g' ./rippled/Builds/containers/shared/rippled-logrotate > ${RPM_BUILD_ROOT}/etc/logrotate.d/rippled-reporting
|
||||
|
||||
|
||||
%post
|
||||
%define _prefix /opt/ripple
|
||||
USER_NAME=rippled
|
||||
GROUP_NAME=rippled
|
||||
|
||||
@@ -75,8 +108,26 @@ chmod 644 %{_prefix}/etc/update-rippled-cron
|
||||
chmod 644 /etc/logrotate.d/rippled
|
||||
chown -R root:$GROUP_NAME %{_prefix}/etc/update-rippled-cron
|
||||
|
||||
%post reporting
|
||||
%define _prefix /opt/rippled-reporting
|
||||
USER_NAME=rippled-reporting
|
||||
GROUP_NAME=rippled-reporting
|
||||
|
||||
getent passwd $USER_NAME &>/dev/null || useradd -r $USER_NAME
|
||||
getent group $GROUP_NAME &>/dev/null || groupadd $GROUP_NAME
|
||||
|
||||
chown -R $USER_NAME:$GROUP_NAME /var/log/rippled-reporting/
|
||||
chown -R $USER_NAME:$GROUP_NAME /var/lib/rippled-reporting/
|
||||
chown -R $USER_NAME:$GROUP_NAME %{_prefix}/
|
||||
|
||||
chmod 755 /var/log/rippled-reporting/
|
||||
chmod 755 /var/lib/rippled-reporting/
|
||||
chmod -x /usr/lib/systemd/system/rippled-reporting.service
|
||||
|
||||
|
||||
%files
|
||||
%doc rippled/README.md rippled/LICENSE
|
||||
%define _prefix /opt/ripple
|
||||
%doc rippled/README.md rippled/LICENSE.md
|
||||
%{_bindir}/rippled
|
||||
/usr/local/bin/rippled
|
||||
%{_bindir}/update-rippled.sh
|
||||
@@ -98,6 +149,25 @@ chown -R root:$GROUP_NAME %{_prefix}/etc/update-rippled-cron
|
||||
%{_prefix}/lib/*.a
|
||||
%{_prefix}/lib/cmake/ripple
|
||||
|
||||
%files reporting
|
||||
%define _prefix /opt/rippled-reporting
|
||||
%doc rippled/README.md rippled/LICENSE.md
|
||||
|
||||
%{_bindir}/rippled-reporting
|
||||
/usr/local/bin/rippled-reporting
|
||||
%config(noreplace) /etc/opt/rippled-reporting/rippled-reporting.cfg
|
||||
%config(noreplace) %{_prefix}/etc/rippled-reporting.cfg
|
||||
%config(noreplace) %{_prefix}/etc/validators.txt
|
||||
%config(noreplace) /etc/opt/rippled-reporting/validators.txt
|
||||
%config(noreplace) /usr/lib/systemd/system/rippled-reporting.service
|
||||
%config(noreplace) /usr/lib/systemd/system-preset/50-rippled-reporting.preset
|
||||
%dir /var/log/rippled-reporting/
|
||||
%dir /var/lib/rippled-reporting/
|
||||
%{_bindir}/update-rippled-reporting.sh
|
||||
%{_bindir}/getRippledReportingInfo
|
||||
%{_prefix}/etc/update-rippled-reporting-cron
|
||||
%config(noreplace) /etc/logrotate.d/rippled-reporting
|
||||
|
||||
%changelog
|
||||
* Wed Aug 28 2019 Mike Ellery <mellery451@gmail.com>
|
||||
- Switch to subproject build for validator-keys
|
||||
@@ -110,4 +180,3 @@ chown -R root:$GROUP_NAME %{_prefix}/etc/update-rippled-cron
|
||||
|
||||
* Thu Jun 02 2016 Brandon Wilson <bwilson@ripple.com>
|
||||
- Install validators.txt
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ function build_boost()
|
||||
mkdir -p /opt/local
|
||||
cd /opt/local
|
||||
BOOST_ROOT=/opt/local/boost_${boost_path}
|
||||
BOOST_URL="https://dl.bintray.com/boostorg/release/${boost_ver}/source/boost_${boost_path}.tar.bz2"
|
||||
BOOST_URL="https://boostorg.jfrog.io/artifactory/main/release/${boost_ver}/source/boost_${boost_path}.tar.gz"
|
||||
BOOST_BUILD_ALL=true
|
||||
. /tmp/install_boost.sh
|
||||
if [ "$do_link" = true ] ; then
|
||||
@@ -29,8 +29,8 @@ cd openssl-${OPENSSL_VER}
|
||||
# NOTE: add -g to the end of the following line if we want debug symbols for openssl
|
||||
SSLDIR=$(openssl version -d | cut -d: -f2 | tr -d [:space:]\")
|
||||
./config -fPIC --prefix=/opt/local/openssl --openssldir=${SSLDIR} zlib shared
|
||||
make -j$(nproc)
|
||||
make install
|
||||
make -j$(nproc) >> make_output.txt 2>&1
|
||||
make install >> make_output.txt 2>&1
|
||||
cd ..
|
||||
rm -f openssl-${OPENSSL_VER}.tar.gz
|
||||
rm -rf openssl-${OPENSSL_VER}
|
||||
@@ -42,8 +42,8 @@ tar xzf libarchive-3.4.1.tar.gz
|
||||
cd libarchive-3.4.1
|
||||
mkdir _bld && cd _bld
|
||||
cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
make -j$(nproc)
|
||||
make install
|
||||
make -j$(nproc) >> make_output.txt 2>&1
|
||||
make install >> make_output.txt 2>&1
|
||||
cd ../..
|
||||
rm -f libarchive-3.4.1.tar.gz
|
||||
rm -rf libarchive-3.4.1
|
||||
@@ -54,8 +54,8 @@ tar xf protobuf-all-3.10.1.tar.gz
|
||||
cd protobuf-3.10.1
|
||||
./autogen.sh
|
||||
./configure
|
||||
make -j$(nproc)
|
||||
make install
|
||||
make -j$(nproc) >> make_output.txt 2>&1
|
||||
make install >> make_output.txt 2>&1
|
||||
ldconfig
|
||||
cd ..
|
||||
rm -f protobuf-all-3.10.1.tar.gz
|
||||
@@ -77,8 +77,8 @@ cmake \
|
||||
-DCARES_BUILD_TESTS=OFF \
|
||||
-DCARES_BUILD_CONTAINER_TESTS=OFF \
|
||||
..
|
||||
make -j$(nproc)
|
||||
make install
|
||||
make -j$(nproc) >> make_output.txt 2>&1
|
||||
make install >> make_output.txt 2>&1
|
||||
cd ../..
|
||||
rm -f c-ares-1.15.0.tar.gz
|
||||
rm -rf c-ares-1.15.0
|
||||
@@ -97,8 +97,8 @@ cmake \
|
||||
-DgRPC_PROTOBUF_PROVIDER=package \
|
||||
-DProtobuf_USE_STATIC_LIBS=ON \
|
||||
..
|
||||
make -j$(nproc)
|
||||
make install
|
||||
make -j$(nproc) >> make_output.txt 2>&1
|
||||
make install >> make_output.txt 2>&1
|
||||
cd ../..
|
||||
rm -f xf v1.25.0.tar.gz
|
||||
rm -rf grpc-1.25.0
|
||||
@@ -114,8 +114,8 @@ if [ "${CI_USE}" = true ] ; then
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -G "Unix Makefiles" ..
|
||||
make -j$(nproc)
|
||||
make install
|
||||
make -j$(nproc) >> make_output.txt 2>&1
|
||||
make install >> make_output.txt 2>&1
|
||||
cd ../..
|
||||
rm -f Release_1_8_16.tar.gz
|
||||
rm -rf doxygen-Release_1_8_16
|
||||
@@ -136,8 +136,8 @@ if [ "${CI_USE}" = true ] ; then
|
||||
tar xf ccache-3.7.6.tar.gz
|
||||
cd ccache-3.7.6
|
||||
./configure --prefix=/usr/local
|
||||
make
|
||||
make install
|
||||
make >> make_output.txt 2>&1
|
||||
make install >> make_output.txt 2>&1
|
||||
cd ..
|
||||
rm -f ccache-3.7.6.tar.gz
|
||||
rm -rf ccache-3.7.6
|
||||
@@ -145,4 +145,3 @@ if [ "${CI_USE}" = true ] ; then
|
||||
pip install requests
|
||||
pip install https://github.com/codecov/codecov-python/archive/master.zip
|
||||
fi
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ if [[ ${BOOST_BUILD_ALL:-false} == "true" ]]; then
|
||||
BLDARGS+=(--without-python)
|
||||
else
|
||||
BLDARGS+=(--with-chrono)
|
||||
BLDARGS+=(--with-container)
|
||||
BLDARGS+=(--with-context)
|
||||
BLDARGS+=(--with-coroutine)
|
||||
BLDARGS+=(--with-date_time)
|
||||
|
||||
15
Builds/containers/shared/rippled-reporting.service
Normal file
15
Builds/containers/shared/rippled-reporting.service
Normal file
@@ -0,0 +1,15 @@
|
||||
[Unit]
|
||||
Description=Ripple Daemon
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/opt/rippled-reporting/bin/rippled-reporting --silent --conf /etc/opt/rippled-reporting/rippled-reporting.cfg
|
||||
Restart=on-failure
|
||||
User=rippled-reporting
|
||||
Group=rippled-reporting
|
||||
LimitNOFILE=65536
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
114
Builds/levelization/README.md
Normal file
114
Builds/levelization/README.md
Normal file
@@ -0,0 +1,114 @@
|
||||
# Levelization
|
||||
|
||||
Levelization is the term used to describe efforts to prevent rippled from
|
||||
having or creating cyclic dependencies.
|
||||
|
||||
rippled code is organized into directories under `src/rippled` (and
|
||||
`src/test`) representing modules. The modules are intended to be
|
||||
organized into "tiers" or "levels" such that a module from one level can
|
||||
only include code from lower levels. Additionally, a module
|
||||
in one level should never include code in an `impl` folder of any level
|
||||
other than it's own.
|
||||
|
||||
Unfortunately, over time, enforcement of levelization has been
|
||||
inconsistent, so the current state of the code doesn't necessarily
|
||||
reflect these rules. Whenever possible, developers should refactor any
|
||||
levelization violations they find (by moving files or individual
|
||||
classes). At the very least, don't make things worse.
|
||||
|
||||
The table below summarizes the _desired_ division of modules, based on the
|
||||
state of the rippled code when it was created. The levels are numbered from
|
||||
the bottom up with the lower level, lower numbered, more independent
|
||||
modules listed first, and the higher level, higher numbered modules with
|
||||
more dependencies listed later.
|
||||
|
||||
**tl;dr:** The modules listed first are more independent than the modules
|
||||
listed later.
|
||||
|
||||
| Level / Tier | Module(s) |
|
||||
|--------------|-----------------------------------------------|
|
||||
| 01 | ripple/beast ripple/unity
|
||||
| 02 | ripple/basics
|
||||
| 03 | ripple/json ripple/crypto
|
||||
| 04 | ripple/protocol
|
||||
| 05 | ripple/core ripple/conditions ripple/consensus ripple/resource ripple/server
|
||||
| 06 | ripple/peerfinder ripple/ledger ripple/nodestore ripple/net
|
||||
| 07 | ripple/shamap ripple/overlay
|
||||
| 08 | ripple/app
|
||||
| 09 | ripple/rpc
|
||||
| 10 | ripple/perflog
|
||||
| 11 | test/jtx test/beast test/csf
|
||||
| 12 | test/unit_test
|
||||
| 13 | test/crypto test/conditions test/json test/resource test/shamap test/peerfinder test/basics test/overlay
|
||||
| 14 | test
|
||||
| 15 | test/net test/protocol test/ledger test/consensus test/core test/server test/nodestore
|
||||
| 16 | test/rpc test/app
|
||||
|
||||
(Note that `test` levelization is *much* less important and *much* less
|
||||
strictly enforced than `ripple` levelization, other than the requirement
|
||||
that `test` code should *never* be included in `ripple` code.)
|
||||
|
||||
## Validation
|
||||
|
||||
The [levelization.sh](levelization.sh) script takes no parameters,
|
||||
reads no environment variables, and can be run from any directory,
|
||||
as long as it is in the expected location in the rippled repo.
|
||||
It can be run at any time from within a checked out repo, and will
|
||||
do an analysis of all the `#include`s in
|
||||
the rippled source. The only caveat is that it runs much slower
|
||||
under Windows than in Linux. It hasn't yet been tested under MacOS.
|
||||
It generates many files of [results](results):
|
||||
|
||||
* `rawincludes.txt`: The raw dump of the `#includes`
|
||||
* `paths.txt`: A second dump grouping the source module
|
||||
to the destination module, deduped, and with frequency counts.
|
||||
* `includes/`: A directory where each file represents a module and
|
||||
contains a list of modules and counts that the module _includes_.
|
||||
* `includedby/`: Similar to `includes/`, but the other way around. Each
|
||||
file represents a module and contains a list of modules and counts
|
||||
that _include_ the module.
|
||||
* [`loops.txt`](results/loops.txt): A list of direct loops detected
|
||||
between modules as they actually exist, as opposed to how they are
|
||||
desired as described above. In a perfect repo, this file will be
|
||||
empty.
|
||||
This file is committed to the repo, and is used by the [levelization
|
||||
Github workflow](../../.github/workflows/levelization.yml) to validate
|
||||
that nothing changed.
|
||||
* [`ordering.txt`](results/ordering.txt): A list showing relationships
|
||||
between modules where there are no loops as they actually exist, as
|
||||
opposed to how they are desired as described above.
|
||||
This file is committed to the repo, and is used by the [levelization
|
||||
Github workflow](../../.github/workflows/levelization.yml) to validate
|
||||
that nothing changed.
|
||||
* [`levelization.yml`](../../.github/workflows/levelization.yml)
|
||||
Github Actions workflow to test that levelization loops haven't
|
||||
changed. Unfortunately, if changes are detected, it can't tell if
|
||||
they are improvements or not, so if you have resolved any issues or
|
||||
done anything else to improve levelization, run `levelization.sh`,
|
||||
and commit the updated results.
|
||||
|
||||
The `loops.txt` and `ordering.txt` files relate the modules
|
||||
using comparison signs, which indicate the number of times each
|
||||
module is included in the other.
|
||||
|
||||
* `A > B` means that A should probably be at a higher level than B,
|
||||
because B is included in A significantly more than A is included in B.
|
||||
These results can be included in both `loops.txt` and `ordering.txt`.
|
||||
Because `ordering.txt`only includes relationships where B is not
|
||||
included in A at all, it will only include these types of results.
|
||||
* `A ~= B` means that A and B are included in each other a different
|
||||
number of times, but the values are so close that the script can't
|
||||
definitively say that one should be above the other. These results
|
||||
will only be included in `loops.txt`.
|
||||
* `A == B` means that A and B include each other the same number of
|
||||
times, so the script has no clue which should be higher. These results
|
||||
will only be included in `loops.txt`.
|
||||
|
||||
The committed files hide the detailed values intentionally, to
|
||||
prevent false alarms and merging issues, and because it's easy to
|
||||
get those details locally.
|
||||
|
||||
1. Run `levelization.sh`
|
||||
2. Grep the modules in `paths.txt`.
|
||||
* For example, if a cycle is found `A ~= B`, simply `grep -w
|
||||
A Builds/levelization/results/paths.txt | grep -w B`
|
||||
127
Builds/levelization/levelization.sh
Executable file
127
Builds/levelization/levelization.sh
Executable file
@@ -0,0 +1,127 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Usage: levelization.sh
|
||||
# This script takes no parameters, reads no environment variables,
|
||||
# and can be run from any directory, as long as it is in the expected
|
||||
# location in the repo.
|
||||
|
||||
pushd $( dirname $0 )
|
||||
|
||||
if [ -v PS1 ]
|
||||
then
|
||||
# if the shell is interactive, clean up any flotsam before analyzing
|
||||
git clean -ix
|
||||
fi
|
||||
|
||||
rm -rfv results
|
||||
mkdir results
|
||||
includes="$( pwd )/results/rawincludes.txt"
|
||||
pushd ../..
|
||||
echo Raw includes:
|
||||
grep -r '#include.*/.*\.h' src/ripple/ src/test/ | \
|
||||
grep -v boost | tee ${includes}
|
||||
popd
|
||||
pushd results
|
||||
|
||||
oldifs=${IFS}
|
||||
IFS=:
|
||||
mkdir includes
|
||||
mkdir includedby
|
||||
echo Build levelization paths
|
||||
exec 3< ${includes} # open rawincludes.txt for input
|
||||
while read -r -u 3 file include
|
||||
do
|
||||
level=$( echo ${file} | cut -d/ -f 2,3 )
|
||||
# If the "level" indicates a file, cut off the filename
|
||||
if [[ "${level##*.}" != "${level}" ]]
|
||||
then
|
||||
# Use the "toplevel" label as a workaround for `sort`
|
||||
# inconsistencies between different utility versions
|
||||
level="$( dirname ${level} )/toplevel"
|
||||
fi
|
||||
level=$( echo ${level} | tr '/' '.' )
|
||||
|
||||
includelevel=$( echo ${include} | sed 's/.*["<]//; s/[">].*//' | \
|
||||
cut -d/ -f 1,2 )
|
||||
if [[ "${includelevel##*.}" != "${includelevel}" ]]
|
||||
then
|
||||
# Use the "toplevel" label as a workaround for `sort`
|
||||
# inconsistencies between different utility versions
|
||||
includelevel="$( dirname ${includelevel} )/toplevel"
|
||||
fi
|
||||
includelevel=$( echo ${includelevel} | tr '/' '.' )
|
||||
|
||||
if [[ "$level" != "$includelevel" ]]
|
||||
then
|
||||
echo $level $includelevel | tee -a paths.txt
|
||||
fi
|
||||
done
|
||||
echo Sort and dedup paths
|
||||
sort -ds paths.txt | uniq -c | tee sortedpaths.txt
|
||||
mv sortedpaths.txt paths.txt
|
||||
exec 3>&- #close fd 3
|
||||
IFS=${oldifs}
|
||||
unset oldifs
|
||||
|
||||
echo Split into flat-file database
|
||||
exec 4<paths.txt # open paths.txt for input
|
||||
while read -r -u 4 count level include
|
||||
do
|
||||
echo ${include} ${count} | tee -a includes/${level}
|
||||
echo ${level} ${count} | tee -a includedby/${include}
|
||||
done
|
||||
exec 4>&- #close fd 4
|
||||
|
||||
loops="$( pwd )/loops.txt"
|
||||
ordering="$( pwd )/ordering.txt"
|
||||
pushd includes
|
||||
echo Search for loops
|
||||
# Redirect stdout to a file
|
||||
exec 4>&1
|
||||
exec 1>"${loops}"
|
||||
for source in *
|
||||
do
|
||||
if [[ -f "$source" ]]
|
||||
then
|
||||
exec 5<"${source}" # open for input
|
||||
while read -r -u 5 include includefreq
|
||||
do
|
||||
if [[ -f $include ]]
|
||||
then
|
||||
if grep -q -w $source $include
|
||||
then
|
||||
if grep -q -w "Loop: $include $source" "${loops}"
|
||||
then
|
||||
continue
|
||||
fi
|
||||
sourcefreq=$( grep -w $source $include | cut -d\ -f2 )
|
||||
echo "Loop: $source $include"
|
||||
# If the counts are close, indicate that the two modules are
|
||||
# on the same level, though they shouldn't be
|
||||
if [[ $(( $includefreq - $sourcefreq )) -gt 3 ]]
|
||||
then
|
||||
echo -e " $source > $include\n"
|
||||
elif [[ $(( $sourcefreq - $includefreq )) -gt 3 ]]
|
||||
then
|
||||
echo -e " $include > $source\n"
|
||||
elif [[ $sourcefreq -eq $includefreq ]]
|
||||
then
|
||||
echo -e " $include == $source\n"
|
||||
else
|
||||
echo -e " $include ~= $source\n"
|
||||
fi
|
||||
else
|
||||
echo "$source > $include" >> "${ordering}"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
exec 5>&- #close fd 5
|
||||
fi
|
||||
done
|
||||
exec 1>&4 #close fd 1
|
||||
exec 4>&- #close fd 4
|
||||
cat "${ordering}"
|
||||
cat "${loops}"
|
||||
popd
|
||||
popd
|
||||
popd
|
||||
51
Builds/levelization/results/loops.txt
Normal file
51
Builds/levelization/results/loops.txt
Normal file
@@ -0,0 +1,51 @@
|
||||
Loop: ripple.app ripple.core
|
||||
ripple.app > ripple.core
|
||||
|
||||
Loop: ripple.app ripple.ledger
|
||||
ripple.app > ripple.ledger
|
||||
|
||||
Loop: ripple.app ripple.net
|
||||
ripple.app > ripple.net
|
||||
|
||||
Loop: ripple.app ripple.nodestore
|
||||
ripple.app > ripple.nodestore
|
||||
|
||||
Loop: ripple.app ripple.overlay
|
||||
ripple.overlay ~= ripple.app
|
||||
|
||||
Loop: ripple.app ripple.peerfinder
|
||||
ripple.peerfinder ~= ripple.app
|
||||
|
||||
Loop: ripple.app ripple.rpc
|
||||
ripple.rpc > ripple.app
|
||||
|
||||
Loop: ripple.app ripple.shamap
|
||||
ripple.app > ripple.shamap
|
||||
|
||||
Loop: ripple.basics ripple.core
|
||||
ripple.core > ripple.basics
|
||||
|
||||
Loop: ripple.basics ripple.json
|
||||
ripple.json ~= ripple.basics
|
||||
|
||||
Loop: ripple.basics ripple.protocol
|
||||
ripple.protocol > ripple.basics
|
||||
|
||||
Loop: ripple.core ripple.net
|
||||
ripple.net > ripple.core
|
||||
|
||||
Loop: ripple.net ripple.rpc
|
||||
ripple.rpc > ripple.net
|
||||
|
||||
Loop: ripple.nodestore ripple.overlay
|
||||
ripple.overlay ~= ripple.nodestore
|
||||
|
||||
Loop: ripple.overlay ripple.rpc
|
||||
ripple.rpc ~= ripple.overlay
|
||||
|
||||
Loop: test.jtx test.toplevel
|
||||
test.toplevel > test.jtx
|
||||
|
||||
Loop: test.jtx test.unit_test
|
||||
test.unit_test == test.jtx
|
||||
|
||||
229
Builds/levelization/results/ordering.txt
Normal file
229
Builds/levelization/results/ordering.txt
Normal file
@@ -0,0 +1,229 @@
|
||||
ripple.app > ripple.basics
|
||||
ripple.app > ripple.beast
|
||||
ripple.app > ripple.conditions
|
||||
ripple.app > ripple.consensus
|
||||
ripple.app > ripple.crypto
|
||||
ripple.app > ripple.json
|
||||
ripple.app > ripple.protocol
|
||||
ripple.app > ripple.resource
|
||||
ripple.app > test.unit_test
|
||||
ripple.basics > ripple.beast
|
||||
ripple.conditions > ripple.basics
|
||||
ripple.conditions > ripple.protocol
|
||||
ripple.consensus > ripple.basics
|
||||
ripple.consensus > ripple.beast
|
||||
ripple.consensus > ripple.json
|
||||
ripple.consensus > ripple.protocol
|
||||
ripple.core > ripple.beast
|
||||
ripple.core > ripple.json
|
||||
ripple.core > ripple.protocol
|
||||
ripple.crypto > ripple.basics
|
||||
ripple.json > ripple.beast
|
||||
ripple.ledger > ripple.basics
|
||||
ripple.ledger > ripple.beast
|
||||
ripple.ledger > ripple.core
|
||||
ripple.ledger > ripple.json
|
||||
ripple.ledger > ripple.protocol
|
||||
ripple.net > ripple.basics
|
||||
ripple.net > ripple.beast
|
||||
ripple.net > ripple.json
|
||||
ripple.net > ripple.protocol
|
||||
ripple.net > ripple.resource
|
||||
ripple.nodestore > ripple.basics
|
||||
ripple.nodestore > ripple.beast
|
||||
ripple.nodestore > ripple.core
|
||||
ripple.nodestore > ripple.json
|
||||
ripple.nodestore > ripple.protocol
|
||||
ripple.nodestore > ripple.unity
|
||||
ripple.overlay > ripple.basics
|
||||
ripple.overlay > ripple.beast
|
||||
ripple.overlay > ripple.core
|
||||
ripple.overlay > ripple.json
|
||||
ripple.overlay > ripple.peerfinder
|
||||
ripple.overlay > ripple.protocol
|
||||
ripple.overlay > ripple.resource
|
||||
ripple.overlay > ripple.server
|
||||
ripple.peerfinder > ripple.basics
|
||||
ripple.peerfinder > ripple.beast
|
||||
ripple.peerfinder > ripple.core
|
||||
ripple.peerfinder > ripple.protocol
|
||||
ripple.perflog > ripple.basics
|
||||
ripple.perflog > ripple.beast
|
||||
ripple.perflog > ripple.core
|
||||
ripple.perflog > ripple.json
|
||||
ripple.perflog > ripple.nodestore
|
||||
ripple.perflog > ripple.protocol
|
||||
ripple.perflog > ripple.rpc
|
||||
ripple.protocol > ripple.beast
|
||||
ripple.protocol > ripple.crypto
|
||||
ripple.protocol > ripple.json
|
||||
ripple.resource > ripple.basics
|
||||
ripple.resource > ripple.beast
|
||||
ripple.resource > ripple.json
|
||||
ripple.resource > ripple.protocol
|
||||
ripple.rpc > ripple.basics
|
||||
ripple.rpc > ripple.beast
|
||||
ripple.rpc > ripple.core
|
||||
ripple.rpc > ripple.crypto
|
||||
ripple.rpc > ripple.json
|
||||
ripple.rpc > ripple.ledger
|
||||
ripple.rpc > ripple.nodestore
|
||||
ripple.rpc > ripple.protocol
|
||||
ripple.rpc > ripple.resource
|
||||
ripple.rpc > ripple.server
|
||||
ripple.rpc > ripple.shamap
|
||||
ripple.server > ripple.basics
|
||||
ripple.server > ripple.beast
|
||||
ripple.server > ripple.crypto
|
||||
ripple.server > ripple.json
|
||||
ripple.server > ripple.protocol
|
||||
ripple.shamap > ripple.basics
|
||||
ripple.shamap > ripple.beast
|
||||
ripple.shamap > ripple.crypto
|
||||
ripple.shamap > ripple.nodestore
|
||||
ripple.shamap > ripple.protocol
|
||||
test.app > ripple.app
|
||||
test.app > ripple.basics
|
||||
test.app > ripple.beast
|
||||
test.app > ripple.core
|
||||
test.app > ripple.json
|
||||
test.app > ripple.ledger
|
||||
test.app > ripple.overlay
|
||||
test.app > ripple.protocol
|
||||
test.app > ripple.resource
|
||||
test.app > ripple.rpc
|
||||
test.app > test.jtx
|
||||
test.app > test.rpc
|
||||
test.app > test.toplevel
|
||||
test.app > test.unit_test
|
||||
test.basics > ripple.basics
|
||||
test.basics > ripple.beast
|
||||
test.basics > ripple.json
|
||||
test.basics > ripple.protocol
|
||||
test.basics > ripple.rpc
|
||||
test.basics > test.jtx
|
||||
test.basics > test.unit_test
|
||||
test.beast > ripple.basics
|
||||
test.beast > ripple.beast
|
||||
test.conditions > ripple.basics
|
||||
test.conditions > ripple.beast
|
||||
test.conditions > ripple.conditions
|
||||
test.consensus > ripple.app
|
||||
test.consensus > ripple.basics
|
||||
test.consensus > ripple.beast
|
||||
test.consensus > ripple.consensus
|
||||
test.consensus > ripple.ledger
|
||||
test.consensus > ripple.rpc
|
||||
test.consensus > test.csf
|
||||
test.consensus > test.toplevel
|
||||
test.consensus > test.unit_test
|
||||
test.core > ripple.basics
|
||||
test.core > ripple.beast
|
||||
test.core > ripple.core
|
||||
test.core > ripple.crypto
|
||||
test.core > ripple.json
|
||||
test.core > ripple.server
|
||||
test.core > test.jtx
|
||||
test.core > test.toplevel
|
||||
test.core > test.unit_test
|
||||
test.csf > ripple.basics
|
||||
test.csf > ripple.beast
|
||||
test.csf > ripple.consensus
|
||||
test.csf > ripple.json
|
||||
test.csf > ripple.protocol
|
||||
test.json > ripple.beast
|
||||
test.json > ripple.json
|
||||
test.json > test.jtx
|
||||
test.jtx > ripple.app
|
||||
test.jtx > ripple.basics
|
||||
test.jtx > ripple.beast
|
||||
test.jtx > ripple.consensus
|
||||
test.jtx > ripple.core
|
||||
test.jtx > ripple.json
|
||||
test.jtx > ripple.ledger
|
||||
test.jtx > ripple.net
|
||||
test.jtx > ripple.protocol
|
||||
test.jtx > ripple.server
|
||||
test.ledger > ripple.app
|
||||
test.ledger > ripple.basics
|
||||
test.ledger > ripple.beast
|
||||
test.ledger > ripple.core
|
||||
test.ledger > ripple.ledger
|
||||
test.ledger > ripple.protocol
|
||||
test.ledger > test.jtx
|
||||
test.ledger > test.toplevel
|
||||
test.net > ripple.net
|
||||
test.net > test.jtx
|
||||
test.net > test.toplevel
|
||||
test.net > test.unit_test
|
||||
test.nodestore > ripple.app
|
||||
test.nodestore > ripple.basics
|
||||
test.nodestore > ripple.beast
|
||||
test.nodestore > ripple.core
|
||||
test.nodestore > ripple.nodestore
|
||||
test.nodestore > ripple.protocol
|
||||
test.nodestore > ripple.unity
|
||||
test.nodestore > test.jtx
|
||||
test.nodestore > test.toplevel
|
||||
test.nodestore > test.unit_test
|
||||
test.overlay > ripple.app
|
||||
test.overlay > ripple.basics
|
||||
test.overlay > ripple.beast
|
||||
test.overlay > ripple.core
|
||||
test.overlay > ripple.overlay
|
||||
test.overlay > ripple.peerfinder
|
||||
test.overlay > ripple.protocol
|
||||
test.overlay > ripple.shamap
|
||||
test.overlay > test.jtx
|
||||
test.overlay > test.unit_test
|
||||
test.peerfinder > ripple.basics
|
||||
test.peerfinder > ripple.beast
|
||||
test.peerfinder > ripple.core
|
||||
test.peerfinder > ripple.peerfinder
|
||||
test.peerfinder > ripple.protocol
|
||||
test.peerfinder > test.beast
|
||||
test.peerfinder > test.unit_test
|
||||
test.protocol > ripple.basics
|
||||
test.protocol > ripple.beast
|
||||
test.protocol > ripple.crypto
|
||||
test.protocol > ripple.json
|
||||
test.protocol > ripple.protocol
|
||||
test.protocol > test.toplevel
|
||||
test.resource > ripple.basics
|
||||
test.resource > ripple.beast
|
||||
test.resource > ripple.resource
|
||||
test.resource > test.unit_test
|
||||
test.rpc > ripple.app
|
||||
test.rpc > ripple.basics
|
||||
test.rpc > ripple.beast
|
||||
test.rpc > ripple.core
|
||||
test.rpc > ripple.json
|
||||
test.rpc > ripple.net
|
||||
test.rpc > ripple.nodestore
|
||||
test.rpc > ripple.overlay
|
||||
test.rpc > ripple.protocol
|
||||
test.rpc > ripple.resource
|
||||
test.rpc > ripple.rpc
|
||||
test.rpc > test.jtx
|
||||
test.rpc > test.nodestore
|
||||
test.rpc > test.toplevel
|
||||
test.server > ripple.app
|
||||
test.server > ripple.basics
|
||||
test.server > ripple.beast
|
||||
test.server > ripple.core
|
||||
test.server > ripple.json
|
||||
test.server > ripple.rpc
|
||||
test.server > ripple.server
|
||||
test.server > test.jtx
|
||||
test.server > test.toplevel
|
||||
test.server > test.unit_test
|
||||
test.shamap > ripple.basics
|
||||
test.shamap > ripple.beast
|
||||
test.shamap > ripple.nodestore
|
||||
test.shamap > ripple.protocol
|
||||
test.shamap > ripple.shamap
|
||||
test.shamap > test.unit_test
|
||||
test.toplevel > ripple.json
|
||||
test.toplevel > test.csf
|
||||
test.unit_test > ripple.basics
|
||||
test.unit_test > ripple.beast
|
||||
@@ -13,13 +13,18 @@ management tools.
|
||||
|
||||
## Dependencies
|
||||
|
||||
gcc-7 or later is required.
|
||||
gcc-8 or later is required.
|
||||
|
||||
Use `apt-get` to install the dependencies provided by the distribution
|
||||
|
||||
```
|
||||
$ apt-get update
|
||||
$ apt-get install -y gcc g++ wget git cmake protobuf-compiler libprotobuf-dev libssl-dev
|
||||
$ apt-get install -y gcc g++ wget git cmake pkg-config libprotoc-dev protobuf-compiler libprotobuf-dev libssl-dev
|
||||
```
|
||||
|
||||
To build the software in reporting mode, install these additional dependencies:
|
||||
```
|
||||
$ apt-get install -y autoconf flex bison
|
||||
```
|
||||
|
||||
Advanced users can choose to install newer versions of gcc, or the clang compiler.
|
||||
@@ -31,9 +36,8 @@ protobuf will give errors.
|
||||
Boost 1.70 or later is required. We recommend downloading and compiling boost
|
||||
with the following process: After changing to the directory where
|
||||
you wish to download and compile boost, run
|
||||
|
||||
```
|
||||
$ wget https://dl.bintray.com/boostorg/release/1.70.0/source/boost_1_70_0.tar.gz
|
||||
$ wget https://boostorg.jfrog.io/artifactory/main/release/1.70.0/source/boost_1_70_0.tar.gz
|
||||
$ tar -xzf boost_1_70_0.tar.gz
|
||||
$ cd boost_1_70_0
|
||||
$ ./bootstrap.sh
|
||||
@@ -139,6 +143,7 @@ testing and running.
|
||||
* `-Dsan=thread` to enable the thread sanitizer with clang
|
||||
* `-Dsan=address` to enable the address sanitizer with clang
|
||||
* `-Dstatic=ON` to enable static linking library dependencies
|
||||
* `-Dreporting=ON` to build code necessary for reporting mode (defaults to OFF)
|
||||
|
||||
Several other infrequently used options are available - run `ccmake` or
|
||||
`cmake-gui` for a list of all options.
|
||||
@@ -155,7 +160,7 @@ the `-j` parameter in this example tells the build tool to compile several
|
||||
files in parallel. This value should be chosen roughly based on the number of
|
||||
cores you have available and/or want to use for building.
|
||||
|
||||
When the build completes succesfully, you will have a `rippled` executable in
|
||||
When the build completes successfully, you will have a `rippled` executable in
|
||||
the current directory, which can be used to connect to the network (when
|
||||
properly configured) or to run unit tests.
|
||||
|
||||
@@ -234,5 +239,3 @@ change the `/opt/local` module path above to match your chosen installation pref
|
||||
`rippled` builds a set of unit tests into the server executable. To run these unit
|
||||
tests after building, pass the `--unittest` option to the compiled `rippled`
|
||||
executable. The executable will exit with summary info after running the unit tests.
|
||||
|
||||
|
||||
|
||||
@@ -1,231 +1,3 @@
|
||||
# macos Build Instructions
|
||||
|
||||
## Important
|
||||
|
||||
We don't recommend macos for rippled production use at this time. Currently, the
|
||||
Ubuntu platform has received the highest level of quality assurance and
|
||||
testing. That said, macos is suitable for many development/test tasks.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
You'll need macos 10.8 or later.
|
||||
|
||||
To clone the source code repository, create branches for inspection or
|
||||
modification, build rippled using clang, and run the system tests you will need
|
||||
these software components:
|
||||
|
||||
* [XCode](https://developer.apple.com/xcode/)
|
||||
* [Homebrew](http://brew.sh/)
|
||||
* [Boost](http://boost.org/)
|
||||
* other misc utilities and libraries installed via homebrew
|
||||
|
||||
## Install Software
|
||||
|
||||
### Install XCode
|
||||
|
||||
If not already installed on your system, download and install XCode using the
|
||||
appstore or by using [this link](https://developer.apple.com/xcode/).
|
||||
|
||||
For more info, see "Step 1: Download and Install the Command Line Tools"
|
||||
[here](http://www.moncefbelyamani.com/how-to-install-xcode-homebrew-git-rvm-ruby-on-mac)
|
||||
|
||||
The command line tools can be installed through the terminal with the command:
|
||||
|
||||
```
|
||||
xcode-select --install
|
||||
```
|
||||
|
||||
### Install Homebrew
|
||||
|
||||
> "[Homebrew](http://brew.sh/) installs the stuff you need that Apple didn’t."
|
||||
|
||||
Open a terminal and type:
|
||||
|
||||
```
|
||||
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
||||
```
|
||||
|
||||
For more info, see "Step 2: Install Homebrew"
|
||||
[here](http://www.moncefbelyamani.com/how-to-install-xcode-homebrew-git-rvm-ruby-on-mac#step-2)
|
||||
|
||||
### Install Dependencies Using Homebrew
|
||||
|
||||
`brew` will generally install the latest stable version of any package, which
|
||||
should satisfy the the minimum version requirements for rippled.
|
||||
|
||||
```
|
||||
brew update
|
||||
brew install git cmake pkg-config protobuf openssl ninja
|
||||
```
|
||||
|
||||
### Build Boost
|
||||
|
||||
Boost 1.70 or later is required.
|
||||
|
||||
We want to compile boost with clang/libc++
|
||||
|
||||
Download [a release](https://dl.bintray.com/boostorg/release/1.70.0/source/boost_1_70_0.tar.bz2)
|
||||
|
||||
Extract it to a folder, making note of where, open a terminal, then:
|
||||
|
||||
```
|
||||
./bootstrap.sh
|
||||
./b2 cxxflags="-std=c++14" visibility=global
|
||||
```
|
||||
|
||||
Create an environment variable `BOOST_ROOT` in one of your `rc` files, pointing
|
||||
to the root of the extracted directory.
|
||||
|
||||
### Dependencies for Building Source Documentation
|
||||
|
||||
Source code documentation is not required for running/debugging rippled. That
|
||||
said, the documentation contains some helpful information about specific
|
||||
components of the application. For more information on how to install and run
|
||||
the necessary components, see [this document](../../docs/README.md)
|
||||
|
||||
## Build
|
||||
|
||||
### Clone the rippled repository
|
||||
|
||||
From a shell:
|
||||
|
||||
```
|
||||
git clone git@github.com:ripple/rippled.git
|
||||
cd rippled
|
||||
```
|
||||
|
||||
For a stable release, choose the `master` branch or one of the tagged releases
|
||||
listed on [GitHub](https://github.com/ripple/rippled/releases GitHub).
|
||||
|
||||
```
|
||||
git checkout master
|
||||
```
|
||||
|
||||
or to test the latest release candidate, choose the `release` branch.
|
||||
|
||||
```
|
||||
git checkout release
|
||||
```
|
||||
|
||||
If you are doing development work and want the latest set of untested
|
||||
features, you can consider using the `develop` branch instead.
|
||||
|
||||
```
|
||||
git checkout develop
|
||||
```
|
||||
|
||||
### Configure Library Paths
|
||||
|
||||
If you didn't persistently set the `BOOST_ROOT` environment variable to the
|
||||
root of the extracted directory above, then you should set it temporarily.
|
||||
|
||||
For example, assuming your username were `Abigail` and you extracted Boost
|
||||
1.70.0 in `/Users/Abigail/Downloads/boost_1_70_0`, you would do for any
|
||||
shell in which you want to build:
|
||||
|
||||
```
|
||||
export BOOST_ROOT=/Users/Abigail/Downloads/boost_1_70_0
|
||||
```
|
||||
|
||||
### Generate and Build
|
||||
|
||||
For simple command line building we recommend using the *Unix Makefile* or
|
||||
*Ninja* generator with cmake. All builds should be done in a separate directory
|
||||
from the source tree root (a subdirectory is fine). For example, from the root
|
||||
of the ripple source tree:
|
||||
|
||||
```
|
||||
mkdir my_build
|
||||
cd my_build
|
||||
```
|
||||
|
||||
followed by:
|
||||
|
||||
```
|
||||
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug ..
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```
|
||||
cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Debug ..
|
||||
```
|
||||
|
||||
`CMAKE_BUILD_TYPE` can be changed as desired for `Debug` vs.
|
||||
`Release` builds (all four standard cmake build types are supported).
|
||||
|
||||
Once you have generated the build system, you can run the build via cmake:
|
||||
|
||||
```
|
||||
cmake --build . -- -j 4
|
||||
```
|
||||
|
||||
the `-j` parameter in this example tells the build tool to compile several
|
||||
files in parallel. This value should be chosen roughly based on the number of
|
||||
cores you have available and/or want to use for building.
|
||||
|
||||
When the build completes succesfully, you will have a `rippled` executable in
|
||||
the current directory, which can be used to connect to the network (when
|
||||
properly configured) or to run unit tests.
|
||||
|
||||
If you prefer to have an XCode project to use for building, ask CMake to
|
||||
generate that instead:
|
||||
|
||||
```
|
||||
cmake -GXcode ..
|
||||
```
|
||||
|
||||
After generation succeeds, the xcode project file can be opened and used to
|
||||
build/debug. However, just as with other generators, cmake knows how to build
|
||||
using the xcode project as well:
|
||||
|
||||
```
|
||||
cmake --build . -- -jobs 4
|
||||
```
|
||||
|
||||
This will invoke the `xcodebuild` utility to compile the project. See `xcodebuild
|
||||
--help` for details about build options.
|
||||
|
||||
#### Optional installation
|
||||
|
||||
If you'd like to install the artifacts of the build, we have preliminary
|
||||
support for standard CMake installation targets. We recommend explicitly
|
||||
setting the installation location when configuring, e.g.:
|
||||
|
||||
```
|
||||
cmake -DCMAKE_INSTALL_PREFIX=/opt/local ..
|
||||
```
|
||||
|
||||
(change the destination as desired), and then build the `install` target:
|
||||
|
||||
```
|
||||
cmake --build . --target install -- -jobs 4
|
||||
```
|
||||
|
||||
#### Options During Configuration:
|
||||
|
||||
The CMake file defines a number of configure-time options which can be
|
||||
examined by running `cmake-gui` or `ccmake` to generated the build. In
|
||||
particular, the `unity` option allows you to select between the unity and
|
||||
non-unity builds. `unity` builds are faster to compile since they combine
|
||||
multiple sources into a single compiliation unit - this is the default if you
|
||||
don't specify. `nounity` builds can be helpful for detecting include omissions
|
||||
or for finding other build-related issues, but aren't generally needed for
|
||||
testing and running.
|
||||
|
||||
* `-Dunity=ON` to enable/disable unity builds (defaults to ON)
|
||||
* `-Dassert=ON` to enable asserts
|
||||
* `-Djemalloc=ON` to enable jemalloc support for heap checking
|
||||
* `-Dsan=thread` to enable the thread sanitizer with clang
|
||||
* `-Dsan=address` to enable the address sanitizer with clang
|
||||
|
||||
Several other infrequently used options are available - run `ccmake` or
|
||||
`cmake-gui` for a list of all options.
|
||||
|
||||
## Unit Tests (Recommended)
|
||||
|
||||
`rippled` builds a set of unit tests into the server executable. To run these unit
|
||||
tests after building, pass the `--unittest` option to the compiled `rippled`
|
||||
executable. The executable will exit with summary info after running the unit tests.
|
||||
|
||||
# macOS Build Instructions
|
||||
|
||||
[Build and Run rippled on macOS](https://xrpl.org/build-run-rippled-macos.html)
|
||||
|
||||
@@ -1,21 +1,31 @@
|
||||
cmake_minimum_required (VERSION 3.9.0)
|
||||
cmake_minimum_required (VERSION 3.16)
|
||||
|
||||
if (POLICY CMP0074)
|
||||
cmake_policy(SET CMP0074 NEW)
|
||||
endif ()
|
||||
|
||||
project (rippled)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
# make GIT_COMMIT_HASH define available to all sources
|
||||
find_package(Git)
|
||||
if(Git_FOUND)
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} describe --always --abbrev=40
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE gch)
|
||||
if(gch)
|
||||
set(GIT_COMMIT_HASH "${gch}")
|
||||
message(STATUS gch: ${GIT_COMMIT_HASH})
|
||||
add_definitions(-DGIT_COMMIT_HASH="${GIT_COMMIT_HASH}")
|
||||
endif()
|
||||
endif() #git
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/Builds/CMake")
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/Builds/CMake/deps")
|
||||
|
||||
include (CheckCXXCompilerFlag)
|
||||
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.11)
|
||||
include (FetchContent)
|
||||
endif ()
|
||||
if (MSVC AND CMAKE_VERSION VERSION_LESS 3.12)
|
||||
message (FATAL_ERROR "MSVC requires cmake 3.12 or greater for proper boost support")
|
||||
endif ()
|
||||
include (FetchContent)
|
||||
include (ExternalProject)
|
||||
include (CMakeFuncs) # must come *after* ExternalProject b/c it overrides one function in EP
|
||||
include (ProcessorCount)
|
||||
@@ -55,6 +65,8 @@ include(deps/Nudb)
|
||||
include(deps/date)
|
||||
include(deps/Protobuf)
|
||||
include(deps/gRPC)
|
||||
include(deps/cassandra)
|
||||
include(deps/Postgres)
|
||||
|
||||
###
|
||||
|
||||
|
||||
17
LICENSE.md
Normal file
17
LICENSE.md
Normal file
@@ -0,0 +1,17 @@
|
||||
ISC License
|
||||
|
||||
Copyright (c) 2011, Arthur Britto, David Schwartz, Jed McCaleb, Vinnie Falco, Bob Way, Eric Lombrozo, Nikolaos D. Bougalis, Howard Hinnant.
|
||||
Copyright (c) 2012-2020, the XRP Ledger developers.
|
||||
|
||||
Permission to use, copy, modify, and distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
35
README.md
35
README.md
@@ -1,18 +1,18 @@
|
||||
# The XRP Ledger
|
||||
|
||||
The XRP Ledger is a decentralized cryptographic ledger powered by a network of peer-to-peer servers. The XRP Ledger uses a novel Byzantine Fault Tolerant consensus algorithm to settle and record transactions in a secure distributed database without a central operator.
|
||||
The [XRP Ledger](https://xrpl.org/) is a decentralized cryptographic ledger powered by a network of peer-to-peer nodes. The XRP Ledger uses a novel Byzantine Fault Tolerant consensus algorithm to settle and record transactions in a secure distributed database without a central operator.
|
||||
|
||||
## XRP
|
||||
XRP is a public, counterparty-free asset native to the XRP Ledger, and is designed to bridge the many different currencies in use worldwide. XRP is traded on the open-market and is available for anyone to access. The XRP Ledger was created in 2012 with a finite supply of 100 billion units of XRP. Its creators gifted 80 billion XRP to a company, now called [Ripple](https://ripple.com/), to develop the XRP Ledger and its ecosystem. Ripple uses XRP to help build the Internet of Value, ushering in a world in which money moves as fast and efficiently as information does today.
|
||||
[XRP](https://xrpl.org/xrp.html) is a public, counterparty-free asset native to the XRP Ledger, and is designed to bridge the many different currencies in use worldwide. XRP is traded on the open-market and is available for anyone to access. The XRP Ledger was created in 2012 with a finite supply of 100 billion units of XRP. Its creators gifted 80 billion XRP to a company, now called [Ripple](https://ripple.com/), to develop the XRP Ledger and its ecosystem. Ripple uses XRP to help build the Internet of Value, ushering in a world in which money moves as fast and efficiently as information does today.
|
||||
|
||||
## rippled
|
||||
The server software that powers the XRP Ledger is called `rippled` and is available in this repository under the permissive [ISC open-source license](LICENSE). The `rippled` server is written primarily in C++ and runs on a variety of platforms.
|
||||
The server software that powers the XRP Ledger is called `rippled` and is available in this repository under the permissive [ISC open-source license](LICENSE.md). The `rippled` server software is written primarily in C++ and runs on a variety of platforms. The `rippled` server software can run in several modes depending on its [configuration](https://xrpl.org/rippled-server-modes.html).
|
||||
|
||||
### Build from Source
|
||||
|
||||
* [Linux](Builds/linux/README.md)
|
||||
* [Mac](Builds/macos/README.md)
|
||||
* [Windows](Builds/VisualStudio2017/README.md)
|
||||
* [Mac](Builds/macos/README.md) (Not recommended for production)
|
||||
* [Windows](Builds/VisualStudio2017/README.md) (Not recommended for production)
|
||||
|
||||
## Key Features of the XRP Ledger
|
||||
|
||||
@@ -24,13 +24,13 @@ The server software that powers the XRP Ledger is called `rippled` and is availa
|
||||
- **[Modern Features for Smart Contracts][]:** Features like Escrow, Checks, and Payment Channels support cutting-edge financial applications including the [Interledger Protocol](https://interledger.org/). This toolbox of advanced features comes with safety features like a process for amending the network and separate checks against invariant constraints.
|
||||
- **[On-Ledger Decentralized Exchange][]:** In addition to all the features that make XRP useful on its own, the XRP Ledger also has a fully-functional accounting system for tracking and trading obligations denominated in any way users want, and an exchange built into the protocol. The XRP Ledger can settle long, cross-currency payment paths and exchanges of multiple currencies in atomic transactions, bridging gaps of trust with XRP.
|
||||
|
||||
[Censorship-Resistant Transaction Processing]: https://developers.ripple.com/xrp-ledger-overview.html#censorship-resistant-transaction-processing
|
||||
[Fast, Efficient Consensus Algorithm]: https://developers.ripple.com/xrp-ledger-overview.html#fast-efficient-consensus-algorithm
|
||||
[Finite XRP Supply]: https://developers.ripple.com/xrp-ledger-overview.html#finite-xrp-supply
|
||||
[Responsible Software Governance]: https://developers.ripple.com/xrp-ledger-overview.html#responsible-software-governance
|
||||
[Secure, Adaptable Cryptography]: https://developers.ripple.com/xrp-ledger-overview.html#secure-adaptable-cryptography
|
||||
[Modern Features for Smart Contracts]: https://developers.ripple.com/xrp-ledger-overview.html#modern-features-for-smart-contracts
|
||||
[On-Ledger Decentralized Exchange]: https://developers.ripple.com/xrp-ledger-overview.html#on-ledger-decentralized-exchange
|
||||
[Censorship-Resistant Transaction Processing]: https://xrpl.org/xrp-ledger-overview.html#censorship-resistant-transaction-processing
|
||||
[Fast, Efficient Consensus Algorithm]: https://xrpl.org/xrp-ledger-overview.html#fast-efficient-consensus-algorithm
|
||||
[Finite XRP Supply]: https://xrpl.org/xrp-ledger-overview.html#finite-xrp-supply
|
||||
[Responsible Software Governance]: https://xrpl.org/xrp-ledger-overview.html#responsible-software-governance
|
||||
[Secure, Adaptable Cryptography]: https://xrpl.org/xrp-ledger-overview.html#secure-adaptable-cryptography
|
||||
[Modern Features for Smart Contracts]: https://xrpl.org/xrp-ledger-overview.html#modern-features-for-smart-contracts
|
||||
[On-Ledger Decentralized Exchange]: https://xrpl.org/xrp-ledger-overview.html#on-ledger-decentralized-exchange
|
||||
|
||||
|
||||
## Source Code
|
||||
@@ -53,10 +53,7 @@ git-subtree. See those directories' README files for more details.
|
||||
|
||||
## See Also
|
||||
|
||||
* [XRP Ledger Dev Portal](https://developers.ripple.com/)
|
||||
* [XRP News](https://ripple.com/category/xrp/)
|
||||
* [Setup and Installation](https://developers.ripple.com/install-rippled.html)
|
||||
* [Doxygen](https://ripple.github.io/rippled)
|
||||
|
||||
To learn about how Ripple is transforming global payments, visit
|
||||
<https://ripple.com/contact/>.
|
||||
* [XRP Ledger Dev Portal](https://xrpl.org/)
|
||||
* [Setup and Installation](https://xrpl.org/install-rippled.html)
|
||||
* [Source Documentation (Doxygen)](https://ripple.github.io/rippled)
|
||||
* [Learn more about the XRP Ledger (YouTube)](https://www.youtube.com/playlist?list=PLJQ55Tj1hIVZtJ_JdTvSum2qMTsedWkNi)
|
||||
|
||||
304
RELEASENOTES.md
304
RELEASENOTES.md
@@ -2,18 +2,314 @@
|
||||
|
||||

|
||||
|
||||
This document contains the release notes for `rippled`, the reference server implementation of the Ripple protocol. To learn more about how to build, run or update a `rippled` server, visit https://xrpl.org/install-rippled.html
|
||||
This document contains the release notes for `rippled`, the reference server implementation of the XRP Ledger protocol. To learn more about how to build, run or update a `rippled` server, visit https://xrpl.org/install-rippled.html
|
||||
|
||||
|
||||
Have new ideas? Need help with setting up your node? Come visit us [here](https://github.com/ripple/rippled/issues/new/choose)
|
||||
|
||||
# Change Log
|
||||
# Change log
|
||||
|
||||
- Work on a version 2 of the XRP Network API has begun. The new API returns the code `notSynced` in place of `noClosed`, `noCurrent`, and `noNetwork`. And `invalidLgrRange` is returned in place of `lgrIdxInvalid`.
|
||||
- The version 2 API can be specified by adding "api_version" : 2 to your json request. The default version remains 1 (if unspecified), except for the command line interface which always uses the latest verison.
|
||||
- API version 2 will now return `signer_lists` in the root of the `account_info` response, no longer nested under `account_data`.
|
||||
|
||||
# Releases
|
||||
|
||||
## Version 1.9.0
|
||||
This is the 1.9.0 release of `rippled`, the reference implementation of the XRP Ledger protocol. This release brings several features and improvements.
|
||||
|
||||
### New and Improved Features
|
||||
- **Introduce NFT support (XLS020):** This release introduces support for non-fungible tokens, currently available to the developer community for broader review and testing. Developers can create applications that allow users to mint, transfer, and ultimately burn (if desired) NFTs on the XRP Ledger. You can try out the new NFT transactions using the [nft-devnet](https://xrpl.org/xrp-testnet-faucet.html). Note that some fields and error codes from earlier releases of the supporting code have been refactored for this release, shown in the Code Refactoring section, below. [70779f](https://github.com/ripple/rippled/commit/70779f6850b5f33cdbb9cf4129bc1c259af0013e)
|
||||
|
||||
- **Simplify the Job Queue:** This is a refactor aimed at cleaning up and simplifying the existing job queue. Currently, all jobs are canceled at the same time and in the same way, so this commit removes the unnecessary per-job cancellation token. [#3656](https://github.com/ripple/rippled/pull/3656)
|
||||
|
||||
- **Optimize trust line caching:** The existing trust line caching code was suboptimal in that it stored redundant information, pinned SLEs into memory, and required multiple memory allocations per cached object. This commit eliminates redundant data, reduces the size of cached objects and unpinning SLEs from memory, and uses value types to avoid the need for `std::shared_ptr`. As a result of these changes, the effective size of a cached object includes the overhead of the memory allocator, and the `std::shared_ptr` should be reduced by at least 64 bytes. This is significant, as there can easily be tens of millions of these objects. [4d5459](https://github.com/ripple/rippled/commit/4d5459d041da8f5a349c5f458d664e5865e1f1b5)
|
||||
|
||||
- **Incremental improvements to pathfinding memory usage:** This commit aborts background pathfinding when closed or disconnected, exits the pathfinding job thread if there are no requests left, does not create the path find a job if there are no requests, and refactors to remove the circular dependency between InfoSub and PathRequest. [#4111](https://github.com/ripple/rippled/pull/4111)
|
||||
|
||||
- **Improve deterministic transaction sorting in TxQ:** This commit ensures that transactions with the same fee level are sorted by TxID XORed with the parent ledger hash, the TxQ is re-sorted after every ledger, and attempts to future-proof the TxQ tie-breaking test. [#4077](https://github.com/ripple/rippled/pull/4077)
|
||||
|
||||
- **Improve stop signaling for Application:** [34ca45](https://github.com/ripple/rippled/commit/34ca45713244d0defc39549dd43821784b2a5c1d)
|
||||
|
||||
- **Eliminate SHAMapInnerNode lock contention:** The `SHAMapInnerNode` class had a global mutex to protect the array of node children. Profiling suggested that around 4% of all attempts to lock the global would block. This commit removes that global mutex, and replaces it with a new per-node 16-way spinlock (implemented so as not to affect the size of an inner node object), effectively eliminating the lock contention. [1b9387](https://github.com/ripple/rippled/commit/1b9387eddc1f52165d3243d2ace9be0c62495eea)
|
||||
|
||||
- **Improve ledger-fetching logic:** When fetching ledgers, the existing code would isolate the peer that sent the most useful responses, and issue follow-up queries only to that peer. This commit increases the query aggressiveness, and changes the mechanism used to select which peers to issue follow-up queries to so as to more evenly spread the load among those peers that provided useful responses. [48803a](https://github.com/ripple/rippled/commit/48803a48afc3bede55d71618c2ee38fd9dbfd3b0)
|
||||
|
||||
- **Simplify and improve order book tracking:** The order book tracking code would use `std::shared_ptr` to track the lifetime of objects. This commit changes the logic to eliminate the overhead of `std::shared_ptr` by using value types, resulting in significant memory savings. [b9903b](https://github.com/ripple/rippled/commit/b9903bbcc483a384decf8d2665f559d123baaba2)
|
||||
|
||||
- **Negative cache support for node store:** This commit allows the cache to service requests for nodes that were previously looked up but not found, reducing the need to perform I/O in several common scenarios. [3eb8aa](https://github.com/ripple/rippled/commit/3eb8aa8b80bd818f04c99cee2cfc243192709667)
|
||||
|
||||
- **Improve asynchronous database handlers:** This commit optimizes the way asynchronous node store operations are processed, both by reducing the number of times locks are held and by minimizing the number of memory allocations and data copying. [6faaa9](https://github.com/ripple/rippled/commit/6faaa91850d6b2eb9fbf16c1256bf7ef11ac4646)
|
||||
|
||||
- **Cleanup AcceptedLedger and AcceptedLedgerTx:** This commit modernizes the `AcceptedLedger` and `AcceptedLedgerTx` classes, reduces their memory footprint, and reduces unnecessary dynamic memory allocations. [8f5868](https://github.com/ripple/rippled/commit/8f586870917818133924bf2e11acab5321c2b588)
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
This release includes name changes in the NFToken API for SFields, RPC return labels, and error codes for clarity and consistency. To refactor your code, migrate the names of these items to the new names as listed below.
|
||||
|
||||
#### `SField` name changes:
|
||||
* `TokenTaxon -> NFTokenTaxon`
|
||||
* `MintedTokens -> MintedNFTokens`
|
||||
* `BurnedTokens -> BurnedNFTokens`
|
||||
* `TokenID -> NFTokenID`
|
||||
* `TokenOffers -> NFTokenOffers`
|
||||
* `BrokerFee -> NFTokenBrokerFee`
|
||||
* `Minter -> NFTokenMinter`
|
||||
* `NonFungibleToken -> NFToken`
|
||||
* `NonFungibleTokens -> NFTokens`
|
||||
* `BuyOffer -> NFTokenBuyOffer`
|
||||
* `SellOffer -> NFTokenSellOffer`
|
||||
* `OfferNode -> NFTokenOfferNode`
|
||||
|
||||
#### RPC return labels
|
||||
* `tokenid -> nft_id`
|
||||
* `index -> nft_offer_index`
|
||||
|
||||
#### Error codes
|
||||
* `temBAD_TRANSFER_FEE -> temBAD_NFTOKEN_TRANSFER_FEE`
|
||||
* `tefTOKEN_IS_NOT_TRANSFERABLE -> tefNFTOKEN_IS_NOT_TRANSFERABLE`
|
||||
* `tecNO_SUITABLE_PAGE -> tecNO_SUITABLE_NFTOKEN_PAGE`
|
||||
* `tecBUY_SELL_MISMATCH -> tecNFTOKEN_BUY_SELL_MISMATCH`
|
||||
* `tecOFFER_TYPE_MISMATCH -> tecNFTOKEN_OFFER_TYPE_MISMATCH`
|
||||
* `tecCANT_ACCEPT_OWN_OFFER -> tecCANT_ACCEPT_OWN_NFTOKEN_OFFER`
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
- **Fix deletion of orphan node store directories:** Orphaned node store directories should only be deleted if the proper node store directories are confirmed to exist. [06e87e](https://github.com/ripple/rippled/commit/06e87e0f6add5b880d647e14ab3d950decfcf416)
|
||||
|
||||
## Version 1.8.5
|
||||
This is the 1.8.5 release of `rippled`, the reference implementation of the XRP Ledger protocol. This release includes fixes and updates for stability and security, and improvements to build scripts. There are no user-facing API or protocol changes in this release.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
This release contains the following bug fixes and under-the-hood improvements:
|
||||
|
||||
- **Correct TaggedPointer move constructor:** Fixes a bug in unused code for the TaggedPointer class. The old code would fail if a caller explicitly tried to remove a child that is not actually part of the node. (227a12d)
|
||||
|
||||
- **Ensure protocol buffer prerequisites are present:** The build scripts and packages now properly handle Protobuf packages and various packages. Prior to this change, building on Ubuntu 21.10 Impish Indri would fail unless the `libprotoc-dev` package was installed. (e06465f)
|
||||
|
||||
- **Improve handling of endpoints during peer discovery.** This hardens and improves handling of incoming messages on the peer protocol. (289bc0a)
|
||||
|
||||
- **Run tests on updated linux distros:** Test builds now run on Rocky Linux 8, Fedora 34 and 35, Ubuntu 18, 20, and 22, and Debian 9, 10, and 11. (a9ee802)
|
||||
|
||||
- **Avoid dereferencing empty optional in ReportingETL:** Fixes a bug in Reporting Mode that could dereference an empty optional value when throwing an error. (cdc215d)
|
||||
|
||||
- **Correctly add GIT_COMMIT_HASH into version string:** When building the server from a non-tagged release, the build files now add the commit ID in a way that follows the semantic-versioning standard, and correctly handle the case where the commit hash ID cannot be retrieved. (d23d37f)
|
||||
|
||||
- **Update RocksDB to version 6.27.3:** Updates the version of RocksDB included in the server from 6.7.3 (which was released on 2020-03-18) to 6.27.3 (released 2021-12-10).
|
||||
|
||||
|
||||
|
||||
## Version 1.8.4
|
||||
This is the 1.8.4 release of `rippled`, the reference implementation of the XRP Ledger protocol.
|
||||
|
||||
This release corrects a technical flaw introduced with 1.8.3 that may result in failures if the newly-introduced 'fast loading' is enabled. The release also adjusts default parameters used to configure the pathfinding engine to reduce resource usage.
|
||||
|
||||
### Bug Fixes
|
||||
- **Adjust mutex scope in `walkMapParallel`**: This commit corrects a technical flaw introduced with commit [7c12f0135897361398917ad2c8cda888249d42ae] that would result in undefined behavior if the server operator configured their server to use the 'fast loading' mechanism introduced with 1.8.3.
|
||||
|
||||
- **Adjust pathfinding configuration defaults**: This commit adjusts the default configuration of the pathfinding engine, to account for the size of the XRP Ledger mainnet. Unless explicitly overriden, the changes mean that pathfinding operations will return fewer, shallower paths than previous releases.
|
||||
|
||||
|
||||
## Version 1.8.3
|
||||
This is the 1.8.3 release of `rippled`, the reference implementation of the XRP Ledger protocol.
|
||||
|
||||
This release implements changes that improve the syncing performance of peers on the network, adds countermeasures to several routines involving LZ4 to defend against CVE-2021-3520, corrects a minor technical flaw that would result in the server not using a cache for nodestore operations, and adjusts tunable values to optimize disk I/O.
|
||||
|
||||
### Summary of Issues
|
||||
Recently, servers in the XRP Ledger network have been taking an increasingly long time to sync back to the network after restartiningg. This is one of several releases which will be made to improve on this issue.
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **Parallel ledger loader & I/O performance improvements**: This commit makes several changes that, together, should decrease the time needed for a server to sync to the network. To make full use of this change, `rippled` needs to be using storage with high IOPS and operators need to explicitly enable this behavior by adding the following to their config file, under the `[node_db]` stanza:
|
||||
|
||||
[node_db]
|
||||
...
|
||||
fast_load=1
|
||||
|
||||
Note that when 'fast loading' is enabled the server will not open RPC and WebSocket interfaces until after the initial load is completed. Because of this, it may appear unresponsive or down.
|
||||
|
||||
- **Detect CVE-2021-3520 when decompressing using LZ4**: This commit adds code to detect LZ4 payloads that may result in out-of-bounds memory accesses.
|
||||
|
||||
- **Provide sensible default values for nodestore cache:**: The nodestore includes a built-in cache to reduce the disk I/O load but, by default, this cache was not initialized unless it was explicitly configured by the server operator. This commit introduces sensible defaults based on the server's configured node size.
|
||||
|
||||
- **Adjust the number of concurrent ledger data jobs**: Processing a large amount of data at once can effectively bottleneck a server's I/O subsystem. This commits helps optimize I/O performance by controlling how many jobs can concurrently process ledger data.
|
||||
|
||||
- **Two small SHAMapSync improvements**: This commit makes minor changes to optimize the way memory is used and control the amount of background I/O performed when attempting to fetch missing `SHAMap` nodes.
|
||||
|
||||
## Version 1.8.2
|
||||
Ripple has released version 1.8.2 of rippled, the reference server implementation of the XRP Ledger protocol. This release addresses the full transaction queues and elevated transaction fees issue observed on the XRP ledger, and also provides some optimizations and small fixes to improve the server's performance overall.
|
||||
|
||||
### Summary of Issues
|
||||
Recently, servers in the XRP Ledger network have had full transaction queues and transactions paying low fees have mostly not been able to be confirmed through the queue. After investigation, it was discovered that a large influx of transactions to the network caused it to raise the transaction costs to be proposed in the next ledger block, and defer transactions paying lower costs to later ledgers. The first part worked as designed, but deferred transactions were not being confirmed as the ledger had capacity to process them.
|
||||
|
||||
The root cause was that there were very many low-cost transactions that different servers in the network received in a different order due to incidental differences in timing or network topology, which caused validators to propose different sets of low-cost transactions from the queue. Since none of these transactions had support from a majority of validators, they were removed from the proposed transaction set. Normally, any transactions removed from a proposed transaction set are supposed to be retried in the next ledger, but servers attempted to put these deferred transactions into their transaction queues first, which had filled up. As a result, the deferred transactions were discarded, and the network was only able to confirm transactions that paid high costs.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **Address elevated transaction fees**: This change addresses the full queue problems in two ways. First, it puts deferred transactions directly into the open ledger, rather than transaction queue. This reverts a subset of the changes from [ximinez@62127d7](https://github.com/ximinez/rippled/commit/62127d725d801641bfaa61dee7d88c95e48820c5). A transaction that is in the open ledger but doesn't get validated should stay in the open ledger so that it can be proposed again right away. Second, it changes the order in which transactions are pulled from the transaction queue to increase the overlap in servers' initial transaction consensus proposals. Like the old rules, transactions paying higher fee levels are selected first. Unlike the old rules, transactions paying the same fee level are ordered by transaction ID / hash ascending. (Previously, transactions paying the same fee level were unsorted, resulting in each server having a different order.)
|
||||
|
||||
- **Add ignore_default option to account_lines API**: This flag, if present, suppresses the output of incoming trust lines in the default state. This is primarily motivated by observing that users often have many unwanted incoming trust lines in a default state, which are not useful in the vast majority of cases. Being able to suppress those when doing `account_lines` saves bandwidth and resources. ([#3980](https://github.com/ripple/rippled/pull/3980))
|
||||
|
||||
- **Make I/O and prefetch worker threads configurable**: This commit adds the ability to specify **io_workers** and **prefetch_workers** in the config file which can be used to specify the number of threads for processing raw inbound and outbound IO and configure the number of threads for performing node store prefetching. ([#3994](https://github.com/ripple/rippled/pull/3994))
|
||||
|
||||
- **Enforce account RPC limits by objects traversed**: This changes the way the account_objects API method counts and limits the number of objects it returns. Instead of limiting results by the number of objects found, it counts by the number of objects traversed. Additionally, the default and maximum limits for non-admin connections have been decreased. This reduces the amount of work that one API call can do so that public API servers can share load more effectively. ([#4032](https://github.com/ripple/rippled/pull/4032))
|
||||
|
||||
- **Fix a crash on shutdown**: The NuDB backend class could throw an error in its destructor, resulting in a crash while the server was shutting down gracefully. This crash was harmless but resulted in false alarms and noise when tracking down other possible crashes. ([#4017](https://github.com/ripple/rippled/pull/4017))
|
||||
|
||||
- **Improve reporting of job queue in admin server_info**: The server_info command, when run with admin permissions, provides information about jobs in the server's job queue. This commit provides more descriptive names and more granular categories for many jobs that were previously all identified as "clientCommand". ([#4031](https://github.com/ripple/rippled/pull/4031))
|
||||
|
||||
- **Improve full & compressed inner node deserialization**: Remove a redundant copy operation from low-level SHAMap deserialization. ([#4004](https://github.com/ripple/rippled/pull/4004))
|
||||
|
||||
- **Reporting mode: only forward to P2P nodes that are synced**: Previously, reporting mode servers forwarded to any of their configured P2P nodes at random. This commit improves the selection so that it only chooses from P2P nodes that are fully synced with the network. ([#4028](https://github.com/ripple/rippled/pull/4028))
|
||||
|
||||
- **Improve handling of HTTP X-Forwarded-For and Forwarded headers**: Fixes the way the server handles IPv6 addresses in these HTTP headers. ([#4009](https://github.com/ripple/rippled/pull/4009), [#4030](https://github.com/ripple/rippled/pull/4030))
|
||||
|
||||
- **Other minor improvements to logging and Reporting Mode.**
|
||||
|
||||
|
||||
## Version 1.8.0
|
||||
Ripple has released version 1.8.0 of rippled, the reference server implementation of the XRP Ledger protocol. This release brings several features and improvements.
|
||||
|
||||
### New and Improved Features
|
||||
|
||||
- **Improve History Sharding**: Shards of ledger history are now assembled in a deterministic way so that any server can make a binary-identical shard for a given range of ledgers. This makes it possible to retrieve a shard from multiple sources in parallel, then verify its integrity by comparing checksums with peers' checksums for the same shard. Additionally, there's a new admin RPC command to import ledger history from the shard store, and the crawl_shards command has been expanded with more info. ([#2688](https://github.com/ripple/rippled/issues/2688), [#3726](https://github.com/ripple/rippled/pull/3726), [#3875](https://github.com/ripple/rippled/pull/3875))
|
||||
- **New CheckCashMakesTrustLine Amendment**: If enabled, this amendment will change the CheckCash transaction type so that cashing a check for an issued token automatically creates a trust line to hold the token, similar to how purchasing a token in the decentralized exchange creates a trust line to hold the token. This change provides a way for issuers to send tokens to a user before that user has set up a trust line, but without forcing anyone to hold tokens they don't want. ([#3823](https://github.com/ripple/rippled/pull/3823))
|
||||
- **Automatically determine the node size**: The server now selects an appropriate `[node_size]` configuration value by default if it is not explicitly specified. This parameter tunes various settings to the specs of the hardware that the server is running on, especially the amount of RAM and the number of CPU threads available in the system. Previously the server always chose the smallest value by default.
|
||||
- **Improve transaction relaying logic**: Previously, the server relayed every transaction to all its peers (except the one that it received the transaction from). To reduce redundant messages, the server now relays transactions to a subset of peers using a randomized algorithm. Peers can determine whether there are transactions they have not seen and can request them from a peer that has them. It is expected that this feature will further reduce the bandwidth needed to operate a server.
|
||||
- **Improve the Byzantine validator detector**: This expands the detection capabilities of the Byzantine validation detector. Previously, the server only monitored validators on its own UNL. Now, the server monitors for Byzantine behavior in all validations it sees.
|
||||
- **Experimental tx stream with history for sidechains**: Adds an experimental subscription stream for sidechain federators to track messages on the main chain in canonical order. This stream is expected to change or be replaced in future versions as work on sidechains matures.
|
||||
- **Support Debian 11 Bullseye**: This is the first release that is compatible with Debian Linux version 11.x, "Bullseye." The .deb packages now use absolute paths only, for compatibility with Bullseye's stricter package requirements. ([#3909](https://github.com/ripple/rippled/pull/3909))
|
||||
- **Improve Cache Performance**: The server uses a new storage structure for several in-memory caches for greatly improved overall performance. The process of purging old data from these caches, called "sweeping", was time-consuming and blocked other important activities necessary for maintaining ledger state and participating in consensus. The new structure divides the caches into smaller partitions that can be swept in parallel.
|
||||
- **Amendment default votes:** Introduces variable default votes per amendment. Previously the server always voted "yes" on any new amendment unless an admin explicitly configured a voting preference for that amendment. Now the server's default vote can be "yes" or "no" in the source code. This should allow a safer, more gradual roll-out of new amendments, as new releases can be configured to understand a new amendment but not vote for it by default. ([#3877](https://github.com/ripple/rippled/pull/3877))
|
||||
- **More fields in the `validations` stream:** The `validations` subscription stream in the API now reports additional fields that were added to validation messages by the HardenedValidations amendment. These fields make it easier to detect misconfigurations such as multiple servers sharing a validation key pair. ([#3865](https://github.com/ripple/rippled/pull/3865))
|
||||
- **Reporting mode supports `validations` and `manifests` streams:** In the API it is now possible to connect to these streams when connected to a servers running in reporting. Previously, attempting to subscribe to these streams on a reporting server failed with the error `reportingUnsupported`. ([#3905](https://github.com/ripple/rippled/pull/3905))
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **Clarify the safety of NetClock::time_point arithmetic**: * NetClock::rep is uint32_t and can be error-prone when used with subtraction. * Fixes [#3656](https://github.com/ripple/rippled/pull/3656)
|
||||
- **Fix out-of-bounds reserve, and some minor optimizations**
|
||||
- **Fix nested locks in ValidatorSite**
|
||||
- **Fix clang warnings about copies vs references**
|
||||
- **Fix reporting mode build issue**
|
||||
- **Fix potential deadlock in Validator sites**
|
||||
- **Use libsecp256k1 instead of OpenSSL for key derivation**: The deterministic key derivation code was still using calls to OpenSSL. This replaces the OpenSSL-based routines with new libsecp256k1-based implementations
|
||||
- **Improve NodeStore to ShardStore imports**: This runs the import process in a background thread while preventing online_delete from removing ledgers pending import
|
||||
- **Simplify SHAMapItem construction**: The existing class offered several constructors which were mostly unnecessary. This eliminates all existing constructors and introduces a single new one, taking a `Slice`. The internal buffer is switched from `std::vector` to `Buffer` to save a minimum of 8 bytes (plus the buffer slack that is inherent in `std::vector`) per SHAMapItem instance.
|
||||
- **Redesign stoppable objects**: Stoppable is no longer an abstract base class, but a pattern, modeled after the well-understood `std::thread`. The immediate benefits are less code, less synchronization, less runtime work, and (subjectively) more readable code. The end goal is to adhere to RAII in our object design, and this is one necessary step on that path.
|
||||
|
||||
## Version 1.7.3
|
||||
|
||||
This is the 1.7.3 release of `rippled`, the reference implementation of the XRP Ledger protocol. This release addresses an OOB memory read identified by Guido Vranken, as well as an unrelated issue identified by the Ripple C++ team that could result in incorrect use of SLEs. Additionally, this version also introduces the `NegativeUNL` amendment, which corresponds to the feature which was introduced with the 1.6.0 release.
|
||||
|
||||
## Action Required
|
||||
|
||||
If you operate an XRP Ledger server, then you should upgrade to version 1.7.3 at your earliest convenience to mitigate the issues addressed in this hotfix. If a sufficient majority of servers on the network upgrade, the `NegativeUNL` amendment may gain a majority, at which point a two week activation countdown will begin. If the `NegativeUNL` amendment activates, servers running versions of `rippled` prior to 1.7.3 will become [amendment blocked](https://xrpl.org/amendments.html#amendment-blocked).
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **Improve SLE usage in check cashing**: Fixes a situation which could result in the incorrect use of SLEs.
|
||||
- **Address OOB in base58 decoder**: Corrects a technical flaw that could allow an out-of-bounds memory read in the Base58 decoder.
|
||||
- **Add `NegativeUNL` as a supported amendment**: Introduces an amendment for the Negative UNL feature introduced in `rippled` 1.6.0.
|
||||
|
||||
## Version 1.7.2
|
||||
|
||||
This the 1.7.2 release of rippled, the reference server implementation of the XRP Ledger protocol. This release protects against the security issue [CVE-2021-3499](https://www.openssl.org/news/secadv/20210325.txt) affecting OpenSSL, adds an amendment to fix an issue with small offers not being properly removed from order books in some cases, and includes various other minor fixes.
|
||||
Version 1.7.2 supersedes version 1.7.1 and adds fixes for more issues that were discovered during the release cycle.
|
||||
|
||||
## Action Required
|
||||
|
||||
This release introduces a new amendment to the XRP Ledger protocol: `fixRmSmallIncreasedQOffers`. This amendments is now open for voting according to the XRP Ledger's amendment process, which enables protocol changes following two weeks of >80% support from trusted validators.
|
||||
If you operate an XRP Ledger server, then you should upgrade to version 1.7.2 within two weeks, to ensure service continuity. The exact time that protocol changes take effect depends on the voting decisions of the decentralized network.
|
||||
If you operate an XRP Ledger validator, please learn more about this amendment so you can make informed decisions about how your validator votes. If you take no action, your validator begins voting in favor of any new amendments as soon as it has been upgraded.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **fixRmSmallIncreasedQOffers Amendment:** This amendment fixes an issue where certain small offers can be left at the tip of an order book without being consumed or removed when appropriate and causes some payments and Offers to fail when they should have succeeded [(#3827)](https://github.com/ripple/rippled/pull/3827).
|
||||
- **Adjust OpenSSL defaults and mitigate CVE-2021-3499:** Prior to this fix, servers compiled against a vulnerable version of OpenSSL could have a crash triggered by a malicious network connection. This fix disables renegotiation support in OpenSSL so that the rippled server is not vulnerable to this bug regardless of the OpenSSL version used to compile the server. This also removes support for deprecated TLS versions 1.0 and 1.1 and ciphers that are not part of TLS 1.2 [(#79e69da)](https://github.com/ripple/rippled/pull/3843/commits/79e69da3647019840dca49622621c3d88bc3883f).
|
||||
- **Support HTTP health check in reporting mode:** Enables the Health Check special method when running the server in the new Reporting Mode introduced in 1.7.0 [(9c8cadd)](https://github.com/ripple/rippled/pull/3843/commits/9c8caddc5a197bdd642556f8beb14f06d53cdfd3).
|
||||
- **Maintain compatibility for forwarded RPC responses:** Fixes a case in API responses from servers in Reporting Mode, where requests that were forwarded to a P2P-mode server would have the result field nested inside another result field [(8579eb0)](https://github.com/ripple/rippled/pull/3843/commits/8579eb0c191005022dcb20641444ab471e277f67).
|
||||
- **Add load_factor in reporting mode:** Adds a load_factor value to the server info method response when running the server in Reporting Mode so that the response is compatible with the format returned by servers in P2P mode (the default) [(430802c)](https://github.com/ripple/rippled/pull/3843/commits/430802c1cf6d4179f2249a30bfab9eff8e1fa748).
|
||||
- **Properly encode metadata from tx RPC command:** Fixes a problem where transaction metadata in the tx API method response would be in JSON format even when binary was requested [(7311629)](https://github.com/ripple/rippled/pull/3843/commits/73116297aa94c4acbfc74c2593d1aa2323b4cc52).
|
||||
- **Updates to Windows builds:** When building on Windows, use vcpkg 2021 by default and add compatibility with MSVC 2019 [(36fe196)](https://github.com/ripple/rippled/pull/3843/commits/36fe1966c3cd37f668693b5d9910fab59c3f8b1f), [(30fd458)](https://github.com/ripple/rippled/pull/3843/commits/30fd45890b1d3d5f372a2091d1397b1e8e29d2ca).
|
||||
|
||||
## Version 1.7.0
|
||||
|
||||
Ripple has released version 1.7.0 of `rippled`, the reference server implementation of the XRP Ledger protocol.
|
||||
This release [significantly improves memory usage](https://blog.ripplex.io/how-ripples-c-team-cut-rippleds-memory-footprint-down-to-size/), introduces a protocol amendment to allow out-of-order transaction execution with Tickets, and brings several other features and improvements.
|
||||
|
||||
## Upgrading (SPECIAL ACTION REQUIRED)
|
||||
If you use the precompiled binaries of rippled that Ripple publishes for supported platforms, please note that Ripple has renewed the GPG key used to sign these packages.
|
||||
If you are upgrading from a previous install, you must download and trust the renewed key. Automatic upgrades will not work until you have re-trusted the key.
|
||||
### Red Hat Enterprise Linux / CentOS
|
||||
|
||||
Perform a [manual upgrade](https://xrpl.org/update-rippled-manually-on-centos-rhel.html). When prompted, confirm that the key's fingerprint matches the following example, then press `y` to accept the updated key:
|
||||
|
||||
```
|
||||
$ sudo yum install rippled
|
||||
Loaded plugins: fastestmirror
|
||||
Loading mirror speeds from cached hostfile
|
||||
* base: mirror.web-ster.com
|
||||
* epel: mirrors.syringanetworks.net
|
||||
* extras: ftp.osuosl.org
|
||||
* updates: mirrors.vcea.wsu.edu
|
||||
ripple-nightly/signature | 650 B 00:00:00
|
||||
Retrieving key from https://repos.ripple.com/repos/rippled-rpm/nightly/repodata/repomd.xml.key
|
||||
Importing GPG key 0xCCAFD9A2:
|
||||
Userid : "TechOps Team at Ripple <techops+rippled@ripple.com>"
|
||||
Fingerprint: c001 0ec2 05b3 5a33 10dc 90de 395f 97ff ccaf d9a2
|
||||
From : https://repos.ripple.com/repos/rippled-rpm/nightly/repodata/repomd.xml.key
|
||||
Is this ok [y/N]: y
|
||||
```
|
||||
|
||||
### Ubuntu / Debian
|
||||
|
||||
Download and trust the updated public key, then perform a [manual upgrade](https://xrpl.org/update-rippled-manually-on-ubuntu.html) as follows:
|
||||
|
||||
```
|
||||
wget -q -O - "https://repos.ripple.com/repos/api/gpg/key/public" | \
|
||||
sudo apt-key add -
|
||||
sudo apt -y update
|
||||
sudo apt -y install rippled
|
||||
```
|
||||
|
||||
### New and Improved Features
|
||||
|
||||
- **Rework deferred node logic and async fetch behavior:** This change significantly improves ledger sync and fetch times while reducing memory consumption. (https://blog.ripplex.io/how-ripples-c-team-cut-rippleds-memory-footprint-down-to-size/)
|
||||
- **New Ticket feature:** Tickets are a mechanism to prepare and send certain transactions outside of the normal sequence order. This version reworks and completes the implementation for Tickets after more than 6 years of development. This feature is now open for voting as the newly-introduced `TicketBatch` amendment, which replaces the previously-proposed `Tickets` amendment. The specification for this change can be found at: [xrp-community/standards-drafts#16](https://github.com/xrp-community/standards-drafts/issues/16)
|
||||
- **Add Reporting Mode:** The server can be compiled to operate in a new mode that serves API requests for validated ledger data without connecting directly to the peer-to-peer network. (The server needs a gRPC connection to another server that is on the peer-to-peer network.) Reporting Mode servers can share access to ledger data via Apache Cassandra and PostgreSQL to more efficiently serve API requests while peer-to-peer servers specialize in broadcasting and processing transactions.
|
||||
- **Optimize relaying of validation and proposal messages:** Servers typically receive multiple copies of any given message from directly connected peers; in particular, consensus proposal and validation messages are often relayed with extremely high redundancy. For servers with several peers, this can cause redundant work. This commit introduces experimental code that attempts to optimize the relaying of proposals and validations by allowing servers to instruct their peers to "squelch" delivery of selected proposals and validations. This change is considered experimental at this time and is disabled by default because the functioning of the consensus network depends on messages propagating with high reliability through the constantly-changing peer-to-peer network. Server operators who wish to test the optimized code can enable it in their server config file.
|
||||
- **Report server domain to other servers:** Server operators now have the option to configure a domain name to be associated with their servers. The value is communicated to other servers and is also reported via the `server_info` API. The value is meant for third-party applications and tools to group servers together. For example, a tool that visualizes the network's topology can show how many servers are operated by different stakeholders. An operator can claim any domain, so tools should use the [xrp-ledger.toml file](https://xrpl.org/xrp-ledger-toml.html) to confirm that the domain also claims ownership of the servers.
|
||||
- **Improve handling of peers that aren't synced:** When evaluating the fitness and usefulness of an outbound peer, the code would incorrectly calculate the amount of time that the peer spent in a non-useful state. This release fixes the calculation and makes the timeout values configurable by server operators. Two new options are introduced in the 'overlay' stanza of the config file.
|
||||
- **Persist API-configured voting settings:** Previously, the amendments that a server would vote in support of or against could be configured both via the configuration file and via the ["feature" API method](https://xrpl.org/feature.html). Changes made in the configuration file were only loaded at server startup; changes made via the command line take effect immediately but were not persisted across restarts. Starting with this release, changes made via the API are saved to the wallet.db database file so that they persist even if the server is restarted.
|
||||
Amendment voting in the config file is deprecated. The first time the server starts with v1.7.0 or higher, it reads any amendment voting settings in the config file and saves the settings to the database; on later restarts the server prints a warning message and ignores the [amendments] and [veto_amendments] stanzas of the config file.
|
||||
Going forward, use the [feature method](https://xrpl.org/feature.html) to view and configure amendment votes. If you want to use the config file to configure amendment votes, add a line to the [rpc_startup] stanza such as the following:
|
||||
[rpc_startup]
|
||||
{ "command": "feature", "feature": "FlowSortStrands", "vetoed": true }
|
||||
- **Support UNLs with future effective dates:** Updates the format for the recommended validator list file format, allowing publishers to pre-publish the next recommended UNL while the current one is still valid. The server is still backwards compatible with the previous format, but the new format removes some uncertainty during the transition from one list to the next. Also, starting with this release, the server locks down and reports an error if it has no valid validator list. You can clear the error by loading a validator list from a file or by configuring a different UNL and restarting; the error also goes away on its own if the server is able to obtain a trusted validator list from the network (for example, after an network outage resolves itself).
|
||||
- **Improve manifest relaying:** Servers now propagate change messages for validators' ephemeral public keys ("manifests") on a best-effort basis, to make manifests more available throughout the peer-to-peer network. Previously, the server would only relay manifests from validators it trusts locally, which made it difficult to detect and track validators that are not broadly trusted.
|
||||
- **Implement ledger forward replay feature:** The server can now sync up to the network by "playing forward" transactions from a previously saved ledger until it catches up to the network. Compared with the default behavior of fetching the latest state and working backwards, forward replay can save time and bandwidth by reconstructing previous ledgers' state data rather than downloading the pre-calculated results from the network. As an added bonus, forward replay confirms that the rest of the network followed the same transaction processing rules as the local server when processing the intervening ledgers. This feature is considered experimental this time and can be enabled with an option in the config file.
|
||||
- **Make the transaction job queue limit adjustable:** The server uses a job queue to manage tasks, with limits on how many jobs of a particular type can be queued. The previously hard-coded limit associated with transactions is now configurable. Server operators can increase the number of transactions their server is able to queue, which may be useful if your server has a large memory capacity or you expect an influx of transactions. (https://github.com/ripple/rippled/issues/3556)
|
||||
- **Add public_key to the Validator List method response:** The [Validator List method](https://xrpl.org/validator-list.html) can be used to request a recommended validator list from a rippled instance. The response now includes the public key of the requested list. (https://github.com/ripple/rippled/issues/3392)
|
||||
- **Server operators can now configure maximum inbound and outbound peers separately:** The new `peers_in_max` and `peers_out_max` config options allow server operators to independently control the maximum number of inbound and outbound peers the server allows. [70c4ecc]
|
||||
- **Improvements to shard downloading:** Previously the download_shard command could only load shards over HTTPS. Compressed shards can now also be downloaded over plain HTTP. The server fully checks the data for integrity and consistency, so the encryption is not strictly necessary. When initiating multiple shard downloads, the server now returns an error if there is not enough space to store all the shards currently being downloaded.
|
||||
- **The manifest command is now public:** The manifest API method returns public information about a given validator. The required permissions have been changed so it is now part of the public API.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **Implement sticky DNS resolution for validator list retrieval:** When attempting to load a validator list from a configured site, attempt to reuse the last IP that was successfully used if that IP is still present in the DNS response. (https://github.com/ripple/rippled/issues/3494).
|
||||
- **Improve handling of RPC ledger_index argument:** You can now provide the `ledger_index` as a numeric string. This allows you to copy and use the numeric string `ledger_index` value returned by certain RPC commands. Previously you could only send native JSON numbers or shortcut strings such as "validated" in the `ledger_index` field. (https://github.com/ripple/rippled/issues/3533)
|
||||
- **Fix improper promotion of bool on return** [6968da1]
|
||||
- **Fix ledger sequence on copynode** [ef53197]
|
||||
- **Fix parsing of node public keys in `manifest` CLI:** The previous code attempts to validate the provided node public key using a function that assumes that the encoded public key is for an account. This causes the parsing to fail. This commit fixes #3317 (https://github.com/ripple/rippled/issues/3317) by letting the caller specify the type of the public key being checked.
|
||||
- **Fix idle peer timer:** Fixes a bug where a function to remove idle peers was called every second instead of every 4 seconds. #3754 (https://github.com/ripple/rippled/issues/3754)
|
||||
- **Add database counters:** Fix bug where DatabaseRotateImp::getBackend and ::sync utilized the writable backend without a lock. ::getBackend was replaced with ::getCounters.
|
||||
- **Improve online_delete configuration and DB tuning** [6e9051e]
|
||||
- **Improve handling of burst writes in NuDB database** ( https://github.com/ripple/rippled/pull/3662 )
|
||||
- **Fix excessive logging after disabling history shards.** Previously if you configured the server with a shard store, then disabled it, the server output excessive warning messages about the shard limit being exceeded.
|
||||
- **Fixed some issues with negotiating link compression.** ( https://github.com/ripple/rippled/pull/3705 )
|
||||
- **Fixed a potential thread deadlock with history sharding.** ( https://github.com/ripple/rippled/pull/3683 )
|
||||
- **Various fixes to typos and comments, refactoring, and build system improvements**
|
||||
|
||||
## Version 1.6.0
|
||||
|
||||
This release introduces several new features including changes to the XRP Ledger's consensus mechanism to make it even more robust in
|
||||
|
||||
@@ -24,7 +24,6 @@ declare -a manual_tests=(
|
||||
'ripple.consensus.ByzantineFailureSim'
|
||||
'ripple.consensus.DistributedValidators'
|
||||
'ripple.consensus.ScaleFreeSim'
|
||||
'ripple.ripple_data.digest'
|
||||
'ripple.tx.CrossingLimits'
|
||||
'ripple.tx.FindOversizeCross'
|
||||
'ripple.tx.Offer_manual'
|
||||
|
||||
@@ -95,8 +95,32 @@ fi
|
||||
mkdir -p "build/${BUILD_DIR}"
|
||||
pushd "build/${BUILD_DIR}"
|
||||
|
||||
# cleanup possible artifacts
|
||||
rm -fv CMakeFiles/CMakeOutput.log CMakeFiles/CMakeError.log
|
||||
# Clean up NIH directories which should be git repos, but aren't
|
||||
for nih_path in ${NIH_CACHE_ROOT}/*/*/*/src ${NIH_CACHE_ROOT}/*/*/src
|
||||
do
|
||||
for dir in lz4 snappy rocksdb
|
||||
do
|
||||
if [ -e ${nih_path}/${dir} -a \! -e ${nih_path}/${dir}/.git ]
|
||||
then
|
||||
ls -la ${nih_path}/${dir}*
|
||||
rm -rfv ${nih_path}/${dir}*
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
# generate
|
||||
${time} cmake ../.. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${CMAKE_EXTRA_ARGS}
|
||||
# Display the cmake output, to help with debugging if something fails
|
||||
for file in CMakeOutput.log CMakeError.log
|
||||
do
|
||||
if [ -f CMakeFiles/${file} ]
|
||||
then
|
||||
ls -l CMakeFiles/${file}
|
||||
cat CMakeFiles/${file}
|
||||
fi
|
||||
done
|
||||
# build
|
||||
export DESTDIR=$(pwd)/_INSTALLED_
|
||||
|
||||
@@ -136,15 +160,15 @@ else
|
||||
# ORDER matters here...sorted in approximately
|
||||
# descending execution time (longest running tests at top)
|
||||
declare -a manual_tests=(
|
||||
'ripple.ripple_data.digest'
|
||||
'ripple.ripple_data.reduce_relay_simulate'
|
||||
'ripple.tx.Offer_manual'
|
||||
'ripple.app.PayStrandAllPairs'
|
||||
'ripple.tx.CrossingLimits'
|
||||
'ripple.tx.PlumpBook'
|
||||
'ripple.app.Flow_manual'
|
||||
'ripple.tx.OversizeMeta'
|
||||
'ripple.consensus.DistributedValidators'
|
||||
'ripple.app.NoRippleCheckLimits'
|
||||
'ripple.ripple_data.compression'
|
||||
'ripple.NodeStore.Timing'
|
||||
'ripple.consensus.ByzantineFailureSim'
|
||||
'beast.chrono.abstract_clock'
|
||||
|
||||
@@ -2,6 +2,21 @@
|
||||
# some cached files create churn, so save them here for
|
||||
# later restoration before packing the cache
|
||||
set -eux
|
||||
clean_cache="travis_clean_cache"
|
||||
if [[ ! ( "${TRAVIS_JOB_NAME}" =~ "windows" || \
|
||||
"${TRAVIS_JOB_NAME}" =~ "prereq-keep" ) ]] && \
|
||||
( [[ "${TRAVIS_COMMIT_MESSAGE}" =~ "${clean_cache}" ]] || \
|
||||
( [[ -v TRAVIS_PULL_REQUEST_SHA && \
|
||||
"${TRAVIS_PULL_REQUEST_SHA}" != "" ]] && \
|
||||
git log -1 "${TRAVIS_PULL_REQUEST_SHA}" | grep -cq "${clean_cache}" -
|
||||
)
|
||||
)
|
||||
then
|
||||
find ${TRAVIS_HOME}/_cache -maxdepth 2 -type d
|
||||
rm -rf ${TRAVIS_HOME}/_cache
|
||||
mkdir -p ${TRAVIS_HOME}/_cache
|
||||
fi
|
||||
|
||||
pushd ${TRAVIS_HOME}
|
||||
if [ -f cache_ignore.tar ] ; then
|
||||
rm -f cache_ignore.tar
|
||||
|
||||
@@ -20,7 +20,7 @@ else
|
||||
if [[ -d "${VCPKG_DIR}" ]] ; then
|
||||
rm -rf "${VCPKG_DIR}"
|
||||
fi
|
||||
git clone --branch 2019.12 https://github.com/Microsoft/vcpkg.git ${VCPKG_DIR}
|
||||
git clone --branch 2021.04.30 https://github.com/Microsoft/vcpkg.git ${VCPKG_DIR}
|
||||
pushd ${VCPKG_DIR}
|
||||
BSARGS=()
|
||||
if [[ "$(uname)" == "Darwin" ]] ; then
|
||||
|
||||
246
bin/start_sync_stop.py
Normal file
246
bin/start_sync_stop.py
Normal file
@@ -0,0 +1,246 @@
|
||||
#!/usr/bin/env python
|
||||
"""A script to test rippled in an infinite loop of start-sync-stop.
|
||||
|
||||
- Requires Python 3.7+.
|
||||
- Can be stopped with SIGINT.
|
||||
- Has no dependencies outside the standard library.
|
||||
"""
|
||||
|
||||
import sys
|
||||
|
||||
assert sys.version_info.major == 3 and sys.version_info.minor >= 7
|
||||
|
||||
import argparse
|
||||
import asyncio
|
||||
import configparser
|
||||
import contextlib
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
from pathlib import Path
|
||||
import platform
|
||||
import subprocess
|
||||
import time
|
||||
import urllib.error
|
||||
import urllib.request
|
||||
|
||||
# Enable asynchronous subprocesses on Windows. The default changed in 3.8.
|
||||
# https://docs.python.org/3.7/library/asyncio-platforms.html#subprocess-support-on-windows
|
||||
if (platform.system() == 'Windows' and sys.version_info.major == 3
|
||||
and sys.version_info.minor < 8):
|
||||
asyncio.set_event_loop_policy(asyncio.WindowsProactorEventLoopPolicy())
|
||||
|
||||
DEFAULT_EXE = 'rippled'
|
||||
DEFAULT_CONFIGURATION_FILE = 'rippled.cfg'
|
||||
# Number of seconds to wait before forcefully terminating.
|
||||
PATIENCE = 120
|
||||
# Number of contiguous seconds in a sync state to be considered synced.
|
||||
DEFAULT_SYNC_DURATION = 60
|
||||
# Number of seconds between polls of state.
|
||||
DEFAULT_POLL_INTERVAL = 5
|
||||
SYNC_STATES = ('full', 'validating', 'proposing')
|
||||
|
||||
|
||||
def read_config(config_file):
|
||||
# strict = False: Allow duplicate keys, e.g. [rpc_startup].
|
||||
# allow_no_value = True: Allow keys with no values. Generally, these
|
||||
# instances use the "key" as the value, and the section name is the key,
|
||||
# e.g. [debug_logfile].
|
||||
# delimiters = ('='): Allow ':' as a character in Windows paths. Some of
|
||||
# our "keys" are actually values, and we don't want to split them on ':'.
|
||||
config = configparser.ConfigParser(
|
||||
strict=False,
|
||||
allow_no_value=True,
|
||||
delimiters=('='),
|
||||
)
|
||||
config.read(config_file)
|
||||
return config
|
||||
|
||||
|
||||
def to_list(value, separator=','):
|
||||
"""Parse a list from a delimited string value."""
|
||||
return [s.strip() for s in value.split(separator) if s]
|
||||
|
||||
|
||||
def find_log_file(config_file):
|
||||
"""Try to figure out what log file the user has chosen. Raises all kinds
|
||||
of exceptions if there is any possibility of ambiguity."""
|
||||
config = read_config(config_file)
|
||||
values = list(config['debug_logfile'].keys())
|
||||
if len(values) < 1:
|
||||
raise ValueError(
|
||||
f'no [debug_logfile] in configuration file: {config_file}')
|
||||
if len(values) > 1:
|
||||
raise ValueError(
|
||||
f'too many [debug_logfile] in configuration file: {config_file}')
|
||||
return values[0]
|
||||
|
||||
|
||||
def find_http_port(config_file):
|
||||
config = read_config(config_file)
|
||||
names = list(config['server'].keys())
|
||||
for name in names:
|
||||
server = config[name]
|
||||
if 'http' in to_list(server.get('protocol', '')):
|
||||
return int(server['port'])
|
||||
raise ValueError(f'no server in [server] for "http" protocol')
|
||||
|
||||
|
||||
@contextlib.asynccontextmanager
|
||||
async def rippled(exe=DEFAULT_EXE, config_file=DEFAULT_CONFIGURATION_FILE):
|
||||
"""A context manager for a rippled process."""
|
||||
# Start the server.
|
||||
process = await asyncio.create_subprocess_exec(
|
||||
str(exe),
|
||||
'--conf',
|
||||
str(config_file),
|
||||
stdout=subprocess.DEVNULL,
|
||||
stderr=subprocess.DEVNULL,
|
||||
)
|
||||
logging.info(f'rippled started with pid {process.pid}')
|
||||
try:
|
||||
yield process
|
||||
finally:
|
||||
# Ask it to stop.
|
||||
logging.info(f'asking rippled (pid: {process.pid}) to stop')
|
||||
start = time.time()
|
||||
process.terminate()
|
||||
|
||||
# Wait nicely.
|
||||
try:
|
||||
await asyncio.wait_for(process.wait(), PATIENCE)
|
||||
except asyncio.TimeoutError:
|
||||
# Ask the operating system to kill it.
|
||||
logging.warning(f'killing rippled ({process.pid})')
|
||||
try:
|
||||
process.kill()
|
||||
except ProcessLookupError:
|
||||
pass
|
||||
|
||||
code = await process.wait()
|
||||
end = time.time()
|
||||
logging.info(
|
||||
f'rippled stopped after {end - start:.1f} seconds with code {code}'
|
||||
)
|
||||
|
||||
|
||||
async def sync(
|
||||
port,
|
||||
*,
|
||||
duration=DEFAULT_SYNC_DURATION,
|
||||
interval=DEFAULT_POLL_INTERVAL,
|
||||
):
|
||||
"""Poll rippled on an interval until it has been synced for a duration."""
|
||||
start = time.perf_counter()
|
||||
while (time.perf_counter() - start) < duration:
|
||||
await asyncio.sleep(interval)
|
||||
|
||||
request = urllib.request.Request(
|
||||
f'http://127.0.0.1:{port}',
|
||||
data=json.dumps({
|
||||
'method': 'server_state'
|
||||
}).encode(),
|
||||
headers={'Content-Type': 'application/json'},
|
||||
)
|
||||
with urllib.request.urlopen(request) as response:
|
||||
try:
|
||||
body = json.loads(response.read())
|
||||
except urllib.error.HTTPError as cause:
|
||||
logging.warning(f'server_state returned not JSON: {cause}')
|
||||
start = time.perf_counter()
|
||||
continue
|
||||
|
||||
try:
|
||||
state = body['result']['state']['server_state']
|
||||
except KeyError as cause:
|
||||
logging.warning(f'server_state response missing key: {cause.key}')
|
||||
start = time.perf_counter()
|
||||
continue
|
||||
logging.info(f'server_state: {state}')
|
||||
if state not in SYNC_STATES:
|
||||
# Require a contiguous sync state.
|
||||
start = time.perf_counter()
|
||||
|
||||
|
||||
async def loop(test,
|
||||
*,
|
||||
exe=DEFAULT_EXE,
|
||||
config_file=DEFAULT_CONFIGURATION_FILE):
|
||||
"""
|
||||
Start-test-stop rippled in an infinite loop.
|
||||
|
||||
Moves log to a different file after each iteration.
|
||||
"""
|
||||
log_file = find_log_file(config_file)
|
||||
id = 0
|
||||
while True:
|
||||
logging.info(f'iteration: {id}')
|
||||
async with rippled(exe, config_file) as process:
|
||||
start = time.perf_counter()
|
||||
exited = asyncio.create_task(process.wait())
|
||||
tested = asyncio.create_task(test())
|
||||
# Try to sync as long as the process is running.
|
||||
done, pending = await asyncio.wait(
|
||||
{exited, tested},
|
||||
return_when=asyncio.FIRST_COMPLETED,
|
||||
)
|
||||
if done == {exited}:
|
||||
code = exited.result()
|
||||
logging.warning(
|
||||
f'server halted for unknown reason with code {code}')
|
||||
else:
|
||||
assert done == {tested}
|
||||
assert tested.exception() is None
|
||||
end = time.perf_counter()
|
||||
logging.info(f'synced after {end - start:.0f} seconds')
|
||||
os.replace(log_file, f'debug.{id}.log')
|
||||
id += 1
|
||||
|
||||
|
||||
logging.basicConfig(
|
||||
format='%(asctime)s %(levelname)-8s %(message)s',
|
||||
level=logging.INFO,
|
||||
datefmt='%Y-%m-%d %H:%M:%S',
|
||||
)
|
||||
|
||||
parser = argparse.ArgumentParser(
|
||||
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
|
||||
parser.add_argument(
|
||||
'rippled',
|
||||
type=Path,
|
||||
nargs='?',
|
||||
default=DEFAULT_EXE,
|
||||
help='Path to rippled.',
|
||||
)
|
||||
parser.add_argument(
|
||||
'--conf',
|
||||
type=Path,
|
||||
default=DEFAULT_CONFIGURATION_FILE,
|
||||
help='Path to configuration file.',
|
||||
)
|
||||
parser.add_argument(
|
||||
'--duration',
|
||||
type=int,
|
||||
default=DEFAULT_SYNC_DURATION,
|
||||
help='Number of contiguous seconds required in a synchronized state.',
|
||||
)
|
||||
parser.add_argument(
|
||||
'--interval',
|
||||
type=int,
|
||||
default=DEFAULT_POLL_INTERVAL,
|
||||
help='Number of seconds to wait between polls of state.',
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
port = find_http_port(args.conf)
|
||||
|
||||
|
||||
def test():
|
||||
return sync(port, duration=args.duration, interval=args.interval)
|
||||
|
||||
|
||||
try:
|
||||
asyncio.run(loop(test, exe=args.rippled, config_file=args.conf))
|
||||
except KeyboardInterrupt:
|
||||
# Squelch the message. This is a normal mode of exit.
|
||||
pass
|
||||
10
cfg/initdb.sh
Executable file
10
cfg/initdb.sh
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Execute this script with a running Postgres server on the current host.
|
||||
# It should work with the most generic installation of Postgres,
|
||||
# and is necessary for rippled to store data in Postgres.
|
||||
|
||||
# usage: sudo -u postgres ./initdb.sh
|
||||
psql -c "CREATE USER rippled"
|
||||
psql -c "CREATE DATABASE rippled WITH OWNER = rippled"
|
||||
|
||||
@@ -13,15 +13,17 @@
|
||||
#
|
||||
# 4. HTTPS Client
|
||||
#
|
||||
# 5. Database
|
||||
# 5. Reporting Mode
|
||||
#
|
||||
# 6. Diagnostics
|
||||
# 6. Database
|
||||
#
|
||||
# 7. Voting
|
||||
# 7. Diagnostics
|
||||
#
|
||||
# 8. Misc Settings
|
||||
# 8. Voting
|
||||
#
|
||||
# 9. Example Settings
|
||||
# 9. Misc Settings
|
||||
#
|
||||
# 10. Example Settings
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
#
|
||||
@@ -198,9 +200,19 @@
|
||||
#
|
||||
# admin = [ IP, IP, IP, ... ]
|
||||
#
|
||||
# A comma-separated list of IP addresses.
|
||||
# A comma-separated list of IP addresses or subnets. Subnets
|
||||
# should be represented in "slash" notation, such as:
|
||||
# 10.0.0.0/8
|
||||
# 172.16.0.0/12
|
||||
# 192.168.0.0/16
|
||||
# Those examples are ipv4, but ipv6 is also supported.
|
||||
# When configuring subnets, the address must match the
|
||||
# underlying network address. Otherwise, the desired IP range is
|
||||
# ambiguous. For example, 10.1.2.3/24 has a network address of
|
||||
# 10.1.2.0. Therefore, that subnet should be configured as
|
||||
# 10.1.2.0/24.
|
||||
#
|
||||
# When set, grants administrative command access to the specified IP
|
||||
# When set, grants administrative command access to the specified
|
||||
# addresses. These commands may be issued over http, https, ws, or wss
|
||||
# if configured on the port. If not provided, the default is to not allow
|
||||
# administrative commands.
|
||||
@@ -231,9 +243,10 @@
|
||||
#
|
||||
# secure_gateway = [ IP, IP, IP, ... ]
|
||||
#
|
||||
# A comma-separated list of IP addresses.
|
||||
# A comma-separated list of IP addresses or subnets. See the
|
||||
# details for the "admin" option above.
|
||||
#
|
||||
# When set, allows the specified IP addresses to pass HTTP headers
|
||||
# When set, allows the specified addresses to pass HTTP headers
|
||||
# containing username and remote IP address for each session. If a
|
||||
# non-empty username is passed in this way, then resource controls
|
||||
# such as often resulting in "tooBusy" errors will be lifted. However,
|
||||
@@ -248,9 +261,9 @@
|
||||
# proxies. Since rippled trusts these hosts, they must be
|
||||
# responsible for properly authenticating the remote user.
|
||||
#
|
||||
# The same IP address cannot be used in both "admin" and "secure_gateway"
|
||||
# lists for the same port. In this case, rippled will abort with an error
|
||||
# message to the console shortly after startup
|
||||
# If some IP addresses are included for both "admin" and
|
||||
# "secure_gateway" connections, then they will be treated as
|
||||
# "admin" addresses.
|
||||
#
|
||||
# ssl_key = <filename>
|
||||
# ssl_cert = <filename>
|
||||
@@ -351,6 +364,14 @@
|
||||
# connection is no longer available.
|
||||
#
|
||||
#
|
||||
# [server_domain]
|
||||
#
|
||||
# domain name
|
||||
#
|
||||
# The domain under which a TOML file applicable to this server can be
|
||||
# found. A server may lie about its domain so the TOML should contain
|
||||
# a reference to this server by pubkey in the [nodes] array.
|
||||
#
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
#
|
||||
@@ -385,7 +406,7 @@
|
||||
#
|
||||
# [ips]
|
||||
# 192.168.0.1
|
||||
# 192.168.0.1 2459
|
||||
# 192.168.0.1 2459
|
||||
# r.ripple.com 51235
|
||||
#
|
||||
#
|
||||
@@ -453,6 +474,13 @@
|
||||
#
|
||||
#
|
||||
#
|
||||
# [max_transactions]
|
||||
#
|
||||
# Configure the maximum number of transactions to have in the job queue
|
||||
#
|
||||
# Must be a number between 100 and 1000, defaults to 250
|
||||
#
|
||||
#
|
||||
# [overlay]
|
||||
#
|
||||
# Controls settings related to the peer to peer overlay.
|
||||
@@ -474,6 +502,23 @@
|
||||
# single host from consuming all inbound slots. If the value is not
|
||||
# present the server will autoconfigure an appropriate limit.
|
||||
#
|
||||
# max_unknown_time = <number>
|
||||
#
|
||||
# The maximum amount of time, in seconds, that an outbound connection
|
||||
# is allowed to stay in the "unknown" tracking state. This option can
|
||||
# take any value between 300 and 1800 seconds, inclusive. If the option
|
||||
# is not present the server will autoconfigure an appropriate limit.
|
||||
#
|
||||
# The current default (which is subject to change) is 600 seconds.
|
||||
#
|
||||
# max_diverged_time = <number>
|
||||
#
|
||||
# The maximum amount of time, in seconds, that an outbound connection
|
||||
# is allowed to stay in the "diverged" tracking state. The option can
|
||||
# take any value between 60 and 900 seconds, inclusive. If the option
|
||||
# is not present the server will autoconfigure an appropriate limit.
|
||||
#
|
||||
# The current default (which is subject to change) is 300 seconds.
|
||||
#
|
||||
#
|
||||
# [transaction_queue] EXPERIMENTAL
|
||||
@@ -506,14 +551,6 @@
|
||||
# than the original transaction's fee, or meet the current open
|
||||
# ledger fee to be considered. Default: 25.
|
||||
#
|
||||
# multi_txn_percent = <number>
|
||||
#
|
||||
# If a client submits multiple transactions (different sequence
|
||||
# numbers), later transactions must pay a fee at least <number>
|
||||
# percent higher than the transaction with the previous sequence
|
||||
# number.
|
||||
# Default: -90.
|
||||
#
|
||||
# minimum_escalation_multiplier = <number>
|
||||
#
|
||||
# At ledger close time, the median fee level of the transactions
|
||||
@@ -583,39 +620,43 @@
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
#
|
||||
# 3. Ripple Protocol
|
||||
# 3. Protocol
|
||||
#
|
||||
#-------------------
|
||||
#
|
||||
# These settings affect the behavior of the server instance with respect
|
||||
# to Ripple payment protocol level activities such as validating and
|
||||
# closing ledgers or adjusting fees in response to server overloads.
|
||||
# to protocol level activities such as validating and closing ledgers
|
||||
# adjusting fees in response to server overloads.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# [relay_proposals]
|
||||
#
|
||||
# Controls the relaying behavior for proposals received by this server that
|
||||
# are issued by validators that are not on the server's UNL.
|
||||
# Controls the relay and processing behavior for proposals received by this
|
||||
# server that are issued by validators that are not on the server's UNL.
|
||||
#
|
||||
# Legal values are: "trusted" and "all". The default is "trusted".
|
||||
# Legal values are:
|
||||
# "all" - Relay and process all incoming proposals
|
||||
# "trusted" - Relay only trusted proposals, but locally process all
|
||||
# "drop_untrusted" - Relay only trusted proposals, do not process untrusted
|
||||
#
|
||||
# The default is "trusted".
|
||||
#
|
||||
#
|
||||
# [relay_validations]
|
||||
#
|
||||
# Controls the relaying behavior for validations received by this server that
|
||||
# are issued by validators that are not on the server's UNL.
|
||||
# Controls the relay and processing behavior for validations received by this
|
||||
# server that are issued by validators that are not on the server's UNL.
|
||||
#
|
||||
# Legal values are: "trusted" and "all". The default is "all".
|
||||
# Legal values are:
|
||||
# "all" - Relay and process all incoming validations
|
||||
# "trusted" - Relay only trusted validations, but locally process all
|
||||
# "drop_untrusted" - Relay only trusted validations, do not process untrusted
|
||||
#
|
||||
# The default is "all".
|
||||
#
|
||||
#
|
||||
# [node_size]
|
||||
#
|
||||
# Tunes the servers based on the expected load and available memory. Legal
|
||||
# sizes are "tiny", "small", "medium", "large", and "huge". We recommend
|
||||
# you start at the default and raise the setting if you have extra memory.
|
||||
# The default is "tiny".
|
||||
#
|
||||
#
|
||||
#
|
||||
@@ -745,9 +786,17 @@
|
||||
# [workers]
|
||||
#
|
||||
# Configures the number of threads for processing work submitted by peers
|
||||
# and clients. If not specified, then the value is automatically determined
|
||||
# by factors including the number of system processors and whether this
|
||||
# node is a validator.
|
||||
# and clients. If not specified, then the value is automatically set to the
|
||||
# number of processor threads plus 2 for networked nodes. Nodes running in
|
||||
# stand alone mode default to 1 worker.
|
||||
#
|
||||
# [io_workers]
|
||||
#
|
||||
# Configures the number of threads for processing raw inbound and outbound IO.
|
||||
#
|
||||
# [prefetch_workers]
|
||||
#
|
||||
# Configures the number of threads for performing nodestore prefetching.
|
||||
#
|
||||
#
|
||||
#
|
||||
@@ -769,6 +818,17 @@
|
||||
# to track a particular network.
|
||||
#
|
||||
#
|
||||
# [ledger_replay]
|
||||
#
|
||||
# 0 or 1.
|
||||
#
|
||||
# 0: Disable the ledger replay feature [default]
|
||||
# 1: Enable the ledger replay feature. With this feature enabled, when
|
||||
# acquiring a ledger from the network, a rippled node only downloads
|
||||
# the ledger header and the transactions instead of the whole ledger.
|
||||
# And the ledger is built by applying the transactions to the parent
|
||||
# ledger.
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
#
|
||||
# 4. HTTPS Client
|
||||
@@ -809,18 +869,135 @@
|
||||
# certificates that the server will accept for verifying HTTP servers.
|
||||
# Used only for outbound HTTPS client connections.
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
#
|
||||
# 5. Reporting Mode
|
||||
#
|
||||
#------------
|
||||
#
|
||||
# rippled has an optional operating mode called Reporting Mode. In Reporting
|
||||
# Mode, rippled does not connect to the peer to peer network. Instead, rippled
|
||||
# will continuously extract data from one or more rippled servers that are
|
||||
# connected to the peer to peer network (referred to as an ETL source).
|
||||
# Reporting mode servers will forward RPC requests that require access to the
|
||||
# peer to peer network (submit, fee, etc) to an ETL source.
|
||||
#
|
||||
# [reporting] Settings for Reporting Mode. If and only if this section is
|
||||
# present, rippled will start in reporting mode. This section
|
||||
# contains a list of ETL source names, and key-value pairs. The
|
||||
# ETL source names each correspond to a configuration file
|
||||
# section; the names must match exactly. The key-value pairs are
|
||||
# optional.
|
||||
#
|
||||
#
|
||||
# [<name>]
|
||||
#
|
||||
# A series of key/value pairs that specify an ETL source.
|
||||
#
|
||||
# source_ip = <IP-address>
|
||||
#
|
||||
# Required. IP address of the ETL source. Can also be a DNS record.
|
||||
#
|
||||
# source_ws_port = <number>
|
||||
#
|
||||
# Required. Port on which ETL source is accepting unencrypted websocket
|
||||
# connections.
|
||||
#
|
||||
# source_grpc_port = <number>
|
||||
#
|
||||
# Required for ETL. Port on which ETL source is accepting gRPC requests.
|
||||
# If this option is ommitted, this ETL source cannot actually be used for
|
||||
# ETL; the Reporting Mode server can still forward RPCs to this ETL
|
||||
# source, but cannot extract data from this ETL source.
|
||||
#
|
||||
#
|
||||
# Key-value pairs (all optional):
|
||||
#
|
||||
# read_only Valid values: 0, 1. Default is 0. If set to 1, the server
|
||||
# will start in strict read-only mode, and will not perform
|
||||
# ETL. The server will still handle RPC requests, and will
|
||||
# still forward RPC requests that require access to the p2p
|
||||
# network.
|
||||
#
|
||||
# start_sequence
|
||||
# Sequence of first ledger to extract if the database is empty.
|
||||
# ETL extracts ledgers in order. If this setting is absent and
|
||||
# the database is empty, ETL will start with the next ledger
|
||||
# validated by the network. If this setting is present and the
|
||||
# database is not empty, an exception is thrown.
|
||||
#
|
||||
# num_markers Degree of parallelism used during the initial ledger
|
||||
# download. Only used if the database is empty. Valid values
|
||||
# are 1-256. A higher degree of parallelism results in a
|
||||
# faster download, but puts more load on the ETL source.
|
||||
# Default is 2.
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# [reporting]
|
||||
# etl_source1
|
||||
# etl_source2
|
||||
# read_only=0
|
||||
# start_sequence=32570
|
||||
# num_markers=8
|
||||
#
|
||||
# [etl_source1]
|
||||
# source_ip=1.2.3.4
|
||||
# source_ws_port=6005
|
||||
# source_grpc_port=50051
|
||||
#
|
||||
# [etl_source2]
|
||||
# source_ip=5.6.7.8
|
||||
# source_ws_port=6005
|
||||
# source_grpc_port=50051
|
||||
#
|
||||
# Minimal Example:
|
||||
#
|
||||
# [reporting]
|
||||
# etl_source1
|
||||
#
|
||||
# [etl_source1]
|
||||
# source_ip=1.2.3.4
|
||||
# source_ws_port=6005
|
||||
# source_grpc_port=50051
|
||||
#
|
||||
#
|
||||
# Notes:
|
||||
#
|
||||
# Reporting Mode requires Postgres (instead of SQLite). The Postgres
|
||||
# connection info is specified under the [ledger_tx_tables] config section;
|
||||
# see the Database section for further documentation.
|
||||
#
|
||||
# Each ETL source specified must have gRPC enabled (by adding a [port_grpc]
|
||||
# section to the config). It is recommended to add a secure_gateway entry to
|
||||
# the gRPC section, in order to bypass the server's rate limiting.
|
||||
# This section needs to be added to the config of the ETL source, not
|
||||
# the config of the reporting node. In the example below, the
|
||||
# reporting server is running at 127.0.0.1. Multiple IPs can be
|
||||
# specified in secure_gateway via a comma separated list.
|
||||
#
|
||||
# [port_grpc]
|
||||
# ip = 0.0.0.0
|
||||
# port = 50051
|
||||
# secure_gateway = 127.0.0.1
|
||||
#
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
#
|
||||
# 5. Database
|
||||
# 6. Database
|
||||
#
|
||||
#------------
|
||||
#
|
||||
# rippled creates 4 SQLite database to hold bookkeeping information
|
||||
# about transactions, local credentials, and various other things.
|
||||
# It also creates the NodeDB, which holds all the objects that
|
||||
# make up the current and historical ledgers.
|
||||
# make up the current and historical ledgers. In Reporting Mode, rippled
|
||||
# uses a Postgres database instead of SQLite.
|
||||
#
|
||||
# The simplest way to work with Postgres is to install it locally.
|
||||
# When it is running, execute the initdb.sh script in the current
|
||||
# directory as: sudo -u postgres ./initdb.sh
|
||||
# This will create the rippled user and an empty database of the same name.
|
||||
#
|
||||
# The size of the NodeDB grows in proportion to the amount of new data and the
|
||||
# amount of historical data (a configurable setting) so the performance of the
|
||||
@@ -862,12 +1039,58 @@
|
||||
# keeping full history is not advised, and using online delete is
|
||||
# recommended.
|
||||
#
|
||||
# Required keys:
|
||||
# path Location to store the database (all types)
|
||||
# type = Cassandra
|
||||
#
|
||||
# Optional keys:
|
||||
# Apache Cassandra is an open-source, distributed key-value store - see
|
||||
# https://cassandra.apache.org/ for more details.
|
||||
#
|
||||
# These keys are possible for any type of backend:
|
||||
# Cassandra is an alternative backend to be used only with Reporting Mode.
|
||||
# See the Reporting Mode section for more details about Reporting Mode.
|
||||
#
|
||||
# Required keys for NuDB and RocksDB:
|
||||
#
|
||||
# path Location to store the database
|
||||
#
|
||||
# Required keys for Cassandra:
|
||||
#
|
||||
# contact_points IP of a node in the Cassandra cluster
|
||||
#
|
||||
# port CQL Native Transport Port
|
||||
#
|
||||
# secure_connect_bundle
|
||||
# Absolute path to a secure connect bundle. When using
|
||||
# a secure connect bundle, contact_points and port are
|
||||
# not required.
|
||||
#
|
||||
# keyspace Name of Cassandra keyspace to use
|
||||
#
|
||||
# table_name Name of table in above keyspace to use
|
||||
#
|
||||
# Optional keys
|
||||
#
|
||||
# cache_size Size of cache for database records. Default is 16384.
|
||||
# Setting this value to 0 will use the default value.
|
||||
#
|
||||
# cache_age Length of time in minutes to keep database records
|
||||
# cached. Default is 5 minutes. Setting this value to
|
||||
# 0 will use the default value.
|
||||
#
|
||||
# Note: if neither cache_size nor cache_age is
|
||||
# specified, the cache for database records will not
|
||||
# be created. If only one of cache_size or cache_age
|
||||
# is specified, the cache will be created using the
|
||||
# default value for the unspecified parameter.
|
||||
#
|
||||
# Note: the cache will not be created if online_delete
|
||||
# is specified, or if shards are used.
|
||||
#
|
||||
# fast_load Boolean. If set, load the last persisted ledger
|
||||
# from disk upon process start before syncing to
|
||||
# the network. This is likely to improve performance
|
||||
# if sufficient IOPS capacity is available.
|
||||
# Default 0.
|
||||
#
|
||||
# Optional keys for NuDB or RocksDB:
|
||||
#
|
||||
# earliest_seq The default is 32570 to match the XRP ledger
|
||||
# network's earliest allowed sequence. Alternate
|
||||
@@ -929,6 +1152,25 @@
|
||||
# delete process is unable to finish.
|
||||
# Default is unset.
|
||||
#
|
||||
# Optional keys for Cassandra:
|
||||
#
|
||||
# username Username to use if Cassandra cluster requires
|
||||
# authentication
|
||||
#
|
||||
# password Password to use if Cassandra cluster requires
|
||||
# authentication
|
||||
#
|
||||
# max_requests_outstanding
|
||||
# Limits the maximum number of concurrent database
|
||||
# writes. Default is 10 million. For slower clusters,
|
||||
# large numbers of concurrent writes can overload the
|
||||
# cluster. Setting this option can help eliminate
|
||||
# write timeouts and other write errors due to the
|
||||
# cluster being overloaded.
|
||||
# io_threads
|
||||
# Set the number of IO threads used by the
|
||||
# Cassandra driver. Defaults to 4.
|
||||
#
|
||||
# Notes:
|
||||
# The 'node_db' entry configures the primary, persistent storage.
|
||||
#
|
||||
@@ -958,7 +1200,18 @@
|
||||
# Required keys:
|
||||
# path Location to store the database
|
||||
#
|
||||
# max_size_gb Maximum disk space the database will utilize (in gigabytes)
|
||||
# Optional keys:
|
||||
# max_historical_shards
|
||||
# The maximum number of historical shards
|
||||
# to store.
|
||||
#
|
||||
# [historical_shard_paths] Additional storage paths for the Shard Database (optional)
|
||||
#
|
||||
# Format (without spaces):
|
||||
# One or more lines, each expressing a full path for storing historical shards:
|
||||
# /mnt/disk1
|
||||
# /mnt/disk2
|
||||
# ...
|
||||
#
|
||||
# [sqlite] Tuning settings for the SQLite databases (optional)
|
||||
#
|
||||
@@ -968,7 +1221,7 @@
|
||||
# ...
|
||||
#
|
||||
# Example 1:
|
||||
# sync_level=low
|
||||
# safety_level=low
|
||||
#
|
||||
# Example 2:
|
||||
# journal_mode=off
|
||||
@@ -1039,12 +1292,45 @@
|
||||
# This setting may not be combined with the
|
||||
# "safety_level" setting.
|
||||
#
|
||||
# [ledger_tx_tables] (optional)
|
||||
#
|
||||
# conninfo Info for connecting to Postgres. Format is
|
||||
# postgres://[username]:[password]@[ip]/[database].
|
||||
# The database and user must already exist. If this
|
||||
# section is missing and rippled is running in
|
||||
# Reporting Mode, rippled will connect as the
|
||||
# user running rippled to a database with the
|
||||
# same name. On Linux and Mac OS X, the connection
|
||||
# will take place using the server's UNIX domain
|
||||
# socket. On Windows, through the localhost IP
|
||||
# address. Default is empty.
|
||||
#
|
||||
# use_tx_tables Valid values: 1, 0
|
||||
# The default is 1 (true). Determines whether to use
|
||||
# the SQLite transaction database. If set to 0,
|
||||
# rippled will not write to the transaction database,
|
||||
# and will reject tx, account_tx and tx_history RPCs.
|
||||
# In Reporting Mode, this setting is ignored.
|
||||
#
|
||||
# max_connections Valid values: any positive integer up to 64 bit
|
||||
# storage length. This configures the maximum
|
||||
# number of concurrent connections to postgres.
|
||||
# Default is the maximum possible value to
|
||||
# fit in a 64 bit integer.
|
||||
#
|
||||
# timeout Number of seconds after which idle postgres
|
||||
# connections are discconnected. If set to 0,
|
||||
# connections never timeout. Default is 600.
|
||||
#
|
||||
#
|
||||
# remember_ip Value values: 1, 0
|
||||
# Default is 1 (true). Whether to cache host and
|
||||
# port connection settings.
|
||||
#
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
#
|
||||
# 6. Diagnostics
|
||||
# 7. Diagnostics
|
||||
#
|
||||
#---------------
|
||||
#
|
||||
@@ -1118,7 +1404,7 @@
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
#
|
||||
# 7. Voting
|
||||
# 8. Voting
|
||||
#
|
||||
#----------
|
||||
#
|
||||
@@ -1169,10 +1455,30 @@
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
#
|
||||
# 8. Misc Settings
|
||||
# 9. Misc Settings
|
||||
#
|
||||
#-----------------
|
||||
#
|
||||
# [node_size]
|
||||
#
|
||||
# Tunes the servers based on the expected load and available memory. Legal
|
||||
# sizes are "tiny", "small", "medium", "large", and "huge". We recommend
|
||||
# you start at the default and raise the setting if you have extra memory.
|
||||
#
|
||||
# The code attempts to automatically determine the appropriate size for
|
||||
# this parameter based on the amount of RAM and the number of execution
|
||||
# cores available to the server. The current decision matrix is:
|
||||
#
|
||||
# | | Cores |
|
||||
# |---------|------------------------|
|
||||
# | RAM | 1 | 2 or 3 | ≥ 4 |
|
||||
# |---------|------|--------|--------|
|
||||
# | < ~8GB | tiny | tiny | tiny |
|
||||
# | < ~12GB | tiny | small | small |
|
||||
# | < ~16GB | tiny | small | medium |
|
||||
# | < ~24GB | tiny | small | large |
|
||||
# | < ~32GB | tiny | small | huge |
|
||||
#
|
||||
# [signing_support]
|
||||
#
|
||||
# Specifies whether the server will accept "sign" and "sign_for" commands
|
||||
@@ -1246,9 +1552,18 @@
|
||||
# Enable or disable access to /vl requests. Default is '1' which
|
||||
# enables access.
|
||||
#
|
||||
# [beta_rpc_api]
|
||||
#
|
||||
# 0 or 1.
|
||||
#
|
||||
# 0: Disable the beta API version for JSON-RPC and WebSocket [default]
|
||||
# 1: Enable the beta API version for testing. The beta API version
|
||||
# contains breaking changes that require a new API version number.
|
||||
# They are not ready for public consumption.
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
#
|
||||
# 9. Example Settings
|
||||
# 10. Example Settings
|
||||
#
|
||||
#--------------------
|
||||
#
|
||||
@@ -1324,6 +1639,7 @@ protocol = ws
|
||||
#[port_grpc]
|
||||
#port = 50051
|
||||
#ip = 0.0.0.0
|
||||
#secure_gateway = 127.0.0.1
|
||||
|
||||
#[port_ws_public]
|
||||
#port = 6005
|
||||
@@ -1332,9 +1648,6 @@ protocol = ws
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
[node_size]
|
||||
medium
|
||||
|
||||
# This is primary persistent datastore for rippled. This includes transaction
|
||||
# metadata, account states, and ledger headers. Helpful information can be
|
||||
# found at https://xrpl.org/capacity-planning.html#node-db-type
|
||||
@@ -1360,11 +1673,28 @@ advisory_delete=0
|
||||
# https://xrpl.org/history-sharding.html
|
||||
#[shard_db]
|
||||
#path=/var/lib/rippled/db/shards/nudb
|
||||
#max_size_gb=500
|
||||
#max_historical_shards=50
|
||||
#
|
||||
# This optional section can be configured with a list
|
||||
# of paths to use for storing historical shards. Each
|
||||
# path must correspond to a unique filesystem.
|
||||
#[historical_shard_paths]
|
||||
#/path/1
|
||||
#/path/2
|
||||
|
||||
[database_path]
|
||||
/var/lib/rippled/db
|
||||
|
||||
|
||||
# To use Postgres, uncomment this section and fill in the appropriate connection
|
||||
# info. Postgres can only be used in Reporting Mode.
|
||||
# To disable writing to the transaction database, uncomment this section, and
|
||||
# set use_tx_tables=0
|
||||
# [ledger_tx_tables]
|
||||
# conninfo = postgres://[username]:[password]@[ip]/[database]
|
||||
# use_tx_tables=1
|
||||
|
||||
|
||||
# This needs to be an absolute directory reference, not a relative one.
|
||||
# Modify this value as required.
|
||||
[debug_logfile]
|
||||
@@ -1398,3 +1728,15 @@ validators.txt
|
||||
# set to ssl_verify to 0.
|
||||
[ssl_verify]
|
||||
1
|
||||
|
||||
|
||||
# To run in Reporting Mode, uncomment this section and fill in the appropriate
|
||||
# connection info for one or more ETL sources.
|
||||
# [reporting]
|
||||
# etl_source
|
||||
#
|
||||
#
|
||||
# [etl_source]
|
||||
# source_grpc_port=50051
|
||||
# source_ws_port=6005
|
||||
# source_ip=127.0.0.1
|
||||
|
||||
1703
cfg/rippled-reporting.cfg
Normal file
1703
cfg/rippled-reporting.cfg
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,12 +1,11 @@
|
||||
#
|
||||
# Default validators.txt
|
||||
#
|
||||
# A list of domains to bootstrap a nodes UNLs or for clients to indirectly
|
||||
# locate IPs to contact the Ripple network.
|
||||
# This file is located in the same folder as your rippled.cfg file
|
||||
# and defines which validators your server trusts not to collude.
|
||||
#
|
||||
# This file is UTF-8 with Dos, UNIX, or Mac style end of lines.
|
||||
# This file is UTF-8 with DOS, UNIX, or Mac style line endings.
|
||||
# Blank lines and lines starting with a '#' are ignored.
|
||||
# All other lines should be hankos or domain names.
|
||||
#
|
||||
#
|
||||
#
|
||||
@@ -25,11 +24,10 @@
|
||||
#
|
||||
# List of URIs serving lists of recommended validators.
|
||||
#
|
||||
# The latest list of recommended validator sites can be
|
||||
# obtained from https://ripple.com/ripple.txt
|
||||
#
|
||||
# Examples:
|
||||
# https://vl.ripple.com
|
||||
# https://vl.coil.com
|
||||
# https://vl.xrplf.org
|
||||
# http://127.0.0.1:8000
|
||||
# file:///etc/opt/ripple/vl.txt
|
||||
#
|
||||
@@ -41,13 +39,9 @@
|
||||
# publisher key.
|
||||
# Validator list keys should be hex-encoded.
|
||||
#
|
||||
# The latest list of recommended validator keys can be
|
||||
# obtained from https://ripple.com/ripple.txt
|
||||
#
|
||||
# Examples:
|
||||
# ed499d732bded01504a7407c224412ef550cc1ade638a4de4eb88af7c36cb8b282
|
||||
# 0202d3f36a801349f3be534e3f64cfa77dede6e1b6310a0b48f40f20f955cec945
|
||||
# 02dd8b7075f64d77d9d2bdb88da364f29fcd975f9ea6f21894abcc7564efda8054
|
||||
# ED2677ABFFD1B33AC6FBC3062B71F1E8397C1505E1C42C64D11AD1B28FF73F4734
|
||||
# ED307A760EE34F2D0CAA103377B1969117C38B8AA0AA1E2A24DAC1F32FC97087ED
|
||||
#
|
||||
|
||||
# The default validator list publishers that the rippled instance
|
||||
@@ -61,11 +55,15 @@
|
||||
|
||||
[validator_list_sites]
|
||||
https://vl.ripple.com
|
||||
https://vl.xrplf.org
|
||||
|
||||
[validator_list_keys]
|
||||
#vl.ripple.com
|
||||
ED2677ABFFD1B33AC6FBC3062B71F1E8397C1505E1C42C64D11AD1B28FF73F4734
|
||||
# vl.xrplf.org
|
||||
ED45D1840EE724BE327ABE9146503D5848EFD5F38B6D5FEDE71E80ACCE5E6E738B
|
||||
|
||||
# To use the XRP test network (see https://ripple.com/build/xrp-test-net/),
|
||||
# To use the test network (see https://xrpl.org/connect-your-rippled-to-the-xrp-test-net.html),
|
||||
# use the following configuration instead:
|
||||
#
|
||||
# [validator_list_sites]
|
||||
|
||||
88
docs/0010-ledger-replay/README.md
Normal file
88
docs/0010-ledger-replay/README.md
Normal file
@@ -0,0 +1,88 @@
|
||||
# Ledger Replay
|
||||
|
||||
`LedgerReplayer` is a new `Stoppable` for replaying ledgers.
|
||||
Patterned after two other `Stoppable`s under `JobQueue`---`InboundLedgers`
|
||||
and `InboundTransactions`---it acts like a factory for creating
|
||||
state-machine workers, and a network message demultiplexer for those workers.
|
||||
Think of these workers like asynchronous functions.
|
||||
Like functions, they each take a set of parameters.
|
||||
The `Stoppable` memoizes these functions. It maintains a table for each
|
||||
worker type, mapping sets of arguments to the worker currently working
|
||||
on that argument set.
|
||||
Whenever the `Stoppable` is asked to construct a worker, it first searches its
|
||||
table to see if there is an existing worker with the same or overlapping
|
||||
argument set.
|
||||
If one exists, then it is used. If not, then a new one is created,
|
||||
initialized, and added to the table.
|
||||
|
||||
For `LedgerReplayer`, there are three worker types: `LedgerReplayTask`,
|
||||
`SkipListAcquire`, and `LedgerDeltaAcquire`.
|
||||
Each is derived from `TimeoutCounter` to give it a timeout.
|
||||
For `LedgerReplayTask`, the parameter set
|
||||
is {reason, finish ledger ID, number of ledgers}. For `SkipListAcquire` and
|
||||
`LedgerDeltaAcquire`, there is just one parameter: a ledger ID.
|
||||
|
||||
Each `Stoppable` has an entry point. For `LedgerReplayer`, it is `replay`.
|
||||
`replay` creates two workers: a `LedgerReplayTask` and a `SkipListAcquire`.
|
||||
`LedgerDeltaAcquire`s are created in the callback for when the skip list
|
||||
returns.
|
||||
|
||||
For `SkipListAcquire` and `LedgerDeltaAcquire`, initialization fires off the
|
||||
underlying asynchronous network request and starts the timeout. The argument
|
||||
set identifying the worker is included in the network request, and copied to
|
||||
the network response. `SkipListAcquire` sends a request for a proof path for
|
||||
the skip list of the desired ledger. `LedgerDeltaAcquire` sends a request for
|
||||
the transaction set of the desired ledger.
|
||||
|
||||
`LedgerReplayer` is also a network message demultiplexer.
|
||||
When a response arrives for a request that was sent by a `SkipListAcquire` or
|
||||
`LedgerDeltaAcquire` worker, the `Peer` object knows to send it to the
|
||||
`LedgerReplayer`, which looks up the worker waiting for that response based on
|
||||
the identifying argument set included in the response.
|
||||
|
||||
`LedgerReplayTask` may ask `InboundLedgers` to send requests to acquire
|
||||
the start ledger, but there is no way to attach a callback or be notified when
|
||||
the `InboundLedger` worker completes. All the responses for its messages will
|
||||
be directed to `InboundLedgers`, not `LedgerReplayer`. Instead,
|
||||
`LedgerReplayTask` checks whether the start ledger has arrived every time its
|
||||
timeout expires.
|
||||
|
||||
Like a promise, each worker keeps track of whether it is pending (`!isDone()`)
|
||||
or whether it has resolved successfully (`complete_ == true`) or unsuccessfully
|
||||
(`failed_ == true`). It will never exist in both resolved states at once, nor
|
||||
will it return to a pending state after reaching a resolved state.
|
||||
|
||||
Like promises, some workers can accept continuations to be called when they
|
||||
reach a resolved state, or immediately if they are already resolved.
|
||||
`SkipListAcquire` and `LedgerDeltaAcquire` both accept continuations of a type
|
||||
specific to their payload, both via a method named `addDataCallback()`. Continuations
|
||||
cannot be removed explicitly, but they are held by `std::weak_ptr` so they can
|
||||
be removed implicitly.
|
||||
|
||||
`LedgerReplayTask` is simultaneously:
|
||||
|
||||
1. an asynchronous function,
|
||||
1. a continuation to one `SkipListAcquire` asynchronous function,
|
||||
1. a continuation to zero or more `LedgerDeltaAcquire` asynchronous functions, and
|
||||
1. a continuation to its own timeout.
|
||||
|
||||
Each of these roles corresponds to different entry points:
|
||||
|
||||
1. `init()`
|
||||
1. the callback added to `SkipListAcquire`, which calls `updateSkipList(...)` or `cancel()`
|
||||
1. the callback added to `LedgerDeltaAcquire`, which calls `deltaReady(...)` or `cancel()`
|
||||
1. `onTimer()`
|
||||
|
||||
Each of these entry points does something unique to that entry point. They
|
||||
either (a) transition `LedgerReplayTask` to a terminal failed resolved state
|
||||
(`cancel()` and `onTimer()`) or (b) try to make progress toward the successful
|
||||
resolved state. `init()` and `updateSkipList(...)` call `trigger()` while
|
||||
`deltaReady(...)` calls `tryAdvance()`. There's a similarity between this
|
||||
pattern and the way coroutines are implemented, where every yield saves the spot
|
||||
in the code where it left off and every resume jumps back to that spot.
|
||||
|
||||
### Sequence Diagram
|
||||

|
||||
|
||||
### Class Diagram
|
||||

|
||||
BIN
docs/0010-ledger-replay/ledger_replay_classes.png
Normal file
BIN
docs/0010-ledger-replay/ledger_replay_classes.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 90 KiB |
98
docs/0010-ledger-replay/ledger_replay_classes.puml
Normal file
98
docs/0010-ledger-replay/ledger_replay_classes.puml
Normal file
@@ -0,0 +1,98 @@
|
||||
@startuml
|
||||
|
||||
class TimeoutCounter {
|
||||
#app_ : Application&
|
||||
}
|
||||
|
||||
TimeoutCounter o-- "1" Application
|
||||
': app_
|
||||
|
||||
Stoppable <.. Application
|
||||
|
||||
class Application {
|
||||
-m_ledgerReplayer : uptr<LedgerReplayer>
|
||||
-m_inboundLedgers : uptr<InboundLedgers>
|
||||
}
|
||||
|
||||
Application *-- "1" LedgerReplayer
|
||||
': m_ledgerReplayer
|
||||
Application *-- "1" InboundLedgers
|
||||
': m_inboundLedgers
|
||||
|
||||
Stoppable <.. InboundLedgers
|
||||
Application "1" --o InboundLedgers
|
||||
': app_
|
||||
|
||||
class InboundLedgers {
|
||||
-app_ : Application&
|
||||
}
|
||||
|
||||
Stoppable <.. LedgerReplayer
|
||||
InboundLedgers "1" --o LedgerReplayer
|
||||
': inboundLedgers_
|
||||
Application "1" --o LedgerReplayer
|
||||
': app_
|
||||
|
||||
class LedgerReplayer {
|
||||
+createDeltas(LedgerReplayTask)
|
||||
-app_ : Application&
|
||||
-inboundLedgers_ : InboundLedgers&
|
||||
-tasks_ : vector<sptr<LedgerReplayTask>>
|
||||
-deltas_ : hash_map<u256, wptr<LedgerDeltaAcquire>>
|
||||
-skipLists_ : hash_map<u256, wptr<SkipListAcquire>>
|
||||
}
|
||||
|
||||
LedgerReplayer *-- LedgerReplayTask
|
||||
': tasks_
|
||||
LedgerReplayer o-- LedgerDeltaAcquire
|
||||
': deltas_
|
||||
LedgerReplayer o-- SkipListAcquire
|
||||
': skipLists_
|
||||
|
||||
TimeoutCounter <.. LedgerReplayTask
|
||||
InboundLedgers "1" --o LedgerReplayTask
|
||||
': inboundLedgers_
|
||||
LedgerReplayer "1" --o LedgerReplayTask
|
||||
': replayer_
|
||||
|
||||
class LedgerReplayTask {
|
||||
-inboundLedgers_ : InboundLedgers&
|
||||
-replayer_ : LedgerReplayer&
|
||||
-skipListAcquirer_ : sptr<SkipListAcquire>
|
||||
-deltas_ : vector<sptr<LedgerDeltaAcquire>>
|
||||
+addDelta(sptr<LedgerDeltaAcquire>)
|
||||
}
|
||||
|
||||
LedgerReplayTask *-- "1" SkipListAcquire
|
||||
': skipListAcquirer_
|
||||
LedgerReplayTask *-- LedgerDeltaAcquire
|
||||
': deltas_
|
||||
|
||||
TimeoutCounter <.. SkipListAcquire
|
||||
InboundLedgers "1" --o SkipListAcquire
|
||||
': inboundLedgers_
|
||||
LedgerReplayer "1" --o SkipListAcquire
|
||||
': replayer_
|
||||
LedgerReplayTask --o SkipListAcquire : implicit via callback
|
||||
|
||||
class SkipListAcquire {
|
||||
+addDataCallback(callback)
|
||||
-inboundLedgers_ : InboundLedgers&
|
||||
-replayer_ : LedgerReplayer&
|
||||
-dataReadyCallbacks_ : vector<callback>
|
||||
}
|
||||
|
||||
TimeoutCounter <.. LedgerDeltaAcquire
|
||||
InboundLedgers "1" --o LedgerDeltaAcquire
|
||||
': inboundLedgers_
|
||||
LedgerReplayer "1" --o LedgerDeltaAcquire
|
||||
': replayer_
|
||||
LedgerReplayTask --o LedgerDeltaAcquire : implicit via callback
|
||||
|
||||
class LedgerDeltaAcquire {
|
||||
+addDataCallback(callback)
|
||||
-inboundLedgers_ : InboundLedgers&
|
||||
-replayer_ : LedgerReplayer&
|
||||
-dataReadyCallbacks_ : vector<callback>
|
||||
}
|
||||
@enduml
|
||||
BIN
docs/0010-ledger-replay/ledger_replay_sequence.png
Normal file
BIN
docs/0010-ledger-replay/ledger_replay_sequence.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 121 KiB |
85
docs/0010-ledger-replay/ledger_replay_sequence.puml
Normal file
85
docs/0010-ledger-replay/ledger_replay_sequence.puml
Normal file
@@ -0,0 +1,85 @@
|
||||
@startuml
|
||||
|
||||
autoactivate on
|
||||
|
||||
' participant app as "Application"
|
||||
participant peer as "Peer"
|
||||
participant lr as "LedgerReplayer"
|
||||
participant lrt as "LedgerReplayTask"
|
||||
participant sla as "SkipListAcquire"
|
||||
participant lda as "LedgerDeltaAcquire"
|
||||
|
||||
[-> lr : replay(finishId, numLedgers)
|
||||
lr -> sla : make_shared(finishHash)
|
||||
return skipList
|
||||
lr -> lrt : make_shared(skipList)
|
||||
return task
|
||||
lr -> sla : init(numPeers=1)
|
||||
sla -> sla : trigger(numPeers=1)
|
||||
sla -> peer : sendRequest(ProofPathRequest)
|
||||
return
|
||||
return
|
||||
return
|
||||
lr -> lrt : init()
|
||||
lrt -> sla : addDataCallback(callback)
|
||||
return
|
||||
return
|
||||
deactivate lr
|
||||
|
||||
[-> peer : onMessage(ProofPathResponse)
|
||||
peer -> lr : gotSkipList(ledgerHeader, item)
|
||||
lr -> sla : processData(ledgerSeq, item)
|
||||
sla -> sla : onSkipListAcquired(skipList, ledgerSeq)
|
||||
sla -> sla : notify()
|
||||
note over sla: call the callbacks added by\naddDataCallback(callback).
|
||||
sla -> lrt : callback(ledgerId)
|
||||
lrt -> lrt : updateSkipList(ledgerId, ledgerSeq, skipList)
|
||||
lrt -> lr : createDeltas(this)
|
||||
loop
|
||||
lr -> lda : make_shared(ledgerId, ledgerSeq)
|
||||
return delta
|
||||
lr -> lrt : addDelta(delta)
|
||||
lrt -> lda : addDataCallback(callback)
|
||||
return
|
||||
return
|
||||
lr -> lda : init(numPeers=1)
|
||||
lda -> lda : trigger(numPeers=1)
|
||||
lda -> peer : sendRequest(ReplayDeltaRequest)
|
||||
return
|
||||
return
|
||||
return
|
||||
end
|
||||
return
|
||||
return
|
||||
return
|
||||
return
|
||||
return
|
||||
return
|
||||
deactivate peer
|
||||
|
||||
[-> peer : onMessage(ReplayDeltaResponse)
|
||||
peer -> lr : gotReplayDelta(ledgerHeader)
|
||||
lr -> lda : processData(ledgerHeader, txns)
|
||||
lda -> lda : notify()
|
||||
note over lda: call the callbacks added by\naddDataCallback(callback).
|
||||
lda -> lrt : callback(ledgerId)
|
||||
lrt -> lrt : deltaReady(ledgerId)
|
||||
lrt -> lrt : tryAdvance()
|
||||
loop as long as child can be built
|
||||
lrt -> lda : tryBuild(parent)
|
||||
lda -> lda : onLedgerBuilt()
|
||||
note over lda
|
||||
Schedule a job to store the built ledger.
|
||||
end note
|
||||
return
|
||||
return child
|
||||
end
|
||||
return
|
||||
return
|
||||
return
|
||||
return
|
||||
return
|
||||
deactivate peer
|
||||
|
||||
|
||||
@enduml
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
Consensus is the task of reaching agreement within a distributed system in the
|
||||
presence of faulty or even malicious participants. This document outlines the
|
||||
[Ripple Consensus Algorithm](https://ripple.com/files/ripple/consensus/whitepaper.pdf)
|
||||
[XRP Ledger Consensus Algorithm](https://arxiv.org/abs/1802.07242)
|
||||
as implemented in [rippled](https://github.com/ripple/rippled), but
|
||||
focuses on its utility as a generic consensus algorithm independent of the
|
||||
detailed mechanics of the Ripple Consensus Ledger. Most notably, the algorithm
|
||||
@@ -469,7 +469,7 @@ struct Ledger
|
||||
// Whether the ledger's close time was a non-trivial consensus result
|
||||
bool closeAgree() const;
|
||||
|
||||
// The close time resolution used in determing the close time
|
||||
// The close time resolution used in determining the close time
|
||||
NetClock::duration closeTimeResolution() const;
|
||||
|
||||
// The (effective) close time, based on the closeTimeResolution
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
# Extras
|
||||
|
||||
These are not part of the official public Beast interface but they are used by the tests and some third party programs.
|
||||
@@ -1,170 +0,0 @@
|
||||
//
|
||||
// Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#ifndef BEAST_DOC_DEBUG_HPP
|
||||
#define BEAST_DOC_DEBUG_HPP
|
||||
|
||||
namespace beast {
|
||||
|
||||
#if BEAST_DOXYGEN
|
||||
|
||||
/// doc type (documentation debug helper)
|
||||
using doc_type = int;
|
||||
|
||||
/// doc enum (documentation debug helper)
|
||||
enum doc_enum
|
||||
{
|
||||
/// One (documentation debug helper)
|
||||
one,
|
||||
|
||||
/// Two (documentation debug helper)
|
||||
two
|
||||
};
|
||||
|
||||
/// doc enum class (documentation debug helper)
|
||||
enum class doc_enum_class : unsigned
|
||||
{
|
||||
/// one (documentation debug helper)
|
||||
one,
|
||||
|
||||
/// two (documentation debug helper)
|
||||
two
|
||||
};
|
||||
|
||||
/// doc func (documentation debug helper)
|
||||
void doc_func();
|
||||
|
||||
/// doc class (documentation debug helper)
|
||||
struct doc_class
|
||||
{
|
||||
/// doc class member func (documentation debug helper)
|
||||
void func();
|
||||
};
|
||||
|
||||
/// (documentation debug helper)
|
||||
namespace nested {
|
||||
|
||||
/// doc type (documentation debug helper)
|
||||
using nested_doc_type = int;
|
||||
|
||||
/// doc enum (documentation debug helper)
|
||||
enum nested_doc_enum
|
||||
{
|
||||
/// One (documentation debug helper)
|
||||
one,
|
||||
|
||||
/// Two (documentation debug helper)
|
||||
two
|
||||
};
|
||||
|
||||
/// doc enum class (documentation debug helper)
|
||||
enum class nested_doc_enum_class : unsigned
|
||||
{
|
||||
/// one (documentation debug helper)
|
||||
one,
|
||||
|
||||
/// two (documentation debug helper)
|
||||
two
|
||||
};
|
||||
|
||||
/// doc func (documentation debug helper)
|
||||
void nested_doc_func();
|
||||
|
||||
/// doc class (documentation debug helper)
|
||||
struct nested_doc_class
|
||||
{
|
||||
/// doc class member func (documentation debug helper)
|
||||
void func();
|
||||
};
|
||||
|
||||
} // nested
|
||||
|
||||
/** This is here to help troubleshoot doc/reference.xsl problems
|
||||
|
||||
Embedded references:
|
||||
|
||||
@li type @ref doc_type
|
||||
|
||||
@li enum @ref doc_enum
|
||||
|
||||
@li enum item @ref doc_enum::one
|
||||
|
||||
@li enum_class @ref doc_enum_class
|
||||
|
||||
@li enum_class item @ref doc_enum_class::one
|
||||
|
||||
@li func @ref doc_func
|
||||
|
||||
@li class @ref doc_class
|
||||
|
||||
@li class func @ref doc_class::func
|
||||
|
||||
@li nested type @ref nested::nested_doc_type
|
||||
|
||||
@li nested enum @ref nested::nested_doc_enum
|
||||
|
||||
@li nested enum item @ref nested::nested_doc_enum::one
|
||||
|
||||
@li nested enum_class @ref nested::nested_doc_enum_class
|
||||
|
||||
@li nested enum_class item @ref nested::nested_doc_enum_class::one
|
||||
|
||||
@li nested func @ref nested::nested_doc_func
|
||||
|
||||
@li nested class @ref nested::nested_doc_class
|
||||
|
||||
@li nested class func @ref nested::nested_doc_class::func
|
||||
*/
|
||||
void doc_debug();
|
||||
|
||||
namespace nested {
|
||||
|
||||
/** This is here to help troubleshoot doc/reference.xsl problems
|
||||
|
||||
Embedded references:
|
||||
|
||||
@li type @ref doc_type
|
||||
|
||||
@li enum @ref doc_enum
|
||||
|
||||
@li enum item @ref doc_enum::one
|
||||
|
||||
@li enum_class @ref doc_enum_class
|
||||
|
||||
@li enum_class item @ref doc_enum_class::one
|
||||
|
||||
@li func @ref doc_func
|
||||
|
||||
@li class @ref doc_class
|
||||
|
||||
@li class func @ref doc_class::func
|
||||
|
||||
@li nested type @ref nested_doc_type
|
||||
|
||||
@li nested enum @ref nested_doc_enum
|
||||
|
||||
@li nested enum item @ref nested_doc_enum::one
|
||||
|
||||
@li nested enum_class @ref nested_doc_enum_class
|
||||
|
||||
@li nested enum_class item @ref nested_doc_enum_class::one
|
||||
|
||||
@li nested func @ref nested_doc_func
|
||||
|
||||
@li nested class @ref nested_doc_class
|
||||
|
||||
@li nested class func @ref nested_doc_class::func
|
||||
*/
|
||||
void nested_doc_debug();
|
||||
|
||||
} // nested
|
||||
|
||||
#endif
|
||||
|
||||
} // beast
|
||||
|
||||
#endif
|
||||
@@ -68,7 +68,6 @@ RCLConsensus::RCLConsensus(
|
||||
journal)
|
||||
, consensus_(clock, adaptor_, journal)
|
||||
, j_(journal)
|
||||
|
||||
{
|
||||
}
|
||||
|
||||
@@ -86,22 +85,37 @@ RCLConsensus::Adaptor::Adaptor(
|
||||
, localTxs_(localTxs)
|
||||
, inboundTransactions_{inboundTransactions}
|
||||
, j_(journal)
|
||||
, nodeID_{validatorKeys.nodeID}
|
||||
, valPublic_{validatorKeys.publicKey}
|
||||
, valSecret_{validatorKeys.secretKey}
|
||||
, validatorKeys_(validatorKeys)
|
||||
, valCookie_{rand_int<std::uint64_t>(
|
||||
1,
|
||||
std::numeric_limits<std::uint64_t>::max())}
|
||||
, nUnlVote_(nodeID_, j_)
|
||||
, nUnlVote_(validatorKeys_.nodeID, j_)
|
||||
{
|
||||
assert(valCookie_ != 0);
|
||||
|
||||
JLOG(j_.info()) << "Consensus engine started"
|
||||
<< " (Node: " << to_string(nodeID_)
|
||||
<< ", Cookie: " << valCookie_ << ")";
|
||||
JLOG(j_.info()) << "Consensus engine started (cookie: " +
|
||||
std::to_string(valCookie_) + ")";
|
||||
|
||||
if (validatorKeys_.nodeID != beast::zero)
|
||||
{
|
||||
std::stringstream ss;
|
||||
|
||||
JLOG(j_.info()) << "Validator identity: "
|
||||
<< toBase58(
|
||||
TokenType::NodePublic,
|
||||
validatorKeys_.masterPublicKey);
|
||||
|
||||
if (validatorKeys_.masterPublicKey != validatorKeys_.publicKey)
|
||||
{
|
||||
JLOG(j_.debug())
|
||||
<< "Validator ephemeral signing key: "
|
||||
<< toBase58(TokenType::NodePublic, validatorKeys_.publicKey)
|
||||
<< " (seq: " << std::to_string(validatorKeys_.sequence) << ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
boost::optional<RCLCxLedger>
|
||||
std::optional<RCLCxLedger>
|
||||
RCLConsensus::Adaptor::acquireLedger(LedgerHash const& hash)
|
||||
{
|
||||
// we need to switch the ledger we're working from
|
||||
@@ -117,14 +131,12 @@ RCLConsensus::Adaptor::acquireLedger(LedgerHash const& hash)
|
||||
acquiringLedger_ = hash;
|
||||
|
||||
app_.getJobQueue().addJob(
|
||||
jtADVANCE,
|
||||
"getConsensusLedger",
|
||||
[id = hash, &app = app_](Job&) {
|
||||
jtADVANCE, "getConsensusLedger", [id = hash, &app = app_]() {
|
||||
app.getInboundLedgers().acquire(
|
||||
id, 0, InboundLedger::Reason::CONSENSUS);
|
||||
});
|
||||
}
|
||||
return boost::none;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
assert(!built->open() && built->isImmutable());
|
||||
@@ -157,7 +169,7 @@ RCLConsensus::Adaptor::share(RCLCxPeerPos const& peerPos)
|
||||
auto const sig = peerPos.signature();
|
||||
prop.set_signature(sig.data(), sig.size());
|
||||
|
||||
app_.overlay().relay(prop, peerPos.suppressionID());
|
||||
app_.overlay().relay(prop, peerPos.suppressionID(), peerPos.publicKey());
|
||||
}
|
||||
|
||||
void
|
||||
@@ -173,8 +185,8 @@ RCLConsensus::Adaptor::share(RCLCxTx const& tx)
|
||||
msg.set_status(protocol::tsNEW);
|
||||
msg.set_receivetimestamp(
|
||||
app_.timeKeeper().now().time_since_epoch().count());
|
||||
app_.overlay().foreach(send_always(
|
||||
std::make_shared<Message>(msg, protocol::mtTRANSACTION)));
|
||||
static std::set<Peer::id_t> skip{};
|
||||
app_.overlay().relay(tx.id(), msg, skip);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -184,10 +196,9 @@ RCLConsensus::Adaptor::share(RCLCxTx const& tx)
|
||||
void
|
||||
RCLConsensus::Adaptor::propose(RCLCxPeerPos::Proposal const& proposal)
|
||||
{
|
||||
JLOG(j_.trace()) << "We propose: "
|
||||
<< (proposal.isBowOut()
|
||||
? std::string("bowOut")
|
||||
: ripple::to_string(proposal.position()));
|
||||
JLOG(j_.trace()) << (proposal.isBowOut() ? "We bow out: " : "We propose: ")
|
||||
<< ripple::to_string(proposal.prevLedger()) << " -> "
|
||||
<< ripple::to_string(proposal.position());
|
||||
|
||||
protocol::TMProposeSet prop;
|
||||
|
||||
@@ -197,8 +208,8 @@ RCLConsensus::Adaptor::propose(RCLCxPeerPos::Proposal const& proposal)
|
||||
proposal.prevLedger().begin(), proposal.prevLedger().size());
|
||||
prop.set_proposeseq(proposal.proposeSeq());
|
||||
prop.set_closetime(proposal.closeTime().time_since_epoch().count());
|
||||
|
||||
prop.set_nodepubkey(valPublic_.data(), valPublic_.size());
|
||||
prop.set_nodepubkey(
|
||||
validatorKeys_.publicKey.data(), validatorKeys_.publicKey.size());
|
||||
|
||||
auto signingHash = sha512Half(
|
||||
HashPrefix::proposal,
|
||||
@@ -207,7 +218,8 @@ RCLConsensus::Adaptor::propose(RCLCxPeerPos::Proposal const& proposal)
|
||||
proposal.prevLedger(),
|
||||
proposal.position());
|
||||
|
||||
auto sig = signDigest(valPublic_, valSecret_, signingHash);
|
||||
auto sig = signDigest(
|
||||
validatorKeys_.publicKey, validatorKeys_.secretKey, signingHash);
|
||||
|
||||
prop.set_signature(sig.data(), sig.size());
|
||||
|
||||
@@ -216,7 +228,7 @@ RCLConsensus::Adaptor::propose(RCLCxPeerPos::Proposal const& proposal)
|
||||
proposal.prevLedger(),
|
||||
proposal.proposeSeq(),
|
||||
proposal.closeTime(),
|
||||
valPublic_,
|
||||
validatorKeys_.publicKey,
|
||||
sig);
|
||||
|
||||
app_.getHashRouter().addSuppression(suppression);
|
||||
@@ -230,14 +242,14 @@ RCLConsensus::Adaptor::share(RCLTxSet const& txns)
|
||||
inboundTransactions_.giveSet(txns.id(), txns.map_, false);
|
||||
}
|
||||
|
||||
boost::optional<RCLTxSet>
|
||||
std::optional<RCLTxSet>
|
||||
RCLConsensus::Adaptor::acquireTxSet(RCLTxSet::ID const& setId)
|
||||
{
|
||||
if (auto txns = inboundTransactions_.getSet(setId, true))
|
||||
{
|
||||
return RCLTxSet{std::move(txns)};
|
||||
}
|
||||
return boost::none;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
bool
|
||||
@@ -315,9 +327,8 @@ RCLConsensus::Adaptor::onClose(
|
||||
Serializer s(2048);
|
||||
tx.first->add(s);
|
||||
initialSet->addItem(
|
||||
SHAMapItem(tx.first->getTransactionID(), std::move(s)),
|
||||
true,
|
||||
false);
|
||||
SHAMapNodeType::tnTRANSACTION_NM,
|
||||
SHAMapItem(tx.first->getTransactionID(), s.slice()));
|
||||
}
|
||||
|
||||
// Add pseudo-transactions to the set
|
||||
@@ -379,7 +390,7 @@ RCLConsensus::Adaptor::onClose(
|
||||
setHash,
|
||||
closeTime,
|
||||
app_.timeKeeper().closeTime(),
|
||||
nodeID_}};
|
||||
validatorKeys_.nodeID}};
|
||||
}
|
||||
|
||||
void
|
||||
@@ -410,9 +421,7 @@ RCLConsensus::Adaptor::onAccept(
|
||||
Json::Value&& consensusJson)
|
||||
{
|
||||
app_.getJobQueue().addJob(
|
||||
jtACCEPT,
|
||||
"acceptLedger",
|
||||
[=, cj = std::move(consensusJson)](auto&) mutable {
|
||||
jtACCEPT, "acceptLedger", [=, cj = std::move(consensusJson)]() mutable {
|
||||
// Note that no lock is held or acquired during this job.
|
||||
// This is because generic Consensus guarantees that once a ledger
|
||||
// is accepted, the consensus results and capture by reference state
|
||||
@@ -621,7 +630,7 @@ RCLConsensus::Adaptor::doAccept(
|
||||
std::lock(lock, sl);
|
||||
|
||||
auto const lastVal = ledgerMaster_.getValidatedLedger();
|
||||
boost::optional<Rules> rules;
|
||||
std::optional<Rules> rules;
|
||||
if (lastVal)
|
||||
rules.emplace(*lastVal, app_.config().features);
|
||||
else
|
||||
@@ -790,9 +799,9 @@ RCLConsensus::Adaptor::validate(
|
||||
|
||||
auto v = std::make_shared<STValidation>(
|
||||
lastValidationTime_,
|
||||
valPublic_,
|
||||
valSecret_,
|
||||
nodeID_,
|
||||
validatorKeys_.publicKey,
|
||||
validatorKeys_.secretKey,
|
||||
validatorKeys_.nodeID,
|
||||
[&](STValidation& v) {
|
||||
v.setFieldH256(sfLedgerHash, ledger.id());
|
||||
v.setFieldH256(sfConsensusHash, txns.id());
|
||||
@@ -845,16 +854,16 @@ RCLConsensus::Adaptor::validate(
|
||||
}
|
||||
});
|
||||
|
||||
auto const serialized = v->getSerialized();
|
||||
|
||||
// suppress it if we receive it
|
||||
app_.getHashRouter().addSuppression(
|
||||
sha512Half(makeSlice(v->getSerialized())));
|
||||
app_.getHashRouter().addSuppression(sha512Half(makeSlice(serialized)));
|
||||
|
||||
handleNewValidation(app_, v, "local");
|
||||
|
||||
// Broadcast to all our peers:
|
||||
Blob validation = v->getSerialized();
|
||||
protocol::TMValidation val;
|
||||
val.set_validation(&validation[0], validation.size());
|
||||
val.set_validation(serialized.data(), serialized.size());
|
||||
app_.overlay().broadcast(val);
|
||||
|
||||
// Publish to all our subscribers:
|
||||
@@ -926,7 +935,7 @@ RCLConsensus::gotTxSet(NetClock::time_point const& now, RCLTxSet const& txSet)
|
||||
void
|
||||
RCLConsensus::simulate(
|
||||
NetClock::time_point const& now,
|
||||
boost::optional<std::chrono::milliseconds> consensusDelay)
|
||||
std::optional<std::chrono::milliseconds> consensusDelay)
|
||||
{
|
||||
std::lock_guard _{mutex_};
|
||||
consensus_.simulate(now, consensusDelay);
|
||||
@@ -948,9 +957,9 @@ RCLConsensus::Adaptor::preStartRound(
|
||||
{
|
||||
// We have a key, we do not want out of sync validations after a restart
|
||||
// and are not amendment blocked.
|
||||
validating_ = valPublic_.size() != 0 &&
|
||||
validating_ = validatorKeys_.publicKey.size() != 0 &&
|
||||
prevLgr.seq() >= app_.getMaxDisallowedLedger() &&
|
||||
!app_.getOPs().isAmendmentBlocked();
|
||||
!app_.getOPs().isBlocked();
|
||||
|
||||
// If we are not running in standalone mode and there's a configured UNL,
|
||||
// check to make sure that it's not expired.
|
||||
@@ -1021,7 +1030,7 @@ RCLConsensus::Adaptor::laggards(
|
||||
bool
|
||||
RCLConsensus::Adaptor::validator() const
|
||||
{
|
||||
return !valPublic_.empty();
|
||||
return !validatorKeys_.publicKey.empty();
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -63,9 +63,8 @@ class RCLConsensus
|
||||
InboundTransactions& inboundTransactions_;
|
||||
beast::Journal const j_;
|
||||
|
||||
NodeID const nodeID_;
|
||||
PublicKey const valPublic_;
|
||||
SecretKey const valSecret_;
|
||||
// If the server is validating, the necessary keying information:
|
||||
ValidatorKeys const& validatorKeys_;
|
||||
|
||||
// A randomly selected non-zero value used to tag our validations
|
||||
std::uint64_t const valCookie_;
|
||||
@@ -200,7 +199,7 @@ class RCLConsensus
|
||||
@param hash The ID/hash of the ledger acquire
|
||||
@return Optional ledger, will be seated if we locally had the ledger
|
||||
*/
|
||||
boost::optional<RCLCxLedger>
|
||||
std::optional<RCLCxLedger>
|
||||
acquireLedger(LedgerHash const& hash);
|
||||
|
||||
/** Share the given proposal with all peers
|
||||
@@ -227,7 +226,7 @@ class RCLConsensus
|
||||
@param setId The transaction set ID associated with the proposal
|
||||
@return Optional set of transactions, seated if available.
|
||||
*/
|
||||
boost::optional<RCLTxSet>
|
||||
std::optional<RCLTxSet>
|
||||
acquireTxSet(RCLTxSet::ID const& setId);
|
||||
|
||||
/** Whether the open ledger has any transactions
|
||||
@@ -386,7 +385,7 @@ class RCLConsensus
|
||||
@param failedTxs Populate with transactions that we could not
|
||||
successfully apply.
|
||||
@return The newly built ledger
|
||||
*/
|
||||
*/
|
||||
RCLCxLedger
|
||||
buildLCL(
|
||||
RCLCxLedger const& previousLedger,
|
||||
@@ -507,7 +506,7 @@ public:
|
||||
void
|
||||
simulate(
|
||||
NetClock::time_point const& now,
|
||||
boost::optional<std::chrono::milliseconds> consensusDelay);
|
||||
std::optional<std::chrono::milliseconds> consensusDelay);
|
||||
|
||||
//! @see Consensus::proposal
|
||||
bool
|
||||
|
||||
@@ -109,7 +109,7 @@ public:
|
||||
Json::Value
|
||||
getJson() const
|
||||
{
|
||||
return ripple::getJson(*ledger_);
|
||||
return ripple::getJson({*ledger_, {}});
|
||||
}
|
||||
|
||||
/** The ledger instance.
|
||||
|
||||
@@ -113,12 +113,6 @@ private:
|
||||
Slice const& signature,
|
||||
uint256 const& suppress,
|
||||
Proposal&& proposal);
|
||||
|
||||
static char const*
|
||||
getCountedObjectName()
|
||||
{
|
||||
return "RCLCxPeerPos::Data";
|
||||
}
|
||||
};
|
||||
|
||||
std::shared_ptr<Data> data_;
|
||||
|
||||
@@ -91,7 +91,7 @@ public:
|
||||
insert(Tx const& t)
|
||||
{
|
||||
return map_->addItem(
|
||||
SHAMapItem{t.id(), t.tx_.peekData()}, true, false);
|
||||
SHAMapNodeType::tnTRANSACTION_NM, SHAMapItem{t.tx_});
|
||||
}
|
||||
|
||||
/** Remove a transaction from the set.
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#include <ripple/basics/StringUtilities.h>
|
||||
#include <ripple/basics/chrono.h>
|
||||
#include <ripple/consensus/LedgerTiming.h>
|
||||
#include <ripple/core/DatabaseCon.h>
|
||||
#include <ripple/core/JobQueue.h>
|
||||
#include <ripple/core/TimeKeeper.h>
|
||||
#include <memory>
|
||||
@@ -88,7 +87,8 @@ RCLValidatedLedger::operator[](Seq const& s) const -> ID
|
||||
|
||||
JLOG(j_.warn()) << "Unable to determine hash of ancestor seq=" << s
|
||||
<< " from ledger hash=" << ledgerID_
|
||||
<< " seq=" << ledgerSeq_;
|
||||
<< " seq=" << ledgerSeq_ << " (available: " << minSeq()
|
||||
<< "-" << seq() << ")";
|
||||
// Default ID that is less than all others
|
||||
return ID{0};
|
||||
}
|
||||
@@ -123,7 +123,7 @@ RCLValidationsAdaptor::now() const
|
||||
return app_.timeKeeper().closeTime();
|
||||
}
|
||||
|
||||
boost::optional<RCLValidatedLedger>
|
||||
std::optional<RCLValidatedLedger>
|
||||
RCLValidationsAdaptor::acquire(LedgerHash const& hash)
|
||||
{
|
||||
auto ledger = app_.getLedgerMaster().getLedgerByHash(hash);
|
||||
@@ -135,11 +135,11 @@ RCLValidationsAdaptor::acquire(LedgerHash const& hash)
|
||||
Application* pApp = &app_;
|
||||
|
||||
app_.getJobQueue().addJob(
|
||||
jtADVANCE, "getConsensusLedger", [pApp, hash](Job&) {
|
||||
jtADVANCE, "getConsensusLedger", [pApp, hash]() {
|
||||
pApp->getInboundLedgers().acquire(
|
||||
hash, 0, InboundLedger::Reason::CONSENSUS);
|
||||
});
|
||||
return boost::none;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
assert(!ledger->open() && ledger->isImmutable());
|
||||
@@ -154,11 +154,13 @@ handleNewValidation(
|
||||
std::shared_ptr<STValidation> const& val,
|
||||
std::string const& source)
|
||||
{
|
||||
PublicKey const& signingKey = val->getSignerPublic();
|
||||
uint256 const& hash = val->getLedgerHash();
|
||||
auto const& signingKey = val->getSignerPublic();
|
||||
auto const& hash = val->getLedgerHash();
|
||||
auto const seq = val->getFieldU32(sfLedgerSequence);
|
||||
|
||||
// Ensure validation is marked as trusted if signer currently trusted
|
||||
auto masterKey = app.validators().getTrustedKey(signingKey);
|
||||
|
||||
if (!val->isTrusted() && masterKey)
|
||||
val->setTrusted();
|
||||
|
||||
@@ -166,56 +168,52 @@ handleNewValidation(
|
||||
if (!masterKey)
|
||||
masterKey = app.validators().getListedKey(signingKey);
|
||||
|
||||
RCLValidations& validations = app.getValidations();
|
||||
beast::Journal const j = validations.adaptor().journal();
|
||||
|
||||
auto dmp = [&](beast::Journal::Stream s, std::string const& msg) {
|
||||
std::string id = toBase58(TokenType::NodePublic, signingKey);
|
||||
|
||||
if (masterKey)
|
||||
id += ":" + toBase58(TokenType::NodePublic, *masterKey);
|
||||
|
||||
s << (val->isTrusted() ? "trusted" : "untrusted") << " "
|
||||
<< (val->isFull() ? "full" : "partial") << " validation: " << hash
|
||||
<< " from " << id << " via " << source << ": " << msg << "\n"
|
||||
<< " [" << val->getSerializer().slice() << "]";
|
||||
};
|
||||
auto& validations = app.getValidations();
|
||||
|
||||
// masterKey is seated only if validator is trusted or listed
|
||||
if (masterKey)
|
||||
auto const outcome =
|
||||
validations.add(calcNodeID(masterKey.value_or(signingKey)), val);
|
||||
|
||||
if (outcome == ValStatus::current)
|
||||
{
|
||||
ValStatus const outcome = validations.add(calcNodeID(*masterKey), val);
|
||||
auto const seq = val->getFieldU32(sfLedgerSequence);
|
||||
|
||||
if (j.debug())
|
||||
dmp(j.debug(), to_string(outcome));
|
||||
|
||||
// One might think that we would not wish to relay validations that
|
||||
// fail these checks. Somewhat counterintuitively, we actually want
|
||||
// to do it for validations that we receive but deem suspicious, so
|
||||
// that our peers will also observe them and realize they're bad.
|
||||
if (outcome == ValStatus::conflicting && j.warn())
|
||||
{
|
||||
dmp(j.warn(),
|
||||
"conflicting validations issued for " + to_string(seq) +
|
||||
" (likely from a Byzantine validator)");
|
||||
}
|
||||
|
||||
if (outcome == ValStatus::multiple && j.warn())
|
||||
{
|
||||
dmp(j.warn(),
|
||||
"multiple validations issued for " + to_string(seq) +
|
||||
" (multiple validators operating with the same key?)");
|
||||
}
|
||||
|
||||
if (val->isTrusted() && outcome == ValStatus::current)
|
||||
if (val->isTrusted())
|
||||
app.getLedgerMaster().checkAccept(hash, seq);
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
||||
// Ensure that problematic validations from validators we trust are
|
||||
// logged at the highest possible level.
|
||||
//
|
||||
// One might think that we should more than just log: we ought to also
|
||||
// not relay validations that fail these checks. Alas, and somewhat
|
||||
// counterintuitively, we *especially* want to forward such validations,
|
||||
// so that our peers will also observe them and take independent notice of
|
||||
// such validators, informing their operators.
|
||||
if (auto const ls = val->isTrusted()
|
||||
? validations.adaptor().journal().error()
|
||||
: validations.adaptor().journal().info();
|
||||
ls.active())
|
||||
{
|
||||
JLOG(j.debug()) << "Val for " << hash << " from "
|
||||
<< toBase58(TokenType::NodePublic, signingKey)
|
||||
<< " not added UNlisted";
|
||||
auto const id = [&masterKey, &signingKey]() {
|
||||
auto ret = toBase58(TokenType::NodePublic, signingKey);
|
||||
|
||||
if (masterKey && masterKey != signingKey)
|
||||
ret += ":" + toBase58(TokenType::NodePublic, *masterKey);
|
||||
|
||||
return ret;
|
||||
}();
|
||||
|
||||
if (outcome == ValStatus::conflicting)
|
||||
ls << "Byzantine Behavior Detector: "
|
||||
<< (val->isTrusted() ? "trusted " : "untrusted ") << id
|
||||
<< ": Conflicting validation for " << seq << "!\n["
|
||||
<< val->getSerializer().slice() << "]";
|
||||
|
||||
if (outcome == ValStatus::multiple)
|
||||
ls << "Byzantine Behavior Detector: "
|
||||
<< (val->isTrusted() ? "trusted " : "untrusted ") << id
|
||||
<< ": Multiple validations for " << seq << "/" << hash << "!\n["
|
||||
<< val->getSerializer().slice() << "]";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ public:
|
||||
}
|
||||
|
||||
/// Get the load fee of the validation if it exists
|
||||
boost::optional<std::uint32_t>
|
||||
std::optional<std::uint32_t>
|
||||
loadFee() const
|
||||
{
|
||||
return ~(*val_)[~sfLoadFee];
|
||||
@@ -218,7 +218,7 @@ public:
|
||||
now() const;
|
||||
|
||||
/** Attempt to acquire the ledger with given id from the network */
|
||||
boost::optional<RCLValidatedLedger>
|
||||
std::optional<RCLValidatedLedger>
|
||||
acquire(LedgerHash const& id);
|
||||
|
||||
beast::Journal
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
#include <ripple/basics/Blob.h>
|
||||
#include <ripple/basics/base_uint.h>
|
||||
#include <boost/optional.hpp>
|
||||
#include <optional>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
@@ -37,10 +37,10 @@ public:
|
||||
/** Retrieves partial ledger data of the coresponding hash from peers.`
|
||||
|
||||
@param nodeHash The 256-bit hash of the data to fetch.
|
||||
@return `boost::none` if the hash isn't cached,
|
||||
@return `std::nullopt` if the hash isn't cached,
|
||||
otherwise, the hash associated data.
|
||||
*/
|
||||
virtual boost::optional<Blob>
|
||||
virtual std::optional<Blob>
|
||||
getFetchPack(uint256 const& nodeHash) = 0;
|
||||
};
|
||||
|
||||
|
||||
@@ -18,40 +18,44 @@
|
||||
//==============================================================================
|
||||
|
||||
#include <ripple/app/ledger/AcceptedLedger.h>
|
||||
#include <ripple/basics/Log.h>
|
||||
#include <ripple/basics/chrono.h>
|
||||
#include <ripple/app/main/Application.h>
|
||||
#include <algorithm>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
AcceptedLedger::AcceptedLedger(
|
||||
std::shared_ptr<ReadView const> const& ledger,
|
||||
AccountIDCache const& accountCache,
|
||||
Logs& logs)
|
||||
Application& app)
|
||||
: mLedger(ledger)
|
||||
{
|
||||
for (auto const& item : ledger->txs)
|
||||
transactions_.reserve(256);
|
||||
|
||||
auto insertAll = [&](auto const& txns) {
|
||||
auto const& idcache = app.accountIDCache();
|
||||
|
||||
for (auto const& item : txns)
|
||||
transactions_.emplace_back(std::make_unique<AcceptedLedgerTx>(
|
||||
ledger, item.first, item.second, idcache));
|
||||
};
|
||||
|
||||
if (app.config().reporting())
|
||||
{
|
||||
insert(std::make_shared<AcceptedLedgerTx>(
|
||||
ledger, item.first, item.second, accountCache, logs));
|
||||
auto const txs = flatFetchTransactions(*ledger, app);
|
||||
transactions_.reserve(txs.size());
|
||||
insertAll(txs);
|
||||
}
|
||||
else
|
||||
{
|
||||
transactions_.reserve(256);
|
||||
insertAll(ledger->txs);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
AcceptedLedger::insert(AcceptedLedgerTx::ref at)
|
||||
{
|
||||
assert(mMap.find(at->getIndex()) == mMap.end());
|
||||
mMap.insert(std::make_pair(at->getIndex(), at));
|
||||
}
|
||||
|
||||
AcceptedLedgerTx::pointer
|
||||
AcceptedLedger::getTxn(int i) const
|
||||
{
|
||||
map_t::const_iterator it = mMap.find(i);
|
||||
|
||||
if (it == mMap.end())
|
||||
return AcceptedLedgerTx::pointer();
|
||||
|
||||
return it->second;
|
||||
std::sort(
|
||||
transactions_.begin(),
|
||||
transactions_.end(),
|
||||
[](auto const& a, auto const& b) {
|
||||
return a->getTxnSeq() < b->getTxnSeq();
|
||||
});
|
||||
}
|
||||
|
||||
} // namespace ripple
|
||||
|
||||
@@ -41,47 +41,40 @@ namespace ripple {
|
||||
the result of the a consensus process (though haven't validated
|
||||
it yet).
|
||||
*/
|
||||
class AcceptedLedger
|
||||
class AcceptedLedger : public CountedObject<AcceptedLedger>
|
||||
{
|
||||
public:
|
||||
using pointer = std::shared_ptr<AcceptedLedger>;
|
||||
using ret = const pointer&;
|
||||
using map_t = std::map<int, AcceptedLedgerTx::pointer>;
|
||||
// mapt_t must be an ordered map!
|
||||
using value_type = map_t::value_type;
|
||||
using const_iterator = map_t::const_iterator;
|
||||
AcceptedLedger(
|
||||
std::shared_ptr<ReadView const> const& ledger,
|
||||
Application& app);
|
||||
|
||||
public:
|
||||
std::shared_ptr<ReadView const> const&
|
||||
getLedger() const
|
||||
{
|
||||
return mLedger;
|
||||
}
|
||||
const map_t&
|
||||
getMap() const
|
||||
|
||||
std::size_t
|
||||
size() const
|
||||
{
|
||||
return mMap;
|
||||
return transactions_.size();
|
||||
}
|
||||
|
||||
int
|
||||
getTxnCount() const
|
||||
auto
|
||||
begin() const
|
||||
{
|
||||
return mMap.size();
|
||||
return transactions_.begin();
|
||||
}
|
||||
|
||||
AcceptedLedgerTx::pointer
|
||||
getTxn(int) const;
|
||||
|
||||
AcceptedLedger(
|
||||
std::shared_ptr<ReadView const> const& ledger,
|
||||
AccountIDCache const& accountCache,
|
||||
Logs& logs);
|
||||
auto
|
||||
end() const
|
||||
{
|
||||
return transactions_.end();
|
||||
}
|
||||
|
||||
private:
|
||||
void insert(AcceptedLedgerTx::ref);
|
||||
|
||||
std::shared_ptr<ReadView const> mLedger;
|
||||
map_t mMap;
|
||||
std::vector<std::unique_ptr<AcceptedLedgerTx>> transactions_;
|
||||
};
|
||||
|
||||
} // namespace ripple
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
//==============================================================================
|
||||
|
||||
#include <ripple/app/ledger/AcceptedLedgerTx.h>
|
||||
#include <ripple/app/main/Application.h>
|
||||
#include <ripple/basics/Log.h>
|
||||
#include <ripple/basics/StringUtilities.h>
|
||||
#include <ripple/protocol/UintTypes.h>
|
||||
@@ -30,72 +29,30 @@ AcceptedLedgerTx::AcceptedLedgerTx(
|
||||
std::shared_ptr<ReadView const> const& ledger,
|
||||
std::shared_ptr<STTx const> const& txn,
|
||||
std::shared_ptr<STObject const> const& met,
|
||||
AccountIDCache const& accountCache,
|
||||
Logs& logs)
|
||||
: mLedger(ledger)
|
||||
, mTxn(txn)
|
||||
, mMeta(std::make_shared<TxMeta>(
|
||||
txn->getTransactionID(),
|
||||
ledger->seq(),
|
||||
*met))
|
||||
, mAffected(mMeta->getAffectedAccounts(logs.journal("View")))
|
||||
, accountCache_(accountCache)
|
||||
, logs_(logs)
|
||||
AccountIDCache const& accountCache)
|
||||
: mTxn(txn)
|
||||
, mMeta(txn->getTransactionID(), ledger->seq(), *met)
|
||||
, mAffected(mMeta.getAffectedAccounts())
|
||||
{
|
||||
assert(!ledger->open());
|
||||
|
||||
mResult = mMeta->getResultTER();
|
||||
|
||||
Serializer s;
|
||||
met->add(s);
|
||||
mRawMeta = std::move(s.modData());
|
||||
|
||||
buildJson();
|
||||
}
|
||||
|
||||
AcceptedLedgerTx::AcceptedLedgerTx(
|
||||
std::shared_ptr<ReadView const> const& ledger,
|
||||
std::shared_ptr<STTx const> const& txn,
|
||||
TER result,
|
||||
AccountIDCache const& accountCache,
|
||||
Logs& logs)
|
||||
: mLedger(ledger)
|
||||
, mTxn(txn)
|
||||
, mResult(result)
|
||||
, mAffected(txn->getMentionedAccounts())
|
||||
, accountCache_(accountCache)
|
||||
, logs_(logs)
|
||||
{
|
||||
assert(ledger->open());
|
||||
buildJson();
|
||||
}
|
||||
|
||||
std::string
|
||||
AcceptedLedgerTx::getEscMeta() const
|
||||
{
|
||||
assert(!mRawMeta.empty());
|
||||
return sqlEscape(mRawMeta);
|
||||
}
|
||||
|
||||
void
|
||||
AcceptedLedgerTx::buildJson()
|
||||
{
|
||||
mJson = Json::objectValue;
|
||||
mJson[jss::transaction] = mTxn->getJson(JsonOptions::none);
|
||||
|
||||
if (mMeta)
|
||||
{
|
||||
mJson[jss::meta] = mMeta->getJson(JsonOptions::none);
|
||||
mJson[jss::raw_meta] = strHex(mRawMeta);
|
||||
}
|
||||
mJson[jss::meta] = mMeta.getJson(JsonOptions::none);
|
||||
mJson[jss::raw_meta] = strHex(mRawMeta);
|
||||
|
||||
mJson[jss::result] = transHuman(mResult);
|
||||
mJson[jss::result] = transHuman(mMeta.getResultTER());
|
||||
|
||||
if (!mAffected.empty())
|
||||
{
|
||||
Json::Value& affected = (mJson[jss::affected] = Json::arrayValue);
|
||||
for (auto const& account : mAffected)
|
||||
affected.append(accountCache_.toBase58(account));
|
||||
affected.append(accountCache.toBase58(account));
|
||||
}
|
||||
|
||||
if (mTxn->getTxnType() == ttOFFER_CREATE)
|
||||
@@ -107,14 +64,21 @@ AcceptedLedgerTx::buildJson()
|
||||
if (account != amount.issue().account)
|
||||
{
|
||||
auto const ownerFunds = accountFunds(
|
||||
*mLedger,
|
||||
*ledger,
|
||||
account,
|
||||
amount,
|
||||
fhIGNORE_FREEZE,
|
||||
logs_.journal("View"));
|
||||
beast::Journal{beast::Journal::getNullSink()});
|
||||
mJson[jss::transaction][jss::owner_funds] = ownerFunds.getText();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::string
|
||||
AcceptedLedgerTx::getEscMeta() const
|
||||
{
|
||||
assert(!mRawMeta.empty());
|
||||
return sqlBlobLiteral(mRawMeta);
|
||||
}
|
||||
|
||||
} // namespace ripple
|
||||
|
||||
@@ -39,40 +39,22 @@ class Logs;
|
||||
- Which accounts are affected
|
||||
* This is used by InfoSub to report to clients
|
||||
- Cached stuff
|
||||
|
||||
@code
|
||||
@endcode
|
||||
|
||||
@see {uri}
|
||||
|
||||
@ingroup ripple_ledger
|
||||
*/
|
||||
class AcceptedLedgerTx
|
||||
class AcceptedLedgerTx : public CountedObject<AcceptedLedgerTx>
|
||||
{
|
||||
public:
|
||||
using pointer = std::shared_ptr<AcceptedLedgerTx>;
|
||||
using ref = const pointer&;
|
||||
|
||||
public:
|
||||
AcceptedLedgerTx(
|
||||
std::shared_ptr<ReadView const> const& ledger,
|
||||
std::shared_ptr<STTx const> const&,
|
||||
std::shared_ptr<STObject const> const&,
|
||||
AccountIDCache const&,
|
||||
Logs&);
|
||||
AcceptedLedgerTx(
|
||||
std::shared_ptr<ReadView const> const&,
|
||||
std::shared_ptr<STTx const> const&,
|
||||
TER,
|
||||
AccountIDCache const&,
|
||||
Logs&);
|
||||
AccountIDCache const&);
|
||||
|
||||
std::shared_ptr<STTx const> const&
|
||||
getTxn() const
|
||||
{
|
||||
return mTxn;
|
||||
}
|
||||
std::shared_ptr<TxMeta> const&
|
||||
TxMeta const&
|
||||
getMeta() const
|
||||
{
|
||||
return mMeta;
|
||||
@@ -97,45 +79,28 @@ public:
|
||||
TER
|
||||
getResult() const
|
||||
{
|
||||
return mResult;
|
||||
return mMeta.getResultTER();
|
||||
}
|
||||
std::uint32_t
|
||||
getTxnSeq() const
|
||||
{
|
||||
return mMeta->getIndex();
|
||||
}
|
||||
|
||||
bool
|
||||
isApplied() const
|
||||
{
|
||||
return bool(mMeta);
|
||||
}
|
||||
int
|
||||
getIndex() const
|
||||
{
|
||||
return mMeta ? mMeta->getIndex() : 0;
|
||||
return mMeta.getIndex();
|
||||
}
|
||||
std::string
|
||||
getEscMeta() const;
|
||||
Json::Value
|
||||
|
||||
Json::Value const&
|
||||
getJson() const
|
||||
{
|
||||
return mJson;
|
||||
}
|
||||
|
||||
private:
|
||||
std::shared_ptr<ReadView const> mLedger;
|
||||
std::shared_ptr<STTx const> mTxn;
|
||||
std::shared_ptr<TxMeta> mMeta;
|
||||
TER mResult;
|
||||
TxMeta mMeta;
|
||||
boost::container::flat_set<AccountID> mAffected;
|
||||
Blob mRawMeta;
|
||||
Json::Value mJson;
|
||||
AccountIDCache const& accountCache_;
|
||||
Logs& logs_;
|
||||
|
||||
void
|
||||
buildJson();
|
||||
};
|
||||
|
||||
} // namespace ripple
|
||||
|
||||
@@ -27,13 +27,13 @@ AccountStateSF::gotNode(
|
||||
SHAMapHash const& nodeHash,
|
||||
std::uint32_t ledgerSeq,
|
||||
Blob&& nodeData,
|
||||
SHAMapTreeNode::TNType) const
|
||||
SHAMapNodeType) const
|
||||
{
|
||||
db_.store(
|
||||
hotACCOUNT_NODE, std::move(nodeData), nodeHash.as_uint256(), ledgerSeq);
|
||||
}
|
||||
|
||||
boost::optional<Blob>
|
||||
std::optional<Blob>
|
||||
AccountStateSF::getNode(SHAMapHash const& nodeHash) const
|
||||
{
|
||||
return fp_.getFetchPack(nodeHash.as_uint256());
|
||||
|
||||
@@ -42,9 +42,9 @@ public:
|
||||
SHAMapHash const& nodeHash,
|
||||
std::uint32_t ledgerSeq,
|
||||
Blob&& nodeData,
|
||||
SHAMapTreeNode::TNType type) const override;
|
||||
SHAMapNodeType type) const override;
|
||||
|
||||
boost::optional<Blob>
|
||||
std::optional<Blob>
|
||||
getNode(SHAMapHash const& nodeHash) const override;
|
||||
|
||||
private:
|
||||
|
||||
@@ -41,14 +41,14 @@ ConsensusTransSetSF::gotNode(
|
||||
SHAMapHash const& nodeHash,
|
||||
std::uint32_t,
|
||||
Blob&& nodeData,
|
||||
SHAMapTreeNode::TNType type) const
|
||||
SHAMapNodeType type) const
|
||||
{
|
||||
if (fromFilter)
|
||||
return;
|
||||
|
||||
m_nodeCache.insert(nodeHash, nodeData);
|
||||
|
||||
if ((type == SHAMapTreeNode::tnTRANSACTION_NM) && (nodeData.size() > 16))
|
||||
if ((type == SHAMapNodeType::tnTRANSACTION_NM) && (nodeData.size() > 16))
|
||||
{
|
||||
// this is a transaction, and we didn't have it
|
||||
JLOG(j_.debug())
|
||||
@@ -62,10 +62,9 @@ ConsensusTransSetSF::gotNode(
|
||||
auto stx = std::make_shared<STTx const>(std::ref(sit));
|
||||
assert(stx->getTransactionID() == nodeHash.as_uint256());
|
||||
auto const pap = &app_;
|
||||
app_.getJobQueue().addJob(
|
||||
jtTRANSACTION, "TXS->TXN", [pap, stx](Job&) {
|
||||
pap->getOPs().submitTransaction(stx);
|
||||
});
|
||||
app_.getJobQueue().addJob(jtTRANSACTION, "TXS->TXN", [pap, stx]() {
|
||||
pap->getOPs().submitTransaction(stx);
|
||||
});
|
||||
}
|
||||
catch (std::exception const&)
|
||||
{
|
||||
@@ -74,7 +73,7 @@ ConsensusTransSetSF::gotNode(
|
||||
}
|
||||
}
|
||||
|
||||
boost::optional<Blob>
|
||||
std::optional<Blob>
|
||||
ConsensusTransSetSF::getNode(SHAMapHash const& nodeHash) const
|
||||
{
|
||||
Blob nodeData;
|
||||
@@ -96,7 +95,7 @@ ConsensusTransSetSF::getNode(SHAMapHash const& nodeHash) const
|
||||
return nodeData;
|
||||
}
|
||||
|
||||
return boost::none;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
} // namespace ripple
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user