mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-06 12:15:52 +00:00
Compare commits
78 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d58f11a60 | ||
|
|
7b18006193 | ||
|
|
9e48fc0c83 | ||
|
|
8e827e32ac | ||
|
|
c5c0e70e23 | ||
|
|
ec61f5e9d3 | ||
|
|
d57cced17b | ||
|
|
54a350be79 | ||
|
|
d6dbf0e0a6 | ||
|
|
0d887ad815 | ||
|
|
d4a5f8390e | ||
|
|
ab5d450d3c | ||
|
|
23c37fa506 | ||
|
|
63209c2646 | ||
|
|
f0dabd1446 | ||
|
|
552377c76f | ||
|
|
e7cd03325b | ||
|
|
decb3c178e | ||
|
|
f6d647d6c3 | ||
|
|
bf4a7b6ce8 | ||
|
|
8e2c85d14d | ||
|
|
1fbf8da79f | ||
|
|
a75309919e | ||
|
|
0ece395c24 | ||
|
|
b6391fe011 | ||
|
|
9a6af9c431 | ||
|
|
fa1cbb0746 | ||
|
|
23991c99c3 | ||
|
|
cc0177be87 | ||
|
|
37b3e96b04 | ||
|
|
2f432e812c | ||
|
|
cad8970a57 | ||
|
|
4d7aed84ec | ||
|
|
d9bd75e683 | ||
|
|
93d8bafb24 | ||
|
|
c19a88fee9 | ||
|
|
0a331ea72e | ||
|
|
7d27b11190 | ||
|
|
eedfec015e | ||
|
|
ffc343a2bc | ||
|
|
e5aa605742 | ||
|
|
8b181ed818 | ||
|
|
f5a349558e | ||
|
|
b9b75ddcf5 | ||
|
|
a39720e94a | ||
|
|
2820feb02a | ||
|
|
8fc805d2e2 | ||
|
|
d54151e7c4 | ||
|
|
21a0a64648 | ||
|
|
20707fac4a | ||
|
|
ad14d09a2b | ||
|
|
f3bcc651c7 | ||
|
|
e8602b81fa | ||
|
|
0f32109993 | ||
|
|
a17ccca615 | ||
|
|
7a1b238035 | ||
|
|
e1534a3200 | ||
|
|
9fec615dca | ||
|
|
ef02893f2f | ||
|
|
7cf4611d7c | ||
|
|
d028005aa6 | ||
|
|
1d23148e6d | ||
|
|
e416ee72ca | ||
|
|
2e902dee53 | ||
|
|
f6879da6c9 | ||
|
|
ae20a3ad3f | ||
|
|
c706926ee3 | ||
|
|
223e6c7590 | ||
|
|
825864032a | ||
|
|
06733ec21a | ||
|
|
9f7c619e4f | ||
|
|
3f5e3212fe | ||
|
|
20d05492d2 | ||
|
|
ae7ea33b75 | ||
|
|
263e984bf4 | ||
|
|
58f3abe3c6 | ||
|
|
d576416953 | ||
|
|
e3d1bb271f |
@@ -45,9 +45,11 @@ DisableFormat: false
|
|||||||
ExperimentalAutoDetectBinPacking: false
|
ExperimentalAutoDetectBinPacking: false
|
||||||
ForEachMacros: [ Q_FOREACH, BOOST_FOREACH ]
|
ForEachMacros: [ Q_FOREACH, BOOST_FOREACH ]
|
||||||
IncludeCategories:
|
IncludeCategories:
|
||||||
- Regex: '^<(BeastConfig)'
|
- Regex: '^<(test)/'
|
||||||
Priority: 0
|
Priority: 0
|
||||||
- Regex: '^<(ripple)/'
|
- Regex: '^<(xrpld)/'
|
||||||
|
Priority: 1
|
||||||
|
- Regex: '^<(xrpl)/'
|
||||||
Priority: 2
|
Priority: 2
|
||||||
- Regex: '^<(boost)/'
|
- Regex: '^<(boost)/'
|
||||||
Priority: 3
|
Priority: 3
|
||||||
@@ -56,6 +58,7 @@ IncludeCategories:
|
|||||||
IncludeIsMainRegex: '$'
|
IncludeIsMainRegex: '$'
|
||||||
IndentCaseLabels: true
|
IndentCaseLabels: true
|
||||||
IndentFunctionDeclarationAfterType: false
|
IndentFunctionDeclarationAfterType: false
|
||||||
|
IndentRequiresClause: true
|
||||||
IndentWidth: 4
|
IndentWidth: 4
|
||||||
IndentWrappedFunctionNames: false
|
IndentWrappedFunctionNames: false
|
||||||
KeepEmptyLinesAtTheStartOfBlocks: false
|
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||||
@@ -71,6 +74,7 @@ PenaltyExcessCharacter: 1000000
|
|||||||
PenaltyReturnTypeOnItsOwnLine: 200
|
PenaltyReturnTypeOnItsOwnLine: 200
|
||||||
PointerAlignment: Left
|
PointerAlignment: Left
|
||||||
ReflowComments: true
|
ReflowComments: true
|
||||||
|
RequiresClausePosition: OwnLine
|
||||||
SortIncludes: true
|
SortIncludes: true
|
||||||
SpaceAfterCStyleCast: false
|
SpaceAfterCStyleCast: false
|
||||||
SpaceBeforeAssignmentOperators: true
|
SpaceBeforeAssignmentOperators: true
|
||||||
|
|||||||
@@ -33,5 +33,5 @@ slack_app: false
|
|||||||
|
|
||||||
ignore:
|
ignore:
|
||||||
- "src/test/"
|
- "src/test/"
|
||||||
- "src/ripple/beast/test/"
|
- "include/xrpl/beast/test/"
|
||||||
- "src/ripple/beast/unit_test/"
|
- "include/xrpl/beast/unit_test/"
|
||||||
|
|||||||
@@ -6,3 +6,8 @@ e2384885f5f630c8f0ffe4bf21a169b433a16858
|
|||||||
241b9ddde9e11beb7480600fd5ed90e1ef109b21
|
241b9ddde9e11beb7480600fd5ed90e1ef109b21
|
||||||
760f16f56835663d9286bd29294d074de26a7ba6
|
760f16f56835663d9286bd29294d074de26a7ba6
|
||||||
0eebe6a5f4246fced516d52b83ec4e7f47373edd
|
0eebe6a5f4246fced516d52b83ec4e7f47373edd
|
||||||
|
2189cc950c0cebb89e4e2fa3b2d8817205bf7cef
|
||||||
|
b9d007813378ad0ff45660dc07285b823c7e9855
|
||||||
|
fe9a5365b8a52d4acc42eb27369247e6f238a4f9
|
||||||
|
9a93577314e6a8d4b4a8368cc9d2b15a5d8303e8
|
||||||
|
552377c76f55b403a1c876df873a23d780fcc81c
|
||||||
|
|||||||
2
.github/actions/build/action.yml
vendored
2
.github/actions/build/action.yml
vendored
@@ -20,6 +20,8 @@ runs:
|
|||||||
${{ inputs.generator && format('-G "{0}"', inputs.generator) || '' }} \
|
${{ inputs.generator && format('-G "{0}"', inputs.generator) || '' }} \
|
||||||
-DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake \
|
-DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake \
|
||||||
-DCMAKE_BUILD_TYPE=${{ inputs.configuration }} \
|
-DCMAKE_BUILD_TYPE=${{ inputs.configuration }} \
|
||||||
|
-Dtests=TRUE \
|
||||||
|
-Dxrpld=TRUE \
|
||||||
${{ inputs.cmake-args }} \
|
${{ inputs.cmake-args }} \
|
||||||
..
|
..
|
||||||
- name: build
|
- name: build
|
||||||
|
|||||||
2
.github/actions/dependencies/action.yml
vendored
2
.github/actions/dependencies/action.yml
vendored
@@ -50,6 +50,8 @@ runs:
|
|||||||
conan install \
|
conan install \
|
||||||
--output-folder . \
|
--output-folder . \
|
||||||
--build missing \
|
--build missing \
|
||||||
|
--options tests=True \
|
||||||
|
--options xrpld=True \
|
||||||
--settings build_type=${{ inputs.configuration }} \
|
--settings build_type=${{ inputs.configuration }} \
|
||||||
..
|
..
|
||||||
- name: upload dependencies to remote
|
- name: upload dependencies to remote
|
||||||
|
|||||||
12
.github/workflows/clang-format.yml
vendored
12
.github/workflows/clang-format.yml
vendored
@@ -4,9 +4,9 @@ on: [push, pull_request]
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check:
|
check:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-24.04
|
||||||
env:
|
env:
|
||||||
CLANG_VERSION: 10
|
CLANG_VERSION: 18
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Install clang-format
|
- name: Install clang-format
|
||||||
@@ -19,10 +19,8 @@ jobs:
|
|||||||
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add
|
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install clang-format-${CLANG_VERSION}
|
sudo apt-get install clang-format-${CLANG_VERSION}
|
||||||
- name: Format src/ripple
|
- name: Format first-party sources
|
||||||
run: find src/ripple -type f \( -name '*.cpp' -o -name '*.h' -o -name '*.ipp' \) -print0 | xargs -0 clang-format-${CLANG_VERSION} -i
|
run: find include src -type f \( -name '*.cpp' -o -name '*.hpp' -o -name '*.h' -o -name '*.ipp' \) -exec clang-format-${CLANG_VERSION} -i {} +
|
||||||
- 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
|
- name: Check for differences
|
||||||
id: assert
|
id: assert
|
||||||
run: |
|
run: |
|
||||||
@@ -52,7 +50,7 @@ jobs:
|
|||||||
To fix it, you can do one of two things:
|
To fix it, you can do one of two things:
|
||||||
1. Download and apply the patch generated as an artifact of this
|
1. Download and apply the patch generated as an artifact of this
|
||||||
job to your repo, commit, and push.
|
job to your repo, commit, and push.
|
||||||
2. Run 'git-clang-format --extensions c,cpp,h,cxx,ipp develop'
|
2. Run 'git-clang-format --extensions cpp,h,hpp,ipp develop'
|
||||||
in your repo, commit, and push.
|
in your repo, commit, and push.
|
||||||
run: |
|
run: |
|
||||||
echo "${PREAMBLE}"
|
echo "${PREAMBLE}"
|
||||||
|
|||||||
1
.github/workflows/doxygen.yml
vendored
1
.github/workflows/doxygen.yml
vendored
@@ -4,6 +4,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- develop
|
- develop
|
||||||
|
- doxygen
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|||||||
88
.github/workflows/libxrpl.yml
vendored
Normal file
88
.github/workflows/libxrpl.yml
vendored
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
name: Check libXRPL compatibility with Clio
|
||||||
|
env:
|
||||||
|
CONAN_URL: http://18.143.149.228:8081/artifactory/api/conan/conan-non-prod
|
||||||
|
CONAN_LOGIN_USERNAME_RIPPLE: ${{ secrets.CONAN_USERNAME }}
|
||||||
|
CONAN_PASSWORD_RIPPLE: ${{ secrets.CONAN_TOKEN }}
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- 'src/libxrpl/protocol/BuildInfo.cpp'
|
||||||
|
- '.github/workflows/libxrpl.yml'
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
publish:
|
||||||
|
name: Publish libXRPL
|
||||||
|
outputs:
|
||||||
|
outcome: ${{ steps.upload.outputs.outcome }}
|
||||||
|
version: ${{ steps.version.outputs.version }}
|
||||||
|
channel: ${{ steps.channel.outputs.channel }}
|
||||||
|
runs-on: [self-hosted, heavy]
|
||||||
|
container: rippleci/rippled-build-ubuntu:aaf5e3e
|
||||||
|
steps:
|
||||||
|
- name: Wait for essential checks to succeed
|
||||||
|
uses: lewagon/wait-on-check-action@v1.3.4
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.pull_request.head.sha || github.sha }}
|
||||||
|
running-workflow-name: wait-for-check-regexp
|
||||||
|
check-regexp: '(dependencies|test).*linux.*' # Ignore windows and mac tests but make sure linux passes
|
||||||
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
wait-interval: 10
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Generate channel
|
||||||
|
id: channel
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo channel="clio/pr_${{ github.event.pull_request.number }}" | tee ${GITHUB_OUTPUT}
|
||||||
|
- name: Export new package
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
conan export . ${{ steps.channel.outputs.channel }}
|
||||||
|
- name: Add Ripple Conan remote
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
conan remote list
|
||||||
|
conan remote remove ripple || true
|
||||||
|
# Do not quote the URL. An empty string will be accepted (with a non-fatal warning), but a missing argument will not.
|
||||||
|
conan remote add ripple ${{ env.CONAN_URL }} --insert 0
|
||||||
|
- name: Parse new version
|
||||||
|
id: version
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo version="$(cat src/libxrpl/protocol/BuildInfo.cpp | grep "versionString =" \
|
||||||
|
| awk -F '"' '{print $2}')" | tee ${GITHUB_OUTPUT}
|
||||||
|
- name: Try to authenticate to Ripple Conan remote
|
||||||
|
id: remote
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
# `conan user` implicitly uses the environment variables CONAN_LOGIN_USERNAME_<REMOTE> and CONAN_PASSWORD_<REMOTE>.
|
||||||
|
# https://docs.conan.io/1/reference/commands/misc/user.html#using-environment-variables
|
||||||
|
# https://docs.conan.io/1/reference/env_vars.html#conan-login-username-conan-login-username-remote-name
|
||||||
|
# https://docs.conan.io/1/reference/env_vars.html#conan-password-conan-password-remote-name
|
||||||
|
echo outcome=$(conan user --remote ripple --password >&2 \
|
||||||
|
&& echo success || echo failure) | tee ${GITHUB_OUTPUT}
|
||||||
|
- name: Upload new package
|
||||||
|
id: upload
|
||||||
|
if: (steps.remote.outputs.outcome == 'success')
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "conan upload version ${{ steps.version.outputs.version }} on channel ${{ steps.channel.outputs.channel }}"
|
||||||
|
echo outcome=$(conan upload xrpl/${{ steps.version.outputs.version }}@${{ steps.channel.outputs.channel }} --remote ripple --confirm >&2 \
|
||||||
|
&& echo success || echo failure) | tee ${GITHUB_OUTPUT}
|
||||||
|
notify_clio:
|
||||||
|
name: Notify Clio
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: publish
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.CLIO_NOTIFY_TOKEN }}
|
||||||
|
steps:
|
||||||
|
- name: Notify Clio about new version
|
||||||
|
if: (needs.publish.outputs.outcome == 'success')
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
gh api --method POST -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" \
|
||||||
|
/repos/xrplf/clio/dispatches -f "event_type=check_libxrpl" \
|
||||||
|
-F "client_payload[version]=${{ needs.publish.outputs.version }}@${{ needs.publish.outputs.channel }}"
|
||||||
52
.github/workflows/nix.yml
vendored
52
.github/workflows/nix.yml
vendored
@@ -222,7 +222,7 @@ jobs:
|
|||||||
- name: upload coverage report
|
- name: upload coverage report
|
||||||
uses: wandalen/wretry.action@v1.4.10
|
uses: wandalen/wretry.action@v1.4.10
|
||||||
with:
|
with:
|
||||||
action: codecov/codecov-action@v4.3.0
|
action: codecov/codecov-action@v4.5.0
|
||||||
with: |
|
with: |
|
||||||
files: coverage.xml
|
files: coverage.xml
|
||||||
fail_ci_if_error: true
|
fail_ci_if_error: true
|
||||||
@@ -232,3 +232,53 @@ jobs:
|
|||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
attempt_limit: 5
|
attempt_limit: 5
|
||||||
attempt_delay: 210000 # in milliseconds
|
attempt_delay: 210000 # in milliseconds
|
||||||
|
|
||||||
|
conan:
|
||||||
|
needs: dependencies
|
||||||
|
runs-on: [self-hosted, heavy]
|
||||||
|
container: rippleci/rippled-build-ubuntu:aaf5e3e
|
||||||
|
env:
|
||||||
|
build_dir: .build
|
||||||
|
configuration: Release
|
||||||
|
steps:
|
||||||
|
- name: download cache
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: linux-gcc-${{ env.configuration }}
|
||||||
|
- name: extract cache
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.conan
|
||||||
|
tar -xzf conan.tar -C ~/.conan
|
||||||
|
- name: check environment
|
||||||
|
run: |
|
||||||
|
env | sort
|
||||||
|
echo ${PATH} | tr ':' '\n'
|
||||||
|
conan --version
|
||||||
|
cmake --version
|
||||||
|
- name: checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: dependencies
|
||||||
|
uses: ./.github/actions/dependencies
|
||||||
|
env:
|
||||||
|
CONAN_URL: http://18.143.149.228:8081/artifactory/api/conan/conan-non-prod
|
||||||
|
with:
|
||||||
|
configuration: ${{ env.configuration }}
|
||||||
|
- name: export
|
||||||
|
run: |
|
||||||
|
version=$(conan inspect --raw version .)
|
||||||
|
reference="xrpl/${version}@local/test"
|
||||||
|
conan remove -f ${reference} || true
|
||||||
|
conan export . local/test
|
||||||
|
echo "reference=${reference}" >> "${GITHUB_ENV}"
|
||||||
|
- name: build
|
||||||
|
run: |
|
||||||
|
cd examples/example
|
||||||
|
mkdir ${build_dir}
|
||||||
|
cd ${build_dir}
|
||||||
|
conan install .. --output-folder . \
|
||||||
|
--require-override ${reference} --build missing
|
||||||
|
cmake .. \
|
||||||
|
-DCMAKE_TOOLCHAIN_FILE:FILEPATH=./build/${configuration}/generators/conan_toolchain.cmake \
|
||||||
|
-DCMAKE_BUILD_TYPE=${configuration}
|
||||||
|
cmake --build .
|
||||||
|
./example | grep '^[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+'
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# .pre-commit-config.yaml
|
# .pre-commit-config.yaml
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/pre-commit/mirrors-clang-format
|
- repo: https://github.com/pre-commit/mirrors-clang-format
|
||||||
rev: v10.0.1
|
rev: v18.1.3
|
||||||
hooks:
|
hooks:
|
||||||
- id: clang-format
|
- id: clang-format
|
||||||
|
|||||||
164
API-CHANGELOG.md
164
API-CHANGELOG.md
@@ -8,35 +8,98 @@ The API version controls the API behavior you see. This includes what properties
|
|||||||
|
|
||||||
For a log of breaking changes, see the **API Version [number]** headings. In general, breaking changes are associated with a particular API Version number. For non-breaking changes, scroll to the **XRP Ledger version [x.y.z]** headings. Non-breaking changes are associated with a particular XRP Ledger (`rippled`) release.
|
For a log of breaking changes, see the **API Version [number]** headings. In general, breaking changes are associated with a particular API Version number. For non-breaking changes, scroll to the **XRP Ledger version [x.y.z]** headings. Non-breaking changes are associated with a particular XRP Ledger (`rippled`) release.
|
||||||
|
|
||||||
|
## API Version 2
|
||||||
|
|
||||||
|
API version 2 is available in `rippled` version 2.0.0 and later. To use this API, clients specify `"api_version" : 2` in each request.
|
||||||
|
|
||||||
|
#### Removed methods
|
||||||
|
|
||||||
|
In API version 2, the following deprecated methods are no longer available: (https://github.com/XRPLF/rippled/pull/4759)
|
||||||
|
|
||||||
|
- `tx_history` - Instead, use other methods such as `account_tx` or `ledger` with the `transactions` field set to `true`.
|
||||||
|
- `ledger_header` - Instead, use the `ledger` method.
|
||||||
|
|
||||||
|
#### Modifications to JSON transaction element in V2
|
||||||
|
|
||||||
|
In API version 2, JSON elements for transaction output have been changed and made consistent for all methods which output transactions. (https://github.com/XRPLF/rippled/pull/4775)
|
||||||
|
This helps to unify the JSON serialization format of transactions. (https://github.com/XRPLF/clio/issues/722, https://github.com/XRPLF/rippled/issues/4727)
|
||||||
|
|
||||||
|
- JSON transaction element is named `tx_json`
|
||||||
|
- Binary transaction element is named `tx_blob`
|
||||||
|
- JSON transaction metadata element is named `meta`
|
||||||
|
- Binary transaction metadata element is named `meta_blob`
|
||||||
|
|
||||||
|
Additionally, these elements are now consistently available next to `tx_json` (i.e. sibling elements), where possible:
|
||||||
|
|
||||||
|
- `hash` - Transaction ID. This data was stored inside transaction output in API version 1, but in API version 2 is a sibling element.
|
||||||
|
- `ledger_index` - Ledger index (only set on validated ledgers)
|
||||||
|
- `ledger_hash` - Ledger hash (only set on closed or validated ledgers)
|
||||||
|
- `close_time_iso` - Ledger close time expressed in ISO 8601 time format (only set on validated ledgers)
|
||||||
|
- `validated` - Bool element set to `true` if the transaction is in a validated ledger, otherwise `false`
|
||||||
|
|
||||||
|
This change affects the following methods:
|
||||||
|
|
||||||
|
- `tx` - Transaction data moved into element `tx_json` (was inline inside `result`) or, if binary output was requested, moved from `tx` to `tx_blob`. Renamed binary transaction metadata element (if it was requested) from `meta` to `meta_blob`. Changed location of `hash` and added new elements
|
||||||
|
- `account_tx` - Renamed transaction element from `tx` to `tx_json`. Renamed binary transaction metadata element (if it was requested) from `meta` to `meta_blob`. Changed location of `hash` and added new elements
|
||||||
|
- `transaction_entry` - Renamed transaction metadata element from `metadata` to `meta`. Changed location of `hash` and added new elements
|
||||||
|
- `subscribe` - Renamed transaction element from `transaction` to `tx_json`. Changed location of `hash` and added new elements
|
||||||
|
- `sign`, `sign_for`, `submit` and `submit_multisigned` - Changed location of `hash` element.
|
||||||
|
|
||||||
|
#### Modification to `Payment` transaction JSON schema
|
||||||
|
|
||||||
|
When reading Payments, the `Amount` field should generally **not** be used. Instead, use [delivered_amount](https://xrpl.org/partial-payments.html#the-delivered_amount-field) to see the amount that the Payment delivered. To clarify its meaning, the `Amount` field is being renamed to `DeliverMax`. (https://github.com/XRPLF/rippled/pull/4733)
|
||||||
|
|
||||||
|
- In `Payment` transaction type, JSON RPC field `Amount` is renamed to `DeliverMax`. To enable smooth client transition, `Amount` is still handled, as described below: (https://github.com/XRPLF/rippled/pull/4733)
|
||||||
|
- On JSON RPC input (e.g. `submit_multisigned` etc. methods), `Amount` is recognized as an alias to `DeliverMax` for both API version 1 and version 2 clients.
|
||||||
|
- On JSON RPC input, submitting both `Amount` and `DeliverMax` fields is allowed _only_ if they are identical; otherwise such input is rejected with `rpcINVALID_PARAMS` error.
|
||||||
|
- On JSON RPC output (e.g. `subscribe`, `account_tx` etc. methods), `DeliverMax` is present in both API version 1 and version 2.
|
||||||
|
- On JSON RPC output, `Amount` is only present in API version 1 and _not_ in version 2.
|
||||||
|
|
||||||
|
#### Modifications to account_info response
|
||||||
|
|
||||||
|
- `signer_lists` is returned in the root of the response. (In API version 1, it was nested under `account_data`.) (https://github.com/XRPLF/rippled/pull/3770)
|
||||||
|
- When using an invalid `signer_lists` value, the API now returns an "invalidParams" error. (https://github.com/XRPLF/rippled/pull/4585)
|
||||||
|
- (`signer_lists` must be a boolean. In API version 1, strings were accepted and may return a normal response - i.e. as if `signer_lists` were `true`.)
|
||||||
|
|
||||||
|
#### Modifications to [account_tx](https://xrpl.org/account_tx.html#account_tx) response
|
||||||
|
|
||||||
|
- Using `ledger_index_min`, `ledger_index_max`, and `ledger_index` returns `invalidParams` because if you use `ledger_index_min` or `ledger_index_max`, then it does not make sense to also specify `ledger_index`. In API version 1, no error was returned. (https://github.com/XRPLF/rippled/pull/4571)
|
||||||
|
- The same applies for `ledger_index_min`, `ledger_index_max`, and `ledger_hash`. (https://github.com/XRPLF/rippled/issues/4545#issuecomment-1565065579)
|
||||||
|
- Using a `ledger_index_min` or `ledger_index_max` beyond the range of ledgers that the server has:
|
||||||
|
- returns `lgrIdxMalformed` in API version 2. Previously, in API version 1, no error was returned. (https://github.com/XRPLF/rippled/issues/4288)
|
||||||
|
- Attempting to use a non-boolean value (such as a string) for the `binary` or `forward` parameters returns `invalidParams` (`rpcINVALID_PARAMS`). Previously, in API version 1, no error was returned. (https://github.com/XRPLF/rippled/pull/4620)
|
||||||
|
|
||||||
|
#### Modifications to [noripple_check](https://xrpl.org/noripple_check.html#noripple_check) response
|
||||||
|
|
||||||
|
- Attempting to use a non-boolean value (such as a string) for the `transactions` parameter returns `invalidParams` (`rpcINVALID_PARAMS`). Previously, in API version 1, no error was returned. (https://github.com/XRPLF/rippled/pull/4620)
|
||||||
|
|
||||||
## API Version 1
|
## API Version 1
|
||||||
|
|
||||||
This version is supported by all `rippled` versions. At time of writing, it is the default API version, used when no `api_version` is specified. When a new API version is introduced, the command line interface will default to the latest API version. The command line is intended for ad-hoc usage by humans, not programs or automated scripts. The command line is not meant for use in production code.
|
This version is supported by all `rippled` versions. For WebSocket and HTTP JSON-RPC requests, it is currently the default API version used when no `api_version` is specified.
|
||||||
|
|
||||||
### Idiosyncrasies
|
The [commandline](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#commandline-format) always uses the latest API version. The command line is intended for ad-hoc usage by humans, not programs or automated scripts. The command line is not meant for use in production code.
|
||||||
|
|
||||||
#### V1 account_info response
|
### Inconsistency: server_info - network_id
|
||||||
|
|
||||||
In [the response to the `account_info` command](https://xrpl.org/account_info.html#response-format), there is `account_data` - which is supposed to be an `AccountRoot` object - and `signer_lists` is returned in this object. However, the docs say that `signer_lists` should be at the root level of the reponse.
|
The `network_id` field was added in the `server_info` response in version 1.5.0 (2019), but it is not returned in [reporting mode](https://xrpl.org/rippled-server-modes.html#reporting-mode). However, use of reporting mode is now discouraged, in favor of using [Clio](https://github.com/XRPLF/clio) instead.
|
||||||
|
|
||||||
It makes sense for `signer_lists` to be at the root level because signer lists are not part of the AccountRoot object. (First reported in [xrpl-dev-portal#938](https://github.com/XRPLF/xrpl-dev-portal/issues/938).)
|
## XRP Ledger server version 2.2.0
|
||||||
|
|
||||||
In `api_version: 2`, the `signer_lists` field [will be moved](#modifications-to-account_info-response-in-v2) to the root level of the account_info response. (https://github.com/XRPLF/rippled/pull/3770)
|
The following is a non-breaking addition to the API.
|
||||||
|
|
||||||
#### server_info - network_id
|
- The `feature` method now has a non-admin mode for users. (It was previously only available to admin connections.) The method returns an updated list of amendments, including their names and other information. ([#4781](https://github.com/XRPLF/rippled/pull/4781))
|
||||||
|
|
||||||
The `network_id` field was added in the `server_info` response in version 1.5.0 (2019), but it is not returned in [reporting mode](https://xrpl.org/rippled-server-modes.html#reporting-mode).
|
### Breaking change in 2.3
|
||||||
|
|
||||||
## XRP Ledger server version 2.0.0
|
- `book_changes`: If the requested ledger version is not available on this node, a `ledgerNotFound` error is returned and the node does not attempt to acquire the ledger from the p2p network (as with other non-admin RPCs).
|
||||||
|
|
||||||
### Additions in 2.2
|
Admins can still attempt to retrieve old ledgers with the `ledger_request` RPC.
|
||||||
|
|
||||||
Additions are intended to be non-breaking (because they are purely additive).
|
### Addition in 2.3
|
||||||
|
|
||||||
- `feature`: A non-admin mode that uses the same formatting as admin RPC, but hides potentially-sensitive data.
|
- `book_changes`: Returns a `validated` field in its response, which was missing in prior versions.
|
||||||
|
|
||||||
### Additions in 2.0
|
The following additions are non-breaking (because they are purely additive).
|
||||||
|
|
||||||
Additions are intended to be non-breaking (because they are purely additive).
|
|
||||||
|
|
||||||
- `server_definitions`: A new RPC that generates a `definitions.json`-like output that can be used in XRPL libraries.
|
- `server_definitions`: A new RPC that generates a `definitions.json`-like output that can be used in XRPL libraries.
|
||||||
- In `Payment` transactions, `DeliverMax` has been added. This is a replacement for the `Amount` field, which should not be used. Typically, the `delivered_amount` (in transaction metadata) should be used. To ease the transition, `DeliverMax` is present regardless of API version, since adding a field is non-breaking.
|
- In `Payment` transactions, `DeliverMax` has been added. This is a replacement for the `Amount` field, which should not be used. Typically, the `delivered_amount` (in transaction metadata) should be used. To ease the transition, `DeliverMax` is present regardless of API version, since adding a field is non-breaking.
|
||||||
@@ -44,11 +107,7 @@ Additions are intended to be non-breaking (because they are purely additive).
|
|||||||
|
|
||||||
## XRP Ledger server version 1.12.0
|
## XRP Ledger server version 1.12.0
|
||||||
|
|
||||||
[Version 1.12.0](https://github.com/XRPLF/rippled/releases/tag/1.12.0) was released on Sep 6, 2023.
|
[Version 1.12.0](https://github.com/XRPLF/rippled/releases/tag/1.12.0) was released on Sep 6, 2023. The following additions are non-breaking (because they are purely additive).
|
||||||
|
|
||||||
### Additions in 1.12
|
|
||||||
|
|
||||||
Additions are intended to be non-breaking (because they are purely additive).
|
|
||||||
|
|
||||||
- `server_info`: Added `ports`, an array which advertises the RPC and WebSocket ports. This information is also included in the `/crawl` endpoint (which calls `server_info` internally). `grpc` and `peer` ports are also included. (https://github.com/XRPLF/rippled/pull/4427)
|
- `server_info`: Added `ports`, an array which advertises the RPC and WebSocket ports. This information is also included in the `/crawl` endpoint (which calls `server_info` internally). `grpc` and `peer` ports are also included. (https://github.com/XRPLF/rippled/pull/4427)
|
||||||
- `ports` contains objects, each containing a `port` for the listening port (a number string), and a `protocol` array listing the supported protocols on that port.
|
- `ports` contains objects, each containing a `port` for the listening port (a number string), and a `protocol` array listing the supported protocols on that port.
|
||||||
@@ -125,71 +184,6 @@ was released on Mar 14, 2023.
|
|||||||
removed from the [ledger subscription stream](https://xrpl.org/subscribe.html#ledger-stream), because it will no longer
|
removed from the [ledger subscription stream](https://xrpl.org/subscribe.html#ledger-stream), because it will no longer
|
||||||
have any meaning.
|
have any meaning.
|
||||||
|
|
||||||
## API Version 2
|
|
||||||
|
|
||||||
API version 2 is introduced in `rippled` version 2.0. Users can request it explicitly by specifying `"api_version" : 2`.
|
|
||||||
|
|
||||||
#### Removed methods
|
|
||||||
|
|
||||||
In API version 2, the following deprecated methods are no longer available: (https://github.com/XRPLF/rippled/pull/4759)
|
|
||||||
|
|
||||||
- `tx_history` - Instead, use other methods such as `account_tx` or `ledger` with the `transactions` field set to `true`.
|
|
||||||
- `ledger_header` - Instead, use the `ledger` method.
|
|
||||||
|
|
||||||
#### Modifications to JSON transaction element in V2
|
|
||||||
|
|
||||||
In API version 2, JSON elements for transaction output have been changed and made consistent for all methods which output transactions. (https://github.com/XRPLF/rippled/pull/4775)
|
|
||||||
This helps to unify the JSON serialization format of transactions. (https://github.com/XRPLF/clio/issues/722, https://github.com/XRPLF/rippled/issues/4727)
|
|
||||||
|
|
||||||
- JSON transaction element is named `tx_json`
|
|
||||||
- Binary transaction element is named `tx_blob`
|
|
||||||
- JSON transaction metadata element is named `meta`
|
|
||||||
- Binary transaction metadata element is named `meta_blob`
|
|
||||||
|
|
||||||
Additionally, these elements are now consistently available next to `tx_json` (i.e. sibling elements), where possible:
|
|
||||||
|
|
||||||
- `hash` - Transaction ID. This data was stored inside transaction output in API version 1, but in API version 2 is a sibling element.
|
|
||||||
- `ledger_index` - Ledger index (only set on validated ledgers)
|
|
||||||
- `ledger_hash` - Ledger hash (only set on closed or validated ledgers)
|
|
||||||
- `close_time_iso` - Ledger close time expressed in ISO 8601 time format (only set on validated ledgers)
|
|
||||||
- `validated` - Bool element set to `true` if the transaction is in a validated ledger, otherwise `false`
|
|
||||||
|
|
||||||
This change affects the following methods:
|
|
||||||
|
|
||||||
- `tx` - Transaction data moved into element `tx_json` (was inline inside `result`) or, if binary output was requested, moved from `tx` to `tx_blob`. Renamed binary transaction metadata element (if it was requested) from `meta` to `meta_blob`. Changed location of `hash` and added new elements
|
|
||||||
- `account_tx` - Renamed transaction element from `tx` to `tx_json`. Renamed binary transaction metadata element (if it was requested) from `meta` to `meta_blob`. Changed location of `hash` and added new elements
|
|
||||||
- `transaction_entry` - Renamed transaction metadata element from `metadata` to `meta`. Changed location of `hash` and added new elements
|
|
||||||
- `subscribe` - Renamed transaction element from `transaction` to `tx_json`. Changed location of `hash` and added new elements
|
|
||||||
- `sign`, `sign_for`, `submit` and `submit_multisigned` - Changed location of `hash` element.
|
|
||||||
|
|
||||||
#### Modification to `Payment` transaction JSON schema
|
|
||||||
|
|
||||||
When reading Payments, the `Amount` field should generally **not** be used. Instead, use [delivered_amount](https://xrpl.org/partial-payments.html#the-delivered_amount-field) to see the amount that the Payment delivered. To clarify its meaning, the `Amount` field is being renamed to `DeliverMax`. (https://github.com/XRPLF/rippled/pull/4733)
|
|
||||||
|
|
||||||
- In `Payment` transaction type, JSON RPC field `Amount` is renamed to `DeliverMax`. To enable smooth client transition, `Amount` is still handled, as described below: (https://github.com/XRPLF/rippled/pull/4733)
|
|
||||||
- On JSON RPC input (e.g. `submit_multisigned` etc. methods), `Amount` is recognized as an alias to `DeliverMax` for both API version 1 and version 2 clients.
|
|
||||||
- On JSON RPC input, submitting both `Amount` and `DeliverMax` fields is allowed _only_ if they are identical; otherwise such input is rejected with `rpcINVALID_PARAMS` error.
|
|
||||||
- On JSON RPC output (e.g. `subscribe`, `account_tx` etc. methods), `DeliverMax` is present in both API version 1 and version 2.
|
|
||||||
- On JSON RPC output, `Amount` is only present in API version 1 and _not_ in version 2.
|
|
||||||
|
|
||||||
#### Modifications to account_info response
|
|
||||||
|
|
||||||
- `signer_lists` is returned in the root of the response. In API version 1, it was nested under `account_data`. (https://github.com/XRPLF/rippled/pull/3770)
|
|
||||||
- When using an invalid `signer_lists` value, the API now returns an "invalidParams" error. (https://github.com/XRPLF/rippled/pull/4585)
|
|
||||||
- (`signer_lists` must be a boolean. In API version 1, strings were accepted and may return a normal response - i.e. as if `signer_lists` were `true`.)
|
|
||||||
|
|
||||||
#### Modifications to [account_tx](https://xrpl.org/account_tx.html#account_tx) response
|
|
||||||
|
|
||||||
- Using `ledger_index_min`, `ledger_index_max`, and `ledger_index` returns `invalidParams` because if you use `ledger_index_min` or `ledger_index_max`, then it does not make sense to also specify `ledger_index`. In API version 1, no error was returned. (https://github.com/XRPLF/rippled/pull/4571)
|
|
||||||
- The same applies for `ledger_index_min`, `ledger_index_max`, and `ledger_hash`. (https://github.com/XRPLF/rippled/issues/4545#issuecomment-1565065579)
|
|
||||||
- Using a `ledger_index_min` or `ledger_index_max` beyond the range of ledgers that the server has:
|
|
||||||
- returns `lgrIdxMalformed` in API version 2. Previously, in API version 1, no error was returned. (https://github.com/XRPLF/rippled/issues/4288)
|
|
||||||
- Attempting to use a non-boolean value (such as a string) for the `binary` or `forward` parameters returns `invalidParams` (`rpcINVALID_PARAMS`). Previously, in API version 1, no error was returned. (https://github.com/XRPLF/rippled/pull/4620)
|
|
||||||
|
|
||||||
#### Modifications to [noripple_check](https://xrpl.org/noripple_check.html#noripple_check) response
|
|
||||||
|
|
||||||
- Attempting to use a non-boolean value (such as a string) for the `transactions` parameter returns `invalidParams` (`rpcINVALID_PARAMS`). Previously, in API version 1, no error was returned. (https://github.com/XRPLF/rippled/pull/4620)
|
|
||||||
|
|
||||||
# Unit tests for API changes
|
# Unit tests for API changes
|
||||||
|
|
||||||
The following information is useful to developers contributing to this project:
|
The following information is useful to developers contributing to this project:
|
||||||
|
|||||||
63
BUILD.md
63
BUILD.md
@@ -36,9 +36,15 @@ See [System Requirements](https://xrpl.org/system-requirements.html).
|
|||||||
Building rippled generally requires git, Python, Conan, CMake, and a C++ compiler. Some guidance on setting up such a [C++ development environment can be found here](./docs/build/environment.md).
|
Building rippled generally requires git, Python, Conan, CMake, and a C++ compiler. Some guidance on setting up such a [C++ development environment can be found here](./docs/build/environment.md).
|
||||||
|
|
||||||
- [Python 3.7](https://www.python.org/downloads/)
|
- [Python 3.7](https://www.python.org/downloads/)
|
||||||
- [Conan 1.55](https://conan.io/downloads.html)
|
- [Conan 1.60](https://conan.io/downloads.html)[^1]
|
||||||
- [CMake 3.16](https://cmake.org/download/)
|
- [CMake 3.16](https://cmake.org/download/)
|
||||||
|
|
||||||
|
[^1]: It is possible to build with Conan 2.x,
|
||||||
|
but the instructions are significantly different,
|
||||||
|
which is why we are not recommending it yet.
|
||||||
|
Notably, the `conan profile update` command is removed in 2.x.
|
||||||
|
Profiles must be edited by hand.
|
||||||
|
|
||||||
`rippled` is written in the C++20 dialect and includes the `<concepts>` header.
|
`rippled` is written in the C++20 dialect and includes the `<concepts>` header.
|
||||||
The [minimum compiler versions][2] required are:
|
The [minimum compiler versions][2] required are:
|
||||||
|
|
||||||
@@ -67,9 +73,6 @@ Here are [sample instructions for setting up a C++ development environment on ma
|
|||||||
Windows is not recommended for production use at this time.
|
Windows is not recommended for production use at this time.
|
||||||
|
|
||||||
- Additionally, 32-bit Windows development is not supported.
|
- Additionally, 32-bit Windows development is not supported.
|
||||||
- Visual Studio 2022 is not yet supported.
|
|
||||||
- rippled generally requires [Boost][] 1.77, which Conan cannot build with VS 2022.
|
|
||||||
- Until rippled is updated for compatibility with later versions of Boost, Windows developers may need to use Visual Studio 2019.
|
|
||||||
|
|
||||||
[Boost]: https://www.boost.org/
|
[Boost]: https://www.boost.org/
|
||||||
|
|
||||||
@@ -95,6 +98,12 @@ Update the compiler settings:
|
|||||||
conan profile update settings.compiler.cppstd=20 default
|
conan profile update settings.compiler.cppstd=20 default
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Configure Conan (1.x only) to use recipe revisions:
|
||||||
|
|
||||||
|
```
|
||||||
|
conan config set general.revisions_enabled=1
|
||||||
|
```
|
||||||
|
|
||||||
**Linux** developers will commonly have a default Conan [profile][] that compiles
|
**Linux** developers will commonly have a default Conan [profile][] that compiles
|
||||||
with GCC and links with libstdc++.
|
with GCC and links with libstdc++.
|
||||||
If you are linking with libstdc++ (see profile setting `compiler.libcxx`),
|
If you are linking with libstdc++ (see profile setting `compiler.libcxx`),
|
||||||
@@ -104,6 +113,20 @@ then you will need to choose the `libstdc++11` ABI:
|
|||||||
conan profile update settings.compiler.libcxx=libstdc++11 default
|
conan profile update settings.compiler.libcxx=libstdc++11 default
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Ensure inter-operability between `boost::string_view` and `std::string_view` types:
|
||||||
|
|
||||||
|
```
|
||||||
|
conan profile update 'conf.tools.build:cxxflags+=["-DBOOST_BEAST_USE_STD_STRING_VIEW"]' default
|
||||||
|
conan profile update 'env.CXXFLAGS="-DBOOST_BEAST_USE_STD_STRING_VIEW"' default
|
||||||
|
```
|
||||||
|
|
||||||
|
If you have other flags in the `conf.tools.build` or `env.CXXFLAGS` sections, make sure to retain the existing flags and append the new ones. You can check them with:
|
||||||
|
```
|
||||||
|
conan profile show default
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
**Windows** developers may need to use the x64 native build tools.
|
**Windows** developers may need to use the x64 native build tools.
|
||||||
An easy way to do that is to run the shortcut "x64 Native Tools Command
|
An easy way to do that is to run the shortcut "x64 Native Tools Command
|
||||||
Prompt" for the version of Visual Studio that you have installed.
|
Prompt" for the version of Visual Studio that you have installed.
|
||||||
@@ -144,21 +167,41 @@ It does not explicitly link the C++ standard library,
|
|||||||
which allows you to statically link it with GCC, if you want.
|
which allows you to statically link it with GCC, if you want.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
# Conan 1.x
|
||||||
conan export external/snappy snappy/1.1.10@
|
conan export external/snappy snappy/1.1.10@
|
||||||
|
# Conan 2.x
|
||||||
|
conan export --version 1.1.10 external/snappy
|
||||||
```
|
```
|
||||||
|
|
||||||
Export our [Conan recipe for RocksDB](./external/rocksdb).
|
Export our [Conan recipe for RocksDB](./external/rocksdb).
|
||||||
It does not override paths to dependencies when building with Visual Studio.
|
It does not override paths to dependencies when building with Visual Studio.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
# Conan 1.x
|
||||||
conan export external/rocksdb rocksdb/6.29.5@
|
conan export external/rocksdb rocksdb/6.29.5@
|
||||||
|
# Conan 2.x
|
||||||
|
conan export --version 6.29.5 external/rocksdb
|
||||||
```
|
```
|
||||||
|
|
||||||
Export our [Conan recipe for SOCI](./external/soci).
|
Export our [Conan recipe for SOCI](./external/soci).
|
||||||
It patches their CMake to correctly import its dependencies.
|
It patches their CMake to correctly import its dependencies.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
# Conan 1.x
|
||||||
conan export external/soci soci/4.0.3@
|
conan export external/soci soci/4.0.3@
|
||||||
|
# Conan 2.x
|
||||||
|
conan export --version 4.0.3 external/soci
|
||||||
|
```
|
||||||
|
|
||||||
|
Export our [Conan recipe for NuDB](./external/nudb).
|
||||||
|
It fixes some source files to add missing `#include`s.
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
# Conan 1.x
|
||||||
|
conan export external/nudb nudb/2.0.8@
|
||||||
|
# Conan 2.x
|
||||||
|
conan export --version 2.0.8 external/nudb
|
||||||
```
|
```
|
||||||
|
|
||||||
### Build and Test
|
### Build and Test
|
||||||
@@ -216,7 +259,7 @@ It patches their CMake to correctly import its dependencies.
|
|||||||
Single-config generators:
|
Single-config generators:
|
||||||
|
|
||||||
```
|
```
|
||||||
cmake -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release ..
|
cmake -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release -Dxrpld=ON -Dtests=ON ..
|
||||||
```
|
```
|
||||||
|
|
||||||
Pass the CMake variable [`CMAKE_BUILD_TYPE`][build_type]
|
Pass the CMake variable [`CMAKE_BUILD_TYPE`][build_type]
|
||||||
@@ -226,7 +269,7 @@ It patches their CMake to correctly import its dependencies.
|
|||||||
Multi-config generators:
|
Multi-config generators:
|
||||||
|
|
||||||
```
|
```
|
||||||
cmake -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake ..
|
cmake -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake -Dxrpld=ON -Dtests=ON ..
|
||||||
```
|
```
|
||||||
|
|
||||||
**Note:** You can pass build options for `rippled` in this step.
|
**Note:** You can pass build options for `rippled` in this step.
|
||||||
@@ -317,7 +360,7 @@ Example use with some cmake variables set:
|
|||||||
```
|
```
|
||||||
cd .build
|
cd .build
|
||||||
conan install .. --output-folder . --build missing --settings build_type=Debug
|
conan install .. --output-folder . --build missing --settings build_type=Debug
|
||||||
cmake -DCMAKE_BUILD_TYPE=Debug -Dcoverage=ON -Dcoverage_test_parallelism=2 -Dcoverage_format=html-details -Dcoverage_extra_args="--json coverage.json" -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake ..
|
cmake -DCMAKE_BUILD_TYPE=Debug -Dcoverage=ON -Dxrpld=ON -Dtests=ON -Dcoverage_test_parallelism=2 -Dcoverage_format=html-details -Dcoverage_extra_args="--json coverage.json" -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake ..
|
||||||
cmake --build . --target coverage
|
cmake --build . --target coverage
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -333,11 +376,11 @@ stored inside the build directory, as either of:
|
|||||||
| Option | Default Value | Description |
|
| Option | Default Value | Description |
|
||||||
| --- | ---| ---|
|
| --- | ---| ---|
|
||||||
| `assert` | OFF | Enable assertions.
|
| `assert` | OFF | Enable assertions.
|
||||||
| `reporting` | OFF | Build the reporting mode feature. |
|
|
||||||
| `coverage` | OFF | Prepare the coverage report. |
|
| `coverage` | OFF | Prepare the coverage report. |
|
||||||
| `tests` | ON | Build tests. |
|
|
||||||
| `unity` | ON | Configure a unity build. |
|
|
||||||
| `san` | N/A | Enable a sanitizer with Clang. Choices are `thread` and `address`. |
|
| `san` | N/A | Enable a sanitizer with Clang. Choices are `thread` and `address`. |
|
||||||
|
| `tests` | OFF | Build tests. |
|
||||||
|
| `unity` | ON | Configure a unity build. |
|
||||||
|
| `xrpld` | OFF | Build the xrpld (`rippled`) application, and not just the libxrpl library. |
|
||||||
|
|
||||||
[Unity builds][5] may be faster for the first build
|
[Unity builds][5] may be faster for the first build
|
||||||
(at the cost of much more memory) since they concatenate sources into fewer
|
(at the cost of much more memory) since they concatenate sources into fewer
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,39 +0,0 @@
|
|||||||
#[===================================================================[
|
|
||||||
multiconfig misc
|
|
||||||
#]===================================================================]
|
|
||||||
|
|
||||||
if (is_multiconfig)
|
|
||||||
# This code finds all source files in the src subdirectory for inclusion
|
|
||||||
# in the IDE file tree as non-compiled sources. Since this file list will
|
|
||||||
# have some overlap with files we have already added to our targets to
|
|
||||||
# be compiled, we explicitly remove any of these target source files from
|
|
||||||
# this list.
|
|
||||||
file (GLOB_RECURSE all_sources RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
CONFIGURE_DEPENDS
|
|
||||||
src/*.* Builds/*.md docs/*.md src/*.md Builds/*.cmake)
|
|
||||||
file(GLOB md_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} CONFIGURE_DEPENDS
|
|
||||||
*.md)
|
|
||||||
LIST(APPEND all_sources ${md_files})
|
|
||||||
foreach (_target secp256k1::secp256k1 ed25519::ed25519 xrpl_core rippled)
|
|
||||||
get_target_property (_type ${_target} TYPE)
|
|
||||||
if(_type STREQUAL "INTERFACE_LIBRARY")
|
|
||||||
continue()
|
|
||||||
endif()
|
|
||||||
get_target_property (_src ${_target} SOURCES)
|
|
||||||
list (REMOVE_ITEM all_sources ${_src})
|
|
||||||
endforeach ()
|
|
||||||
target_sources (rippled PRIVATE ${all_sources})
|
|
||||||
set_property (
|
|
||||||
SOURCE ${all_sources}
|
|
||||||
APPEND
|
|
||||||
PROPERTY HEADER_FILE_ONLY true)
|
|
||||||
if (MSVC)
|
|
||||||
set_property(
|
|
||||||
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
PROPERTY VS_STARTUP_PROJECT rippled)
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
group_sources(src)
|
|
||||||
group_sources(docs)
|
|
||||||
group_sources(Builds)
|
|
||||||
endif ()
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
#[===================================================================[
|
|
||||||
read version from source
|
|
||||||
#]===================================================================]
|
|
||||||
|
|
||||||
file (STRINGS src/ripple/protocol/impl/BuildInfo.cpp BUILD_INFO)
|
|
||||||
foreach (line_ ${BUILD_INFO})
|
|
||||||
if (line_ MATCHES "versionString[ ]*=[ ]*\"(.+)\"")
|
|
||||||
set (rippled_version ${CMAKE_MATCH_1})
|
|
||||||
endif ()
|
|
||||||
endforeach ()
|
|
||||||
if (rippled_version)
|
|
||||||
message (STATUS "rippled version: ${rippled_version}")
|
|
||||||
else ()
|
|
||||||
message (FATAL_ERROR "unable to determine rippled version")
|
|
||||||
endif ()
|
|
||||||
@@ -13,12 +13,15 @@ then
|
|||||||
git clean -ix
|
git clean -ix
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Ensure all sorting is ASCII-order consistently across platforms.
|
||||||
|
export LANG=C
|
||||||
|
|
||||||
rm -rfv results
|
rm -rfv results
|
||||||
mkdir results
|
mkdir results
|
||||||
includes="$( pwd )/results/rawincludes.txt"
|
includes="$( pwd )/results/rawincludes.txt"
|
||||||
pushd ../..
|
pushd ../..
|
||||||
echo Raw includes:
|
echo Raw includes:
|
||||||
grep -r '#include.*/.*\.h' src/ripple/ src/test/ | \
|
grep -r '#include.*/.*\.h' include src | \
|
||||||
grep -v boost | tee ${includes}
|
grep -v boost | tee ${includes}
|
||||||
popd
|
popd
|
||||||
pushd results
|
pushd results
|
||||||
|
|||||||
@@ -1,51 +1,45 @@
|
|||||||
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.app > ripple.peerfinder
|
|
||||||
|
|
||||||
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
|
Loop: test.jtx test.toplevel
|
||||||
test.toplevel > test.jtx
|
test.toplevel > test.jtx
|
||||||
|
|
||||||
Loop: test.jtx test.unit_test
|
Loop: test.jtx test.unit_test
|
||||||
test.unit_test == test.jtx
|
test.unit_test == test.jtx
|
||||||
|
|
||||||
|
Loop: xrpl.basics xrpl.json
|
||||||
|
xrpl.json == xrpl.basics
|
||||||
|
|
||||||
|
Loop: xrpld.app xrpld.core
|
||||||
|
xrpld.app > xrpld.core
|
||||||
|
|
||||||
|
Loop: xrpld.app xrpld.ledger
|
||||||
|
xrpld.app > xrpld.ledger
|
||||||
|
|
||||||
|
Loop: xrpld.app xrpld.net
|
||||||
|
xrpld.app > xrpld.net
|
||||||
|
|
||||||
|
Loop: xrpld.app xrpld.overlay
|
||||||
|
xrpld.overlay == xrpld.app
|
||||||
|
|
||||||
|
Loop: xrpld.app xrpld.peerfinder
|
||||||
|
xrpld.app > xrpld.peerfinder
|
||||||
|
|
||||||
|
Loop: xrpld.app xrpld.rpc
|
||||||
|
xrpld.rpc > xrpld.app
|
||||||
|
|
||||||
|
Loop: xrpld.app xrpld.shamap
|
||||||
|
xrpld.app > xrpld.shamap
|
||||||
|
|
||||||
|
Loop: xrpld.core xrpld.net
|
||||||
|
xrpld.net > xrpld.core
|
||||||
|
|
||||||
|
Loop: xrpld.core xrpld.perflog
|
||||||
|
xrpld.perflog == xrpld.core
|
||||||
|
|
||||||
|
Loop: xrpld.net xrpld.rpc
|
||||||
|
xrpld.rpc ~= xrpld.net
|
||||||
|
|
||||||
|
Loop: xrpld.overlay xrpld.rpc
|
||||||
|
xrpld.rpc ~= xrpld.overlay
|
||||||
|
|
||||||
|
Loop: xrpld.perflog xrpld.rpc
|
||||||
|
xrpld.rpc ~= xrpld.perflog
|
||||||
|
|
||||||
|
|||||||
@@ -1,229 +1,195 @@
|
|||||||
ripple.app > ripple.basics
|
libxrpl.basics > xrpl.basics
|
||||||
ripple.app > ripple.beast
|
libxrpl.basics > xrpl.protocol
|
||||||
ripple.app > ripple.conditions
|
libxrpl.crypto > xrpl.basics
|
||||||
ripple.app > ripple.consensus
|
libxrpl.json > xrpl.basics
|
||||||
ripple.app > ripple.crypto
|
libxrpl.json > xrpl.json
|
||||||
ripple.app > ripple.json
|
libxrpl.protocol > xrpl.basics
|
||||||
ripple.app > ripple.protocol
|
libxrpl.protocol > xrpl.json
|
||||||
ripple.app > ripple.resource
|
libxrpl.protocol > xrpl.protocol
|
||||||
ripple.app > test.unit_test
|
libxrpl.resource > xrpl.basics
|
||||||
ripple.basics > ripple.beast
|
libxrpl.resource > xrpl.resource
|
||||||
ripple.conditions > ripple.basics
|
libxrpl.server > xrpl.basics
|
||||||
ripple.conditions > ripple.protocol
|
libxrpl.server > xrpl.json
|
||||||
ripple.consensus > ripple.basics
|
libxrpl.server > xrpl.protocol
|
||||||
ripple.consensus > ripple.beast
|
libxrpl.server > xrpl.server
|
||||||
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.jtx
|
||||||
test.app > test.rpc
|
test.app > test.rpc
|
||||||
test.app > test.toplevel
|
test.app > test.toplevel
|
||||||
test.app > test.unit_test
|
test.app > test.unit_test
|
||||||
test.basics > ripple.basics
|
test.app > xrpl.basics
|
||||||
test.basics > ripple.beast
|
test.app > xrpld.app
|
||||||
test.basics > ripple.json
|
test.app > xrpld.core
|
||||||
test.basics > ripple.protocol
|
test.app > xrpld.ledger
|
||||||
test.basics > ripple.rpc
|
test.app > xrpld.overlay
|
||||||
|
test.app > xrpld.rpc
|
||||||
|
test.app > xrpl.json
|
||||||
|
test.app > xrpl.protocol
|
||||||
|
test.app > xrpl.resource
|
||||||
test.basics > test.jtx
|
test.basics > test.jtx
|
||||||
test.basics > test.unit_test
|
test.basics > test.unit_test
|
||||||
test.beast > ripple.basics
|
test.basics > xrpl.basics
|
||||||
test.beast > ripple.beast
|
test.basics > xrpld.perflog
|
||||||
test.conditions > ripple.basics
|
test.basics > xrpld.rpc
|
||||||
test.conditions > ripple.beast
|
test.basics > xrpl.json
|
||||||
test.conditions > ripple.conditions
|
test.basics > xrpl.protocol
|
||||||
test.consensus > ripple.app
|
test.beast > xrpl.basics
|
||||||
test.consensus > ripple.basics
|
test.conditions > xrpl.basics
|
||||||
test.consensus > ripple.beast
|
test.conditions > xrpld.conditions
|
||||||
test.consensus > ripple.consensus
|
|
||||||
test.consensus > ripple.ledger
|
|
||||||
test.consensus > test.csf
|
test.consensus > test.csf
|
||||||
test.consensus > test.toplevel
|
test.consensus > test.toplevel
|
||||||
test.consensus > test.unit_test
|
test.consensus > test.unit_test
|
||||||
test.core > ripple.basics
|
test.consensus > xrpl.basics
|
||||||
test.core > ripple.beast
|
test.consensus > xrpld.app
|
||||||
test.core > ripple.core
|
test.consensus > xrpld.consensus
|
||||||
test.core > ripple.crypto
|
test.consensus > xrpld.ledger
|
||||||
test.core > ripple.json
|
|
||||||
test.core > ripple.server
|
|
||||||
test.core > test.jtx
|
test.core > test.jtx
|
||||||
test.core > test.toplevel
|
test.core > test.toplevel
|
||||||
test.core > test.unit_test
|
test.core > test.unit_test
|
||||||
test.csf > ripple.basics
|
test.core > xrpl.basics
|
||||||
test.csf > ripple.beast
|
test.core > xrpld.core
|
||||||
test.csf > ripple.consensus
|
test.core > xrpld.perflog
|
||||||
test.csf > ripple.json
|
test.core > xrpl.json
|
||||||
test.csf > ripple.protocol
|
test.core > xrpl.server
|
||||||
test.json > ripple.beast
|
test.csf > xrpl.basics
|
||||||
test.json > ripple.json
|
test.csf > xrpld.consensus
|
||||||
|
test.csf > xrpl.json
|
||||||
|
test.csf > xrpl.protocol
|
||||||
test.json > test.jtx
|
test.json > test.jtx
|
||||||
test.jtx > ripple.app
|
test.json > xrpl.json
|
||||||
test.jtx > ripple.basics
|
test.jtx > xrpl.basics
|
||||||
test.jtx > ripple.beast
|
test.jtx > xrpld.app
|
||||||
test.jtx > ripple.consensus
|
test.jtx > xrpld.consensus
|
||||||
test.jtx > ripple.core
|
test.jtx > xrpld.core
|
||||||
test.jtx > ripple.json
|
test.jtx > xrpld.ledger
|
||||||
test.jtx > ripple.ledger
|
test.jtx > xrpld.net
|
||||||
test.jtx > ripple.net
|
test.jtx > xrpld.rpc
|
||||||
test.jtx > ripple.protocol
|
test.jtx > xrpl.json
|
||||||
test.jtx > ripple.resource
|
test.jtx > xrpl.protocol
|
||||||
test.jtx > ripple.rpc
|
test.jtx > xrpl.resource
|
||||||
test.jtx > ripple.server
|
test.jtx > xrpl.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.jtx
|
||||||
test.ledger > test.toplevel
|
test.ledger > test.toplevel
|
||||||
test.net > ripple.net
|
test.ledger > xrpl.basics
|
||||||
test.net > test.jtx
|
test.ledger > xrpld.app
|
||||||
test.net > test.toplevel
|
test.ledger > xrpld.core
|
||||||
test.net > test.unit_test
|
test.ledger > xrpld.ledger
|
||||||
test.nodestore > ripple.app
|
test.ledger > xrpl.protocol
|
||||||
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.jtx
|
||||||
test.nodestore > test.toplevel
|
test.nodestore > test.toplevel
|
||||||
test.nodestore > test.unit_test
|
test.nodestore > test.unit_test
|
||||||
test.overlay > ripple.app
|
test.nodestore > xrpl.basics
|
||||||
test.overlay > ripple.basics
|
test.nodestore > xrpld.core
|
||||||
test.overlay > ripple.beast
|
test.nodestore > xrpld.nodestore
|
||||||
test.overlay > ripple.overlay
|
test.nodestore > xrpld.unity
|
||||||
test.overlay > ripple.peerfinder
|
|
||||||
test.overlay > ripple.protocol
|
|
||||||
test.overlay > ripple.shamap
|
|
||||||
test.overlay > test.jtx
|
test.overlay > test.jtx
|
||||||
test.overlay > test.unit_test
|
test.overlay > test.unit_test
|
||||||
test.peerfinder > ripple.basics
|
test.overlay > xrpl.basics
|
||||||
test.peerfinder > ripple.beast
|
test.overlay > xrpld.app
|
||||||
test.peerfinder > ripple.core
|
test.overlay > xrpld.overlay
|
||||||
test.peerfinder > ripple.peerfinder
|
test.overlay > xrpld.peerfinder
|
||||||
test.peerfinder > ripple.protocol
|
test.overlay > xrpld.shamap
|
||||||
|
test.overlay > xrpl.protocol
|
||||||
test.peerfinder > test.beast
|
test.peerfinder > test.beast
|
||||||
test.peerfinder > test.unit_test
|
test.peerfinder > test.unit_test
|
||||||
test.protocol > ripple.basics
|
test.peerfinder > xrpl.basics
|
||||||
test.protocol > ripple.beast
|
test.peerfinder > xrpld.core
|
||||||
test.protocol > ripple.crypto
|
test.peerfinder > xrpld.peerfinder
|
||||||
test.protocol > ripple.json
|
test.peerfinder > xrpl.protocol
|
||||||
test.protocol > ripple.protocol
|
|
||||||
test.protocol > test.toplevel
|
test.protocol > test.toplevel
|
||||||
test.resource > ripple.basics
|
test.protocol > xrpl.basics
|
||||||
test.resource > ripple.beast
|
test.protocol > xrpl.json
|
||||||
test.resource > ripple.resource
|
test.protocol > xrpl.protocol
|
||||||
test.resource > test.unit_test
|
test.resource > test.unit_test
|
||||||
test.rpc > ripple.app
|
test.resource > xrpl.basics
|
||||||
test.rpc > ripple.basics
|
test.resource > xrpl.resource
|
||||||
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.jtx
|
||||||
test.rpc > test.nodestore
|
|
||||||
test.rpc > test.toplevel
|
test.rpc > test.toplevel
|
||||||
test.server > ripple.app
|
test.rpc > xrpl.basics
|
||||||
test.server > ripple.basics
|
test.rpc > xrpld.app
|
||||||
test.server > ripple.beast
|
test.rpc > xrpld.core
|
||||||
test.server > ripple.core
|
test.rpc > xrpld.net
|
||||||
test.server > ripple.json
|
test.rpc > xrpld.overlay
|
||||||
test.server > ripple.rpc
|
test.rpc > xrpld.rpc
|
||||||
test.server > ripple.server
|
test.rpc > xrpl.json
|
||||||
|
test.rpc > xrpl.protocol
|
||||||
|
test.rpc > xrpl.resource
|
||||||
test.server > test.jtx
|
test.server > test.jtx
|
||||||
test.server > test.toplevel
|
test.server > test.toplevel
|
||||||
test.server > test.unit_test
|
test.server > test.unit_test
|
||||||
test.shamap > ripple.basics
|
test.server > xrpl.basics
|
||||||
test.shamap > ripple.beast
|
test.server > xrpld.app
|
||||||
test.shamap > ripple.nodestore
|
test.server > xrpld.core
|
||||||
test.shamap > ripple.protocol
|
test.server > xrpld.rpc
|
||||||
test.shamap > ripple.shamap
|
test.server > xrpl.json
|
||||||
|
test.server > xrpl.server
|
||||||
test.shamap > test.unit_test
|
test.shamap > test.unit_test
|
||||||
test.toplevel > ripple.json
|
test.shamap > xrpl.basics
|
||||||
|
test.shamap > xrpld.nodestore
|
||||||
|
test.shamap > xrpld.shamap
|
||||||
|
test.shamap > xrpl.protocol
|
||||||
test.toplevel > test.csf
|
test.toplevel > test.csf
|
||||||
test.unit_test > ripple.basics
|
test.toplevel > xrpl.json
|
||||||
test.unit_test > ripple.beast
|
test.unit_test > xrpl.basics
|
||||||
|
xrpl.protocol > xrpl.basics
|
||||||
|
xrpl.protocol > xrpl.json
|
||||||
|
xrpl.resource > xrpl.basics
|
||||||
|
xrpl.resource > xrpl.json
|
||||||
|
xrpl.resource > xrpl.protocol
|
||||||
|
xrpl.server > xrpl.basics
|
||||||
|
xrpl.server > xrpl.json
|
||||||
|
xrpl.server > xrpl.protocol
|
||||||
|
xrpld.app > test.unit_test
|
||||||
|
xrpld.app > xrpl.basics
|
||||||
|
xrpld.app > xrpld.conditions
|
||||||
|
xrpld.app > xrpld.consensus
|
||||||
|
xrpld.app > xrpld.nodestore
|
||||||
|
xrpld.app > xrpld.perflog
|
||||||
|
xrpld.app > xrpl.json
|
||||||
|
xrpld.app > xrpl.protocol
|
||||||
|
xrpld.app > xrpl.resource
|
||||||
|
xrpld.conditions > xrpl.basics
|
||||||
|
xrpld.conditions > xrpl.protocol
|
||||||
|
xrpld.consensus > xrpl.basics
|
||||||
|
xrpld.consensus > xrpl.json
|
||||||
|
xrpld.consensus > xrpl.protocol
|
||||||
|
xrpld.core > xrpl.basics
|
||||||
|
xrpld.core > xrpl.json
|
||||||
|
xrpld.core > xrpl.protocol
|
||||||
|
xrpld.ledger > xrpl.basics
|
||||||
|
xrpld.ledger > xrpld.core
|
||||||
|
xrpld.ledger > xrpl.json
|
||||||
|
xrpld.ledger > xrpl.protocol
|
||||||
|
xrpld.net > xrpl.basics
|
||||||
|
xrpld.net > xrpl.json
|
||||||
|
xrpld.net > xrpl.protocol
|
||||||
|
xrpld.net > xrpl.resource
|
||||||
|
xrpld.nodestore > xrpl.basics
|
||||||
|
xrpld.nodestore > xrpld.core
|
||||||
|
xrpld.nodestore > xrpld.unity
|
||||||
|
xrpld.nodestore > xrpl.json
|
||||||
|
xrpld.nodestore > xrpl.protocol
|
||||||
|
xrpld.overlay > xrpl.basics
|
||||||
|
xrpld.overlay > xrpld.core
|
||||||
|
xrpld.overlay > xrpld.peerfinder
|
||||||
|
xrpld.overlay > xrpld.perflog
|
||||||
|
xrpld.overlay > xrpl.json
|
||||||
|
xrpld.overlay > xrpl.protocol
|
||||||
|
xrpld.overlay > xrpl.resource
|
||||||
|
xrpld.overlay > xrpl.server
|
||||||
|
xrpld.peerfinder > xrpl.basics
|
||||||
|
xrpld.peerfinder > xrpld.core
|
||||||
|
xrpld.peerfinder > xrpl.protocol
|
||||||
|
xrpld.perflog > xrpl.basics
|
||||||
|
xrpld.perflog > xrpl.json
|
||||||
|
xrpld.perflog > xrpl.protocol
|
||||||
|
xrpld.rpc > xrpl.basics
|
||||||
|
xrpld.rpc > xrpld.core
|
||||||
|
xrpld.rpc > xrpld.ledger
|
||||||
|
xrpld.rpc > xrpld.nodestore
|
||||||
|
xrpld.rpc > xrpl.json
|
||||||
|
xrpld.rpc > xrpl.protocol
|
||||||
|
xrpld.rpc > xrpl.resource
|
||||||
|
xrpld.rpc > xrpl.server
|
||||||
|
xrpld.shamap > xrpl.basics
|
||||||
|
xrpld.shamap > xrpld.nodestore
|
||||||
|
xrpld.shamap > xrpl.protocol
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ endif()
|
|||||||
|
|
||||||
# Fix "unrecognized escape" issues when passing CMAKE_MODULE_PATH on Windows.
|
# Fix "unrecognized escape" issues when passing CMAKE_MODULE_PATH on Windows.
|
||||||
file(TO_CMAKE_PATH "${CMAKE_MODULE_PATH}" CMAKE_MODULE_PATH)
|
file(TO_CMAKE_PATH "${CMAKE_MODULE_PATH}" CMAKE_MODULE_PATH)
|
||||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/Builds/CMake")
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||||
|
|
||||||
project(rippled)
|
project(xrpl)
|
||||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||||
set(CMAKE_CXX_STANDARD 20)
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
@@ -81,7 +81,6 @@ find_package(lz4 REQUIRED)
|
|||||||
find_package(LibArchive REQUIRED)
|
find_package(LibArchive REQUIRED)
|
||||||
find_package(SOCI REQUIRED)
|
find_package(SOCI REQUIRED)
|
||||||
find_package(SQLite3 REQUIRED)
|
find_package(SQLite3 REQUIRED)
|
||||||
find_package(Snappy REQUIRED)
|
|
||||||
|
|
||||||
option(rocksdb "Enable RocksDB" ON)
|
option(rocksdb "Enable RocksDB" ON)
|
||||||
if(rocksdb)
|
if(rocksdb)
|
||||||
@@ -116,22 +115,11 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
target_link_libraries(ripple_libs INTERFACE ${nudb})
|
target_link_libraries(ripple_libs INTERFACE ${nudb})
|
||||||
|
|
||||||
if(reporting)
|
|
||||||
find_package(cassandra-cpp-driver REQUIRED)
|
|
||||||
find_package(PostgreSQL REQUIRED)
|
|
||||||
target_link_libraries(ripple_libs INTERFACE
|
|
||||||
cassandra-cpp-driver::cassandra-cpp-driver
|
|
||||||
PostgreSQL::PostgreSQL
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(coverage)
|
if(coverage)
|
||||||
include(RippledCov)
|
include(RippledCov)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
###
|
set(PROJECT_EXPORT_SET RippleExports)
|
||||||
|
|
||||||
include(RippledCore)
|
include(RippledCore)
|
||||||
include(RippledInstall)
|
include(RippledInstall)
|
||||||
include(RippledMultiConfig)
|
|
||||||
include(RippledValidatorKeys)
|
include(RippledValidatorKeys)
|
||||||
|
|||||||
230
CONTRIBUTING.md
230
CONTRIBUTING.md
@@ -73,27 +73,235 @@ The source must be formatted according to the style guide below.
|
|||||||
|
|
||||||
Header includes must be [levelized](./Builds/levelization).
|
Header includes must be [levelized](./Builds/levelization).
|
||||||
|
|
||||||
|
Changes should be usually squashed down into a single commit.
|
||||||
|
Some larger or more complicated change sets make more sense,
|
||||||
|
and are easier to review if organized into multiple logical commits.
|
||||||
|
Either way, all commits should fit the following criteria:
|
||||||
|
* Changes should be presented in a single commit or a logical
|
||||||
|
sequence of commits.
|
||||||
|
Specifically, chronological commits that simply
|
||||||
|
reflect the history of how the author implemented
|
||||||
|
the change, "warts and all", are not useful to
|
||||||
|
reviewers.
|
||||||
|
* Every commit should have a [good message](#good-commit-messages).
|
||||||
|
to explain a specific aspects of the change.
|
||||||
|
* Every commit should be signed.
|
||||||
|
* Every commit should be well-formed (builds successfully,
|
||||||
|
unit tests passing), as this helps to resolve merge
|
||||||
|
conflicts, and makes it easier to use `git bisect`
|
||||||
|
to find bugs.
|
||||||
|
|
||||||
|
### Good commit messages
|
||||||
|
|
||||||
|
Refer to
|
||||||
|
["How to Write a Git Commit Message"](https://cbea.ms/git-commit/)
|
||||||
|
for general rules on writing a good commit message.
|
||||||
|
|
||||||
|
In addition to those guidelines, please add one of the following
|
||||||
|
prefixes to the subject line if appropriate.
|
||||||
|
* `fix:` - The primary purpose is to fix an existing bug.
|
||||||
|
* `perf:` - The primary purpose is performance improvements.
|
||||||
|
* `refactor:` - The changes refactor code without affecting
|
||||||
|
functionality.
|
||||||
|
* `test:` - The changes _only_ affect unit tests.
|
||||||
|
* `docs:` - The changes _only_ affect documentation. This can
|
||||||
|
include code comments in addition to `.md` files like this one.
|
||||||
|
* `build:` - The changes _only_ affect the build process,
|
||||||
|
including CMake and/or Conan settings.
|
||||||
|
* `chore:` - Other tasks that don't affect the binary, but don't fit
|
||||||
|
any of the other cases. e.g. formatting, git settings, updating
|
||||||
|
Github Actions jobs.
|
||||||
|
|
||||||
|
Whenever possible, when updating commits after the PR is open, please
|
||||||
|
add the PR number to the end of the subject line. e.g. `test: Add
|
||||||
|
unit tests for Feature X (#1234)`.
|
||||||
|
|
||||||
## Pull requests
|
## Pull requests
|
||||||
|
|
||||||
In general, pull requests use `develop` as the base branch.
|
In general, pull requests use `develop` as the base branch.
|
||||||
|
|
||||||
(Hotfixes are an exception.)
|
(Hotfixes are an exception.)
|
||||||
|
|
||||||
Changes to pull requests must be added as new commits.
|
If your changes are not quite ready, but you want to make it easily available
|
||||||
Once code reviewers have started looking at your code, please avoid
|
for preliminary examination or review, you can create a "Draft" pull request.
|
||||||
force-pushing a branch in a pull request.
|
While a pull request is marked as a "Draft", you can rebase or reorganize the
|
||||||
|
commits in the pull request as desired.
|
||||||
|
|
||||||
|
Github pull requests are created as "Ready" by default, or you can mark
|
||||||
|
a "Draft" pull request as "Ready".
|
||||||
|
Once a pull request is marked as "Ready",
|
||||||
|
any changes must be added as new commits. Do not
|
||||||
|
force-push to a branch in a pull request under review.
|
||||||
|
(This includes rebasing your branch onto the updated base branch.
|
||||||
|
Use a merge operation, instead or hit the "Update branch" button
|
||||||
|
at the bottom of the Github PR page.)
|
||||||
This preserves the ability for reviewers to filter changes since their last
|
This preserves the ability for reviewers to filter changes since their last
|
||||||
review.
|
review.
|
||||||
|
|
||||||
A pull request must obtain **approvals from at least two reviewers** before it
|
A pull request must obtain **approvals from at least two reviewers**
|
||||||
can be considered for merge by a Maintainer.
|
before it can be considered for merge by a Maintainer.
|
||||||
Maintainers retain discretion to require more approvals if they feel the
|
Maintainers retain discretion to require more approvals if they feel the
|
||||||
credibility of the existing approvals is insufficient.
|
credibility of the existing approvals is insufficient.
|
||||||
|
|
||||||
Pull requests must be merged by [squash-and-merge][2]
|
Pull requests must be merged by [squash-and-merge][2]
|
||||||
to preserve a linear history for the `develop` branch.
|
to preserve a linear history for the `develop` branch.
|
||||||
|
|
||||||
|
### When and how to merge pull requests
|
||||||
|
|
||||||
|
#### "Passed"
|
||||||
|
|
||||||
|
A pull request should only have the "Passed" label added when it
|
||||||
|
meets a few criteria:
|
||||||
|
|
||||||
|
1. It must have two approving reviews [as described
|
||||||
|
above](#pull-requests). (Exception: PRs that are deemed "trivial"
|
||||||
|
only need one approval.)
|
||||||
|
2. All CI checks must be complete and passed. (One-off failures may
|
||||||
|
be acceptable if they are related to a known issue.)
|
||||||
|
3. The PR must have a [good commit message](#good-commit-messages).
|
||||||
|
* If the PR started with a good commit message, and it doesn't
|
||||||
|
need to be updated, the author can indicate that in a comment.
|
||||||
|
* Any contributor, preferably the author, can leave a comment
|
||||||
|
suggesting a commit message.
|
||||||
|
* If the author squashes and rebases the code in preparation for
|
||||||
|
merge, they should also ensure the commit message(s) are updated
|
||||||
|
as well.
|
||||||
|
4. The PR branch must be up to date with the base branch (usually
|
||||||
|
`develop`). This is usually accomplised by merging the base branch
|
||||||
|
into the feature branch, but if the other criteria are met, the
|
||||||
|
changes can be squashed and rebased on top of the base branch.
|
||||||
|
5. Finally, and most importantly, the author of the PR must
|
||||||
|
positively indicate that the PR is ready to merge. That can be
|
||||||
|
accomplished by adding the "Passed" label if their role allows,
|
||||||
|
or by leaving a comment to the effect that the PR is ready to
|
||||||
|
merge.
|
||||||
|
|
||||||
|
Once the "Passed" label is added, a maintainer may merge the PR at
|
||||||
|
any time, so don't use it lightly.
|
||||||
|
|
||||||
|
#### Instructions for maintainers
|
||||||
|
|
||||||
|
The maintainer should double-check that the PR has met all the
|
||||||
|
necessary criteria, and can request additional information from the
|
||||||
|
owner, or additional reviews, and can always feel free to remove the
|
||||||
|
"Passed" label if appropriate. The maintainer has final say on
|
||||||
|
whether a PR gets merged, and are encouraged to communicate and
|
||||||
|
issues or concerns to other maintainers.
|
||||||
|
|
||||||
|
##### Most pull requests: "Squash and merge"
|
||||||
|
|
||||||
|
Most pull requests don't need special handling, and can simply be
|
||||||
|
merged using the "Squash and merge" button on the Github UI. Update
|
||||||
|
the suggested commit message if necessary.
|
||||||
|
|
||||||
|
##### Slightly more complicated pull requests
|
||||||
|
|
||||||
|
Some pull requests need to be pushed to `develop` as more than one
|
||||||
|
commit. There are multiple ways to accomplish this. If the author
|
||||||
|
describes a process, and it is reasonable, follow it. Otherwise, do
|
||||||
|
a fast forward only merge (`--ff-only`) on the command line and push.
|
||||||
|
|
||||||
|
Either way, check that:
|
||||||
|
* The commits are based on the current tip of `develop`.
|
||||||
|
* The commits are clean: No merge commits (except when reverse
|
||||||
|
merging), no "[FOLD]" or "fixup!" messages.
|
||||||
|
* All commits are signed. If the commits are not signed by the author, use
|
||||||
|
`git commit --amend -S` to sign them yourself.
|
||||||
|
* At least one (but preferably all) of the commits has the PR number
|
||||||
|
in the commit message.
|
||||||
|
|
||||||
|
**Never use the "Create a merge commit" or "Rebase and merge"
|
||||||
|
functions!**
|
||||||
|
|
||||||
|
##### Releases, release candidates, and betas
|
||||||
|
|
||||||
|
All releases, including release candidates and betas, are handled
|
||||||
|
differently from typical PRs. Most importantly, never use
|
||||||
|
the Github UI to merge a release.
|
||||||
|
|
||||||
|
1. There are two possible conditions that the `develop` branch will
|
||||||
|
be in when preparing a release.
|
||||||
|
1. Ready or almost ready to go: There may be one or two PRs that
|
||||||
|
need to be merged, but otherwise, the only change needed is to
|
||||||
|
update the version number in `BuildInfo.cpp`. In this case,
|
||||||
|
merge those PRs as appropriate, updating the second one, and
|
||||||
|
waiting for CI to finish in between. Then update
|
||||||
|
`BuildInfo.cpp`.
|
||||||
|
2. Several pending PRs: In this case, do not use the Github UI,
|
||||||
|
because the delays waiting for CI in between each merge will be
|
||||||
|
unnecessarily onerous. Instead, create a working branch (e.g.
|
||||||
|
`develop-next`) based off of `develop`. Squash the changes
|
||||||
|
from each PR onto the branch, one commit each (unless
|
||||||
|
more are needed), being sure to sign each commit and update
|
||||||
|
the commit message to include the PR number. You may be able
|
||||||
|
to use a fast-forward merge for the first PR. The workflow may
|
||||||
|
look something like:
|
||||||
|
```
|
||||||
|
git fetch upstream
|
||||||
|
git checkout upstream/develop
|
||||||
|
git checkout -b develop-next
|
||||||
|
# Use -S on the ff-only merge if prbranch1 isn't signed.
|
||||||
|
# Or do another branch first.
|
||||||
|
git merge --ff-only user1/prbranch1
|
||||||
|
git merge --squash user2/prbranch2
|
||||||
|
git commit -S
|
||||||
|
git merge --squash user3/prbranch3
|
||||||
|
git commit -S
|
||||||
|
[...]
|
||||||
|
git push --set-upstream origin develop-next
|
||||||
|
</pre>
|
||||||
|
```
|
||||||
|
2. Create the Pull Request with `release` as the base branch. If any
|
||||||
|
of the included PRs are still open,
|
||||||
|
[use closing keywords](https://docs.github.com/articles/closing-issues-using-keywords)
|
||||||
|
in the description to ensure they are closed when the code is
|
||||||
|
released. e.g. "Closes #1234"
|
||||||
|
3. Instead of the default template, reuse and update the message from
|
||||||
|
the previous release. Include the following verbiage somewhere in
|
||||||
|
the description:
|
||||||
|
```
|
||||||
|
The base branch is release. All releases (including betas) go in
|
||||||
|
release. This PR will be merged with --ff-only (not squashed or
|
||||||
|
rebased, and not using the GitHub UI) to both release and develop.
|
||||||
|
```
|
||||||
|
4. Sign-offs for the three platforms usually occur offline, but at
|
||||||
|
least one approval will be needed on the PR.
|
||||||
|
5. Once everything is ready to go, open a terminal, and do the
|
||||||
|
fast-forward merges manually. Do not push any branches until you
|
||||||
|
verify that all of them update correctly.
|
||||||
|
```
|
||||||
|
git fetch upstream
|
||||||
|
git checkout -b upstream--develop -t upstream/develop || git checkout upstream--develop
|
||||||
|
git reset --hard upstream/develop
|
||||||
|
# develop-next must be signed already!
|
||||||
|
git merge --ff-only origin/develop-next
|
||||||
|
git checkout -b upstream--release -t upstream/release || git checkout upstream--release
|
||||||
|
git reset --hard upstream/release
|
||||||
|
git merge --ff-only origin/develop-next
|
||||||
|
# Only do these 3 steps if pushing a release. No betas or RCs
|
||||||
|
git checkout -b upstream--master -t upstream/master || git checkout upstream--master
|
||||||
|
git reset --hard upstream/master
|
||||||
|
git merge --ff-only origin/develop-next
|
||||||
|
# Check that all of the branches are updated
|
||||||
|
git log -1 --oneline
|
||||||
|
# The output should look like:
|
||||||
|
# 02ec8b7962 (HEAD -> upstream--master, origin/develop-next, upstream--release, upstream--develop, develop-next) Set version to 2.2.0-rc1
|
||||||
|
# Note that all of the upstream--develop/release/master are on this commit.
|
||||||
|
# (Master will be missing for betas, etc.)
|
||||||
|
# Just to be safe, do a dry run first:
|
||||||
|
git push --dry-run upstream-push HEAD:develop
|
||||||
|
git push --dry-run upstream-push HEAD:release
|
||||||
|
# git push --dry-run upstream-push HEAD:master
|
||||||
|
# Now push
|
||||||
|
git push upstream-push HEAD:develop
|
||||||
|
git push upstream-push HEAD:release
|
||||||
|
# git push upstream-push HEAD:master
|
||||||
|
# Don't forget to tag the release, too.
|
||||||
|
git tag <version number>
|
||||||
|
git push upstream-push <version number>
|
||||||
|
```
|
||||||
|
6. Finally
|
||||||
|
[create a new release on Github](https://github.com/XRPLF/rippled/releases).
|
||||||
|
|
||||||
|
|
||||||
# Style guide
|
# Style guide
|
||||||
|
|
||||||
@@ -119,6 +327,16 @@ this:
|
|||||||
You can format individual files in place by running `clang-format -i <file>...`
|
You can format individual files in place by running `clang-format -i <file>...`
|
||||||
from any directory within this project.
|
from any directory within this project.
|
||||||
|
|
||||||
|
There is a Continuous Integration job that runs clang-format on pull requests. If the code doesn't comply, a patch file that corrects auto-fixable formatting issues is generated.
|
||||||
|
|
||||||
|
To download the patch file:
|
||||||
|
|
||||||
|
1. Next to `clang-format / check (pull_request) Failing after #s` -> click **Details** to open the details page.
|
||||||
|
2. Left menu -> click **Summary**
|
||||||
|
3. Scroll down to near the bottom-right under `Artifacts` -> click **clang-format.patch**
|
||||||
|
4. Download the zip file and extract it to your local git repository. Run `git apply [patch-file-name]`.
|
||||||
|
5. Commit and push.
|
||||||
|
|
||||||
You can install a pre-commit hook to automatically run `clang-format` before every commit:
|
You can install a pre-commit hook to automatically run `clang-format` before every commit:
|
||||||
```
|
```
|
||||||
pip3 install pre-commit
|
pip3 install pre-commit
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ The [XRP Ledger](https://xrpl.org/) is a decentralized cryptographic ledger powe
|
|||||||
## rippled
|
## 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.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).
|
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).
|
||||||
|
|
||||||
If you are interested in running an **API Server** (including a **Full History Server**) or a **Reporting Mode** server, take a look at [Clio](https://github.com/XRPLF/clio). rippled Reporting Mode is expected to be replaced by Clio.
|
If you are interested in running an **API Server** (including a **Full History Server**), take a look at [Clio](https://github.com/XRPLF/clio). (rippled Reporting Mode has been replaced by Clio.)
|
||||||
|
|
||||||
### Build from Source
|
### Build from Source
|
||||||
|
|
||||||
|
|||||||
@@ -557,7 +557,7 @@ If you operate an XRP Ledger server, upgrade to version 2.0.0 by January 22, 202
|
|||||||
|
|
||||||
- Switched to Unity builds to speed up Windows CI. [#4780](https://github.com/XRPLF/rippled/pull/4780)
|
- Switched to Unity builds to speed up Windows CI. [#4780](https://github.com/XRPLF/rippled/pull/4780)
|
||||||
|
|
||||||
- Clarified what makes concensus healthy in `FeeEscalation.md`. [#4729](https://github.com/XRPLF/rippled/pull/4729)
|
- Clarified what makes consensus healthy in `FeeEscalation.md`. [#4729](https://github.com/XRPLF/rippled/pull/4729)
|
||||||
|
|
||||||
- Removed a dependency on the <ranges> header for unit tests. [#4788](https://github.com/XRPLF/rippled/pull/4788)
|
- Removed a dependency on the <ranges> header for unit tests. [#4788](https://github.com/XRPLF/rippled/pull/4788)
|
||||||
|
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
In this directory are two scripts, `build.sh` and `test.sh` used for building
|
|
||||||
and testing rippled.
|
|
||||||
|
|
||||||
(For now, they assume Bash and Linux. Once I get Windows containers for
|
|
||||||
testing, I'll try them there, but if Bash is not available, then they will
|
|
||||||
soon be joined by PowerShell scripts `build.ps` and `test.ps`.)
|
|
||||||
|
|
||||||
We don't want these scripts to require arcane invocations that can only be
|
|
||||||
pieced together from within a CI configuration. We want something that humans
|
|
||||||
can easily invoke, read, and understand, for when we eventually have to test
|
|
||||||
and debug them interactively. That means:
|
|
||||||
|
|
||||||
(1) They should work with no arguments.
|
|
||||||
(2) They should document their arguments.
|
|
||||||
(3) They should expand short arguments into long arguments.
|
|
||||||
|
|
||||||
While we want to provide options for common use cases, we don't need to offer
|
|
||||||
the kitchen sink. We can rightfully expect users with esoteric, complicated
|
|
||||||
needs to write their own scripts.
|
|
||||||
|
|
||||||
To make argument-handling easy for us, the implementers, we can just take all
|
|
||||||
arguments from environment variables. They have the nice advantage that every
|
|
||||||
command-line uses named arguments. For the benefit of us and our users, we
|
|
||||||
document those variables at the top of each script.
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -o xtrace
|
|
||||||
set -o errexit
|
|
||||||
|
|
||||||
# The build system. Either 'Unix Makefiles' or 'Ninja'.
|
|
||||||
GENERATOR=${GENERATOR:-Unix Makefiles}
|
|
||||||
# The compiler. Either 'gcc' or 'clang'.
|
|
||||||
COMPILER=${COMPILER:-gcc}
|
|
||||||
# The build type. Either 'Debug' or 'Release'.
|
|
||||||
BUILD_TYPE=${BUILD_TYPE:-Debug}
|
|
||||||
# Additional arguments to CMake.
|
|
||||||
# We use the `-` substitution here instead of `:-` so that callers can erase
|
|
||||||
# the default by setting `$CMAKE_ARGS` to the empty string.
|
|
||||||
CMAKE_ARGS=${CMAKE_ARGS-'-Dwerr=ON'}
|
|
||||||
|
|
||||||
# https://gitlab.kitware.com/cmake/cmake/issues/18865
|
|
||||||
CMAKE_ARGS="-DBoost_NO_BOOST_CMAKE=ON ${CMAKE_ARGS}"
|
|
||||||
|
|
||||||
if [[ ${COMPILER} == 'gcc' ]]; then
|
|
||||||
export CC='gcc'
|
|
||||||
export CXX='g++'
|
|
||||||
elif [[ ${COMPILER} == 'clang' ]]; then
|
|
||||||
export CC='clang'
|
|
||||||
export CXX='clang++'
|
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir build
|
|
||||||
cd build
|
|
||||||
cmake -G "${GENERATOR}" -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${CMAKE_ARGS} ..
|
|
||||||
cmake --build . -- -j $(nproc)
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -o xtrace
|
|
||||||
set -o errexit
|
|
||||||
|
|
||||||
# Set to 'true' to run the known "manual" tests in rippled.
|
|
||||||
MANUAL_TESTS=${MANUAL_TESTS:-false}
|
|
||||||
# The maximum number of concurrent tests.
|
|
||||||
CONCURRENT_TESTS=${CONCURRENT_TESTS:-$(nproc)}
|
|
||||||
# The path to rippled.
|
|
||||||
RIPPLED=${RIPPLED:-build/rippled}
|
|
||||||
# Additional arguments to rippled.
|
|
||||||
RIPPLED_ARGS=${RIPPLED_ARGS:-}
|
|
||||||
|
|
||||||
function join_by { local IFS="$1"; shift; echo "$*"; }
|
|
||||||
|
|
||||||
declare -a manual_tests=(
|
|
||||||
'beast.chrono.abstract_clock'
|
|
||||||
'beast.unit_test.print'
|
|
||||||
'ripple.NodeStore.Timing'
|
|
||||||
'ripple.app.Flow_manual'
|
|
||||||
'ripple.app.NoRippleCheckLimits'
|
|
||||||
'ripple.app.PayStrandAllPairs'
|
|
||||||
'ripple.consensus.ByzantineFailureSim'
|
|
||||||
'ripple.consensus.DistributedValidators'
|
|
||||||
'ripple.consensus.ScaleFreeSim'
|
|
||||||
'ripple.tx.CrossingLimits'
|
|
||||||
'ripple.tx.FindOversizeCross'
|
|
||||||
'ripple.tx.Offer_manual'
|
|
||||||
'ripple.tx.OversizeMeta'
|
|
||||||
'ripple.tx.PlumpBook'
|
|
||||||
)
|
|
||||||
|
|
||||||
if [[ ${MANUAL_TESTS} == 'true' ]]; then
|
|
||||||
RIPPLED_ARGS+=" --unittest=$(join_by , "${manual_tests[@]}")"
|
|
||||||
else
|
|
||||||
RIPPLED_ARGS+=" --unittest --quiet --unittest-log"
|
|
||||||
fi
|
|
||||||
RIPPLED_ARGS+=" --unittest-jobs ${CONCURRENT_TESTS}"
|
|
||||||
|
|
||||||
${RIPPLED} ${RIPPLED_ARGS}
|
|
||||||
@@ -1,274 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -ex
|
|
||||||
|
|
||||||
function version_ge() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" == "$1"; }
|
|
||||||
|
|
||||||
__dirname=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
|
||||||
echo "using CC: ${CC}"
|
|
||||||
"${CC}" --version
|
|
||||||
export CC
|
|
||||||
|
|
||||||
COMPNAME=$(basename $CC)
|
|
||||||
echo "using CXX: ${CXX:-notset}"
|
|
||||||
if [[ $CXX ]]; then
|
|
||||||
"${CXX}" --version
|
|
||||||
export CXX
|
|
||||||
fi
|
|
||||||
: ${BUILD_TYPE:=Debug}
|
|
||||||
echo "BUILD TYPE: ${BUILD_TYPE}"
|
|
||||||
|
|
||||||
: ${TARGET:=install}
|
|
||||||
echo "BUILD TARGET: ${TARGET}"
|
|
||||||
|
|
||||||
JOBS=${NUM_PROCESSORS:-2}
|
|
||||||
if [[ ${TRAVIS:-false} != "true" ]]; then
|
|
||||||
JOBS=$((JOBS+1))
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ! -z "${CMAKE_EXE:-}" ]] ; then
|
|
||||||
export PATH="$(dirname ${CMAKE_EXE}):$PATH"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -x /usr/bin/time ] ; then
|
|
||||||
: ${TIME:="Duration: %E"}
|
|
||||||
export TIME
|
|
||||||
time=/usr/bin/time
|
|
||||||
else
|
|
||||||
time=
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Building rippled"
|
|
||||||
: ${CMAKE_EXTRA_ARGS:=""}
|
|
||||||
if [[ ${NINJA_BUILD:-} == true ]]; then
|
|
||||||
CMAKE_EXTRA_ARGS+=" -G Ninja"
|
|
||||||
fi
|
|
||||||
|
|
||||||
coverage=false
|
|
||||||
if [[ "${TARGET}" == "coverage" ]] ; then
|
|
||||||
echo "coverage option detected."
|
|
||||||
coverage=true
|
|
||||||
fi
|
|
||||||
|
|
||||||
cmake --version
|
|
||||||
CMAKE_VER=$(cmake --version | cut -d " " -f 3 | head -1)
|
|
||||||
|
|
||||||
#
|
|
||||||
# allow explicit setting of the name of the build
|
|
||||||
# dir, otherwise default to the compiler.build_type
|
|
||||||
#
|
|
||||||
: "${BUILD_DIR:=${COMPNAME}.${BUILD_TYPE}}"
|
|
||||||
BUILDARGS="--target ${TARGET}"
|
|
||||||
BUILDTOOLARGS=""
|
|
||||||
if version_ge $CMAKE_VER "3.12.0" ; then
|
|
||||||
BUILDARGS+=" --parallel"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ${NINJA_BUILD:-} == false ]]; then
|
|
||||||
if version_ge $CMAKE_VER "3.12.0" ; then
|
|
||||||
BUILDARGS+=" ${JOBS}"
|
|
||||||
else
|
|
||||||
BUILDTOOLARGS+=" -j ${JOBS}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ${VERBOSE_BUILD:-} == true ]]; then
|
|
||||||
CMAKE_EXTRA_ARGS+=" -DCMAKE_VERBOSE_MAKEFILE=ON"
|
|
||||||
if version_ge $CMAKE_VER "3.14.0" ; then
|
|
||||||
BUILDARGS+=" --verbose"
|
|
||||||
else
|
|
||||||
if [[ ${NINJA_BUILD:-} == false ]]; then
|
|
||||||
BUILDTOOLARGS+=" verbose=1"
|
|
||||||
else
|
|
||||||
BUILDTOOLARGS+=" -v"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ${USE_CCACHE:-} == true ]]; then
|
|
||||||
echo "using ccache with basedir [${CCACHE_BASEDIR:-}]"
|
|
||||||
CMAKE_EXTRA_ARGS+=" -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
|
|
||||||
fi
|
|
||||||
if [ -d "build/${BUILD_DIR}" ]; then
|
|
||||||
rm -rf "build/${BUILD_DIR}"
|
|
||||||
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_
|
|
||||||
|
|
||||||
${time} eval cmake --build . ${BUILDARGS} -- ${BUILDTOOLARGS}
|
|
||||||
|
|
||||||
if [[ ${TARGET} == "docs" ]]; then
|
|
||||||
## mimic the standard test output for docs build
|
|
||||||
## to make controlling processes like jenkins happy
|
|
||||||
if [ -f docs/html/index.html ]; then
|
|
||||||
echo "1 case, 1 test total, 0 failures"
|
|
||||||
else
|
|
||||||
echo "1 case, 1 test total, 1 failures"
|
|
||||||
fi
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
popd
|
|
||||||
|
|
||||||
if [[ "${TARGET}" == "validator-keys" ]] ; then
|
|
||||||
export APP_PATH="$PWD/build/${BUILD_DIR}/validator-keys/validator-keys"
|
|
||||||
else
|
|
||||||
export APP_PATH="$PWD/build/${BUILD_DIR}/rippled"
|
|
||||||
fi
|
|
||||||
echo "using APP_PATH: ${APP_PATH}"
|
|
||||||
|
|
||||||
# See what we've actually built
|
|
||||||
ldd ${APP_PATH}
|
|
||||||
|
|
||||||
: ${APP_ARGS:=}
|
|
||||||
|
|
||||||
if [[ "${TARGET}" == "validator-keys" ]] ; then
|
|
||||||
APP_ARGS="--unittest"
|
|
||||||
else
|
|
||||||
function join_by { local IFS="$1"; shift; echo "$*"; }
|
|
||||||
|
|
||||||
# This is a list of manual tests
|
|
||||||
# in rippled that we want to run
|
|
||||||
# ORDER matters here...sorted in approximately
|
|
||||||
# descending execution time (longest running tests at top)
|
|
||||||
declare -a manual_tests=(
|
|
||||||
'ripple.ripple_data.reduce_relay_simulate'
|
|
||||||
'ripple.tx.Offer_manual'
|
|
||||||
'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'
|
|
||||||
'beast.unit_test.print'
|
|
||||||
)
|
|
||||||
if [[ ${TRAVIS:-false} != "true" ]]; then
|
|
||||||
# these two tests cause travis CI to run out of memory.
|
|
||||||
# TODO: investigate possible workarounds.
|
|
||||||
manual_tests=(
|
|
||||||
'ripple.consensus.ScaleFreeSim'
|
|
||||||
'ripple.tx.FindOversizeCross'
|
|
||||||
"${manual_tests[@]}"
|
|
||||||
)
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ${MANUAL_TESTS:-} == true ]]; then
|
|
||||||
APP_ARGS+=" --unittest=$(join_by , "${manual_tests[@]}")"
|
|
||||||
else
|
|
||||||
APP_ARGS+=" --unittest --quiet --unittest-log"
|
|
||||||
fi
|
|
||||||
if [[ ${coverage} == false && ${PARALLEL_TESTS:-} == true ]]; then
|
|
||||||
APP_ARGS+=" --unittest-jobs ${JOBS}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ${IPV6_TESTS:-} == true ]]; then
|
|
||||||
APP_ARGS+=" --unittest-ipv6"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ${coverage} == true && $CC =~ ^gcc ]]; then
|
|
||||||
# Push the results (lcov.info) to codecov
|
|
||||||
codecov -X gcov # don't even try and look for .gcov files ;)
|
|
||||||
find . -name "*.gcda" | xargs rm -f
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ${SKIP_TESTS:-} == true ]]; then
|
|
||||||
echo "skipping tests."
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
ulimit -a
|
|
||||||
corepat=$(cat /proc/sys/kernel/core_pattern)
|
|
||||||
if [[ ${corepat} =~ ^[:space:]*\| ]] ; then
|
|
||||||
echo "WARNING: core pattern is piping - can't search for core files"
|
|
||||||
look_core=false
|
|
||||||
else
|
|
||||||
look_core=true
|
|
||||||
coredir=$(dirname ${corepat})
|
|
||||||
fi
|
|
||||||
if [[ ${look_core} == true ]]; then
|
|
||||||
before=$(ls -A1 ${coredir})
|
|
||||||
fi
|
|
||||||
|
|
||||||
set +e
|
|
||||||
echo "Running tests for ${APP_PATH}"
|
|
||||||
if [[ ${MANUAL_TESTS:-} == true && ${PARALLEL_TESTS:-} != true ]]; then
|
|
||||||
for t in "${manual_tests[@]}" ; do
|
|
||||||
${APP_PATH} --unittest=${t}
|
|
||||||
TEST_STAT=$?
|
|
||||||
if [[ $TEST_STAT -ne 0 ]] ; then
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
else
|
|
||||||
${APP_PATH} ${APP_ARGS}
|
|
||||||
TEST_STAT=$?
|
|
||||||
fi
|
|
||||||
set -e
|
|
||||||
|
|
||||||
if [[ ${look_core} == true ]]; then
|
|
||||||
after=$(ls -A1 ${coredir})
|
|
||||||
oIFS="${IFS}"
|
|
||||||
IFS=$'\n\r'
|
|
||||||
found_core=false
|
|
||||||
for l in $(diff -w --suppress-common-lines <(echo "$before") <(echo "$after")) ; do
|
|
||||||
if [[ "$l" =~ ^[[:space:]]*\>[[:space:]]*(.+)$ ]] ; then
|
|
||||||
corefile="${BASH_REMATCH[1]}"
|
|
||||||
echo "FOUND core dump file at '${coredir}/${corefile}'"
|
|
||||||
gdb_output=$(/bin/mktemp /tmp/gdb_output_XXXXXXXXXX.txt)
|
|
||||||
found_core=true
|
|
||||||
gdb \
|
|
||||||
-ex "set height 0" \
|
|
||||||
-ex "set logging file ${gdb_output}" \
|
|
||||||
-ex "set logging on" \
|
|
||||||
-ex "print 'ripple::BuildInfo::versionString'" \
|
|
||||||
-ex "thread apply all backtrace full" \
|
|
||||||
-ex "info inferiors" \
|
|
||||||
-ex quit \
|
|
||||||
"$APP_PATH" \
|
|
||||||
"${coredir}/${corefile}" &> /dev/null
|
|
||||||
|
|
||||||
echo -e "CORE INFO: \n\n $(cat ${gdb_output}) \n\n)"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
IFS="${oIFS}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ${found_core} == true ]]; then
|
|
||||||
exit -1
|
|
||||||
else
|
|
||||||
exit $TEST_STAT
|
|
||||||
fi
|
|
||||||
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# run our build script in a docker container
|
|
||||||
# using travis-ci hosts
|
|
||||||
set -eux
|
|
||||||
|
|
||||||
function join_by { local IFS="$1"; shift; echo "$*"; }
|
|
||||||
|
|
||||||
set +x
|
|
||||||
echo "VERBOSE_BUILD=true" > /tmp/co.env
|
|
||||||
matchers=(
|
|
||||||
'TRAVIS.*' 'CI' 'CC' 'CXX'
|
|
||||||
'BUILD_TYPE' 'TARGET' 'MAX_TIME'
|
|
||||||
'CODECOV.+' 'CMAKE.*' '.+_TESTS'
|
|
||||||
'.+_OPTIONS' 'NINJA.*' 'NUM_.+'
|
|
||||||
'NIH_.+' 'BOOST.*' '.*CCACHE.*')
|
|
||||||
|
|
||||||
matchstring=$(join_by '|' "${matchers[@]}")
|
|
||||||
echo "MATCHSTRING IS:: $matchstring"
|
|
||||||
env | grep -E "^(${matchstring})=" >> /tmp/co.env
|
|
||||||
set -x
|
|
||||||
# need to eliminate TRAVIS_CMD...don't want to pass it to the container
|
|
||||||
cat /tmp/co.env | grep -v TRAVIS_CMD > /tmp/co.env.2
|
|
||||||
mv /tmp/co.env.2 /tmp/co.env
|
|
||||||
cat /tmp/co.env
|
|
||||||
mkdir -p -m 0777 ${TRAVIS_BUILD_DIR}/cores
|
|
||||||
echo "${TRAVIS_BUILD_DIR}/cores/%e.%p" | sudo tee /proc/sys/kernel/core_pattern
|
|
||||||
docker run \
|
|
||||||
-t --env-file /tmp/co.env \
|
|
||||||
-v ${TRAVIS_HOME}:${TRAVIS_HOME} \
|
|
||||||
-w ${TRAVIS_BUILD_DIR} \
|
|
||||||
--cap-add SYS_PTRACE \
|
|
||||||
--ulimit "core=-1" \
|
|
||||||
$DOCKER_IMAGE \
|
|
||||||
/bin/bash -c 'if [[ $CC =~ ([[:alpha:]]+)-([[:digit:].]+) ]] ; then sudo update-alternatives --set ${BASH_REMATCH[1]} /usr/bin/$CC; fi; bin/ci/ubuntu/build-and-test.sh'
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# 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
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -d _cache/nih_c ] ; then
|
|
||||||
find _cache/nih_c -name "build.ninja" | tar rf cache_ignore.tar --files-from -
|
|
||||||
find _cache/nih_c -name ".ninja_deps" | tar rf cache_ignore.tar --files-from -
|
|
||||||
find _cache/nih_c -name ".ninja_log" | tar rf cache_ignore.tar --files-from -
|
|
||||||
find _cache/nih_c -name "*.log" | tar rf cache_ignore.tar --files-from -
|
|
||||||
find _cache/nih_c -name "*.tlog" | tar rf cache_ignore.tar --files-from -
|
|
||||||
# show .a files in the cache, for sanity checking
|
|
||||||
find _cache/nih_c -name "*.a" -ls
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -d _cache/ccache ] ; then
|
|
||||||
find _cache/ccache -name "stats" | tar rf cache_ignore.tar --files-from -
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f cache_ignore.tar ] ; then
|
|
||||||
tar -tf cache_ignore.tar
|
|
||||||
fi
|
|
||||||
popd
|
|
||||||
|
|
||||||
|
|
||||||
218
bin/physical.sh
Executable file
218
bin/physical.sh
Executable file
@@ -0,0 +1,218 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -o errexit
|
||||||
|
|
||||||
|
marker_base=985c80fbc6131f3a8cedd0da7e8af98dfceb13c7
|
||||||
|
marker_commit=${1:-${marker_base}}
|
||||||
|
|
||||||
|
if [ $(git merge-base ${marker_commit} ${marker_base}) != ${marker_base} ]; then
|
||||||
|
echo "first marker commit not an ancestor: ${marker_commit}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $(git merge-base ${marker_commit} HEAD) != $(git rev-parse --verify ${marker_commit}) ]; then
|
||||||
|
echo "given marker commit not an ancestor: ${marker_commit}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -e Builds/CMake ]; then
|
||||||
|
echo move CMake
|
||||||
|
git mv Builds/CMake cmake
|
||||||
|
git add --update .
|
||||||
|
git commit -m 'Move CMake directory' --author 'Pretty Printer <cpp@ripple.com>'
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -e src/ripple ]; then
|
||||||
|
|
||||||
|
echo move protocol buffers
|
||||||
|
mkdir -p include/xrpl
|
||||||
|
if [ -e src/ripple/proto ]; then
|
||||||
|
git mv src/ripple/proto include/xrpl
|
||||||
|
fi
|
||||||
|
|
||||||
|
extract_list() {
|
||||||
|
git show ${marker_commit}:Builds/CMake/RippledCore.cmake | \
|
||||||
|
awk "/END ${1}/ { p = 0 } p && /src\/ripple/; /BEGIN ${1}/ { p = 1 }" | \
|
||||||
|
sed -e 's#src/ripple/##' -e 's#[^a-z]\+$##'
|
||||||
|
}
|
||||||
|
|
||||||
|
move_files() {
|
||||||
|
oldroot="$1"; shift
|
||||||
|
newroot="$1"; shift
|
||||||
|
detail="$1"; shift
|
||||||
|
files=("$@")
|
||||||
|
for file in ${files[@]}; do
|
||||||
|
if [ ! -e ${oldroot}/${file} ]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
dir=$(dirname ${file})
|
||||||
|
if [ $(basename ${dir}) == 'details' ]; then
|
||||||
|
dir=$(dirname ${dir})
|
||||||
|
fi
|
||||||
|
if [ $(basename ${dir}) == 'impl' ]; then
|
||||||
|
dir="$(dirname ${dir})/${detail}"
|
||||||
|
fi
|
||||||
|
mkdir -p ${newroot}/${dir}
|
||||||
|
git mv ${oldroot}/${file} ${newroot}/${dir}
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
echo move libxrpl headers
|
||||||
|
files=$(extract_list 'LIBXRPL HEADERS')
|
||||||
|
files+=(
|
||||||
|
basics/SlabAllocator.h
|
||||||
|
|
||||||
|
beast/asio/io_latency_probe.h
|
||||||
|
beast/container/aged_container.h
|
||||||
|
beast/container/aged_container_utility.h
|
||||||
|
beast/container/aged_map.h
|
||||||
|
beast/container/aged_multimap.h
|
||||||
|
beast/container/aged_multiset.h
|
||||||
|
beast/container/aged_set.h
|
||||||
|
beast/container/aged_unordered_map.h
|
||||||
|
beast/container/aged_unordered_multimap.h
|
||||||
|
beast/container/aged_unordered_multiset.h
|
||||||
|
beast/container/aged_unordered_set.h
|
||||||
|
beast/container/detail/aged_associative_container.h
|
||||||
|
beast/container/detail/aged_container_iterator.h
|
||||||
|
beast/container/detail/aged_ordered_container.h
|
||||||
|
beast/container/detail/aged_unordered_container.h
|
||||||
|
beast/container/detail/empty_base_optimization.h
|
||||||
|
beast/core/LockFreeStack.h
|
||||||
|
beast/insight/Collector.h
|
||||||
|
beast/insight/Counter.h
|
||||||
|
beast/insight/CounterImpl.h
|
||||||
|
beast/insight/Event.h
|
||||||
|
beast/insight/EventImpl.h
|
||||||
|
beast/insight/Gauge.h
|
||||||
|
beast/insight/GaugeImpl.h
|
||||||
|
beast/insight/Group.h
|
||||||
|
beast/insight/Groups.h
|
||||||
|
beast/insight/Hook.h
|
||||||
|
beast/insight/HookImpl.h
|
||||||
|
beast/insight/Insight.h
|
||||||
|
beast/insight/Meter.h
|
||||||
|
beast/insight/MeterImpl.h
|
||||||
|
beast/insight/NullCollector.h
|
||||||
|
beast/insight/StatsDCollector.h
|
||||||
|
beast/test/fail_counter.h
|
||||||
|
beast/test/fail_stream.h
|
||||||
|
beast/test/pipe_stream.h
|
||||||
|
beast/test/sig_wait.h
|
||||||
|
beast/test/string_iostream.h
|
||||||
|
beast/test/string_istream.h
|
||||||
|
beast/test/string_ostream.h
|
||||||
|
beast/test/test_allocator.h
|
||||||
|
beast/test/yield_to.h
|
||||||
|
beast/utility/hash_pair.h
|
||||||
|
beast/utility/maybe_const.h
|
||||||
|
beast/utility/temp_dir.h
|
||||||
|
|
||||||
|
# included by only json/impl/json_assert.h
|
||||||
|
json/json_errors.h
|
||||||
|
|
||||||
|
protocol/PayChan.h
|
||||||
|
protocol/RippleLedgerHash.h
|
||||||
|
protocol/messages.h
|
||||||
|
protocol/st.h
|
||||||
|
)
|
||||||
|
files+=(
|
||||||
|
basics/README.md
|
||||||
|
crypto/README.md
|
||||||
|
json/README.md
|
||||||
|
protocol/README.md
|
||||||
|
resource/README.md
|
||||||
|
)
|
||||||
|
move_files src/ripple include/xrpl detail ${files[@]}
|
||||||
|
|
||||||
|
echo move libxrpl sources
|
||||||
|
files=$(extract_list 'LIBXRPL SOURCES')
|
||||||
|
move_files src/ripple src/libxrpl "" ${files[@]}
|
||||||
|
|
||||||
|
echo check leftovers
|
||||||
|
dirs=$(cd include/xrpl; ls -d */)
|
||||||
|
dirs=$(cd src/ripple; ls -d ${dirs} 2>/dev/null || true)
|
||||||
|
files="$(cd src/ripple; find ${dirs} -type f)"
|
||||||
|
if [ -n "${files}" ]; then
|
||||||
|
echo "leftover files:"
|
||||||
|
echo ${files}
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo remove empty directories
|
||||||
|
empty_dirs="$(cd src/ripple; find ${dirs} -depth -type d)"
|
||||||
|
for dir in ${empty_dirs[@]}; do
|
||||||
|
if [ -e ${dir} ]; then
|
||||||
|
rmdir ${dir}
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo move xrpld sources
|
||||||
|
files=$(
|
||||||
|
extract_list 'XRPLD SOURCES'
|
||||||
|
cd src/ripple
|
||||||
|
find * -regex '.*\.\(h\|ipp\|md\|pu\|uml\|png\)'
|
||||||
|
)
|
||||||
|
move_files src/ripple src/xrpld detail ${files[@]}
|
||||||
|
|
||||||
|
files="$(cd src/ripple; find . -type f)"
|
||||||
|
if [ -n "${files}" ]; then
|
||||||
|
echo "leftover files:"
|
||||||
|
echo ${files}
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -rf src/ripple
|
||||||
|
|
||||||
|
echo rename .hpp to .h
|
||||||
|
find include src -name '*.hpp' -exec bash -c 'f="{}"; git mv "${f}" "${f%hpp}h"' \;
|
||||||
|
|
||||||
|
echo move PerfLog.h
|
||||||
|
if [ -e include/xrpl/basics/PerfLog.h ]; then
|
||||||
|
git mv include/xrpl/basics/PerfLog.h src/xrpld/perflog
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Make sure all protobuf includes have the correct prefix.
|
||||||
|
protobuf_replace='s:^#include\s*["<].*org/xrpl\([^">]\+\)[">]:#include <xrpl/proto/org/xrpl\1>:'
|
||||||
|
# Make sure first-party includes use angle brackets and .h extension.
|
||||||
|
ripple_replace='s:include\s*["<]ripple/\(.*\)\.h\(pp\)\?[">]:include <ripple/\1.h>:'
|
||||||
|
beast_replace='s:include\s*<beast/:include <xrpl/beast/:'
|
||||||
|
# Rename impl directories to detail.
|
||||||
|
impl_rename='s:\(<xrpl.*\)/impl\(/details\)\?/:\1/detail/:'
|
||||||
|
|
||||||
|
echo rewrite includes in libxrpl
|
||||||
|
find include/xrpl src/libxrpl -type f -exec sed -i \
|
||||||
|
-e "${protobuf_replace}" \
|
||||||
|
-e "${ripple_replace}" \
|
||||||
|
-e "${beast_replace}" \
|
||||||
|
-e 's:^#include <ripple/:#include <xrpl/:' \
|
||||||
|
-e "${impl_rename}" \
|
||||||
|
{} +
|
||||||
|
|
||||||
|
echo rewrite includes in xrpld
|
||||||
|
# # https://www.baeldung.com/linux/join-multiple-lines
|
||||||
|
libxrpl_dirs="$(cd include/xrpl; ls -d1 */ | sed 's:/$::')"
|
||||||
|
# libxrpl_dirs='a\nb\nc\n'
|
||||||
|
readarray -t libxrpl_dirs <<< "${libxrpl_dirs}"
|
||||||
|
# libxrpl_dirs=(a b c)
|
||||||
|
libxrpl_dirs=$(printf -v txt '%s\\|' "${libxrpl_dirs[@]}"; echo "${txt%\\|}")
|
||||||
|
# libxrpl_dirs='a\|b\|c'
|
||||||
|
find src/xrpld src/test -type f -exec sed -i \
|
||||||
|
-e "${protobuf_replace}" \
|
||||||
|
-e "${ripple_replace}" \
|
||||||
|
-e "${beast_replace}" \
|
||||||
|
-e "s:^#include <ripple/basics/PerfLog.h>:#include <xrpld/perflog/PerfLog.h>:" \
|
||||||
|
-e "s:^#include <ripple/\(${libxrpl_dirs}\)/:#include <xrpl/\1/:" \
|
||||||
|
-e 's:^#include <ripple/:#include <xrpld/:' \
|
||||||
|
-e "${impl_rename}" \
|
||||||
|
{} +
|
||||||
|
|
||||||
|
git commit -m 'Rearrange sources' --author 'Pretty Printer <cpp@ripple.com>'
|
||||||
|
find include src -type f \( -name '*.cpp' -o -name '*.h' -o -name '*.ipp' \) -exec clang-format-10 -i {} +
|
||||||
|
git add --update .
|
||||||
|
git commit -m 'Rewrite includes' --author 'Pretty Printer <cpp@ripple.com>'
|
||||||
|
./Builds/levelization/levelization.sh
|
||||||
|
git add --update .
|
||||||
|
git commit -m 'Recompute loops' --author 'Pretty Printer <cpp@ripple.com>'
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
#!/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,7 +13,7 @@
|
|||||||
#
|
#
|
||||||
# 4. HTTPS Client
|
# 4. HTTPS Client
|
||||||
#
|
#
|
||||||
# 5. Reporting Mode
|
# 5. <vacated>
|
||||||
#
|
#
|
||||||
# 6. Database
|
# 6. Database
|
||||||
#
|
#
|
||||||
@@ -417,6 +417,7 @@
|
|||||||
# The default list of entries is:
|
# The default list of entries is:
|
||||||
# - r.ripple.com 51235
|
# - r.ripple.com 51235
|
||||||
# - sahyadri.isrdc.in 51235
|
# - sahyadri.isrdc.in 51235
|
||||||
|
# - hubs.xrpkuwait.com 51235
|
||||||
#
|
#
|
||||||
# Examples:
|
# Examples:
|
||||||
#
|
#
|
||||||
@@ -883,119 +884,6 @@
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# 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
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#-------------------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
# 6. Database
|
# 6. Database
|
||||||
#
|
#
|
||||||
#------------
|
#------------
|
||||||
@@ -1003,13 +891,7 @@
|
|||||||
# rippled creates 4 SQLite database to hold bookkeeping information
|
# rippled creates 4 SQLite database to hold bookkeeping information
|
||||||
# about transactions, local credentials, and various other things.
|
# about transactions, local credentials, and various other things.
|
||||||
# It also creates the NodeDB, which holds all the objects that
|
# It also creates the NodeDB, which holds all the objects that
|
||||||
# make up the current and historical ledgers. In Reporting Mode, rippled
|
# make up the current and historical ledgers.
|
||||||
# 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
|
# 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
|
# amount of historical data (a configurable setting) so the performance of the
|
||||||
@@ -1051,33 +933,10 @@
|
|||||||
# keeping full history is not advised, and using online delete is
|
# keeping full history is not advised, and using online delete is
|
||||||
# recommended.
|
# recommended.
|
||||||
#
|
#
|
||||||
# type = Cassandra
|
|
||||||
#
|
|
||||||
# Apache Cassandra is an open-source, distributed key-value store - see
|
|
||||||
# https://cassandra.apache.org/ for more details.
|
|
||||||
#
|
|
||||||
# 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:
|
# Required keys for NuDB and RocksDB:
|
||||||
#
|
#
|
||||||
# path Location to store the database
|
# 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
|
# Optional keys
|
||||||
#
|
#
|
||||||
# cache_size Size of cache for database records. Default is 16384.
|
# cache_size Size of cache for database records. Default is 16384.
|
||||||
@@ -1094,7 +953,7 @@
|
|||||||
# default value for the unspecified parameter.
|
# default value for the unspecified parameter.
|
||||||
#
|
#
|
||||||
# Note: the cache will not be created if online_delete
|
# Note: the cache will not be created if online_delete
|
||||||
# is specified, or if shards are used.
|
# is specified.
|
||||||
#
|
#
|
||||||
# fast_load Boolean. If set, load the last persisted ledger
|
# fast_load Boolean. If set, load the last persisted ledger
|
||||||
# from disk upon process start before syncing to
|
# from disk upon process start before syncing to
|
||||||
@@ -1107,10 +966,6 @@
|
|||||||
# earliest_seq The default is 32570 to match the XRP ledger
|
# earliest_seq The default is 32570 to match the XRP ledger
|
||||||
# network's earliest allowed sequence. Alternate
|
# network's earliest allowed sequence. Alternate
|
||||||
# networks may set this value. Minimum value of 1.
|
# networks may set this value. Minimum value of 1.
|
||||||
# If a [shard_db] section is defined, and this
|
|
||||||
# value is present either [node_db] or [shard_db],
|
|
||||||
# it must be defined with the same value in both
|
|
||||||
# sections.
|
|
||||||
#
|
#
|
||||||
# online_delete Minimum value of 256. Enable automatic purging
|
# online_delete Minimum value of 256. Enable automatic purging
|
||||||
# of older ledger information. Maintain at least this
|
# of older ledger information. Maintain at least this
|
||||||
@@ -1157,25 +1012,6 @@
|
|||||||
# checking until healthy.
|
# checking until healthy.
|
||||||
# Default is 5.
|
# Default is 5.
|
||||||
#
|
#
|
||||||
# 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:
|
# Notes:
|
||||||
# The 'node_db' entry configures the primary, persistent storage.
|
# The 'node_db' entry configures the primary, persistent storage.
|
||||||
#
|
#
|
||||||
@@ -1192,32 +1028,6 @@
|
|||||||
# your rippled.cfg file.
|
# your rippled.cfg file.
|
||||||
# Partial pathnames are relative to the location of the rippled executable.
|
# Partial pathnames are relative to the location of the rippled executable.
|
||||||
#
|
#
|
||||||
# [shard_db] Settings for the Shard Database (optional)
|
|
||||||
#
|
|
||||||
# Format (without spaces):
|
|
||||||
# One or more lines of case-insensitive key / value pairs:
|
|
||||||
# <key> '=' <value>
|
|
||||||
# ...
|
|
||||||
#
|
|
||||||
# Example:
|
|
||||||
# path=db/shards/nudb
|
|
||||||
#
|
|
||||||
# Required keys:
|
|
||||||
# path Location to store the database
|
|
||||||
#
|
|
||||||
# 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)
|
# [sqlite] Tuning settings for the SQLite databases (optional)
|
||||||
#
|
#
|
||||||
# Format (without spaces):
|
# Format (without spaces):
|
||||||
@@ -1297,40 +1107,18 @@
|
|||||||
# This setting may not be combined with the
|
# This setting may not be combined with the
|
||||||
# "safety_level" setting.
|
# "safety_level" setting.
|
||||||
#
|
#
|
||||||
# [ledger_tx_tables] (optional)
|
# page_size Valid values: integer (MUST be power of 2 between 512 and 65536)
|
||||||
|
# The default is 4096 bytes. This setting determines
|
||||||
|
# the size of a page in the transaction.db file.
|
||||||
|
# See https://www.sqlite.org/pragma.html#pragma_page_size
|
||||||
|
# for more details about the available options.
|
||||||
#
|
#
|
||||||
# conninfo Info for connecting to Postgres. Format is
|
# journal_size_limit Valid values: integer
|
||||||
# postgres://[username]:[password]@[ip]/[database].
|
# The default is 1582080. This setting limits
|
||||||
# The database and user must already exist. If this
|
# the size of the journal for transaction.db file. When the limit is
|
||||||
# section is missing and rippled is running in
|
# reached, older entries will be deleted.
|
||||||
# Reporting Mode, rippled will connect as the
|
# See https://www.sqlite.org/pragma.html#pragma_journal_size_limit
|
||||||
# user running rippled to a database with the
|
# for more details about the available options.
|
||||||
# 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.
|
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
@@ -1596,6 +1384,12 @@
|
|||||||
# Admin level API commands over Secure Websockets, when originating
|
# Admin level API commands over Secure Websockets, when originating
|
||||||
# from the same machine (via the loopback adapter at 127.0.0.1).
|
# from the same machine (via the loopback adapter at 127.0.0.1).
|
||||||
#
|
#
|
||||||
|
# "grpc"
|
||||||
|
#
|
||||||
|
# ETL commands for Clio. We recommend setting secure_gateway
|
||||||
|
# in this section to a comma-separated list of the addresses
|
||||||
|
# of your Clio servers, in order to bypass rippled's rate limiting.
|
||||||
|
#
|
||||||
# This port is commented out but can be enabled by removing
|
# This port is commented out but can be enabled by removing
|
||||||
# the '#' from each corresponding line including the entry under [server]
|
# the '#' from each corresponding line including the entry under [server]
|
||||||
#
|
#
|
||||||
@@ -1674,34 +1468,10 @@ path=/var/lib/rippled/db/nudb
|
|||||||
online_delete=512
|
online_delete=512
|
||||||
advisory_delete=0
|
advisory_delete=0
|
||||||
|
|
||||||
# This is the persistent datastore for shards. It is important for the health
|
|
||||||
# of the ripple network that rippled operators shard as much as practical.
|
|
||||||
# NuDB requires SSD storage. Helpful information can be found at
|
|
||||||
# https://xrpl.org/history-sharding.html
|
|
||||||
#[shard_db]
|
|
||||||
#path=/var/lib/rippled/db/shards/nudb
|
|
||||||
#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]
|
[database_path]
|
||||||
/var/lib/rippled/db
|
/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.
|
# This needs to be an absolute directory reference, not a relative one.
|
||||||
# Modify this value as required.
|
# Modify this value as required.
|
||||||
[debug_logfile]
|
[debug_logfile]
|
||||||
@@ -1729,15 +1499,3 @@ validators.txt
|
|||||||
# set to ssl_verify to 0.
|
# set to ssl_verify to 0.
|
||||||
[ssl_verify]
|
[ssl_verify]
|
||||||
1
|
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
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
140
cmake/RippledCore.cmake
Normal file
140
cmake/RippledCore.cmake
Normal file
@@ -0,0 +1,140 @@
|
|||||||
|
#[===================================================================[
|
||||||
|
Exported targets.
|
||||||
|
#]===================================================================]
|
||||||
|
|
||||||
|
include(target_protobuf_sources)
|
||||||
|
|
||||||
|
# Protocol buffers cannot participate in a unity build,
|
||||||
|
# because all the generated sources
|
||||||
|
# define a bunch of `static const` variables with the same names,
|
||||||
|
# so we just build them as a separate library.
|
||||||
|
add_library(xrpl.libpb)
|
||||||
|
target_protobuf_sources(xrpl.libpb xrpl/proto
|
||||||
|
LANGUAGE cpp
|
||||||
|
IMPORT_DIRS include/xrpl/proto
|
||||||
|
PROTOS include/xrpl/proto/ripple.proto
|
||||||
|
)
|
||||||
|
|
||||||
|
file(GLOB_RECURSE protos "include/xrpl/proto/org/*.proto")
|
||||||
|
target_protobuf_sources(xrpl.libpb xrpl/proto
|
||||||
|
LANGUAGE cpp
|
||||||
|
IMPORT_DIRS include/xrpl/proto
|
||||||
|
PROTOS "${protos}"
|
||||||
|
)
|
||||||
|
target_protobuf_sources(xrpl.libpb xrpl/proto
|
||||||
|
LANGUAGE grpc
|
||||||
|
IMPORT_DIRS include/xrpl/proto
|
||||||
|
PROTOS "${protos}"
|
||||||
|
PLUGIN protoc-gen-grpc=$<TARGET_FILE:gRPC::grpc_cpp_plugin>
|
||||||
|
GENERATE_EXTENSIONS .grpc.pb.h .grpc.pb.cc
|
||||||
|
)
|
||||||
|
|
||||||
|
target_compile_options(xrpl.libpb
|
||||||
|
PUBLIC
|
||||||
|
$<$<BOOL:${MSVC}>:-wd4996>
|
||||||
|
$<$<BOOL:${XCODE}>:
|
||||||
|
--system-header-prefix="google/protobuf"
|
||||||
|
-Wno-deprecated-dynamic-exception-spec
|
||||||
|
>
|
||||||
|
PRIVATE
|
||||||
|
$<$<BOOL:${MSVC}>:-wd4065>
|
||||||
|
$<$<NOT:$<BOOL:${MSVC}>>:-Wno-deprecated-declarations>
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(xrpl.libpb
|
||||||
|
PUBLIC
|
||||||
|
protobuf::libprotobuf
|
||||||
|
gRPC::grpc++
|
||||||
|
)
|
||||||
|
|
||||||
|
add_library(xrpl.libxrpl)
|
||||||
|
set_target_properties(xrpl.libxrpl PROPERTIES OUTPUT_NAME xrpl)
|
||||||
|
if(unity)
|
||||||
|
set_target_properties(xrpl.libxrpl PROPERTIES UNITY_BUILD ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_library(xrpl::libxrpl ALIAS xrpl.libxrpl)
|
||||||
|
|
||||||
|
file(GLOB_RECURSE sources CONFIGURE_DEPENDS
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/src/libxrpl/*.cpp"
|
||||||
|
)
|
||||||
|
target_sources(xrpl.libxrpl PRIVATE ${sources})
|
||||||
|
|
||||||
|
target_include_directories(xrpl.libxrpl
|
||||||
|
PUBLIC
|
||||||
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||||
|
$<INSTALL_INTERFACE:include>)
|
||||||
|
|
||||||
|
target_compile_definitions(xrpl.libxrpl
|
||||||
|
PUBLIC
|
||||||
|
BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT
|
||||||
|
BOOST_CONTAINER_FWD_BAD_DEQUE
|
||||||
|
HAS_UNCAUGHT_EXCEPTIONS=1)
|
||||||
|
|
||||||
|
target_compile_options(xrpl.libxrpl
|
||||||
|
PUBLIC
|
||||||
|
$<$<BOOL:${is_gcc}>:-Wno-maybe-uninitialized>
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(xrpl.libxrpl
|
||||||
|
PUBLIC
|
||||||
|
LibArchive::LibArchive
|
||||||
|
OpenSSL::Crypto
|
||||||
|
Ripple::boost
|
||||||
|
Ripple::opts
|
||||||
|
Ripple::syslibs
|
||||||
|
absl::random_random
|
||||||
|
date::date
|
||||||
|
ed25519::ed25519
|
||||||
|
secp256k1::secp256k1
|
||||||
|
xrpl.libpb
|
||||||
|
xxHash::xxhash
|
||||||
|
)
|
||||||
|
|
||||||
|
if(xrpld)
|
||||||
|
add_executable(rippled)
|
||||||
|
if(unity)
|
||||||
|
set_target_properties(rippled PROPERTIES UNITY_BUILD ON)
|
||||||
|
endif()
|
||||||
|
if(tests)
|
||||||
|
target_compile_definitions(rippled PUBLIC ENABLE_TESTS)
|
||||||
|
endif()
|
||||||
|
target_include_directories(rippled
|
||||||
|
PRIVATE
|
||||||
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
|
||||||
|
)
|
||||||
|
|
||||||
|
file(GLOB_RECURSE sources CONFIGURE_DEPENDS
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/src/xrpld/*.cpp"
|
||||||
|
)
|
||||||
|
target_sources(rippled PRIVATE ${sources})
|
||||||
|
|
||||||
|
if(tests)
|
||||||
|
file(GLOB_RECURSE sources CONFIGURE_DEPENDS
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/src/test/*.cpp"
|
||||||
|
)
|
||||||
|
target_sources(rippled PRIVATE ${sources})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
target_link_libraries(rippled
|
||||||
|
Ripple::boost
|
||||||
|
Ripple::opts
|
||||||
|
Ripple::libs
|
||||||
|
xrpl.libxrpl
|
||||||
|
)
|
||||||
|
exclude_if_included(rippled)
|
||||||
|
# define a macro for tests that might need to
|
||||||
|
# be exluded or run differently in CI environment
|
||||||
|
if(is_ci)
|
||||||
|
target_compile_definitions(rippled PRIVATE RIPPLED_RUNNING_IN_CI)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
# any files that don't play well with unity should be added here
|
||||||
|
if(tests)
|
||||||
|
set_source_files_properties(
|
||||||
|
# these two seem to produce conflicts in beast teardown template methods
|
||||||
|
src/test/rpc/ValidatorRPC_test.cpp
|
||||||
|
src/test/ledger/Invariants_test.cpp
|
||||||
|
PROPERTIES SKIP_UNITY_BUILD_INCLUSION TRUE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
@@ -33,6 +33,6 @@ setup_target_for_coverage_gcovr(
|
|||||||
FORMAT ${coverage_format}
|
FORMAT ${coverage_format}
|
||||||
EXECUTABLE rippled
|
EXECUTABLE rippled
|
||||||
EXECUTABLE_ARGS --unittest$<$<BOOL:${coverage_test}>:=${coverage_test}> --unittest-jobs ${coverage_test_parallelism} --quiet --unittest-log
|
EXECUTABLE_ARGS --unittest$<$<BOOL:${coverage_test}>:=${coverage_test}> --unittest-jobs ${coverage_test_parallelism} --quiet --unittest-log
|
||||||
EXCLUDE "src/test" "${CMAKE_BINARY_DIR}/proto_gen" "${CMAKE_BINARY_DIR}/proto_gen_grpc"
|
EXCLUDE "src/test" "include/xrpl/beast/test" "include/xrpl/beast/unit_test" "${CMAKE_BINARY_DIR}/pb-xrpl.libpb"
|
||||||
DEPENDENCIES rippled
|
DEPENDENCIES rippled
|
||||||
)
|
)
|
||||||
@@ -21,16 +21,17 @@ set(doxyfile "${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile")
|
|||||||
|
|
||||||
file(GLOB_RECURSE doxygen_input
|
file(GLOB_RECURSE doxygen_input
|
||||||
docs/*.md
|
docs/*.md
|
||||||
src/ripple/*.h
|
include/*.h
|
||||||
src/ripple/*.cpp
|
include/*.cpp
|
||||||
src/ripple/*.md
|
include/*.md
|
||||||
src/test/*.h
|
src/*.h
|
||||||
src/test/*.md
|
src/*.cpp
|
||||||
Builds/*/README.md)
|
src/*.md
|
||||||
|
Builds/*.md
|
||||||
|
*.md)
|
||||||
list(APPEND doxygen_input
|
list(APPEND doxygen_input
|
||||||
README.md
|
external/README.md
|
||||||
RELEASENOTES.md
|
)
|
||||||
src/README.md)
|
|
||||||
set(dependencies "${doxygen_input}" "${doxyfile}")
|
set(dependencies "${doxygen_input}" "${doxyfile}")
|
||||||
|
|
||||||
function(verbose_find_path variable name)
|
function(verbose_find_path variable name)
|
||||||
@@ -8,14 +8,26 @@ install (
|
|||||||
opts
|
opts
|
||||||
ripple_syslibs
|
ripple_syslibs
|
||||||
ripple_boost
|
ripple_boost
|
||||||
xrpl_core
|
|
||||||
xrpl.libpb
|
xrpl.libpb
|
||||||
|
xrpl.libxrpl
|
||||||
EXPORT RippleExports
|
EXPORT RippleExports
|
||||||
LIBRARY DESTINATION lib
|
LIBRARY DESTINATION lib
|
||||||
ARCHIVE DESTINATION lib
|
ARCHIVE DESTINATION lib
|
||||||
RUNTIME DESTINATION bin
|
RUNTIME DESTINATION bin
|
||||||
INCLUDES DESTINATION include)
|
INCLUDES DESTINATION include)
|
||||||
|
|
||||||
|
install(
|
||||||
|
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/xrpl"
|
||||||
|
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
|
||||||
|
)
|
||||||
|
|
||||||
|
if(NOT WIN32)
|
||||||
|
install(
|
||||||
|
CODE "file(CREATE_LINK xrpl \
|
||||||
|
\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/ripple SYMBOLIC)"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
install (EXPORT RippleExports
|
install (EXPORT RippleExports
|
||||||
FILE RippleTargets.cmake
|
FILE RippleTargets.cmake
|
||||||
NAMESPACE Ripple::
|
NAMESPACE Ripple::
|
||||||
@@ -26,14 +38,9 @@ write_basic_package_version_file (
|
|||||||
VERSION ${rippled_version}
|
VERSION ${rippled_version}
|
||||||
COMPATIBILITY SameMajorVersion)
|
COMPATIBILITY SameMajorVersion)
|
||||||
|
|
||||||
if (is_root_project)
|
if (is_root_project AND TARGET rippled)
|
||||||
install (TARGETS rippled RUNTIME DESTINATION bin)
|
install (TARGETS rippled RUNTIME DESTINATION bin)
|
||||||
set_target_properties(rippled PROPERTIES INSTALL_RPATH_USE_LINK_PATH ON)
|
set_target_properties(rippled PROPERTIES INSTALL_RPATH_USE_LINK_PATH ON)
|
||||||
install (
|
|
||||||
FILES
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/Builds/CMake/RippleConfig.cmake
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/RippleConfigVersion.cmake
|
|
||||||
DESTINATION lib/cmake/ripple)
|
|
||||||
# sample configs should not overwrite existing files
|
# sample configs should not overwrite existing files
|
||||||
# install if-not-exists workaround as suggested by
|
# install if-not-exists workaround as suggested by
|
||||||
# https://cmake.org/Bug/view.php?id=12646
|
# https://cmake.org/Bug/view.php?id=12646
|
||||||
@@ -48,4 +55,16 @@ if (is_root_project)
|
|||||||
copy_if_not_exists(\"${CMAKE_CURRENT_SOURCE_DIR}/cfg/rippled-example.cfg\" etc rippled.cfg)
|
copy_if_not_exists(\"${CMAKE_CURRENT_SOURCE_DIR}/cfg/rippled-example.cfg\" etc rippled.cfg)
|
||||||
copy_if_not_exists(\"${CMAKE_CURRENT_SOURCE_DIR}/cfg/validators-example.txt\" etc validators.txt)
|
copy_if_not_exists(\"${CMAKE_CURRENT_SOURCE_DIR}/cfg/validators-example.txt\" etc validators.txt)
|
||||||
")
|
")
|
||||||
|
if(NOT WIN32)
|
||||||
|
install(
|
||||||
|
CODE "file(CREATE_LINK rippled${suffix} \
|
||||||
|
\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/xrpld${suffix} SYMBOLIC)"
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
install (
|
||||||
|
FILES
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/cmake/RippleConfig.cmake
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/RippleConfigVersion.cmake
|
||||||
|
DESTINATION lib/cmake/ripple)
|
||||||
@@ -8,7 +8,7 @@ ProcessorCount(PROCESSOR_COUNT)
|
|||||||
|
|
||||||
option(assert "Enables asserts, even in release builds" OFF)
|
option(assert "Enables asserts, even in release builds" OFF)
|
||||||
|
|
||||||
option(reporting "Build rippled with reporting mode enabled" OFF)
|
option(xrpld "Build xrpld" ON)
|
||||||
|
|
||||||
option(tests "Build tests" ON)
|
option(tests "Build tests" ON)
|
||||||
|
|
||||||
15
cmake/RippledVersion.cmake
Normal file
15
cmake/RippledVersion.cmake
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
#[===================================================================[
|
||||||
|
read version from source
|
||||||
|
#]===================================================================]
|
||||||
|
|
||||||
|
file(STRINGS src/libxrpl/protocol/BuildInfo.cpp BUILD_INFO)
|
||||||
|
foreach(line_ ${BUILD_INFO})
|
||||||
|
if(line_ MATCHES "versionString[ ]*=[ ]*\"(.+)\"")
|
||||||
|
set(rippled_version ${CMAKE_MATCH_1})
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
if(rippled_version)
|
||||||
|
message(STATUS "rippled version: ${rippled_version}")
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "unable to determine rippled version")
|
||||||
|
endif()
|
||||||
116
conanfile.py
116
conanfile.py
@@ -15,28 +15,23 @@ class Xrpl(ConanFile):
|
|||||||
'coverage': [True, False],
|
'coverage': [True, False],
|
||||||
'fPIC': [True, False],
|
'fPIC': [True, False],
|
||||||
'jemalloc': [True, False],
|
'jemalloc': [True, False],
|
||||||
'reporting': [True, False],
|
|
||||||
'rocksdb': [True, False],
|
'rocksdb': [True, False],
|
||||||
'shared': [True, False],
|
'shared': [True, False],
|
||||||
'static': [True, False],
|
'static': [True, False],
|
||||||
'tests': [True, False],
|
'tests': [True, False],
|
||||||
'unity': [True, False],
|
'unity': [True, False],
|
||||||
|
'xrpld': [True, False],
|
||||||
}
|
}
|
||||||
|
|
||||||
requires = [
|
requires = [
|
||||||
'boost/1.82.0',
|
|
||||||
'date/3.0.1',
|
'date/3.0.1',
|
||||||
'grpc/1.50.1',
|
'grpc/1.50.1',
|
||||||
'libarchive/3.6.2',
|
'libarchive/3.6.2',
|
||||||
'lz4/1.9.3',
|
|
||||||
'nudb/2.0.8',
|
'nudb/2.0.8',
|
||||||
'openssl/1.1.1u',
|
'openssl/1.1.1u',
|
||||||
'protobuf/3.21.9',
|
|
||||||
'snappy/1.1.10',
|
|
||||||
'soci/4.0.3',
|
'soci/4.0.3',
|
||||||
'sqlite3/3.42.0',
|
|
||||||
'zlib/1.2.13',
|
|
||||||
'xxhash/0.8.2',
|
'xxhash/0.8.2',
|
||||||
|
'zlib/1.2.13',
|
||||||
]
|
]
|
||||||
|
|
||||||
tool_requires = [
|
tool_requires = [
|
||||||
@@ -48,54 +43,51 @@ class Xrpl(ConanFile):
|
|||||||
'coverage': False,
|
'coverage': False,
|
||||||
'fPIC': True,
|
'fPIC': True,
|
||||||
'jemalloc': False,
|
'jemalloc': False,
|
||||||
'reporting': False,
|
|
||||||
'rocksdb': True,
|
'rocksdb': True,
|
||||||
'shared': False,
|
'shared': False,
|
||||||
'static': True,
|
'static': True,
|
||||||
'tests': True,
|
'tests': False,
|
||||||
'unity': False,
|
'unity': False,
|
||||||
|
'xrpld': False,
|
||||||
|
|
||||||
'cassandra-cpp-driver:shared': False,
|
'date/*:header_only': True,
|
||||||
'cassandra-cpp-driver:use_atomic': None,
|
'grpc/*:shared': False,
|
||||||
'date:header_only': True,
|
'grpc/*:secure': True,
|
||||||
'grpc:shared': False,
|
'libarchive/*:shared': False,
|
||||||
'grpc:secure': True,
|
'libarchive/*:with_acl': False,
|
||||||
'libarchive:shared': False,
|
'libarchive/*:with_bzip2': False,
|
||||||
'libarchive:with_acl': False,
|
'libarchive/*:with_cng': False,
|
||||||
'libarchive:with_bzip2': False,
|
'libarchive/*:with_expat': False,
|
||||||
'libarchive:with_cng': False,
|
'libarchive/*:with_iconv': False,
|
||||||
'libarchive:with_expat': False,
|
'libarchive/*:with_libxml2': False,
|
||||||
'libarchive:with_iconv': False,
|
'libarchive/*:with_lz4': True,
|
||||||
'libarchive:with_libxml2': False,
|
'libarchive/*:with_lzma': False,
|
||||||
'libarchive:with_lz4': True,
|
'libarchive/*:with_lzo': False,
|
||||||
'libarchive:with_lzma': False,
|
'libarchive/*:with_nettle': False,
|
||||||
'libarchive:with_lzo': False,
|
'libarchive/*:with_openssl': False,
|
||||||
'libarchive:with_nettle': False,
|
'libarchive/*:with_pcreposix': False,
|
||||||
'libarchive:with_openssl': False,
|
'libarchive/*:with_xattr': False,
|
||||||
'libarchive:with_pcreposix': False,
|
'libarchive/*:with_zlib': False,
|
||||||
'libarchive:with_xattr': False,
|
'lz4/*:shared': False,
|
||||||
'libarchive:with_zlib': False,
|
'openssl/*:shared': False,
|
||||||
'libpq:shared': False,
|
'protobuf/*:shared': False,
|
||||||
'lz4:shared': False,
|
'protobuf/*:with_zlib': True,
|
||||||
'openssl:shared': False,
|
'rocksdb/*:enable_sse': False,
|
||||||
'protobuf:shared': False,
|
'rocksdb/*:lite': False,
|
||||||
'protobuf:with_zlib': True,
|
'rocksdb/*:shared': False,
|
||||||
'rocksdb:enable_sse': False,
|
'rocksdb/*:use_rtti': True,
|
||||||
'rocksdb:lite': False,
|
'rocksdb/*:with_jemalloc': False,
|
||||||
'rocksdb:shared': False,
|
'rocksdb/*:with_lz4': True,
|
||||||
'rocksdb:use_rtti': True,
|
'rocksdb/*:with_snappy': True,
|
||||||
'rocksdb:with_jemalloc': False,
|
'snappy/*:shared': False,
|
||||||
'rocksdb:with_lz4': True,
|
'soci/*:shared': False,
|
||||||
'rocksdb:with_snappy': True,
|
'soci/*:with_sqlite3': True,
|
||||||
'snappy:shared': False,
|
'soci/*:with_boost': True,
|
||||||
'soci:shared': False,
|
'xxhash/*:shared': False,
|
||||||
'soci:with_sqlite3': True,
|
|
||||||
'soci:with_boost': True,
|
|
||||||
'xxhash:shared': False,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def set_version(self):
|
def set_version(self):
|
||||||
path = f'{self.recipe_folder}/src/ripple/protocol/impl/BuildInfo.cpp'
|
path = f'{self.recipe_folder}/src/libxrpl/protocol/BuildInfo.cpp'
|
||||||
regex = r'versionString\s?=\s?\"(.*)\"'
|
regex = r'versionString\s?=\s?\"(.*)\"'
|
||||||
with open(path, 'r') as file:
|
with open(path, 'r') as file:
|
||||||
matches = (re.search(regex, line) for line in file)
|
matches = (re.search(regex, line) for line in file)
|
||||||
@@ -107,16 +99,23 @@ class Xrpl(ConanFile):
|
|||||||
self.options['boost'].visibility = 'global'
|
self.options['boost'].visibility = 'global'
|
||||||
|
|
||||||
def requirements(self):
|
def requirements(self):
|
||||||
|
self.requires('boost/1.82.0', force=True)
|
||||||
|
self.requires('lz4/1.9.3', force=True)
|
||||||
|
self.requires('protobuf/3.21.9', force=True)
|
||||||
|
self.requires('sqlite3/3.42.0', force=True)
|
||||||
if self.options.jemalloc:
|
if self.options.jemalloc:
|
||||||
self.requires('jemalloc/5.3.0')
|
self.requires('jemalloc/5.3.0')
|
||||||
if self.options.reporting:
|
|
||||||
self.requires('cassandra-cpp-driver/2.15.3')
|
|
||||||
self.requires('libpq/14.7')
|
|
||||||
if self.options.rocksdb:
|
if self.options.rocksdb:
|
||||||
self.requires('rocksdb/6.29.5')
|
self.requires('rocksdb/6.29.5')
|
||||||
|
|
||||||
exports_sources = (
|
exports_sources = (
|
||||||
'CMakeLists.txt', 'Builds/*', 'bin/getRippledInfo', 'src/*', 'cfg/*', 'external/*'
|
'CMakeLists.txt',
|
||||||
|
'bin/getRippledInfo',
|
||||||
|
'cfg/*',
|
||||||
|
'cmake/*',
|
||||||
|
'external/*',
|
||||||
|
'include/*',
|
||||||
|
'src/*',
|
||||||
)
|
)
|
||||||
|
|
||||||
def layout(self):
|
def layout(self):
|
||||||
@@ -132,11 +131,11 @@ class Xrpl(ConanFile):
|
|||||||
tc.variables['assert'] = self.options.assertions
|
tc.variables['assert'] = self.options.assertions
|
||||||
tc.variables['coverage'] = self.options.coverage
|
tc.variables['coverage'] = self.options.coverage
|
||||||
tc.variables['jemalloc'] = self.options.jemalloc
|
tc.variables['jemalloc'] = self.options.jemalloc
|
||||||
tc.variables['reporting'] = self.options.reporting
|
|
||||||
tc.variables['rocksdb'] = self.options.rocksdb
|
tc.variables['rocksdb'] = self.options.rocksdb
|
||||||
tc.variables['BUILD_SHARED_LIBS'] = self.options.shared
|
tc.variables['BUILD_SHARED_LIBS'] = self.options.shared
|
||||||
tc.variables['static'] = self.options.static
|
tc.variables['static'] = self.options.static
|
||||||
tc.variables['unity'] = self.options.unity
|
tc.variables['unity'] = self.options.unity
|
||||||
|
tc.variables['xrpld'] = self.options.xrpld
|
||||||
tc.generate()
|
tc.generate()
|
||||||
|
|
||||||
def build(self):
|
def build(self):
|
||||||
@@ -153,7 +152,7 @@ class Xrpl(ConanFile):
|
|||||||
def package_info(self):
|
def package_info(self):
|
||||||
libxrpl = self.cpp_info.components['libxrpl']
|
libxrpl = self.cpp_info.components['libxrpl']
|
||||||
libxrpl.libs = [
|
libxrpl.libs = [
|
||||||
'xrpl_core',
|
'xrpl',
|
||||||
'xrpl.libpb',
|
'xrpl.libpb',
|
||||||
'ed25519',
|
'ed25519',
|
||||||
'secp256k1',
|
'secp256k1',
|
||||||
@@ -163,8 +162,17 @@ class Xrpl(ConanFile):
|
|||||||
libxrpl.includedirs = ['include', 'include/ripple/proto']
|
libxrpl.includedirs = ['include', 'include/ripple/proto']
|
||||||
libxrpl.requires = [
|
libxrpl.requires = [
|
||||||
'boost::boost',
|
'boost::boost',
|
||||||
'openssl::crypto',
|
|
||||||
'date::date',
|
'date::date',
|
||||||
'grpc::grpc++',
|
'grpc::grpc++',
|
||||||
|
'libarchive::libarchive',
|
||||||
|
'lz4::lz4',
|
||||||
|
'nudb::nudb',
|
||||||
|
'openssl::crypto',
|
||||||
|
'protobuf::libprotobuf',
|
||||||
|
'soci::soci',
|
||||||
|
'sqlite3::sqlite',
|
||||||
'xxhash::xxhash',
|
'xxhash::xxhash',
|
||||||
|
'zlib::zlib',
|
||||||
]
|
]
|
||||||
|
if self.options.rocksdb:
|
||||||
|
libxrpl.requires.append('rocksdb::librocksdb')
|
||||||
|
|||||||
@@ -103,18 +103,17 @@ WARN_LOGFILE =
|
|||||||
# Configuration options related to the input files
|
# Configuration options related to the input files
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
INPUT = \
|
INPUT = \
|
||||||
docs \
|
. \
|
||||||
src/ripple \
|
|
||||||
src/test \
|
|
||||||
src/README.md \
|
|
||||||
README.md \
|
|
||||||
RELEASENOTES.md \
|
|
||||||
|
|
||||||
|
|
||||||
INPUT_ENCODING = UTF-8
|
INPUT_ENCODING = UTF-8
|
||||||
FILE_PATTERNS = *.h *.cpp *.md
|
FILE_PATTERNS = *.h *.cpp *.md
|
||||||
RECURSIVE = YES
|
RECURSIVE = YES
|
||||||
EXCLUDE =
|
EXCLUDE = \
|
||||||
|
.github \
|
||||||
|
external/ed25519-donna \
|
||||||
|
external/secp256k1 \
|
||||||
|
|
||||||
EXCLUDE_SYMLINKS = NO
|
EXCLUDE_SYMLINKS = NO
|
||||||
EXCLUDE_PATTERNS =
|
EXCLUDE_PATTERNS =
|
||||||
EXCLUDE_SYMBOLS =
|
EXCLUDE_SYMBOLS =
|
||||||
@@ -130,7 +129,7 @@ INPUT_FILTER =
|
|||||||
FILTER_PATTERNS =
|
FILTER_PATTERNS =
|
||||||
FILTER_SOURCE_FILES = NO
|
FILTER_SOURCE_FILES = NO
|
||||||
FILTER_SOURCE_PATTERNS =
|
FILTER_SOURCE_PATTERNS =
|
||||||
USE_MDFILE_AS_MAINPAGE = src/README.md
|
USE_MDFILE_AS_MAINPAGE = ./README.md
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# Configuration options related to source browsing
|
# Configuration options related to source browsing
|
||||||
|
|||||||
2
docs/build/environment.md
vendored
2
docs/build/environment.md
vendored
@@ -23,7 +23,7 @@ direction.
|
|||||||
|
|
||||||
```
|
```
|
||||||
apt update
|
apt update
|
||||||
apt install --yes curl git libssl-dev python3.10-dev python3-pip make g++-11
|
apt install --yes curl git libssl-dev python3.10-dev python3-pip make g++-11 libprotobuf-dev protobuf-compiler
|
||||||
|
|
||||||
curl --location --remote-name \
|
curl --location --remote-name \
|
||||||
"https://github.com/Kitware/CMake/releases/download/v3.25.1/cmake-3.25.1.tar.gz"
|
"https://github.com/Kitware/CMake/releases/download/v3.25.1/cmake-3.25.1.tar.gz"
|
||||||
|
|||||||
16
examples/example/CMakeLists.txt
Normal file
16
examples/example/CMakeLists.txt
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.21)
|
||||||
|
|
||||||
|
set(name example)
|
||||||
|
set(version 0.1.0)
|
||||||
|
|
||||||
|
project(
|
||||||
|
${name}
|
||||||
|
VERSION ${version}
|
||||||
|
LANGUAGES CXX
|
||||||
|
)
|
||||||
|
|
||||||
|
find_package(xrpl REQUIRED)
|
||||||
|
|
||||||
|
add_executable(example)
|
||||||
|
target_sources(example PRIVATE src/example.cpp)
|
||||||
|
target_link_libraries(example PRIVATE xrpl::libxrpl)
|
||||||
59
examples/example/conanfile.py
Normal file
59
examples/example/conanfile.py
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
from conan import ConanFile, conan_version
|
||||||
|
from conan.tools.cmake import CMake, cmake_layout
|
||||||
|
|
||||||
|
class Example(ConanFile):
|
||||||
|
|
||||||
|
def set_name(self):
|
||||||
|
if self.name is None:
|
||||||
|
self.name = 'example'
|
||||||
|
|
||||||
|
def set_version(self):
|
||||||
|
if self.version is None:
|
||||||
|
self.version = '0.1.0'
|
||||||
|
|
||||||
|
license = 'ISC'
|
||||||
|
author = 'John Freeman <jfreeman08@gmail.com>'
|
||||||
|
|
||||||
|
settings = 'os', 'compiler', 'build_type', 'arch'
|
||||||
|
options = {'shared': [True, False], 'fPIC': [True, False]}
|
||||||
|
default_options = {
|
||||||
|
'shared': False,
|
||||||
|
'fPIC': True,
|
||||||
|
'xrpl:xrpld': False,
|
||||||
|
}
|
||||||
|
|
||||||
|
requires = ['xrpl/2.2.0-rc1@jfreeman/nodestore']
|
||||||
|
generators = ['CMakeDeps', 'CMakeToolchain']
|
||||||
|
|
||||||
|
exports_sources = [
|
||||||
|
'CMakeLists.txt',
|
||||||
|
'cmake/*',
|
||||||
|
'external/*',
|
||||||
|
'include/*',
|
||||||
|
'src/*',
|
||||||
|
]
|
||||||
|
|
||||||
|
# For out-of-source build.
|
||||||
|
# https://docs.conan.io/en/latest/reference/build_helpers/cmake.html#configure
|
||||||
|
no_copy_source = True
|
||||||
|
|
||||||
|
def layout(self):
|
||||||
|
cmake_layout(self)
|
||||||
|
|
||||||
|
def config_options(self):
|
||||||
|
if self.settings.os == 'Windows':
|
||||||
|
del self.options.fPIC
|
||||||
|
|
||||||
|
def build(self):
|
||||||
|
cmake = CMake(self)
|
||||||
|
cmake.configure(variables={'BUILD_TESTING': 'NO'})
|
||||||
|
cmake.build()
|
||||||
|
|
||||||
|
def package(self):
|
||||||
|
cmake = CMake(self)
|
||||||
|
cmake.install()
|
||||||
|
|
||||||
|
def package_info(self):
|
||||||
|
path = f'{self.package_folder}/share/{self.name}/cpp_info.py'
|
||||||
|
with open(path, 'r') as file:
|
||||||
|
exec(file.read(), {}, {'self': self.cpp_info})
|
||||||
8
examples/example/src/example.cpp
Normal file
8
examples/example/src/example.cpp
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#include <cstdio>
|
||||||
|
|
||||||
|
#include <xrpl/protocol/BuildInfo.h>
|
||||||
|
|
||||||
|
int main(int argc, char const** argv) {
|
||||||
|
std::printf("%s\n", ripple::BuildInfo::getVersionString().c_str());
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
2
external/README.md
vendored
2
external/README.md
vendored
@@ -1,3 +1,5 @@
|
|||||||
|
# External Conan recipes
|
||||||
|
|
||||||
The subdirectories in this directory contain either copies or Conan recipes
|
The subdirectories in this directory contain either copies or Conan recipes
|
||||||
of external libraries used by rippled.
|
of external libraries used by rippled.
|
||||||
The Conan recipes include patches we have not yet pushed upstream.
|
The Conan recipes include patches we have not yet pushed upstream.
|
||||||
|
|||||||
10
external/nudb/conandata.yml
vendored
Normal file
10
external/nudb/conandata.yml
vendored
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
sources:
|
||||||
|
"2.0.8":
|
||||||
|
url: "https://github.com/CPPAlliance/NuDB/archive/2.0.8.tar.gz"
|
||||||
|
sha256: "9b71903d8ba111cd893ab064b9a8b6ac4124ed8bd6b4f67250205bc43c7f13a8"
|
||||||
|
patches:
|
||||||
|
"2.0.8":
|
||||||
|
- patch_file: "patches/2.0.8-0001-add-include-stdexcept-for-msvc.patch"
|
||||||
|
patch_description: "Fix build for MSVC by including stdexcept"
|
||||||
|
patch_type: "portability"
|
||||||
|
patch_source: "https://github.com/cppalliance/NuDB/pull/100/files"
|
||||||
72
external/nudb/conanfile.py
vendored
Normal file
72
external/nudb/conanfile.py
vendored
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
import os
|
||||||
|
|
||||||
|
from conan import ConanFile
|
||||||
|
from conan.tools.build import check_min_cppstd
|
||||||
|
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get
|
||||||
|
from conan.tools.layout import basic_layout
|
||||||
|
|
||||||
|
required_conan_version = ">=1.52.0"
|
||||||
|
|
||||||
|
|
||||||
|
class NudbConan(ConanFile):
|
||||||
|
name = "nudb"
|
||||||
|
description = "A fast key/value insert-only database for SSD drives in C++11"
|
||||||
|
license = "BSL-1.0"
|
||||||
|
url = "https://github.com/conan-io/conan-center-index"
|
||||||
|
homepage = "https://github.com/CPPAlliance/NuDB"
|
||||||
|
topics = ("header-only", "KVS", "insert-only")
|
||||||
|
|
||||||
|
package_type = "header-library"
|
||||||
|
settings = "os", "arch", "compiler", "build_type"
|
||||||
|
no_copy_source = True
|
||||||
|
|
||||||
|
@property
|
||||||
|
def _min_cppstd(self):
|
||||||
|
return 11
|
||||||
|
|
||||||
|
def export_sources(self):
|
||||||
|
export_conandata_patches(self)
|
||||||
|
|
||||||
|
def layout(self):
|
||||||
|
basic_layout(self, src_folder="src")
|
||||||
|
|
||||||
|
def requirements(self):
|
||||||
|
self.requires("boost/1.83.0")
|
||||||
|
|
||||||
|
def package_id(self):
|
||||||
|
self.info.clear()
|
||||||
|
|
||||||
|
def validate(self):
|
||||||
|
if self.settings.compiler.cppstd:
|
||||||
|
check_min_cppstd(self, self._min_cppstd)
|
||||||
|
|
||||||
|
def source(self):
|
||||||
|
get(self, **self.conan_data["sources"][self.version], strip_root=True)
|
||||||
|
|
||||||
|
def build(self):
|
||||||
|
apply_conandata_patches(self)
|
||||||
|
|
||||||
|
def package(self):
|
||||||
|
copy(self, "LICENSE*",
|
||||||
|
dst=os.path.join(self.package_folder, "licenses"),
|
||||||
|
src=self.source_folder)
|
||||||
|
copy(self, "*",
|
||||||
|
dst=os.path.join(self.package_folder, "include"),
|
||||||
|
src=os.path.join(self.source_folder, "include"))
|
||||||
|
|
||||||
|
def package_info(self):
|
||||||
|
self.cpp_info.bindirs = []
|
||||||
|
self.cpp_info.libdirs = []
|
||||||
|
|
||||||
|
self.cpp_info.set_property("cmake_target_name", "NuDB")
|
||||||
|
self.cpp_info.set_property("cmake_target_aliases", ["NuDB::nudb"])
|
||||||
|
self.cpp_info.set_property("cmake_find_mode", "both")
|
||||||
|
|
||||||
|
self.cpp_info.components["core"].set_property("cmake_target_name", "nudb")
|
||||||
|
self.cpp_info.components["core"].names["cmake_find_package"] = "nudb"
|
||||||
|
self.cpp_info.components["core"].names["cmake_find_package_multi"] = "nudb"
|
||||||
|
self.cpp_info.components["core"].requires = ["boost::thread", "boost::system"]
|
||||||
|
|
||||||
|
# TODO: to remove in conan v2 once cmake_find_package_* generators removed
|
||||||
|
self.cpp_info.names["cmake_find_package"] = "NuDB"
|
||||||
|
self.cpp_info.names["cmake_find_package_multi"] = "NuDB"
|
||||||
24
external/nudb/patches/2.0.8-0001-add-include-stdexcept-for-msvc.patch
vendored
Normal file
24
external/nudb/patches/2.0.8-0001-add-include-stdexcept-for-msvc.patch
vendored
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
diff --git a/include/nudb/detail/stream.hpp b/include/nudb/detail/stream.hpp
|
||||||
|
index 6c07bf1..e0ce8ed 100644
|
||||||
|
--- a/include/nudb/detail/stream.hpp
|
||||||
|
+++ b/include/nudb/detail/stream.hpp
|
||||||
|
@@ -14,6 +14,7 @@
|
||||||
|
#include <cstdint>
|
||||||
|
#include <cstring>
|
||||||
|
#include <memory>
|
||||||
|
+#include <stdexcept>
|
||||||
|
|
||||||
|
namespace nudb {
|
||||||
|
namespace detail {
|
||||||
|
diff --git a/include/nudb/impl/context.ipp b/include/nudb/impl/context.ipp
|
||||||
|
index beb7058..ffde0b3 100644
|
||||||
|
--- a/include/nudb/impl/context.ipp
|
||||||
|
+++ b/include/nudb/impl/context.ipp
|
||||||
|
@@ -9,6 +9,7 @@
|
||||||
|
#define NUDB_IMPL_CONTEXT_IPP
|
||||||
|
|
||||||
|
#include <nudb/detail/store_base.hpp>
|
||||||
|
+#include <stdexcept>
|
||||||
|
|
||||||
|
namespace nudb {
|
||||||
|
|
||||||
2
external/secp256k1/src/secp256k1.c
vendored
2
external/secp256k1/src/secp256k1.c
vendored
@@ -526,7 +526,7 @@ static int secp256k1_ecdsa_sign_inner(const secp256k1_context* ctx, secp256k1_sc
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
is_nonce_valid = secp256k1_scalar_set_b32_seckey(&non, nonce32);
|
is_nonce_valid = secp256k1_scalar_set_b32_seckey(&non, nonce32);
|
||||||
/* The nonce is still secret here, but it being invalid is is less likely than 1:2^255. */
|
/* The nonce is still secret here, but it being invalid is less likely than 1:2^255. */
|
||||||
secp256k1_declassify(ctx, &is_nonce_valid, sizeof(is_nonce_valid));
|
secp256k1_declassify(ctx, &is_nonce_valid, sizeof(is_nonce_valid));
|
||||||
if (is_nonce_valid) {
|
if (is_nonce_valid) {
|
||||||
ret = secp256k1_ecdsa_sig_sign(&ctx->ecmult_gen_ctx, r, s, &sec, &msg, &non, recid);
|
ret = secp256k1_ecdsa_sig_sign(&ctx->ecmult_gen_ctx, r, s, &sec, &msg, &non, recid);
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
#ifndef RIPPLE_BASICS_BASICCONFIG_H_INCLUDED
|
#ifndef RIPPLE_BASICS_BASICCONFIG_H_INCLUDED
|
||||||
#define RIPPLE_BASICS_BASICCONFIG_H_INCLUDED
|
#define RIPPLE_BASICS_BASICCONFIG_H_INCLUDED
|
||||||
|
|
||||||
#include <ripple/basics/contract.h>
|
#include <xrpl/basics/contract.h>
|
||||||
#include <boost/beast/core/string.hpp>
|
#include <boost/beast/core/string.hpp>
|
||||||
#include <boost/lexical_cast.hpp>
|
#include <boost/lexical_cast.hpp>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
#ifndef RIPPLE_BASICS_BUFFER_H_INCLUDED
|
#ifndef RIPPLE_BASICS_BUFFER_H_INCLUDED
|
||||||
#define RIPPLE_BASICS_BUFFER_H_INCLUDED
|
#define RIPPLE_BASICS_BUFFER_H_INCLUDED
|
||||||
|
|
||||||
#include <ripple/basics/Slice.h>
|
#include <xrpl/basics/Slice.h>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
#ifndef RIPPLED_COMPRESSIONALGORITHMS_H_INCLUDED
|
#ifndef RIPPLED_COMPRESSIONALGORITHMS_H_INCLUDED
|
||||||
#define RIPPLED_COMPRESSIONALGORITHMS_H_INCLUDED
|
#define RIPPLED_COMPRESSIONALGORITHMS_H_INCLUDED
|
||||||
|
|
||||||
#include <ripple/basics/contract.h>
|
#include <xrpl/basics/contract.h>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <lz4.h>
|
#include <lz4.h>
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
#ifndef RIPPLE_BASICS_COUNTEDOBJECT_H_INCLUDED
|
#ifndef RIPPLE_BASICS_COUNTEDOBJECT_H_INCLUDED
|
||||||
#define RIPPLE_BASICS_COUNTEDOBJECT_H_INCLUDED
|
#define RIPPLE_BASICS_COUNTEDOBJECT_H_INCLUDED
|
||||||
|
|
||||||
#include <ripple/beast/type_name.h>
|
#include <xrpl/beast/type_name.h>
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
#ifndef RIPPLE_BASICS_EXPECTED_H_INCLUDED
|
#ifndef RIPPLE_BASICS_EXPECTED_H_INCLUDED
|
||||||
#define RIPPLE_BASICS_EXPECTED_H_INCLUDED
|
#define RIPPLE_BASICS_EXPECTED_H_INCLUDED
|
||||||
|
|
||||||
#include <ripple/basics/contract.h>
|
#include <xrpl/basics/contract.h>
|
||||||
|
|
||||||
#include <boost/outcome.hpp>
|
#include <boost/outcome.hpp>
|
||||||
|
|
||||||
@@ -136,44 +136,49 @@ class [[nodiscard]] Expected
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
template <typename U>
|
template <typename U>
|
||||||
requires std::convertible_to<U, T> constexpr Expected(U && r)
|
requires std::convertible_to<U, T>
|
||||||
: Base(T(std::forward<U>(r)))
|
constexpr Expected(U&& r) : Base(T(std::forward<U>(r)))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename U>
|
template <typename U>
|
||||||
requires std::convertible_to<U, E> &&
|
requires std::convertible_to<U, E> && (!std::is_reference_v<U>)
|
||||||
(!std::is_reference_v<U>)constexpr Expected(Unexpected<U> e)
|
constexpr Expected(Unexpected<U> e) : Base(E(std::move(e.value())))
|
||||||
: Base(E(std::move(e.value())))
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr bool has_value() const
|
constexpr bool
|
||||||
|
has_value() const
|
||||||
{
|
{
|
||||||
return Base::has_value();
|
return Base::has_value();
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr T const& value() const
|
constexpr T const&
|
||||||
|
value() const
|
||||||
{
|
{
|
||||||
return Base::value();
|
return Base::value();
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr T& value()
|
constexpr T&
|
||||||
|
value()
|
||||||
{
|
{
|
||||||
return Base::value();
|
return Base::value();
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr E const& error() const
|
constexpr E const&
|
||||||
|
error() const
|
||||||
{
|
{
|
||||||
return Base::error();
|
return Base::error();
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr E& error()
|
constexpr E&
|
||||||
|
error()
|
||||||
{
|
{
|
||||||
return Base::error();
|
return Base::error();
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr explicit operator bool() const
|
constexpr explicit
|
||||||
|
operator bool() const
|
||||||
{
|
{
|
||||||
return has_value();
|
return has_value();
|
||||||
}
|
}
|
||||||
@@ -181,22 +186,26 @@ public:
|
|||||||
// Add operator* and operator-> so the Expected API looks a bit more like
|
// Add operator* and operator-> so the Expected API looks a bit more like
|
||||||
// what std::expected is likely to look like. See:
|
// what std::expected is likely to look like. See:
|
||||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0323r10.html
|
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0323r10.html
|
||||||
[[nodiscard]] constexpr T& operator*()
|
[[nodiscard]] constexpr T&
|
||||||
|
operator*()
|
||||||
{
|
{
|
||||||
return this->value();
|
return this->value();
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] constexpr T const& operator*() const
|
[[nodiscard]] constexpr T const&
|
||||||
|
operator*() const
|
||||||
{
|
{
|
||||||
return this->value();
|
return this->value();
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] constexpr T* operator->()
|
[[nodiscard]] constexpr T*
|
||||||
|
operator->()
|
||||||
{
|
{
|
||||||
return &this->value();
|
return &this->value();
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] constexpr T const* operator->() const
|
[[nodiscard]] constexpr T const*
|
||||||
|
operator->() const
|
||||||
{
|
{
|
||||||
return &this->value();
|
return &this->value();
|
||||||
}
|
}
|
||||||
@@ -218,23 +227,25 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename U>
|
template <typename U>
|
||||||
requires std::convertible_to<U, E> &&
|
requires std::convertible_to<U, E> && (!std::is_reference_v<U>)
|
||||||
(!std::is_reference_v<U>)constexpr Expected(Unexpected<U> e)
|
constexpr Expected(Unexpected<U> e) : Base(E(std::move(e.value())))
|
||||||
: Base(E(std::move(e.value())))
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr E const& error() const
|
constexpr E const&
|
||||||
|
error() const
|
||||||
{
|
{
|
||||||
return Base::error();
|
return Base::error();
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr E& error()
|
constexpr E&
|
||||||
|
error()
|
||||||
{
|
{
|
||||||
return Base::error();
|
return Base::error();
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr explicit operator bool() const
|
constexpr explicit
|
||||||
|
operator bool() const
|
||||||
{
|
{
|
||||||
return Base::has_value();
|
return Base::has_value();
|
||||||
}
|
}
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
#ifndef BASICS_FEES_H_INCLUDED
|
#ifndef BASICS_FEES_H_INCLUDED
|
||||||
#define BASICS_FEES_H_INCLUDED
|
#define BASICS_FEES_H_INCLUDED
|
||||||
|
|
||||||
#include <ripple/basics/XRPAmount.h>
|
#include <xrpl/basics/XRPAmount.h>
|
||||||
#include <boost/multiprecision/cpp_int.hpp>
|
#include <boost/multiprecision/cpp_int.hpp>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
@@ -110,7 +110,8 @@ public:
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr TaggedFee& operator=(beast::Zero)
|
constexpr TaggedFee&
|
||||||
|
operator=(beast::Zero)
|
||||||
{
|
{
|
||||||
fee_ = 0;
|
fee_ = 0;
|
||||||
return *this;
|
return *this;
|
||||||
@@ -250,7 +251,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Returns true if the amount is not zero */
|
/** Returns true if the amount is not zero */
|
||||||
explicit constexpr operator bool() const noexcept
|
explicit constexpr
|
||||||
|
operator bool() const noexcept
|
||||||
{
|
{
|
||||||
return fee_ != 0;
|
return fee_ != 0;
|
||||||
}
|
}
|
||||||
@@ -354,8 +356,8 @@ template <
|
|||||||
class = enable_if_unit_t<Source1>,
|
class = enable_if_unit_t<Source1>,
|
||||||
class = enable_if_unit_t<Source2>>
|
class = enable_if_unit_t<Source2>>
|
||||||
constexpr bool can_muldiv_sources_v =
|
constexpr bool can_muldiv_sources_v =
|
||||||
can_muldiv_source_v<Source1>&& can_muldiv_source_v<Source2>&& std::
|
can_muldiv_source_v<Source1> && can_muldiv_source_v<Source2> &&
|
||||||
is_same_v<typename Source1::unit_type, typename Source2::unit_type>;
|
std::is_same_v<typename Source1::unit_type, typename Source2::unit_type>;
|
||||||
|
|
||||||
template <
|
template <
|
||||||
class Source1,
|
class Source1,
|
||||||
@@ -20,9 +20,9 @@
|
|||||||
#ifndef RIPPLE_BASICS_IOUAMOUNT_H_INCLUDED
|
#ifndef RIPPLE_BASICS_IOUAMOUNT_H_INCLUDED
|
||||||
#define RIPPLE_BASICS_IOUAMOUNT_H_INCLUDED
|
#define RIPPLE_BASICS_IOUAMOUNT_H_INCLUDED
|
||||||
|
|
||||||
#include <ripple/basics/LocalValue.h>
|
#include <xrpl/basics/LocalValue.h>
|
||||||
#include <ripple/basics/Number.h>
|
#include <xrpl/basics/Number.h>
|
||||||
#include <ripple/beast/utility/Zero.h>
|
#include <xrpl/beast/utility/Zero.h>
|
||||||
#include <boost/operators.hpp>
|
#include <boost/operators.hpp>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -82,7 +82,8 @@ public:
|
|||||||
operator<(IOUAmount const& other) const;
|
operator<(IOUAmount const& other) const;
|
||||||
|
|
||||||
/** Returns true if the amount is not zero */
|
/** Returns true if the amount is not zero */
|
||||||
explicit operator bool() const noexcept;
|
explicit
|
||||||
|
operator bool() const noexcept;
|
||||||
|
|
||||||
/** Return the sign of the amount */
|
/** Return the sign of the amount */
|
||||||
int
|
int
|
||||||
@@ -109,7 +110,8 @@ inline IOUAmount::IOUAmount(std::int64_t mantissa, int exponent)
|
|||||||
normalize();
|
normalize();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline IOUAmount& IOUAmount::operator=(beast::Zero)
|
inline IOUAmount&
|
||||||
|
IOUAmount::operator=(beast::Zero)
|
||||||
{
|
{
|
||||||
// The -100 is used to allow 0 to sort less than small positive values
|
// The -100 is used to allow 0 to sort less than small positive values
|
||||||
// which will have a large negative exponent.
|
// which will have a large negative exponent.
|
||||||
@@ -20,8 +20,8 @@
|
|||||||
#ifndef RIPPLE_BASICS_KEYCACHE_H
|
#ifndef RIPPLE_BASICS_KEYCACHE_H
|
||||||
#define RIPPLE_BASICS_KEYCACHE_H
|
#define RIPPLE_BASICS_KEYCACHE_H
|
||||||
|
|
||||||
#include <ripple/basics/TaggedCache.h>
|
#include <xrpl/basics/TaggedCache.h>
|
||||||
#include <ripple/basics/base_uint.h>
|
#include <xrpl/basics/base_uint.h>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
|
|
||||||
@@ -20,8 +20,8 @@
|
|||||||
#ifndef RIPPLE_BASICS_LOG_H_INCLUDED
|
#ifndef RIPPLE_BASICS_LOG_H_INCLUDED
|
||||||
#define RIPPLE_BASICS_LOG_H_INCLUDED
|
#define RIPPLE_BASICS_LOG_H_INCLUDED
|
||||||
|
|
||||||
#include <ripple/basics/UnorderedContainers.h>
|
#include <xrpl/basics/UnorderedContainers.h>
|
||||||
#include <ripple/beast/utility/Journal.h>
|
#include <xrpl/beast/utility/Journal.h>
|
||||||
#include <boost/beast/core/string.hpp>
|
#include <boost/beast/core/string.hpp>
|
||||||
#include <boost/filesystem.hpp>
|
#include <boost/filesystem.hpp>
|
||||||
#include <map>
|
#include <map>
|
||||||
166
include/xrpl/basics/MPTAmount.h
Normal file
166
include/xrpl/basics/MPTAmount.h
Normal file
@@ -0,0 +1,166 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
/*
|
||||||
|
This file is part of rippled: https://github.com/ripple/rippled
|
||||||
|
Copyright (c) 2024 Ripple Labs Inc.
|
||||||
|
|
||||||
|
Permission to use, copy, modify, and/or 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.
|
||||||
|
*/
|
||||||
|
//==============================================================================
|
||||||
|
|
||||||
|
#ifndef RIPPLE_BASICS_MPTAMOUNT_H_INCLUDED
|
||||||
|
#define RIPPLE_BASICS_MPTAMOUNT_H_INCLUDED
|
||||||
|
|
||||||
|
#include <xrpl/basics/contract.h>
|
||||||
|
#include <xrpl/basics/safe_cast.h>
|
||||||
|
#include <xrpl/beast/utility/Zero.h>
|
||||||
|
#include <xrpl/json/json_value.h>
|
||||||
|
|
||||||
|
#include <boost/multiprecision/cpp_int.hpp>
|
||||||
|
#include <boost/operators.hpp>
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
#include <optional>
|
||||||
|
#include <string>
|
||||||
|
#include <type_traits>
|
||||||
|
|
||||||
|
namespace ripple {
|
||||||
|
|
||||||
|
class MPTAmount : private boost::totally_ordered<MPTAmount>,
|
||||||
|
private boost::additive<MPTAmount>,
|
||||||
|
private boost::equality_comparable<MPTAmount, std::int64_t>,
|
||||||
|
private boost::additive<MPTAmount, std::int64_t>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
using value_type = std::int64_t;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
value_type value_;
|
||||||
|
|
||||||
|
public:
|
||||||
|
MPTAmount() = default;
|
||||||
|
constexpr MPTAmount(MPTAmount const& other) = default;
|
||||||
|
constexpr MPTAmount&
|
||||||
|
operator=(MPTAmount const& other) = default;
|
||||||
|
|
||||||
|
constexpr explicit MPTAmount(value_type value);
|
||||||
|
|
||||||
|
constexpr MPTAmount& operator=(beast::Zero);
|
||||||
|
|
||||||
|
MPTAmount&
|
||||||
|
operator+=(MPTAmount const& other);
|
||||||
|
|
||||||
|
MPTAmount&
|
||||||
|
operator-=(MPTAmount const& other);
|
||||||
|
|
||||||
|
MPTAmount
|
||||||
|
operator-() const;
|
||||||
|
|
||||||
|
bool
|
||||||
|
operator==(MPTAmount const& other) const;
|
||||||
|
|
||||||
|
bool
|
||||||
|
operator==(value_type other) const;
|
||||||
|
|
||||||
|
bool
|
||||||
|
operator<(MPTAmount const& other) const;
|
||||||
|
|
||||||
|
/** Returns true if the amount is not zero */
|
||||||
|
explicit constexpr
|
||||||
|
operator bool() const noexcept;
|
||||||
|
|
||||||
|
/** Return the sign of the amount */
|
||||||
|
constexpr int
|
||||||
|
signum() const noexcept;
|
||||||
|
|
||||||
|
/** Returns the underlying value. Code SHOULD NOT call this
|
||||||
|
function unless the type has been abstracted away,
|
||||||
|
e.g. in a templated function.
|
||||||
|
*/
|
||||||
|
constexpr value_type
|
||||||
|
value() const;
|
||||||
|
|
||||||
|
static MPTAmount
|
||||||
|
minPositiveAmount();
|
||||||
|
};
|
||||||
|
|
||||||
|
constexpr MPTAmount::MPTAmount(value_type value) : value_(value)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
constexpr MPTAmount&
|
||||||
|
MPTAmount::operator=(beast::Zero)
|
||||||
|
{
|
||||||
|
value_ = 0;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Returns true if the amount is not zero */
|
||||||
|
constexpr MPTAmount::operator bool() const noexcept
|
||||||
|
{
|
||||||
|
return value_ != 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Return the sign of the amount */
|
||||||
|
constexpr int
|
||||||
|
MPTAmount::signum() const noexcept
|
||||||
|
{
|
||||||
|
return (value_ < 0) ? -1 : (value_ ? 1 : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Returns the underlying value. Code SHOULD NOT call this
|
||||||
|
function unless the type has been abstracted away,
|
||||||
|
e.g. in a templated function.
|
||||||
|
*/
|
||||||
|
constexpr MPTAmount::value_type
|
||||||
|
MPTAmount::value() const
|
||||||
|
{
|
||||||
|
return value_;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline std::string
|
||||||
|
to_string(MPTAmount const& amount)
|
||||||
|
{
|
||||||
|
return std::to_string(amount.value());
|
||||||
|
}
|
||||||
|
|
||||||
|
inline MPTAmount
|
||||||
|
mulRatio(
|
||||||
|
MPTAmount const& amt,
|
||||||
|
std::uint32_t num,
|
||||||
|
std::uint32_t den,
|
||||||
|
bool roundUp)
|
||||||
|
{
|
||||||
|
using namespace boost::multiprecision;
|
||||||
|
|
||||||
|
if (!den)
|
||||||
|
Throw<std::runtime_error>("division by zero");
|
||||||
|
|
||||||
|
int128_t const amt128(amt.value());
|
||||||
|
auto const neg = amt.value() < 0;
|
||||||
|
auto const m = amt128 * num;
|
||||||
|
auto r = m / den;
|
||||||
|
if (m % den)
|
||||||
|
{
|
||||||
|
if (!neg && roundUp)
|
||||||
|
r += 1;
|
||||||
|
if (neg && !roundUp)
|
||||||
|
r -= 1;
|
||||||
|
}
|
||||||
|
if (r > std::numeric_limits<MPTAmount::value_type>::max())
|
||||||
|
Throw<std::overflow_error>("MPT mulRatio overflow");
|
||||||
|
return MPTAmount(r.convert_to<MPTAmount::value_type>());
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace ripple
|
||||||
|
|
||||||
|
#endif // RIPPLE_BASICS_MPTAMOUNT_H_INCLUDED
|
||||||
@@ -20,7 +20,8 @@
|
|||||||
#ifndef RIPPLE_BASICS_NUMBER_H_INCLUDED
|
#ifndef RIPPLE_BASICS_NUMBER_H_INCLUDED
|
||||||
#define RIPPLE_BASICS_NUMBER_H_INCLUDED
|
#define RIPPLE_BASICS_NUMBER_H_INCLUDED
|
||||||
|
|
||||||
#include <ripple/basics/XRPAmount.h>
|
#include <xrpl/basics/MPTAmount.h>
|
||||||
|
#include <xrpl/basics/XRPAmount.h>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
@@ -52,6 +53,7 @@ public:
|
|||||||
explicit constexpr Number(rep mantissa, int exponent, unchecked) noexcept;
|
explicit constexpr Number(rep mantissa, int exponent, unchecked) noexcept;
|
||||||
|
|
||||||
Number(XRPAmount const& x);
|
Number(XRPAmount const& x);
|
||||||
|
Number(MPTAmount const& x);
|
||||||
|
|
||||||
constexpr rep
|
constexpr rep
|
||||||
mantissa() const noexcept;
|
mantissa() const noexcept;
|
||||||
@@ -88,8 +90,17 @@ public:
|
|||||||
static constexpr Number
|
static constexpr Number
|
||||||
lowest() noexcept;
|
lowest() noexcept;
|
||||||
|
|
||||||
explicit operator XRPAmount() const; // round to nearest, even on tie
|
/** Conversions to Number are implicit and conversions away from Number
|
||||||
explicit operator rep() const; // round to nearest, even on tie
|
* are explicit. This design encourages and facilitates the use of Number
|
||||||
|
* as the preferred type for floating point arithmetic as it makes
|
||||||
|
* "mixed mode" more convenient, e.g. MPTAmount + Number.
|
||||||
|
*/
|
||||||
|
explicit
|
||||||
|
operator XRPAmount() const; // round to nearest, even on tie
|
||||||
|
explicit
|
||||||
|
operator MPTAmount() const; // round to nearest, even on tie
|
||||||
|
explicit
|
||||||
|
operator rep() const; // round to nearest, even on tie
|
||||||
|
|
||||||
friend constexpr bool
|
friend constexpr bool
|
||||||
operator==(Number const& x, Number const& y) noexcept
|
operator==(Number const& x, Number const& y) noexcept
|
||||||
@@ -210,6 +221,10 @@ inline Number::Number(XRPAmount const& x) : Number{x.drops()}
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline Number::Number(MPTAmount const& x) : Number{x.value()}
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
inline constexpr Number::rep
|
inline constexpr Number::rep
|
||||||
Number::mantissa() const noexcept
|
Number::mantissa() const noexcept
|
||||||
{
|
{
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
#ifndef RIPPLE_BASICS_RANGESET_H_INCLUDED
|
#ifndef RIPPLE_BASICS_RANGESET_H_INCLUDED
|
||||||
#define RIPPLE_BASICS_RANGESET_H_INCLUDED
|
#define RIPPLE_BASICS_RANGESET_H_INCLUDED
|
||||||
|
|
||||||
#include <ripple/beast/core/LexicalCast.h>
|
#include <xrpl/beast/core/LexicalCast.h>
|
||||||
|
|
||||||
#include <boost/algorithm/string.hpp>
|
#include <boost/algorithm/string.hpp>
|
||||||
#include <boost/icl/closed_interval.hpp>
|
#include <boost/icl/closed_interval.hpp>
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
#include <functional>
|
#include <functional>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <ripple/beast/net/IPEndpoint.h>
|
#include <xrpl/beast/net/IPEndpoint.h>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
|
|
||||||
@@ -20,8 +20,8 @@
|
|||||||
#ifndef RIPPLE_BASICS_RESOLVERASIO_H_INCLUDED
|
#ifndef RIPPLE_BASICS_RESOLVERASIO_H_INCLUDED
|
||||||
#define RIPPLE_BASICS_RESOLVERASIO_H_INCLUDED
|
#define RIPPLE_BASICS_RESOLVERASIO_H_INCLUDED
|
||||||
|
|
||||||
#include <ripple/basics/Resolver.h>
|
#include <xrpl/basics/Resolver.h>
|
||||||
#include <ripple/beast/utility/Journal.h>
|
#include <xrpl/beast/utility/Journal.h>
|
||||||
#include <boost/asio/io_service.hpp>
|
#include <boost/asio/io_service.hpp>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
#ifndef RIPPLE_BASICS_SHAMAP_HASH_H_INCLUDED
|
#ifndef RIPPLE_BASICS_SHAMAP_HASH_H_INCLUDED
|
||||||
#define RIPPLE_BASICS_SHAMAP_HASH_H_INCLUDED
|
#define RIPPLE_BASICS_SHAMAP_HASH_H_INCLUDED
|
||||||
|
|
||||||
#include <ripple/basics/base_uint.h>
|
#include <xrpl/basics/base_uint.h>
|
||||||
|
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
#ifndef RIPPLE_BASICS_SLABALLOCATOR_H_INCLUDED
|
#ifndef RIPPLE_BASICS_SLABALLOCATOR_H_INCLUDED
|
||||||
#define RIPPLE_BASICS_SLABALLOCATOR_H_INCLUDED
|
#define RIPPLE_BASICS_SLABALLOCATOR_H_INCLUDED
|
||||||
|
|
||||||
#include <ripple/beast/type_name.h>
|
#include <xrpl/beast/type_name.h>
|
||||||
|
|
||||||
#include <boost/align.hpp>
|
#include <boost/align.hpp>
|
||||||
#include <boost/container/static_vector.hpp>
|
#include <boost/container/static_vector.hpp>
|
||||||
@@ -20,8 +20,8 @@
|
|||||||
#ifndef RIPPLE_BASICS_SLICE_H_INCLUDED
|
#ifndef RIPPLE_BASICS_SLICE_H_INCLUDED
|
||||||
#define RIPPLE_BASICS_SLICE_H_INCLUDED
|
#define RIPPLE_BASICS_SLICE_H_INCLUDED
|
||||||
|
|
||||||
#include <ripple/basics/contract.h>
|
#include <xrpl/basics/contract.h>
|
||||||
#include <ripple/basics/strHex.h>
|
#include <xrpl/basics/strHex.h>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
@@ -20,8 +20,8 @@
|
|||||||
#ifndef RIPPLE_BASICS_STRINGUTILITIES_H_INCLUDED
|
#ifndef RIPPLE_BASICS_STRINGUTILITIES_H_INCLUDED
|
||||||
#define RIPPLE_BASICS_STRINGUTILITIES_H_INCLUDED
|
#define RIPPLE_BASICS_STRINGUTILITIES_H_INCLUDED
|
||||||
|
|
||||||
#include <ripple/basics/Blob.h>
|
#include <xrpl/basics/Blob.h>
|
||||||
#include <ripple/basics/strHex.h>
|
#include <xrpl/basics/strHex.h>
|
||||||
|
|
||||||
#include <boost/format.hpp>
|
#include <boost/format.hpp>
|
||||||
#include <boost/utility/string_view.hpp>
|
#include <boost/utility/string_view.hpp>
|
||||||
@@ -110,7 +110,7 @@ strUnHex(std::string const& strSrc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline std::optional<Blob>
|
inline std::optional<Blob>
|
||||||
strViewUnHex(boost::string_view const& strSrc)
|
strViewUnHex(std::string_view strSrc)
|
||||||
{
|
{
|
||||||
return strUnHex(strSrc.size(), strSrc.cbegin(), strSrc.cend());
|
return strUnHex(strSrc.size(), strSrc.cbegin(), strSrc.cend());
|
||||||
}
|
}
|
||||||
@@ -150,7 +150,7 @@ to_uint64(std::string const& s);
|
|||||||
doesn't check whether the TLD is valid.
|
doesn't check whether the TLD is valid.
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
isProperlyFormedTomlDomain(std::string const& domain);
|
isProperlyFormedTomlDomain(std::string_view domain);
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace ripple
|
||||||
|
|
||||||
@@ -20,11 +20,11 @@
|
|||||||
#ifndef RIPPLE_BASICS_TAGGEDCACHE_H_INCLUDED
|
#ifndef RIPPLE_BASICS_TAGGEDCACHE_H_INCLUDED
|
||||||
#define RIPPLE_BASICS_TAGGEDCACHE_H_INCLUDED
|
#define RIPPLE_BASICS_TAGGEDCACHE_H_INCLUDED
|
||||||
|
|
||||||
#include <ripple/basics/Log.h>
|
#include <xrpl/basics/Log.h>
|
||||||
#include <ripple/basics/UnorderedContainers.h>
|
#include <xrpl/basics/UnorderedContainers.h>
|
||||||
#include <ripple/basics/hardened_hash.h>
|
#include <xrpl/basics/hardened_hash.h>
|
||||||
#include <ripple/beast/clock/abstract_clock.h>
|
#include <xrpl/beast/clock/abstract_clock.h>
|
||||||
#include <ripple/beast/insight/Insight.h>
|
#include <xrpl/beast/insight/Insight.h>
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
@@ -20,11 +20,11 @@
|
|||||||
#ifndef RIPPLE_BASICS_UNORDEREDCONTAINERS_H_INCLUDED
|
#ifndef RIPPLE_BASICS_UNORDEREDCONTAINERS_H_INCLUDED
|
||||||
#define RIPPLE_BASICS_UNORDEREDCONTAINERS_H_INCLUDED
|
#define RIPPLE_BASICS_UNORDEREDCONTAINERS_H_INCLUDED
|
||||||
|
|
||||||
#include <ripple/basics/hardened_hash.h>
|
#include <xrpl/basics/hardened_hash.h>
|
||||||
#include <ripple/basics/partitioned_unordered_map.h>
|
#include <xrpl/basics/partitioned_unordered_map.h>
|
||||||
#include <ripple/beast/hash/hash_append.h>
|
#include <xrpl/beast/hash/hash_append.h>
|
||||||
#include <ripple/beast/hash/uhash.h>
|
#include <xrpl/beast/hash/uhash.h>
|
||||||
#include <ripple/beast/hash/xxhasher.h>
|
#include <xrpl/beast/hash/xxhasher.h>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
|
|
||||||
@@ -20,10 +20,10 @@
|
|||||||
#ifndef RIPPLE_BASICS_XRPAMOUNT_H_INCLUDED
|
#ifndef RIPPLE_BASICS_XRPAMOUNT_H_INCLUDED
|
||||||
#define RIPPLE_BASICS_XRPAMOUNT_H_INCLUDED
|
#define RIPPLE_BASICS_XRPAMOUNT_H_INCLUDED
|
||||||
|
|
||||||
#include <ripple/basics/contract.h>
|
#include <xrpl/basics/contract.h>
|
||||||
#include <ripple/basics/safe_cast.h>
|
#include <xrpl/basics/safe_cast.h>
|
||||||
#include <ripple/beast/utility/Zero.h>
|
#include <xrpl/beast/utility/Zero.h>
|
||||||
#include <ripple/json/json_value.h>
|
#include <xrpl/json/json_value.h>
|
||||||
|
|
||||||
#include <boost/multiprecision/cpp_int.hpp>
|
#include <boost/multiprecision/cpp_int.hpp>
|
||||||
#include <boost/operators.hpp>
|
#include <boost/operators.hpp>
|
||||||
@@ -65,7 +65,8 @@ public:
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr XRPAmount& operator=(beast::Zero)
|
constexpr XRPAmount&
|
||||||
|
operator=(beast::Zero)
|
||||||
{
|
{
|
||||||
drops_ = 0;
|
drops_ = 0;
|
||||||
return *this;
|
return *this;
|
||||||
@@ -155,7 +156,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Returns true if the amount is not zero */
|
/** Returns true if the amount is not zero */
|
||||||
explicit constexpr operator bool() const noexcept
|
explicit constexpr
|
||||||
|
operator bool() const noexcept
|
||||||
{
|
{
|
||||||
return drops_ != 0;
|
return drops_ != 0;
|
||||||
}
|
}
|
||||||
@@ -205,6 +207,10 @@ public:
|
|||||||
return dropsAs<Dest>().value_or(defaultValue.drops());
|
return dropsAs<Dest>().value_or(defaultValue.drops());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Clips a 64-bit value to a 32-bit JSON number. It is only used
|
||||||
|
* in contexts that don't expect the value to ever approach
|
||||||
|
* the 32-bit limits (i.e. fees and reserves).
|
||||||
|
*/
|
||||||
Json::Value
|
Json::Value
|
||||||
jsonClipped() const
|
jsonClipped() const
|
||||||
{
|
{
|
||||||
@@ -73,7 +73,7 @@ base64_encode(std::string const& s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
base64_decode(std::string const& data);
|
base64_decode(std::string_view data);
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace ripple
|
||||||
|
|
||||||
@@ -25,12 +25,12 @@
|
|||||||
#ifndef RIPPLE_BASICS_BASE_UINT_H_INCLUDED
|
#ifndef RIPPLE_BASICS_BASE_UINT_H_INCLUDED
|
||||||
#define RIPPLE_BASICS_BASE_UINT_H_INCLUDED
|
#define RIPPLE_BASICS_BASE_UINT_H_INCLUDED
|
||||||
|
|
||||||
#include <ripple/basics/Expected.h>
|
#include <xrpl/basics/Expected.h>
|
||||||
#include <ripple/basics/Slice.h>
|
#include <xrpl/basics/Slice.h>
|
||||||
#include <ripple/basics/contract.h>
|
#include <xrpl/basics/contract.h>
|
||||||
#include <ripple/basics/hardened_hash.h>
|
#include <xrpl/basics/hardened_hash.h>
|
||||||
#include <ripple/basics/strHex.h>
|
#include <xrpl/basics/strHex.h>
|
||||||
#include <ripple/beast/utility/Zero.h>
|
#include <xrpl/beast/utility/Zero.h>
|
||||||
#include <boost/endian/conversion.hpp>
|
#include <boost/endian/conversion.hpp>
|
||||||
#include <boost/functional/hash.hpp>
|
#include <boost/functional/hash.hpp>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@@ -521,7 +521,8 @@ public:
|
|||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
base_uint<Bits, Tag>& operator=(beast::Zero)
|
base_uint<Bits, Tag>&
|
||||||
|
operator=(beast::Zero)
|
||||||
{
|
{
|
||||||
data_.fill(0);
|
data_.fill(0);
|
||||||
return *this;
|
return *this;
|
||||||
@@ -548,6 +549,7 @@ public:
|
|||||||
using uint128 = base_uint<128>;
|
using uint128 = base_uint<128>;
|
||||||
using uint160 = base_uint<160>;
|
using uint160 = base_uint<160>;
|
||||||
using uint256 = base_uint<256>;
|
using uint256 = base_uint<256>;
|
||||||
|
using uint192 = base_uint<192>;
|
||||||
|
|
||||||
template <std::size_t Bits, class Tag>
|
template <std::size_t Bits, class Tag>
|
||||||
[[nodiscard]] inline constexpr std::strong_ordering
|
[[nodiscard]] inline constexpr std::strong_ordering
|
||||||
@@ -633,6 +635,7 @@ operator<<(std::ostream& out, base_uint<Bits, Tag> const& u)
|
|||||||
#ifndef __INTELLISENSE__
|
#ifndef __INTELLISENSE__
|
||||||
static_assert(sizeof(uint128) == 128 / 8, "There should be no padding bytes");
|
static_assert(sizeof(uint128) == 128 / 8, "There should be no padding bytes");
|
||||||
static_assert(sizeof(uint160) == 160 / 8, "There should be no padding bytes");
|
static_assert(sizeof(uint160) == 160 / 8, "There should be no padding bytes");
|
||||||
|
static_assert(sizeof(uint192) == 192 / 8, "There should be no padding bytes");
|
||||||
static_assert(sizeof(uint256) == 256 / 8, "There should be no padding bytes");
|
static_assert(sizeof(uint256) == 256 / 8, "There should be no padding bytes");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -22,9 +22,9 @@
|
|||||||
|
|
||||||
#include <date/date.h>
|
#include <date/date.h>
|
||||||
|
|
||||||
#include <ripple/beast/clock/abstract_clock.h>
|
#include <xrpl/beast/clock/abstract_clock.h>
|
||||||
#include <ripple/beast/clock/basic_seconds_clock.h>
|
#include <xrpl/beast/clock/basic_seconds_clock.h>
|
||||||
#include <ripple/beast/clock/manual_clock.h>
|
#include <xrpl/beast/clock/manual_clock.h>
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
#ifndef RIPPLE_BASICS_CONTRACT_H_INCLUDED
|
#ifndef RIPPLE_BASICS_CONTRACT_H_INCLUDED
|
||||||
#define RIPPLE_BASICS_CONTRACT_H_INCLUDED
|
#define RIPPLE_BASICS_CONTRACT_H_INCLUDED
|
||||||
|
|
||||||
#include <ripple/beast/type_name.h>
|
#include <xrpl/beast/type_name.h>
|
||||||
#include <exception>
|
#include <exception>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <typeinfo>
|
#include <typeinfo>
|
||||||
@@ -20,8 +20,8 @@
|
|||||||
#ifndef RIPPLE_BASICS_HARDENED_HASH_H_INCLUDED
|
#ifndef RIPPLE_BASICS_HARDENED_HASH_H_INCLUDED
|
||||||
#define RIPPLE_BASICS_HARDENED_HASH_H_INCLUDED
|
#define RIPPLE_BASICS_HARDENED_HASH_H_INCLUDED
|
||||||
|
|
||||||
#include <ripple/beast/hash/hash_append.h>
|
#include <xrpl/beast/hash/hash_append.h>
|
||||||
#include <ripple/beast/hash/xxhasher.h>
|
#include <xrpl/beast/hash/xxhasher.h>
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user