mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-05 08:48:03 +00:00
Compare commits
183 Commits
0.29.0
...
0.30.0-hf2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ad2383bd4b | ||
|
|
5b5a01989c | ||
|
|
c17f7e8b37 | ||
|
|
aa4f347e7c | ||
|
|
0a0adaac6d | ||
|
|
3d2aae9ea5 | ||
|
|
3d5ff2b4cd | ||
|
|
d20f0d5014 | ||
|
|
a8859b495b | ||
|
|
caccee1d98 | ||
|
|
379110a8a2 | ||
|
|
8d37cd9169 | ||
|
|
b40ade5165 | ||
|
|
c475b23c7d | ||
|
|
d6b9cfcc34 | ||
|
|
0c05bd3def | ||
|
|
8f7ab21423 | ||
|
|
07418cfb34 | ||
|
|
ac9816c01d | ||
|
|
bd3e4ac11c | ||
|
|
926d08db6f | ||
|
|
a23f6457dc | ||
|
|
4f9dba22c7 | ||
|
|
97e1a7db25 | ||
|
|
e03effd63b | ||
|
|
f9a65e4966 | ||
|
|
3c52fdfabe | ||
|
|
938b2fed7c | ||
|
|
d6875975ab | ||
|
|
92b2ca70b7 | ||
|
|
df6ac8f7f5 | ||
|
|
fa796a2eb5 | ||
|
|
c7b3153958 | ||
|
|
5bbb89753d | ||
|
|
654084d181 | ||
|
|
094f08211a | ||
|
|
74b0a7c633 | ||
|
|
8f09d3449d | ||
|
|
0c7a7903b6 | ||
|
|
6a8d24372e | ||
|
|
884dc11365 | ||
|
|
83830ef9c0 | ||
|
|
849e1ce5f4 | ||
|
|
4eb6020813 | ||
|
|
d655fdca56 | ||
|
|
b6df6748df | ||
|
|
269809dd1a | ||
|
|
65fdf1dc5e | ||
|
|
60002bf9bc | ||
|
|
dd94de2830 | ||
|
|
e1fc81f66f | ||
|
|
b2cf1e4c65 | ||
|
|
a65f692ab7 | ||
|
|
44e4a50050 | ||
|
|
ffbcb96eff | ||
|
|
eed1a891a7 | ||
|
|
9b787434c9 | ||
|
|
f4fe55caff | ||
|
|
8df88238cd | ||
|
|
ea0bd08660 | ||
|
|
c1f50ca7b3 | ||
|
|
a6f866b4d8 | ||
|
|
545b2fd6b1 | ||
|
|
b0a855a10e | ||
|
|
b5600e940a | ||
|
|
7f5d273e53 | ||
|
|
b0e6be93ff | ||
|
|
324c42ae09 | ||
|
|
acd03faee5 | ||
|
|
94af42da44 | ||
|
|
1e9624270d | ||
|
|
a50d67257c | ||
|
|
3759c553b0 | ||
|
|
332114c02a | ||
|
|
5d841c13b7 | ||
|
|
caecf78a6d | ||
|
|
408a62f7d0 | ||
|
|
b822d061ef | ||
|
|
020a112e77 | ||
|
|
8e33ae78f8 | ||
|
|
dbddc6b7f2 | ||
|
|
f32be2b28d | ||
|
|
0f05ebd834 | ||
|
|
14db51e3e4 | ||
|
|
8f3bb286f2 | ||
|
|
258c93f8d8 | ||
|
|
88f885f2e7 | ||
|
|
91eee1a42d | ||
|
|
6a55f99ede | ||
|
|
0b457497d0 | ||
|
|
b7c9e33343 | ||
|
|
502d5689bf | ||
|
|
d015debe2b | ||
|
|
d8aab5a749 | ||
|
|
7ed2094a6a | ||
|
|
464410d8be | ||
|
|
aa0e17dd93 | ||
|
|
b2cb4df29a | ||
|
|
3d777f3f5d | ||
|
|
1842878c40 | ||
|
|
23f47adb60 | ||
|
|
377e3d479c | ||
|
|
d5193a776e | ||
|
|
ef51128270 | ||
|
|
9b15c88b0e | ||
|
|
f1c29ae20b | ||
|
|
6d2e3da306 | ||
|
|
7695ea2822 | ||
|
|
c729ceab20 | ||
|
|
e8643dd8cc | ||
|
|
7b69592fe1 | ||
|
|
12e11721f9 | ||
|
|
96c13f0d98 | ||
|
|
df728cd2cd | ||
|
|
0d7cad8d64 | ||
|
|
d69285f6ad | ||
|
|
b8e192e058 | ||
|
|
aeebfeab10 | ||
|
|
8aafebbb75 | ||
|
|
c3da2e1f03 | ||
|
|
c8c8003677 | ||
|
|
caab155a00 | ||
|
|
1b85b6eaba | ||
|
|
863add6a19 | ||
|
|
64b80e0573 | ||
|
|
ed902d9dea | ||
|
|
f38b373cb6 | ||
|
|
b8f2fdb6ac | ||
|
|
182f570f24 | ||
|
|
5b90ccf65d | ||
|
|
22a8e25538 | ||
|
|
d63aab6312 | ||
|
|
774dcad392 | ||
|
|
7b7b27ee9e | ||
|
|
c5adbc859a | ||
|
|
2cc12b2f2f | ||
|
|
13b33b5d4d | ||
|
|
c7dea3ed17 | ||
|
|
a7e6ecb5b3 | ||
|
|
e45c1b238f | ||
|
|
d166e6a45e | ||
|
|
e759137f15 | ||
|
|
0bb570a36d | ||
|
|
38c6083a2f | ||
|
|
cfdf0d2f0a | ||
|
|
f0dc2bc425 | ||
|
|
32ec3fe089 | ||
|
|
9e69bd5c56 | ||
|
|
ceeb36039e | ||
|
|
2bfae2f0ac | ||
|
|
5d2d88209f | ||
|
|
ecf1a3c69c | ||
|
|
3f0eacf5e7 | ||
|
|
d49f9ea109 | ||
|
|
2ec40cb6f1 | ||
|
|
3e342e4b71 | ||
|
|
147fee0272 | ||
|
|
fa900de548 | ||
|
|
8cd44c637d | ||
|
|
729caaacff | ||
|
|
2f5d721ec1 | ||
|
|
c15394c42a | ||
|
|
36a62f110c | ||
|
|
2d02b46253 | ||
|
|
6cf75f0fc2 | ||
|
|
1a3e2e3f36 | ||
|
|
645e32b19e | ||
|
|
fa0a61b5d7 | ||
|
|
1dc3acb071 | ||
|
|
0cf58cc505 | ||
|
|
eb49e1bf47 | ||
|
|
0627d3487b | ||
|
|
84161b86c7 | ||
|
|
110bbf3956 | ||
|
|
fad9998f9d | ||
|
|
b38a96ae82 | ||
|
|
e82d774d32 | ||
|
|
8d1b169f5a | ||
|
|
70ccdabf7c | ||
|
|
af36942e1f | ||
|
|
b1b98fa3b0 | ||
|
|
bb251063fc | ||
|
|
663742e0d1 |
5
.gitignore
vendored
5
.gitignore
vendored
@@ -24,6 +24,11 @@ bin/rippled
|
||||
Debug/*.*
|
||||
Release/*.*
|
||||
|
||||
# Ignore coverage files.
|
||||
*.gcno
|
||||
*.gcda
|
||||
*.gcov
|
||||
|
||||
# Ignore locally installed node_modules
|
||||
/node_modules
|
||||
|
||||
|
||||
136
.travis.yml
136
.travis.yml
@@ -1,70 +1,84 @@
|
||||
sudo: false
|
||||
language: cpp
|
||||
compiler:
|
||||
- clang
|
||||
- gcc
|
||||
|
||||
env:
|
||||
- TARGET=debug
|
||||
- TARGET=debug.nounity
|
||||
# We can specify any combination of builds here, for example, to
|
||||
# include release builds, too, uncomment the following lines.
|
||||
#- TARGET=release
|
||||
#- TARGET=release.nounity
|
||||
global:
|
||||
# Maintenance note: to move to a new version
|
||||
# of boost, update both BOOST_ROOT and BOOST_URL.
|
||||
# Note that for simplicity, BOOST_ROOT's final
|
||||
# namepart must match the folder name internal
|
||||
# to boost's .tar.gz.
|
||||
- BOOST_ROOT=$HOME/boost_1_59_0
|
||||
- BOOST_URL='http://downloads.sourceforge.net/project/boost/boost/1.59.0/boost_1_59_0.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fboost%2Ffiles%2Fboost%2F1.59.0%2Fboost_1_59_0.tar.gz%2Fdownload&ts=1441761349&use_mirror=skylineservers'
|
||||
- RIPPLED_OLD_GCC_ABI=1
|
||||
|
||||
|
||||
packages: &gcc5_pkgs
|
||||
- gcc-5
|
||||
- g++-5
|
||||
- python-software-properties
|
||||
- protobuf-compiler
|
||||
- libprotobuf-dev
|
||||
- libssl-dev
|
||||
- libstdc++6
|
||||
- binutils-gold
|
||||
# Provides a backtrace if the unittests crash
|
||||
- gdb
|
||||
|
||||
packages: &gcc48_pkgs
|
||||
- gcc-4.8
|
||||
- g++-4.8
|
||||
- python-software-properties
|
||||
- protobuf-compiler
|
||||
- libprotobuf-dev
|
||||
- libssl-dev
|
||||
- libstdc++6
|
||||
- binutils-gold
|
||||
# Provides a backtrace if the unittests crash
|
||||
- gdb
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- compiler: gcc
|
||||
env: GCC_VER=5 TARGET=debug.nounity
|
||||
addons: &ao_gcc5
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: *gcc5_pkgs
|
||||
|
||||
- compiler: gcc
|
||||
env: GCC_VER=5 TARGET=coverage
|
||||
addons: *ao_gcc5
|
||||
|
||||
- compiler: clang
|
||||
env: GCC_VER=4.8 TARGET=debug
|
||||
addons: &ao_gcc48
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: *gcc48_pkgs
|
||||
|
||||
- compiler: clang
|
||||
env: GCC_VER=4.8 TARGET=debug.nounity
|
||||
addons: *ao_gcc48
|
||||
|
||||
- compiler: gcc
|
||||
env: GCC_VER=4.8 TARGET=debug
|
||||
addons: *ao_gcc48
|
||||
|
||||
- compiler: gcc
|
||||
env: GCC_VER=4.8 TARGET=debug.nounity
|
||||
addons: *ao_gcc48
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $BOOST_ROOT
|
||||
|
||||
before_install:
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get install -qq python-software-properties
|
||||
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
|
||||
- sudo add-apt-repository -y ppa:afrank/boost
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get install -qq g++-4.8
|
||||
- sudo apt-get install -qq libboost1.57-all-dev
|
||||
- sudo apt-get install -qq mlocate
|
||||
- sudo updatedb
|
||||
- sudo locate libboost | grep /lib | grep -e ".a$"
|
||||
- sudo apt-get install -qq protobuf-compiler libprotobuf-dev libssl-dev exuberant-ctags
|
||||
# We need gcc >= 4.8 for some c++11 features
|
||||
- sudo apt-get install -qq gcc-4.8
|
||||
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8
|
||||
- sudo update-alternatives --set gcc /usr/bin/gcc-4.8
|
||||
# Stuff is gold. Nuff said ;)
|
||||
- sudo apt-get -y install binutils-gold
|
||||
# We can get a backtrace if the guy crashes
|
||||
- sudo apt-get -y install gdb
|
||||
# What versions are we ACTUALLY running?
|
||||
- g++ -v
|
||||
- clang -v
|
||||
# Avoid `spurious errors` caused by ~/.npm permission issues
|
||||
# Does it already exist? Who owns? What permissions?
|
||||
- ls -lah ~/.npm || mkdir ~/.npm
|
||||
# Make sure we own it
|
||||
- sudo chown -R $USER ~/.npm
|
||||
- bin/ci/ubuntu/install-dependencies.sh
|
||||
|
||||
script:
|
||||
# Set so any failing command will abort the build
|
||||
- set -e
|
||||
# Make sure vcxproj is up to date
|
||||
- scons vcxproj
|
||||
- git diff --exit-code
|
||||
# $CC will be either `clang` or `gcc` (If only we could do -j12 ;)
|
||||
- scons $CC.$TARGET
|
||||
# We can be sure we're using the build/$CC.$TARGET variant (-f so never err)
|
||||
- rm -f build/rippled
|
||||
- export RIPPLED_PATH="$PWD/build/$CC.$TARGET/rippled"
|
||||
# See what we've actually built
|
||||
- ldd $RIPPLED_PATH
|
||||
# Run unittests (under gdb)
|
||||
- | # create gdb script
|
||||
echo "set env MALLOC_CHECK_=3" > script.gdb
|
||||
echo "run" >> script.gdb
|
||||
echo "backtrace full" >> script.gdb
|
||||
# gdb --help
|
||||
- cat script.gdb | gdb --ex 'set print thread-events off' --return-child-result --args $RIPPLED_PATH --unittest
|
||||
- npm install
|
||||
# Use build/(gcc|clang).$TARGET/rippled
|
||||
- |
|
||||
echo "exports.default_server_config = {\"rippled_path\" : \"$RIPPLED_PATH\"};" > test/config.js
|
||||
- bin/ci/ubuntu/build-and-test.sh
|
||||
|
||||
# Run integration tests
|
||||
- npm test
|
||||
notifications:
|
||||
email:
|
||||
false
|
||||
|
||||
@@ -17,18 +17,29 @@
|
||||
|
||||
"""
|
||||
Invocation:
|
||||
./Builds/Test.py - builds and tests all configurations
|
||||
|
||||
#
|
||||
# The build must succeed without shell aliases for this to work.
|
||||
#
|
||||
# Common problems:
|
||||
# 1) Boost not found. Solution: export BOOST_ROOT=[path to boost folder]
|
||||
# 2) OpenSSL not found. Solution: export OPENSSL_ROOT=[path to OpenSSL folder]
|
||||
# 3) scons is an alias. Solution: Create a script named "scons" somewhere in
|
||||
# your $PATH (eg. ~/bin/scons will often work).
|
||||
# #!/bin/sh
|
||||
# python /C/Python27/Scripts/scons.py "${@}"
|
||||
./Builds/Test.py - builds and tests all configurations
|
||||
|
||||
The build must succeed without shell aliases for this to work.
|
||||
|
||||
To pass flags to scons, put them at the very end of the command line, after
|
||||
the -- flag - like this:
|
||||
|
||||
./Builds/Test.py -- -j4 # Pass -j4 to scons.
|
||||
|
||||
|
||||
Common problems:
|
||||
|
||||
1) Boost not found. Solution: export BOOST_ROOT=[path to boost folder]
|
||||
|
||||
2) OpenSSL not found. Solution: export OPENSSL_ROOT=[path to OpenSSL folder]
|
||||
|
||||
3) scons is an alias. Solution: Create a script named "scons" somewhere in
|
||||
your $PATH (eg. ~/bin/scons will often work).
|
||||
|
||||
#!/bin/sh
|
||||
python /C/Python27/Scripts/scons.py "${@}"
|
||||
|
||||
"""
|
||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
||||
|
||||
|
||||
339
Builds/VisualStudio2015/README.md
Normal file
339
Builds/VisualStudio2015/README.md
Normal file
@@ -0,0 +1,339 @@
|
||||
# Visual Studio 2015 Build Instructions
|
||||
|
||||
## Important
|
||||
|
||||
We do not recommend Windows for rippled production use at this time. Currently, the Ubuntu
|
||||
platform has received the highest level of quality assurance, testing, and support.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
To clone the source code repository, create branches for inspection or modification,
|
||||
build rippled under Visual Studio, and run the unit tests you will need these
|
||||
software components:
|
||||
|
||||
* [Visual Studio 2015](https://www.visualstudio.com/)
|
||||
* [Git for Windows](http://git-scm.com/)
|
||||
* [Google Protocol Buffers Compiler](https://code.google.com/p/protobuf/source/checkout)
|
||||
* [OpenSSL Library](README.md#install-openssl)
|
||||
* [ActivePerl](https://www.activestate.com/activeperl/downloads)
|
||||
(Recommended to build OpenSSL.)
|
||||
* [Boost 1.59 library](http://www.boost.org/users/download/)
|
||||
* [Node.js](http://nodejs.org/download/)
|
||||
|
||||
Any version of Visual Studio 2015 may be used, including the Visual Studio Community
|
||||
Edition which is available under a free license.
|
||||
|
||||
## Install Software
|
||||
|
||||
### Install Visual Studio 2015
|
||||
|
||||
If not already installed on your system, download your choice of installers from the
|
||||
[Visual Studio 2015 Download](https://www.visualstudio.com/downloads/download-visual-studio-vs)
|
||||
page, run the installer, and follow the directions.
|
||||
The **Visual Studio 2015 Community** edition is available for free, while paid editions
|
||||
may be used for an free initial trial period.
|
||||
|
||||
### Install Git for Windows
|
||||
|
||||
Git is a distributed revision control system. The Windows version also provides the
|
||||
bash shell and many Windows versions of Unix commands. While there are other
|
||||
varieties of Git (such as TortoiseGit, which has a native Windows interface and
|
||||
integrates with the Explorer shell), we recommend installing
|
||||
[Git for Windows](https://git-scm.com/) since
|
||||
it provides a Unix-like command line environment useful for running shell scripts.
|
||||
Use of the bash shell under Windows is mandatory for running the unit tests.
|
||||
|
||||
* NOTE: To gain full featured access to the
|
||||
[git-subtree](https://blogs.atlassian.com/2013/05/alternatives-to-git-submodule-git-subtree/)
|
||||
functionality used in the rippled repository we suggest Git version 1.8.3.2 or later.
|
||||
|
||||
### Install Google Protocol Buffers Compiler
|
||||
|
||||
Building rippled requires **protoc.exe** version 2.5.1 or later. At your option you
|
||||
may build it yourself from the sources in the
|
||||
[Google Protocol Buffers](https://github.com/google/protobuf) repository,
|
||||
or you may download a
|
||||
[protoc.exe](https://ripple.github.io/Downloads/protoc/2.5.1/protoc.exe)
|
||||
([alternate link](https://github.com/ripple/Downloads/raw/gh-pages/protoc/2.5.1/protoc.exe))
|
||||
precompiled Windows executable from the
|
||||
[Ripple Organization](https://github.com/ripple).
|
||||
|
||||
Either way, once you have the required version of **protoc.exe**, copy it into
|
||||
a folder in your command line `%PATH%`.
|
||||
|
||||
* **NOTE:** If you use an older version of the compiler, the build will fail with
|
||||
errors related to a mismatch of the version of protocol buffer headers versus
|
||||
the compiler.
|
||||
|
||||
### Install ActivePerl
|
||||
|
||||
If not already installed on your system, download your choice of installers from the
|
||||
[Activeperl Download](https://www.activestate.com/activeperl/downloads)
|
||||
page, run the installer, and follow the directions.
|
||||
|
||||
## Configure Dependencies
|
||||
|
||||
### Install OpenSSL
|
||||
|
||||
1. Download OpenSSL *v1.0.2d or higher* source https://www.openssl.org/source/
|
||||
2. Unpack the source archive into a temporary folder.
|
||||
3. Open `cmd.exe`. Change the the folder where you unpacked OpenSSL.
|
||||
4. Build the 64-bit libraries: (
|
||||
[Reference 1](http://developer.covenanteyes.com/building-openssl-for-visual-studio/),
|
||||
[Reference 2](http://www.p-nand-q.com/programming/windows/building_openssl_with_visual_studio_2013.html))
|
||||
|
||||
```powershell
|
||||
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat"
|
||||
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat"
|
||||
|
||||
perl Configure VC-WIN64A --prefix=C:\lib\openssl-VC-64
|
||||
ms\do_win64a
|
||||
nmake -f ms\nt.mak
|
||||
nmake -f ms\nt.mak install
|
||||
|
||||
copy tmp32\lib.pdb C:\lib\openssl-VC-64\lib\
|
||||
```
|
||||
5. Optionally, delete the temporary folder.
|
||||
|
||||
* NOTE: Since rippled links statically to OpenSSL, it does not matter where the OpenSSL
|
||||
.DLL files are placed, or what version they are. rippled does not use or require any
|
||||
external .DLL files to run other than the standard operating system ones.
|
||||
|
||||
### Build Boost
|
||||
|
||||
After downloading boost and unpacking it, open a **Developer Command Prompt** for
|
||||
Visual Studio, change to the directory containing boost, then bootstrap the build tools:
|
||||
|
||||
```powershell
|
||||
cd C:\lib\boost_1_59_0
|
||||
bootstrap
|
||||
```
|
||||
|
||||
The rippled application is linked statically to the standard runtimes and external
|
||||
dependencies on Windows, to ensure that the behavior of the executable is not
|
||||
affected by changes in outside files. Therefore, it is necessary to build the
|
||||
required boost static libraries using this command:
|
||||
|
||||
```powershell
|
||||
bjam --toolset=msvc-14.0 --build-type=complete variant=debug,release link=static runtime-link=static address-model=64
|
||||
```
|
||||
|
||||
Building the boost libraries may take considerable time. When the build process
|
||||
is completed, take note of both the reported compiler include paths and linker
|
||||
library paths as they will be required later.
|
||||
|
||||
* NOTE: If older versions of Visual Studio are also installed, the build may fail.
|
||||
If this happens, make sure that only Visual Studio 2015 is installed. Due to
|
||||
defects in the uninstallation procedures of these Microsoft products, it may
|
||||
be necessary to start with a fresh install of the operating system with only
|
||||
the necessary development environment components installed to have a successful build.
|
||||
|
||||
### Clone the rippled repository
|
||||
|
||||
If you are familiar with cloning github repositories, just follow your normal process
|
||||
and clone `git@github.com:ripple/rippled.git`. Otherwise follow this section for instructions.
|
||||
|
||||
1. If you don't have a github account, sign up for one at
|
||||
[github.com](https://github.com/).
|
||||
2. Make sure you have Github ssh keys. For help see
|
||||
[generating-ssh-keys](https://help.github.com/articles/generating-ssh-keys).
|
||||
|
||||
Open the "Git Bash" shell that was installed with "Git for Windows" in the
|
||||
step above. Navigate to the directory where you want to clone rippled (git
|
||||
bash uses `/c` for windows's `C:` and forward slash where windows uses
|
||||
backslash, so `C:\Users\joe\projs` would be `/c/Users/joe/projs` in git bash).
|
||||
Now clone the repository and optionally switch to the *master* branch.
|
||||
Type the following at the bash prompt:
|
||||
|
||||
```powershell
|
||||
git clone git@github.com:ripple/rippled.git
|
||||
cd rippled
|
||||
git checkout master
|
||||
```
|
||||
|
||||
* If you receive an error about not having the "correct access rights"
|
||||
make sure you have Github ssh keys, as described above.
|
||||
|
||||
### Configure Library Paths
|
||||
|
||||
Open the solution file located at **Builds/Visual Studio 2015/ripple.sln**
|
||||
and select the "View->Other Windows->Property Manager" to bring up the Property Manager.
|
||||
Expand the *debug | x64* section (or similar section on 32-windows) and
|
||||
double click the *Microsoft.Cpp.x64.user* property sheet to bring up the
|
||||
*Property Pages* dialog (these sections will be called *Win32* instead of
|
||||
*x64* on 32-bit windows). These are global properties applied to all
|
||||
64-bit build targets:
|
||||
|
||||

|
||||
|
||||
Go to *C/C++, General, Additional Include Directories* and add the
|
||||
location of the boost installation:
|
||||
|
||||

|
||||
|
||||
Then, go to *Linker, General, Additional Library Directories* and add
|
||||
the location of the compiled boost libraries reported at the completion
|
||||
of building the boost libraries:
|
||||
|
||||

|
||||
|
||||
Follow the same procedure for adding the `Additional Include Directories`
|
||||
and `Additional Library Directories` required for OpenSSL. In our example
|
||||
these directories are **C:\lib\openssl-VC-64\include** and
|
||||
**C:\lib\openssl-VC-64\lib** respectively.
|
||||
|
||||
# Setup Environment
|
||||
|
||||
## Create a working directory for rippled.cfg
|
||||
|
||||
The rippled server uses the [Rippled.cfg](https://wiki.ripple.com/Rippled.cfg)
|
||||
file to read its configuration parameters. This section describes setting up
|
||||
a directory to hold the config file. The next sections describe how to tell
|
||||
the rippled server where that file is.
|
||||
|
||||
1. Create a directory to hold the configuration file. In this example, the
|
||||
ripple config directory was created in `C:\Users\joe\ripple\config`.
|
||||
2. Copy the example config file located in `doc\rippled-example.cfg` to the
|
||||
new directory and rename it "rippled.cfg".
|
||||
3. Read the rippled.cfg file and edit as appropriate.
|
||||
|
||||
## Change the Visual Studio Projects Debugging Properties
|
||||
|
||||
1. If not already open, open the solution file located at **Builds/Visual Studio 2015/Ripple.sln**
|
||||
2. Select the correct solution platform in the solution platform dropdown (either *x64*
|
||||
or *Win32* depending on machine type).
|
||||
3. Select the "Project->Properties" menu item to bring up RippleD's Properties Pages
|
||||
4. In "Configuration Properties" select "Debugging".
|
||||
5. In the upper-left Configurations drop down, select "All Configurations".
|
||||
6. In "Debugger to Launch" select "Local Windows Debugger".
|
||||
|
||||
### Tell rippled where to find the configuration file.
|
||||
|
||||
The `--conf` command-line switch to tell rippled where to find this file.
|
||||
In the "Command Arguments" field in the properties dialog (that you opened
|
||||
in the above section), add: `--conf="C:/Users/joe/ripple/config/rippled.cfg"`
|
||||
(of course replacing that path with the path you set up above).
|
||||
|
||||

|
||||
|
||||
### Set the _NO_DEBUG_HEAP Environment Variable
|
||||
|
||||
Rippled can run very slowly in the debugger when using the Windows Debug Heap.
|
||||
Set the `_NO_DEBUG_HEAP` environment variable to one to disable the debug heap.
|
||||
In the "Environment" field (that you opened in the above section), add:
|
||||
`_NO_DEBUG_HEAP=1`
|
||||
|
||||

|
||||
|
||||
# Build
|
||||
|
||||
After these steps are complete, rippled should be ready to build. Simply
|
||||
set rippled as the startup project by right clicking on it in the
|
||||
Visual Studio Solution Explorer, choose **Set as Startup Project**,
|
||||
and then choose the **Build->Build Solution** menu item.
|
||||
|
||||
# Unit Tests (Recommended)
|
||||
|
||||
The external rippled unit tests are written in Javascript using Node.js,
|
||||
and utilize the mocha unit test framework. To run the unit tests, it
|
||||
will be necessary to perform the following steps:
|
||||
|
||||
## Install Node.js
|
||||
|
||||
[Install Node.js](http://nodejs.org/download/). We recommend the Windows
|
||||
installer (**.msi** file) as it takes care of updating the *PATH* environment
|
||||
variable so that scripts can find the command. On Windows systems,
|
||||
**Node.js** comes with **npm**. A separate installation of **npm**
|
||||
is not necessary.
|
||||
|
||||
## Create node_modules
|
||||
|
||||
Open a windows console. From the root of your local rippled repository
|
||||
directory, invoke **npm** to bring in the necessary components:
|
||||
|
||||
```
|
||||
npm install
|
||||
```
|
||||
|
||||
If you get an error that looks like
|
||||
|
||||
```
|
||||
Error: ENOENT, stat 'C:\Users\username\AppData\Roaming\npm'
|
||||
```
|
||||
|
||||
simply create the indicated folder and try again.
|
||||
|
||||
## Create a test config.js
|
||||
|
||||
From a *bash* shell (installed with Git for Windows), copy the
|
||||
example configuration file into the appropriate location:
|
||||
|
||||
```
|
||||
cp test/config-example.js test/config.js
|
||||
```
|
||||
|
||||
Edit your version of test/config.js to reflect the correct path to the rippled executable:
|
||||
|
||||
```
|
||||
exports.default_server_config = {
|
||||
// Where to find the binary.
|
||||
rippled_path: path.resolve(__dirname, "../build/msvc.debug/rippled.exe")
|
||||
};
|
||||
```
|
||||
|
||||
Also in **test/config.js**, change any occurrences of the
|
||||
IP address *0.0.0.0* to *127.0.0.1*.
|
||||
|
||||
## Run Tests
|
||||
|
||||
From a windows console, run the unit tests:
|
||||
|
||||
```
|
||||
npm test
|
||||
```
|
||||
|
||||
Alternatively, run an individual test using mocha:
|
||||
|
||||
```
|
||||
sh
|
||||
node_modules/mocha/bin/mocha test/account_tx-test.js
|
||||
```
|
||||
|
||||
* NOTE: The version of ripple-lib provided by the npm install
|
||||
facility is usually slightly behind the develop branch of the
|
||||
authoritative ripple-lib repository. Therefore, some tests might fail.
|
||||
|
||||
## Development ripple-lib
|
||||
|
||||
To use the latest branch of **ripple-lib** during the unit tests,
|
||||
first clone the repository in a new location outside of your rippled
|
||||
repository. Then update the submodules. After, run **npm install**
|
||||
to set up the **node_modules** directory. Finally, install the
|
||||
**grunt** command line tools required to run **grunt** and
|
||||
build **ripple-lib**.
|
||||
|
||||
```
|
||||
git clone git@github.com:ripple/ripple-lib.git
|
||||
cd ripple-lib
|
||||
git submodule update --init
|
||||
npm install
|
||||
npm install -g grunt-cli
|
||||
grunt
|
||||
```
|
||||
|
||||
Now link this version of **ripple-lib** into the global packages:
|
||||
|
||||
```
|
||||
sudo npm link
|
||||
```
|
||||
|
||||
To make rippled use the newly linked global **ripple-lib** package
|
||||
instead of the one installed under **node_modules**, change
|
||||
directories to the local rippled repository and delete the old
|
||||
**ripple-lib** then link to the new one:
|
||||
|
||||
```
|
||||
sh
|
||||
rm -rf node_modules/ripple-lib
|
||||
npm link ripple-lib
|
||||
```
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{26B7D9AC-1A80-8EF8-6703-D061F1BECB75}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
@@ -28,7 +28,7 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug.classic|x64'" Label="Configuration">
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<LinkIncremental>False</LinkIncremental>
|
||||
<UseDebugLibraries>False</UseDebugLibraries>
|
||||
<UseOfMfc>False</UseOfMfc>
|
||||
@@ -39,7 +39,7 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|x64'" Label="Configuration">
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<LinkIncremental>False</LinkIncremental>
|
||||
<UseDebugLibraries>False</UseDebugLibraries>
|
||||
<UseOfMfc>False</UseOfMfc>
|
||||
@@ -50,7 +50,7 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'" Label="Configuration">
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<LinkIncremental>False</LinkIncremental>
|
||||
<UseDebugLibraries>False</UseDebugLibraries>
|
||||
<UseOfMfc>False</UseOfMfc>
|
||||
@@ -61,7 +61,7 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|x64'" Label="Configuration">
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<LinkIncremental>False</LinkIncremental>
|
||||
<UseDebugLibraries>False</UseDebugLibraries>
|
||||
<UseOfMfc>False</UseOfMfc>
|
||||
@@ -86,8 +86,8 @@
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug.classic|x64'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>HAVE_USLEEP=1;_WIN32_WINNT=0x6000;DEBUG;DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;OPENSSL_NO_SSL2;WIN32_CONSOLE;_CRTDBG_MAP_ALLOC;_CRT_SECURE_NO_WARNINGS;_DEBUG;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\..\build\proto;..\..\src;..\..\src\beast;..\..\src\protobuf\src;..\..\src\protobuf\vsprojects;..\..\src\soci\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>HAVE_USLEEP=1;SOCI_CXX_C11=1;_WIN32_WINNT=0x6000;DEBUG;DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;OPENSSL_NO_SSL2;WIN32_CONSOLE;_CRTDBG_MAP_ALLOC;_CRT_SECURE_NO_WARNINGS;_DEBUG;_SCL_SECURE_NO_WARNINGS;_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\..\build\proto;..\..\src;..\..\src\beast;..\..\src\protobuf\src;..\..\src\protobuf\vsprojects;..\..\src\soci\include;..\..\src\soci\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4800;4244;4267;4018</DisableSpecificWarnings>
|
||||
<ExceptionHandling>Async</ExceptionHandling>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
@@ -110,7 +110,7 @@
|
||||
<AdditionalOptions>/bigobj /FS %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>advapi32.lib;comdlg32.lib;gdi32.lib;kernel32.lib;libeay32MT.lib;odbc32.lib;odbccp32.lib;ole32.lib;oleaut32.lib;shell32.lib;Shlwapi.lib;ssleay32MT.lib;user32.lib;uuid.lib;winspool.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>advapi32.lib;comdlg32.lib;gdi32.lib;kernel32.lib;libeay32.lib;odbc32.lib;odbccp32.lib;ole32.lib;oleaut32.lib;shell32.lib;Shlwapi.lib;ssleay32.lib;user32.lib;uuid.lib;winspool.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<SuppressStartupBanner>True</SuppressStartupBanner>
|
||||
<ErrorReporting>NoErrorReport</ErrorReporting>
|
||||
<SubSystem>Console</SubSystem>
|
||||
@@ -123,8 +123,8 @@
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug|x64'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>HAVE_USLEEP=1;_WIN32_WINNT=0x6000;DEBUG;DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;OPENSSL_NO_SSL2;WIN32_CONSOLE;_CRTDBG_MAP_ALLOC;_CRT_SECURE_NO_WARNINGS;_DEBUG;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\..\build\proto;..\..\src;..\..\src\beast;..\..\src\protobuf\src;..\..\src\protobuf\vsprojects;..\..\src\soci\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>HAVE_USLEEP=1;SOCI_CXX_C11=1;_WIN32_WINNT=0x6000;DEBUG;DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;OPENSSL_NO_SSL2;WIN32_CONSOLE;_CRTDBG_MAP_ALLOC;_CRT_SECURE_NO_WARNINGS;_DEBUG;_SCL_SECURE_NO_WARNINGS;_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\..\build\proto;..\..\src;..\..\src\beast;..\..\src\protobuf\src;..\..\src\protobuf\vsprojects;..\..\src\soci\include;..\..\src\soci\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4800;4244;4267;4018</DisableSpecificWarnings>
|
||||
<ExceptionHandling>Async</ExceptionHandling>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
@@ -147,7 +147,7 @@
|
||||
<AdditionalOptions>/bigobj /FS %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>advapi32.lib;comdlg32.lib;gdi32.lib;kernel32.lib;libeay32MT.lib;odbc32.lib;odbccp32.lib;ole32.lib;oleaut32.lib;shell32.lib;Shlwapi.lib;ssleay32MT.lib;user32.lib;uuid.lib;winspool.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>advapi32.lib;comdlg32.lib;gdi32.lib;kernel32.lib;libeay32.lib;odbc32.lib;odbccp32.lib;ole32.lib;oleaut32.lib;shell32.lib;Shlwapi.lib;ssleay32.lib;user32.lib;uuid.lib;winspool.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<SuppressStartupBanner>True</SuppressStartupBanner>
|
||||
<ErrorReporting>NoErrorReport</ErrorReporting>
|
||||
<SubSystem>Console</SubSystem>
|
||||
@@ -160,8 +160,8 @@
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>HAVE_USLEEP=1;_WIN32_WINNT=0x6000;DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;NDEBUG;OPENSSL_NO_SSL2;WIN32_CONSOLE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\..\build\proto;..\..\src;..\..\src\beast;..\..\src\protobuf\src;..\..\src\protobuf\vsprojects;..\..\src\soci\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>HAVE_USLEEP=1;SOCI_CXX_C11=1;_WIN32_WINNT=0x6000;DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;NDEBUG;OPENSSL_NO_SSL2;WIN32_CONSOLE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\..\build\proto;..\..\src;..\..\src\beast;..\..\src\protobuf\src;..\..\src\protobuf\vsprojects;..\..\src\soci\include;..\..\src\soci\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4800;4244;4267;4018</DisableSpecificWarnings>
|
||||
<ExceptionHandling>Async</ExceptionHandling>
|
||||
<FloatingPointModel>Precise</FloatingPointModel>
|
||||
@@ -182,7 +182,7 @@
|
||||
<AdditionalOptions>/bigobj /FS %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>advapi32.lib;comdlg32.lib;gdi32.lib;kernel32.lib;libeay32MT.lib;odbc32.lib;odbccp32.lib;ole32.lib;oleaut32.lib;shell32.lib;Shlwapi.lib;ssleay32MT.lib;user32.lib;uuid.lib;winspool.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>advapi32.lib;comdlg32.lib;gdi32.lib;kernel32.lib;libeay32.lib;odbc32.lib;odbccp32.lib;ole32.lib;oleaut32.lib;shell32.lib;Shlwapi.lib;ssleay32.lib;user32.lib;uuid.lib;winspool.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<SuppressStartupBanner>True</SuppressStartupBanner>
|
||||
<ErrorReporting>NoErrorReport</ErrorReporting>
|
||||
<SubSystem>Console</SubSystem>
|
||||
@@ -195,8 +195,8 @@
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release|x64'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>HAVE_USLEEP=1;_WIN32_WINNT=0x6000;DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;NDEBUG;OPENSSL_NO_SSL2;WIN32_CONSOLE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\..\build\proto;..\..\src;..\..\src\beast;..\..\src\protobuf\src;..\..\src\protobuf\vsprojects;..\..\src\soci\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>HAVE_USLEEP=1;SOCI_CXX_C11=1;_WIN32_WINNT=0x6000;DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;NDEBUG;OPENSSL_NO_SSL2;WIN32_CONSOLE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\..\build\proto;..\..\src;..\..\src\beast;..\..\src\protobuf\src;..\..\src\protobuf\vsprojects;..\..\src\soci\include;..\..\src\soci\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4800;4244;4267;4018</DisableSpecificWarnings>
|
||||
<ExceptionHandling>Async</ExceptionHandling>
|
||||
<FloatingPointModel>Precise</FloatingPointModel>
|
||||
@@ -217,7 +217,7 @@
|
||||
<AdditionalOptions>/bigobj /FS %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>advapi32.lib;comdlg32.lib;gdi32.lib;kernel32.lib;libeay32MT.lib;odbc32.lib;odbccp32.lib;ole32.lib;oleaut32.lib;shell32.lib;Shlwapi.lib;ssleay32MT.lib;user32.lib;uuid.lib;winspool.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>advapi32.lib;comdlg32.lib;gdi32.lib;kernel32.lib;libeay32.lib;odbc32.lib;odbccp32.lib;ole32.lib;oleaut32.lib;shell32.lib;Shlwapi.lib;ssleay32.lib;user32.lib;uuid.lib;winspool.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<SuppressStartupBanner>True</SuppressStartupBanner>
|
||||
<ErrorReporting>NoErrorReport</ErrorReporting>
|
||||
<SubSystem>Console</SubSystem>
|
||||
@@ -270,8 +270,6 @@
|
||||
<ClCompile Include="..\..\src\beast\beast\asio\tests\streambuf.test.cpp">
|
||||
<ExcludedFromBuild>True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\beast\beast\asio\waitable_executor.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\beast\beast\boost\Boost.unity.cpp">
|
||||
<ExcludedFromBuild>True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
@@ -1455,16 +1453,6 @@
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\app\ledger\PendingSaves.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\app\ledger\tests\common_ledger.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\app\ledger\tests\common_ledger.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\app\ledger\tests\Ledger_test.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\app\ledger\TransactionStateSF.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
@@ -1541,7 +1529,7 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\app\misc\IHashRouter.h">
|
||||
<ClInclude Include="..\..\src\ripple\app\misc\HashRouter.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\app\misc\impl\AccountTxPaging.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
@@ -1565,14 +1553,6 @@
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\app\misc\SHAMapStoreImp.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\app\misc\tests\AccountTxPaging.test.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\app\misc\tests\AmendmentTable.test.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\app\misc\UniqueNodeList.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
@@ -1697,18 +1677,62 @@
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\app\paths\RippleState.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\app\paths\tests\Path_test.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\app\paths\Tuning.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\app\paths\Types.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\app\tests\AccountTxPaging.test.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\app\tests\AmendmentTable.test.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\app\tests\CrossingLimits_test.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\app\tests\DeliverMin.test.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\app\tests\MultiSign.test.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\app\tests\Offer.test.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\app\tests\OfferStream.test.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\app\tests\OversizeMeta_test.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\app\tests\Path_test.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\app\tests\Regression_test.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\app\tests\SetAuth_test.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\app\tests\SusPay_test.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\app\tests\Taker.test.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\app\tx\apply.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\app\tx\impl\apply.cpp">
|
||||
@@ -1809,6 +1833,12 @@
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\app\tx\impl\SignerEntries.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\app\tx\impl\SusPay.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\app\tx\impl\SusPay.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\app\tx\impl\Taker.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
@@ -1837,32 +1867,6 @@
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\app\tx\LocalTxs.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\app\tx\tests\common_transactor.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\app\tx\tests\common_transactor.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\app\tx\tests\DeliverMin.test.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\app\tx\tests\MultiSign.test.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\app\tx\tests\Offer.test.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\app\tx\tests\OfferStream.test.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\app\tx\tests\Taker.test.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\app\tx\Transaction.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\app\tx\TransactionAcquire.h">
|
||||
@@ -2057,26 +2061,38 @@
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='debug.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\core\impl\LoadFeeTrackImp.cpp">
|
||||
<ClCompile Include="..\..\src\ripple\core\impl\LoadFeeTrack.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='debug.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\core\impl\LoadFeeTrackImp.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\core\impl\LoadMonitor.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='debug.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\core\impl\SNTPClock.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='debug.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\core\impl\SNTPClock.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\core\impl\SociDB.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='debug.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\core\impl\TimeKeeper.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='debug.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\core\Job.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\core\JobQueue.h">
|
||||
@@ -2113,6 +2129,8 @@
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='debug.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\core\TimeKeeper.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\crypto\Base58.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\crypto\Base58Data.h">
|
||||
@@ -2121,8 +2139,6 @@
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\crypto\CBigNum.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\crypto\DHUtil.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\crypto\ECDSA.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\crypto\ECDSACanonical.h">
|
||||
@@ -2143,10 +2159,6 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\crypto\impl\DHUtil.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\crypto\impl\ECDSA.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
@@ -2287,7 +2299,7 @@
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\ledger\CachedSLEs.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\ledger\CachingReadView.h">
|
||||
<ClInclude Include="..\..\src\ripple\ledger\CachedView.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\ledger\detail\ApplyStateTable.h">
|
||||
</ClInclude>
|
||||
@@ -2317,7 +2329,7 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\ledger\impl\CachingReadView.cpp">
|
||||
<ClCompile Include="..\..\src\ripple\ledger\impl\CachedView.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
@@ -2337,6 +2349,10 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\ledger\impl\ReadView.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\ledger\impl\TxMeta.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
@@ -2365,6 +2381,10 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\ledger\tests\SkipList_test.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\ledger\tests\View_test.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
@@ -2401,10 +2421,6 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\net\impl\SNTPClient.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\net\InfoSub.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\net\RPCCall.h">
|
||||
@@ -2413,8 +2429,6 @@
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\net\RPCSub.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\net\SNTPClient.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\nodestore\Backend.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\nodestore\backend\MemoryFactory.cpp">
|
||||
@@ -2707,10 +2721,6 @@
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\sim\Predicates.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\peerfinder\sim\Tests.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\sim\WrappedSink.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\Slot.h">
|
||||
@@ -2733,6 +2743,8 @@
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\protocol\ErrorCodes.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\protocol\Feature.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\protocol\HashPrefix.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\protocol\impl\AccountID.cpp">
|
||||
@@ -2755,6 +2767,10 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\protocol\impl\Feature.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\protocol\impl\HashPrefix.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
@@ -2787,6 +2803,10 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\protocol\impl\Rate2.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\protocol\impl\RippleAddress.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
@@ -2909,6 +2929,8 @@
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\protocol\Quality.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\protocol\Rate.h">
|
||||
</ClInclude>
|
||||
<None Include="..\..\src\ripple\protocol\README.md">
|
||||
</None>
|
||||
<ClInclude Include="..\..\src\ripple\protocol\RippleAddress.h">
|
||||
@@ -2927,6 +2949,8 @@
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\protocol\SOTemplate.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\protocol\st.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\protocol\STAccount.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\protocol\STAmount.h">
|
||||
@@ -3142,7 +3166,7 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\rpc\handlers\Feature.cpp">
|
||||
<ClCompile Include="..\..\src\ripple\rpc\handlers\Feature1.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
@@ -3670,6 +3694,10 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\test\jtx\impl\tag.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\test\jtx\impl\ticket.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
@@ -3720,6 +3748,8 @@
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\test\jtx\sig.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\test\jtx\tag.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\test\jtx\tags.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\test\jtx\ter.h">
|
||||
@@ -3851,22 +3881,24 @@
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release|x64'">..\..\src\snappy\config;..\..\src\snappy\snappy;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\unity\soci.cpp">
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='debug.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='debug|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='debug.classic|x64'">..\..\src\soci\include\private;..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='debug|x64'">..\..\src\soci\include\private;..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'">..\..\src\soci\include\private;..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release|x64'">..\..\src\soci\include\private;..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\unity\soci_ripple.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug.classic|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'">True</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='debug|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='debug|x64'">..\..\src\soci\include\private;..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release|x64'">..\..\src\soci\include\private;..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\unity\test.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug.classic|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\unity\validators.cpp">
|
||||
<ClCompile Include="..\..\src\ripple\unity\unl.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug.classic|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\unity\websocket02.cpp">
|
||||
</ClCompile>
|
||||
@@ -3876,37 +3908,32 @@
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'">..\..\src\websocketpp;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release|x64'">..\..\src\websocketpp;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\validators\Connection.h">
|
||||
<ClInclude Include="..\..\src\ripple\unl\tests\BasicNetwork.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\validators\impl\ConnectionImp.cpp">
|
||||
<ExcludedFromBuild>True</ExcludedFromBuild>
|
||||
<ClCompile Include="..\..\src\ripple\unl\tests\Consensus_test.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\validators\impl\ConnectionImp.h">
|
||||
<ClInclude Include="..\..\src\ripple\unl\tests\metrics.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\validators\impl\Logic.cpp">
|
||||
<ExcludedFromBuild>True</ExcludedFromBuild>
|
||||
<ClCompile Include="..\..\src\ripple\unl\tests\Network_test.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\validators\impl\Logic.h">
|
||||
<ClInclude Include="..\..\src\ripple\unl\tests\qalloc.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\validators\impl\Store.h">
|
||||
<ClInclude Include="..\..\src\ripple\unl\tests\Sim1.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\validators\impl\StoreSqdb.cpp">
|
||||
<ExcludedFromBuild>True</ExcludedFromBuild>
|
||||
<ClInclude Include="..\..\src\ripple\unl\tests\Sim2.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\unl\tests\Sim3.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\unl\tests\Sim4.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\unl\tests\SlotPeer_test.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\validators\impl\StoreSqdb.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\validators\impl\Tuning.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\validators\impl\ValidatorManager.cpp">
|
||||
<ExcludedFromBuild>True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\validators\make_Manager.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\validators\tests\Validators.test.cpp">
|
||||
<ExcludedFromBuild>True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\validators\ValidatorManager.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\websocket\AutoSocket.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\websocket\Config04.h">
|
||||
@@ -4613,6 +4640,104 @@
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\snappy\snappy\snappy.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\private\soci-compiler.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\private\soci-cpp.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\private\soci-cstrtod.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\private\soci-dtocstr.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\private\soci-exchange-cast.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\private\soci-mktime.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\backend-loader.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\bind-values.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\blob-exchange.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\blob.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\boost-fusion.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\boost-gregorian-date.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\boost-optional.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\boost-tuple.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\connection-parameters.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\connection-pool.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\error.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\exchange-traits.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\into-type.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\into.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\noreturn.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\once-temp-type.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\prepare-temp-type.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\procedure.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\query_transformation.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\ref-counted-prepare-info.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\ref-counted-statement.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\row-exchange.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\row.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\rowid-exchange.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\rowid.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\rowset.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\session.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\soci-backend.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\soci-platform.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\soci-simple.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\soci.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\sqlite3\soci-sqlite3.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\statement.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\transaction.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\type-conversion-traits.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\type-conversion.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\type-holder.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\type-ptr.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\unsigned-types.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\use-type.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\use.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\values-exchange.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\values.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\backends\sqlite3\blob.cpp">
|
||||
<ExcludedFromBuild>True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
@@ -4621,6 +4746,9 @@
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\soci\src\backends\sqlite3\common.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\backends\sqlite3\error.cpp">
|
||||
<ExcludedFromBuild>True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\soci\src\backends\sqlite3\factory.cpp">
|
||||
<ExcludedFromBuild>True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
@@ -4630,8 +4758,6 @@
|
||||
<ClCompile Include="..\..\src\soci\src\backends\sqlite3\session.cpp">
|
||||
<ExcludedFromBuild>True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\soci\src\backends\sqlite3\soci-sqlite3.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\backends\sqlite3\standard-into-type.cpp">
|
||||
<ExcludedFromBuild>True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
@@ -4647,144 +4773,60 @@
|
||||
<ClCompile Include="..\..\src\soci\src\backends\sqlite3\vector-use-type.cpp">
|
||||
<ExcludedFromBuild>True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\soci\src\core\backend-loader.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\blob-exchange.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\core\blob.cpp">
|
||||
<ExcludedFromBuild>True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\soci\src\core\blob.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\boost-fusion.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\boost-gregorian-date.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\boost-optional.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\boost-tuple.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\core\connection-parameters.cpp">
|
||||
<ExcludedFromBuild>True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\soci\src\core\connection-parameters.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\core\connection-pool.cpp">
|
||||
<ExcludedFromBuild>True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\soci\src\core\connection-pool.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\core\error.cpp">
|
||||
<ExcludedFromBuild>True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\soci\src\core\error.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\exchange-traits.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\core\into-type.cpp">
|
||||
<ExcludedFromBuild>True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\soci\src\core\into-type.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\into.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\core\once-temp-type.cpp">
|
||||
<ExcludedFromBuild>True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\soci\src\core\once-temp-type.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\core\prepare-temp-type.cpp">
|
||||
<ExcludedFromBuild>True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\soci\src\core\prepare-temp-type.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\core\procedure.cpp">
|
||||
<ExcludedFromBuild>True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\soci\src\core\procedure.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\query_transformation.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\core\ref-counted-prepare-info.cpp">
|
||||
<ExcludedFromBuild>True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\soci\src\core\ref-counted-prepare-info.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\core\ref-counted-statement.cpp">
|
||||
<ExcludedFromBuild>True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\soci\src\core\ref-counted-statement.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\row-exchange.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\core\row.cpp">
|
||||
<ExcludedFromBuild>True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\soci\src\core\row.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\rowid-exchange.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\core\rowid.cpp">
|
||||
<ExcludedFromBuild>True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\soci\src\core\rowid.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\rowset.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\core\session.cpp">
|
||||
<ExcludedFromBuild>True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\soci\src\core\session.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\soci-backend.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\soci-config.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\soci-platform.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\core\soci-simple.cpp">
|
||||
<ExcludedFromBuild>True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\soci\src\core\soci-simple.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\soci.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\core\statement.cpp">
|
||||
<ExcludedFromBuild>True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\soci\src\core\statement.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\core\transaction.cpp">
|
||||
<ExcludedFromBuild>True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\soci\src\core\transaction.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\type-conversion-traits.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\type-conversion.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\type-holder.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\type-ptr.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\unsigned-types.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\core\use-type.cpp">
|
||||
<ExcludedFromBuild>True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\soci\src\core\use-type.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\use.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\values-exchange.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\core\values.cpp">
|
||||
<ExcludedFromBuild>True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\soci\src\core\values.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\version.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\sqlite\sqlite.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\sqlite\sqlite.unity.c">
|
||||
@@ -250,9 +250,6 @@
|
||||
<Filter Include="ripple\app\ledger\impl">
|
||||
<UniqueIdentifier>{0EF1A571-94CC-4D70-E004-48579DF8AF2B}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ripple\app\ledger\tests">
|
||||
<UniqueIdentifier>{55A76B5B-A18E-E655-1A07-9492C6F8F356}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ripple\app\main">
|
||||
<UniqueIdentifier>{91D5931B-D981-52BC-BC12-08DA9F7BF606}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -262,18 +259,12 @@
|
||||
<Filter Include="ripple\app\misc\impl">
|
||||
<UniqueIdentifier>{C4BDB9F8-7DB7-E304-D286-098085D5D16E}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ripple\app\misc\tests">
|
||||
<UniqueIdentifier>{815DC1A2-E2EF-E6E3-D979-19AD1476A28B}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ripple\app\paths">
|
||||
<UniqueIdentifier>{03533509-DAC6-636F-9F7E-288894549E95}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ripple\app\paths\cursor">
|
||||
<UniqueIdentifier>{9AD8D049-10A8-704C-D51A-FAD55B1F235F}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ripple\app\paths\tests">
|
||||
<UniqueIdentifier>{1025719B-6A8F-D9FB-A6BA-02B93756DE09}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ripple\app\tests">
|
||||
<UniqueIdentifier>{2E791662-6ED0-D1E1-03A4-0CB35473EC56}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -283,9 +274,6 @@
|
||||
<Filter Include="ripple\app\tx\impl">
|
||||
<UniqueIdentifier>{4849F8A8-26D5-8416-2D59-F4CA49F0100C}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ripple\app\tx\tests">
|
||||
<UniqueIdentifier>{9F69C81C-840B-8296-2595-D669EC736BED}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ripple\basics">
|
||||
<UniqueIdentifier>{B8720E2F-21B1-2847-F96C-4E00A45DC639}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -436,14 +424,11 @@
|
||||
<Filter Include="ripple\unity">
|
||||
<UniqueIdentifier>{5DB3CD0B-B361-B301-9562-697CA8A52B68}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ripple\validators">
|
||||
<UniqueIdentifier>{B23DCD4C-1622-2C31-4562-87F2F95D3884}</UniqueIdentifier>
|
||||
<Filter Include="ripple\unl">
|
||||
<UniqueIdentifier>{843C622F-AA52-E6C5-D3EB-D4B6D564B395}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ripple\validators\impl">
|
||||
<UniqueIdentifier>{3D1F0CBE-9B69-D29E-EAAE-E5A1204068BC}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ripple\validators\tests">
|
||||
<UniqueIdentifier>{663AE0EE-6781-C2F4-8D04-0D5D30AC0773}</UniqueIdentifier>
|
||||
<Filter Include="ripple\unl\tests">
|
||||
<UniqueIdentifier>{2C910562-8D0A-B115-B829-556779436F2F}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ripple\websocket">
|
||||
<UniqueIdentifier>{44780F86-42D3-2F2B-0846-5AEE2CA6D7FE}</UniqueIdentifier>
|
||||
@@ -532,6 +517,18 @@
|
||||
<Filter Include="soci">
|
||||
<UniqueIdentifier>{E5334950-60C3-CE41-4DD7-535029F143F7}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="soci\include">
|
||||
<UniqueIdentifier>{326BC235-4389-131A-EFCF-B54C652509F1}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="soci\include\private">
|
||||
<UniqueIdentifier>{95BB48F7-02FF-05FA-0112-506B0BB188FE}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="soci\include\soci">
|
||||
<UniqueIdentifier>{227F15C2-FEEE-AFD6-835C-989647DBEBE2}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="soci\include\soci\sqlite3">
|
||||
<UniqueIdentifier>{AEF95E82-C569-5213-CEFC-7546DD7CDD77}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="soci\src">
|
||||
<UniqueIdentifier>{5A1D8022-39F2-67E1-FFBE-EA7D5BF9FBDB}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -708,9 +705,6 @@
|
||||
<ClCompile Include="..\..\src\beast\beast\asio\tests\streambuf.test.cpp">
|
||||
<Filter>beast\asio\tests</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\beast\beast\asio\waitable_executor.h">
|
||||
<Filter>beast\asio</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\beast\beast\boost\Boost.unity.cpp">
|
||||
<Filter>beast\boost</Filter>
|
||||
</ClCompile>
|
||||
@@ -2211,15 +2205,6 @@
|
||||
<ClInclude Include="..\..\src\ripple\app\ledger\PendingSaves.h">
|
||||
<Filter>ripple\app\ledger</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\app\ledger\tests\common_ledger.cpp">
|
||||
<Filter>ripple\app\ledger\tests</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\app\ledger\tests\common_ledger.h">
|
||||
<Filter>ripple\app\ledger\tests</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\app\ledger\tests\Ledger_test.cpp">
|
||||
<Filter>ripple\app\ledger\tests</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\app\ledger\TransactionStateSF.cpp">
|
||||
<Filter>ripple\app\ledger</Filter>
|
||||
</ClCompile>
|
||||
@@ -2295,7 +2280,7 @@
|
||||
<ClCompile Include="..\..\src\ripple\app\misc\HashRouter.cpp">
|
||||
<Filter>ripple\app\misc</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\app\misc\IHashRouter.h">
|
||||
<ClInclude Include="..\..\src\ripple\app\misc\HashRouter.h">
|
||||
<Filter>ripple\app\misc</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\app\misc\impl\AccountTxPaging.cpp">
|
||||
@@ -2322,12 +2307,6 @@
|
||||
<ClInclude Include="..\..\src\ripple\app\misc\SHAMapStoreImp.h">
|
||||
<Filter>ripple\app\misc</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\app\misc\tests\AccountTxPaging.test.cpp">
|
||||
<Filter>ripple\app\misc\tests</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\app\misc\tests\AmendmentTable.test.cpp">
|
||||
<Filter>ripple\app\misc\tests</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\app\misc\UniqueNodeList.cpp">
|
||||
<Filter>ripple\app\misc</Filter>
|
||||
</ClCompile>
|
||||
@@ -2445,18 +2424,51 @@
|
||||
<ClInclude Include="..\..\src\ripple\app\paths\RippleState.h">
|
||||
<Filter>ripple\app\paths</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\app\paths\tests\Path_test.cpp">
|
||||
<Filter>ripple\app\paths\tests</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\app\paths\Tuning.h">
|
||||
<Filter>ripple\app\paths</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\app\paths\Types.h">
|
||||
<Filter>ripple\app\paths</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\app\tests\AccountTxPaging.test.cpp">
|
||||
<Filter>ripple\app\tests</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\app\tests\AmendmentTable.test.cpp">
|
||||
<Filter>ripple\app\tests</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\app\tests\CrossingLimits_test.cpp">
|
||||
<Filter>ripple\app\tests</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\app\tests\DeliverMin.test.cpp">
|
||||
<Filter>ripple\app\tests</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\app\tests\MultiSign.test.cpp">
|
||||
<Filter>ripple\app\tests</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\app\tests\Offer.test.cpp">
|
||||
<Filter>ripple\app\tests</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\app\tests\OfferStream.test.cpp">
|
||||
<Filter>ripple\app\tests</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\app\tests\OversizeMeta_test.cpp">
|
||||
<Filter>ripple\app\tests</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\app\tests\Path_test.cpp">
|
||||
<Filter>ripple\app\tests</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\app\tests\Regression_test.cpp">
|
||||
<Filter>ripple\app\tests</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\app\tests\SetAuth_test.cpp">
|
||||
<Filter>ripple\app\tests</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\app\tests\SusPay_test.cpp">
|
||||
<Filter>ripple\app\tests</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\app\tests\Taker.test.cpp">
|
||||
<Filter>ripple\app\tests</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\app\tx\apply.h">
|
||||
<Filter>ripple\app\tx</Filter>
|
||||
</ClInclude>
|
||||
@@ -2556,6 +2568,12 @@
|
||||
<ClInclude Include="..\..\src\ripple\app\tx\impl\SignerEntries.h">
|
||||
<Filter>ripple\app\tx\impl</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\app\tx\impl\SusPay.cpp">
|
||||
<Filter>ripple\app\tx\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\app\tx\impl\SusPay.h">
|
||||
<Filter>ripple\app\tx\impl</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\app\tx\impl\Taker.cpp">
|
||||
<Filter>ripple\app\tx\impl</Filter>
|
||||
</ClCompile>
|
||||
@@ -2583,27 +2601,6 @@
|
||||
<ClInclude Include="..\..\src\ripple\app\tx\LocalTxs.h">
|
||||
<Filter>ripple\app\tx</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\app\tx\tests\common_transactor.cpp">
|
||||
<Filter>ripple\app\tx\tests</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\app\tx\tests\common_transactor.h">
|
||||
<Filter>ripple\app\tx\tests</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\app\tx\tests\DeliverMin.test.cpp">
|
||||
<Filter>ripple\app\tx\tests</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\app\tx\tests\MultiSign.test.cpp">
|
||||
<Filter>ripple\app\tx\tests</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\app\tx\tests\Offer.test.cpp">
|
||||
<Filter>ripple\app\tx\tests</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\app\tx\tests\OfferStream.test.cpp">
|
||||
<Filter>ripple\app\tx\tests</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\app\tx\tests\Taker.test.cpp">
|
||||
<Filter>ripple\app\tx\tests</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\app\tx\Transaction.h">
|
||||
<Filter>ripple\app\tx</Filter>
|
||||
</ClInclude>
|
||||
@@ -2796,18 +2793,24 @@
|
||||
<ClCompile Include="..\..\src\ripple\core\impl\LoadEvent.cpp">
|
||||
<Filter>ripple\core\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\core\impl\LoadFeeTrackImp.cpp">
|
||||
<ClCompile Include="..\..\src\ripple\core\impl\LoadFeeTrack.cpp">
|
||||
<Filter>ripple\core\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\core\impl\LoadFeeTrackImp.h">
|
||||
<Filter>ripple\core\impl</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\core\impl\LoadMonitor.cpp">
|
||||
<Filter>ripple\core\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\core\impl\SNTPClock.cpp">
|
||||
<Filter>ripple\core\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\core\impl\SNTPClock.h">
|
||||
<Filter>ripple\core\impl</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\core\impl\SociDB.cpp">
|
||||
<Filter>ripple\core\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\core\impl\TimeKeeper.cpp">
|
||||
<Filter>ripple\core\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\core\Job.h">
|
||||
<Filter>ripple\core</Filter>
|
||||
</ClInclude>
|
||||
@@ -2844,6 +2847,9 @@
|
||||
<ClCompile Include="..\..\src\ripple\core\tests\SociDB.test.cpp">
|
||||
<Filter>ripple\core\tests</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\core\TimeKeeper.h">
|
||||
<Filter>ripple\core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\crypto\Base58.h">
|
||||
<Filter>ripple\crypto</Filter>
|
||||
</ClInclude>
|
||||
@@ -2856,9 +2862,6 @@
|
||||
<ClInclude Include="..\..\src\ripple\crypto\CBigNum.h">
|
||||
<Filter>ripple\crypto</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\crypto\DHUtil.h">
|
||||
<Filter>ripple\crypto</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\crypto\ECDSA.h">
|
||||
<Filter>ripple\crypto</Filter>
|
||||
</ClInclude>
|
||||
@@ -2880,9 +2883,6 @@
|
||||
<ClCompile Include="..\..\src\ripple\crypto\impl\CBigNum.cpp">
|
||||
<Filter>ripple\crypto\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\crypto\impl\DHUtil.cpp">
|
||||
<Filter>ripple\crypto\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\crypto\impl\ECDSA.cpp">
|
||||
<Filter>ripple\crypto\impl</Filter>
|
||||
</ClCompile>
|
||||
@@ -3018,7 +3018,7 @@
|
||||
<ClInclude Include="..\..\src\ripple\ledger\CachedSLEs.h">
|
||||
<Filter>ripple\ledger</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\ledger\CachingReadView.h">
|
||||
<ClInclude Include="..\..\src\ripple\ledger\CachedView.h">
|
||||
<Filter>ripple\ledger</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\ledger\detail\ApplyStateTable.h">
|
||||
@@ -3051,7 +3051,7 @@
|
||||
<ClCompile Include="..\..\src\ripple\ledger\impl\CachedSLEs.cpp">
|
||||
<Filter>ripple\ledger\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\ledger\impl\CachingReadView.cpp">
|
||||
<ClCompile Include="..\..\src\ripple\ledger\impl\CachedView.cpp">
|
||||
<Filter>ripple\ledger\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\ledger\impl\Directory.cpp">
|
||||
@@ -3066,6 +3066,9 @@
|
||||
<ClCompile Include="..\..\src\ripple\ledger\impl\RawStateTable.cpp">
|
||||
<Filter>ripple\ledger\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\ledger\impl\ReadView.cpp">
|
||||
<Filter>ripple\ledger\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\ledger\impl\TxMeta.cpp">
|
||||
<Filter>ripple\ledger\impl</Filter>
|
||||
</ClCompile>
|
||||
@@ -3096,6 +3099,9 @@
|
||||
<ClCompile Include="..\..\src\ripple\ledger\tests\PaymentSandbox_test.cpp">
|
||||
<Filter>ripple\ledger\tests</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\ledger\tests\SkipList_test.cpp">
|
||||
<Filter>ripple\ledger\tests</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\ledger\tests\View_test.cpp">
|
||||
<Filter>ripple\ledger\tests</Filter>
|
||||
</ClCompile>
|
||||
@@ -3129,9 +3135,6 @@
|
||||
<ClCompile Include="..\..\src\ripple\net\impl\RPCSub.cpp">
|
||||
<Filter>ripple\net\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\net\impl\SNTPClient.cpp">
|
||||
<Filter>ripple\net\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\net\InfoSub.h">
|
||||
<Filter>ripple\net</Filter>
|
||||
</ClInclude>
|
||||
@@ -3144,9 +3147,6 @@
|
||||
<ClInclude Include="..\..\src\ripple\net\RPCSub.h">
|
||||
<Filter>ripple\net</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\net\SNTPClient.h">
|
||||
<Filter>ripple\net</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\nodestore\Backend.h">
|
||||
<Filter>ripple\nodestore</Filter>
|
||||
</ClInclude>
|
||||
@@ -3429,9 +3429,6 @@
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\sim\Predicates.h">
|
||||
<Filter>ripple\peerfinder\sim</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\peerfinder\sim\Tests.cpp">
|
||||
<Filter>ripple\peerfinder\sim</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\sim\WrappedSink.h">
|
||||
<Filter>ripple\peerfinder\sim</Filter>
|
||||
</ClInclude>
|
||||
@@ -3459,6 +3456,9 @@
|
||||
<ClInclude Include="..\..\src\ripple\protocol\ErrorCodes.h">
|
||||
<Filter>ripple\protocol</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\protocol\Feature.h">
|
||||
<Filter>ripple\protocol</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\protocol\HashPrefix.h">
|
||||
<Filter>ripple\protocol</Filter>
|
||||
</ClInclude>
|
||||
@@ -3477,6 +3477,9 @@
|
||||
<ClCompile Include="..\..\src\ripple\protocol\impl\ErrorCodes.cpp">
|
||||
<Filter>ripple\protocol\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\protocol\impl\Feature.cpp">
|
||||
<Filter>ripple\protocol\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\protocol\impl\HashPrefix.cpp">
|
||||
<Filter>ripple\protocol\impl</Filter>
|
||||
</ClCompile>
|
||||
@@ -3501,6 +3504,9 @@
|
||||
<ClCompile Include="..\..\src\ripple\protocol\impl\Quality.cpp">
|
||||
<Filter>ripple\protocol\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\protocol\impl\Rate2.cpp">
|
||||
<Filter>ripple\protocol\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\protocol\impl\RippleAddress.cpp">
|
||||
<Filter>ripple\protocol\impl</Filter>
|
||||
</ClCompile>
|
||||
@@ -3612,6 +3618,9 @@
|
||||
<ClInclude Include="..\..\src\ripple\protocol\Quality.h">
|
||||
<Filter>ripple\protocol</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\protocol\Rate.h">
|
||||
<Filter>ripple\protocol</Filter>
|
||||
</ClInclude>
|
||||
<None Include="..\..\src\ripple\protocol\README.md">
|
||||
<Filter>ripple\protocol</Filter>
|
||||
</None>
|
||||
@@ -3639,6 +3648,9 @@
|
||||
<ClInclude Include="..\..\src\ripple\protocol\SOTemplate.h">
|
||||
<Filter>ripple\protocol</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\protocol\st.h">
|
||||
<Filter>ripple\protocol</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\protocol\STAccount.h">
|
||||
<Filter>ripple\protocol</Filter>
|
||||
</ClInclude>
|
||||
@@ -3849,7 +3861,7 @@
|
||||
<ClCompile Include="..\..\src\ripple\rpc\handlers\ConsensusInfo.cpp">
|
||||
<Filter>ripple\rpc\handlers</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\rpc\handlers\Feature.cpp">
|
||||
<ClCompile Include="..\..\src\ripple\rpc\handlers\Feature1.cpp">
|
||||
<Filter>ripple\rpc\handlers</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\rpc\handlers\FetchInfo.cpp">
|
||||
@@ -4341,6 +4353,9 @@
|
||||
<ClCompile Include="..\..\src\ripple\test\jtx\impl\sig.cpp">
|
||||
<Filter>ripple\test\jtx\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\test\jtx\impl\tag.cpp">
|
||||
<Filter>ripple\test\jtx\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\test\jtx\impl\ticket.cpp">
|
||||
<Filter>ripple\test\jtx\impl</Filter>
|
||||
</ClCompile>
|
||||
@@ -4404,6 +4419,9 @@
|
||||
<ClInclude Include="..\..\src\ripple\test\jtx\sig.h">
|
||||
<Filter>ripple\test\jtx</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\test\jtx\tag.h">
|
||||
<Filter>ripple\test\jtx</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\test\jtx\tags.h">
|
||||
<Filter>ripple\test\jtx</Filter>
|
||||
</ClInclude>
|
||||
@@ -4527,7 +4545,7 @@
|
||||
<ClCompile Include="..\..\src\ripple\unity\test.cpp">
|
||||
<Filter>ripple\unity</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\unity\validators.cpp">
|
||||
<ClCompile Include="..\..\src\ripple\unity\unl.cpp">
|
||||
<Filter>ripple\unity</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\unity\websocket02.cpp">
|
||||
@@ -4536,45 +4554,36 @@
|
||||
<ClCompile Include="..\..\src\ripple\unity\websocket04.cpp">
|
||||
<Filter>ripple\unity</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\validators\Connection.h">
|
||||
<Filter>ripple\validators</Filter>
|
||||
<ClInclude Include="..\..\src\ripple\unl\tests\BasicNetwork.h">
|
||||
<Filter>ripple\unl\tests</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\validators\impl\ConnectionImp.cpp">
|
||||
<Filter>ripple\validators\impl</Filter>
|
||||
<ClCompile Include="..\..\src\ripple\unl\tests\Consensus_test.cpp">
|
||||
<Filter>ripple\unl\tests</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\validators\impl\ConnectionImp.h">
|
||||
<Filter>ripple\validators\impl</Filter>
|
||||
<ClInclude Include="..\..\src\ripple\unl\tests\metrics.h">
|
||||
<Filter>ripple\unl\tests</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\validators\impl\Logic.cpp">
|
||||
<Filter>ripple\validators\impl</Filter>
|
||||
<ClCompile Include="..\..\src\ripple\unl\tests\Network_test.cpp">
|
||||
<Filter>ripple\unl\tests</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\validators\impl\Logic.h">
|
||||
<Filter>ripple\validators\impl</Filter>
|
||||
<ClInclude Include="..\..\src\ripple\unl\tests\qalloc.h">
|
||||
<Filter>ripple\unl\tests</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\validators\impl\Store.h">
|
||||
<Filter>ripple\validators\impl</Filter>
|
||||
<ClInclude Include="..\..\src\ripple\unl\tests\Sim1.h">
|
||||
<Filter>ripple\unl\tests</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\validators\impl\StoreSqdb.cpp">
|
||||
<Filter>ripple\validators\impl</Filter>
|
||||
<ClInclude Include="..\..\src\ripple\unl\tests\Sim2.h">
|
||||
<Filter>ripple\unl\tests</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\unl\tests\Sim3.h">
|
||||
<Filter>ripple\unl\tests</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\unl\tests\Sim4.h">
|
||||
<Filter>ripple\unl\tests</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\unl\tests\SlotPeer_test.cpp">
|
||||
<Filter>ripple\unl\tests</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\validators\impl\StoreSqdb.h">
|
||||
<Filter>ripple\validators\impl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\validators\impl\Tuning.h">
|
||||
<Filter>ripple\validators\impl</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\validators\impl\ValidatorManager.cpp">
|
||||
<Filter>ripple\validators\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\validators\make_Manager.h">
|
||||
<Filter>ripple\validators</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\validators\tests\Validators.test.cpp">
|
||||
<Filter>ripple\validators\tests</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\validators\ValidatorManager.h">
|
||||
<Filter>ripple\validators</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\websocket\AutoSocket.h">
|
||||
<Filter>ripple\websocket</Filter>
|
||||
</ClInclude>
|
||||
@@ -5466,6 +5475,153 @@
|
||||
<ClInclude Include="..\..\src\snappy\snappy\snappy.h">
|
||||
<Filter>snappy\snappy</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\private\soci-compiler.h">
|
||||
<Filter>soci\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\private\soci-cpp.h">
|
||||
<Filter>soci\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\private\soci-cstrtod.h">
|
||||
<Filter>soci\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\private\soci-dtocstr.h">
|
||||
<Filter>soci\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\private\soci-exchange-cast.h">
|
||||
<Filter>soci\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\private\soci-mktime.h">
|
||||
<Filter>soci\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\backend-loader.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\bind-values.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\blob-exchange.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\blob.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\boost-fusion.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\boost-gregorian-date.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\boost-optional.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\boost-tuple.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\connection-parameters.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\connection-pool.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\error.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\exchange-traits.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\into-type.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\into.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\noreturn.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\once-temp-type.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\prepare-temp-type.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\procedure.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\query_transformation.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\ref-counted-prepare-info.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\ref-counted-statement.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\row-exchange.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\row.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\rowid-exchange.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\rowid.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\rowset.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\session.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\soci-backend.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\soci-platform.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\soci-simple.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\soci.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\sqlite3\soci-sqlite3.h">
|
||||
<Filter>soci\include\soci\sqlite3</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\statement.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\transaction.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\type-conversion-traits.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\type-conversion.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\type-holder.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\type-ptr.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\unsigned-types.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\use-type.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\use.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\values-exchange.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\include\soci\values.h">
|
||||
<Filter>soci\include\soci</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\backends\sqlite3\blob.cpp">
|
||||
<Filter>soci\src\backends\sqlite3</Filter>
|
||||
</ClCompile>
|
||||
@@ -5475,6 +5631,9 @@
|
||||
<ClInclude Include="..\..\src\soci\src\backends\sqlite3\common.h">
|
||||
<Filter>soci\src\backends\sqlite3</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\backends\sqlite3\error.cpp">
|
||||
<Filter>soci\src\backends\sqlite3</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\soci\src\backends\sqlite3\factory.cpp">
|
||||
<Filter>soci\src\backends\sqlite3</Filter>
|
||||
</ClCompile>
|
||||
@@ -5484,9 +5643,6 @@
|
||||
<ClCompile Include="..\..\src\soci\src\backends\sqlite3\session.cpp">
|
||||
<Filter>soci\src\backends\sqlite3</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\soci\src\backends\sqlite3\soci-sqlite3.h">
|
||||
<Filter>soci\src\backends\sqlite3</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\backends\sqlite3\standard-into-type.cpp">
|
||||
<Filter>soci\src\backends\sqlite3</Filter>
|
||||
</ClCompile>
|
||||
@@ -5502,186 +5658,60 @@
|
||||
<ClCompile Include="..\..\src\soci\src\backends\sqlite3\vector-use-type.cpp">
|
||||
<Filter>soci\src\backends\sqlite3</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\soci\src\core\backend-loader.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\blob-exchange.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\core\blob.cpp">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\soci\src\core\blob.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\boost-fusion.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\boost-gregorian-date.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\boost-optional.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\boost-tuple.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\core\connection-parameters.cpp">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\soci\src\core\connection-parameters.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\core\connection-pool.cpp">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\soci\src\core\connection-pool.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\core\error.cpp">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\soci\src\core\error.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\exchange-traits.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\core\into-type.cpp">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\soci\src\core\into-type.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\into.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\core\once-temp-type.cpp">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\soci\src\core\once-temp-type.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\core\prepare-temp-type.cpp">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\soci\src\core\prepare-temp-type.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\core\procedure.cpp">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\soci\src\core\procedure.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\query_transformation.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\core\ref-counted-prepare-info.cpp">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\soci\src\core\ref-counted-prepare-info.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\core\ref-counted-statement.cpp">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\soci\src\core\ref-counted-statement.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\row-exchange.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\core\row.cpp">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\soci\src\core\row.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\rowid-exchange.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\core\rowid.cpp">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\soci\src\core\rowid.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\rowset.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\core\session.cpp">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\soci\src\core\session.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\soci-backend.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\soci-config.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\soci-platform.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\core\soci-simple.cpp">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\soci\src\core\soci-simple.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\soci.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\core\statement.cpp">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\soci\src\core\statement.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\core\transaction.cpp">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\soci\src\core\transaction.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\type-conversion-traits.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\type-conversion.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\type-holder.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\type-ptr.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\unsigned-types.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\core\use-type.cpp">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\soci\src\core\use-type.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\use.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\values-exchange.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\soci\src\core\values.cpp">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\soci\src\core\values.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\soci\src\core\version.h">
|
||||
<Filter>soci\src\core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\sqlite\sqlite.h">
|
||||
<Filter>sqlite</Filter>
|
||||
</ClInclude>
|
||||
BIN
Builds/VisualStudio2015/images/NoDebugHeapPropPage.png
Normal file
BIN
Builds/VisualStudio2015/images/NoDebugHeapPropPage.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 34 KiB |
BIN
Builds/VisualStudio2015/images/VS2015x64IncludeDirs.png
Normal file
BIN
Builds/VisualStudio2015/images/VS2015x64IncludeDirs.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 62 KiB |
BIN
Builds/VisualStudio2015/images/VS2015x64LibraryDirs.png
Normal file
BIN
Builds/VisualStudio2015/images/VS2015x64LibraryDirs.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 49 KiB |
BIN
Builds/VisualStudio2015/images/VS2015x64Properties.png
Normal file
BIN
Builds/VisualStudio2015/images/VS2015x64Properties.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
BIN
Builds/VisualStudio2015/images/VSCommandArgsPropPage.png
Normal file
BIN
Builds/VisualStudio2015/images/VSCommandArgsPropPage.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
@@ -1,9 +1,9 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Express 2013 for Windows Desktop
|
||||
VisualStudioVersion = 12.0.31101.0
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.23107.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{26B7D9AC-1A80-8EF8-6703-D061F1BECB75}") = "RippleD", "RippleD.vcxproj", "{26B7D9AC-1A80-8EF8-6703-D061F1BECB75}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RippleD", "RippleD.vcxproj", "{26B7D9AC-1A80-8EF8-6703-D061F1BECB75}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@@ -1,14 +1,18 @@
|
||||
%define rippled_branch %(echo $RIPPLED_BRANCH)
|
||||
Name: rippled
|
||||
Version: 0.29.0
|
||||
Release: 1%{?dist}
|
||||
# Version must be limited to MAJOR.MINOR.PATCH
|
||||
Version: 0.30.0
|
||||
# Release should include either the build or hotfix number (ex: hf1%{?dist} or b2%{?dist})
|
||||
# If there is no b# or hf#, then use 1%{?dist}
|
||||
Release: %{?dist}
|
||||
Summary: Ripple peer-to-peer network daemon
|
||||
|
||||
Group: Applications/Internet
|
||||
License: ISC
|
||||
URL: https://github.com/ripple/rippled
|
||||
|
||||
# curl -L -o SOURCES/rippled-release.zip https://github.com/ripple/rippled/archive/release.zip
|
||||
Source0: rippled-release.zip
|
||||
# curl -L -o SOURCES/rippled-release.zip https://github.com/ripple/rippled/archive/${RIPPLED_BRANCH}.zip
|
||||
Source0: rippled-%{rippled_branch}.zip
|
||||
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
|
||||
|
||||
BuildRequires: gcc-c++ scons openssl-devel protobuf-devel
|
||||
@@ -20,13 +24,11 @@ Rippled is the server component of the Ripple network.
|
||||
|
||||
|
||||
%prep
|
||||
%setup -n rippled-release
|
||||
%setup -n rippled-%{rippled_branch}
|
||||
|
||||
|
||||
%build
|
||||
# Assume boost is manually installed
|
||||
export RIPPLED_BOOST_HOME=/usr/local/boost_1_55_0
|
||||
scons -j `grep -c processor /proc/cpuinfo` build/rippled
|
||||
scons -j `grep -c processor /proc/cpuinfo`
|
||||
|
||||
|
||||
%install
|
||||
@@ -49,4 +51,4 @@ rm -rf %{buildroot}
|
||||
%defattr(-,root,root,-)
|
||||
/usr/bin/rippled
|
||||
/usr/share/rippled/LICENSE
|
||||
/etc/rippled/rippled-example.cfg
|
||||
%config(noreplace) /etc/rippled/rippled.cfg
|
||||
|
||||
164
SConstruct
164
SConstruct
@@ -15,11 +15,13 @@
|
||||
|
||||
clang All clang variants
|
||||
clang.debug clang debug variant
|
||||
clang.coverage clang coverage variant
|
||||
clang.release clang release variant
|
||||
clang.profile clang profile variant
|
||||
|
||||
gcc All gcc variants
|
||||
gcc.debug gcc debug variant
|
||||
gcc.coverage gcc coverage variant
|
||||
gcc.release gcc release variant
|
||||
gcc.profile gcc profile variant
|
||||
|
||||
@@ -65,6 +67,19 @@ The following extra options may be used:
|
||||
(see: https://martine.github.io/ninja/). Only gcc and clang targets
|
||||
are supported.
|
||||
|
||||
GCC 5 support: There is transitional support for user-installed gcc 5. Setting
|
||||
the environment variable: `RIPPLED_OLD_GCC_ABI` to one enables the transitional
|
||||
support. Due to an ABI change between gcc 4 and gcc 5, it is assumed all
|
||||
libraries are built with the old, gcc 4 ABI. Since no linux distro has upgraded
|
||||
to gcc 5, this allows us to use the package manager to install rippled
|
||||
dependencies and to easily switch between gcc 4 and gcc 5. It also means if the
|
||||
user builds C++ dependencies themselves - such as boost - they must either be
|
||||
built with gcc 4 or with the preprocessor flag `_GLIBCXX_USE_CXX11_ABI` set to
|
||||
zero. When linux distros upgrade to gcc 5, the transitional support will be
|
||||
removed. To enable C++-14 support, define the environment variable `RIPPLED_USE_CPP_14`
|
||||
to one. This is also transitional and will be removed when we permanently enable C++ 14
|
||||
support.
|
||||
|
||||
'''
|
||||
#
|
||||
'''
|
||||
@@ -99,7 +114,13 @@ AddOption('--ninja', dest='ninja', action='store_true',
|
||||
help='generate ninja build file build.ninja')
|
||||
|
||||
def parse_time(t):
|
||||
return time.strptime(t, '%a %b %d %H:%M:%S %Z %Y')
|
||||
l = len(t.split())
|
||||
if l==5:
|
||||
return time.strptime(t, '%a %b %d %H:%M:%S %Y')
|
||||
elif l==3:
|
||||
return time.strptime(t, '%d %b %Y')
|
||||
else:
|
||||
return time.strptime(t, '%a %b %d %H:%M:%S %Z %Y')
|
||||
|
||||
CHECK_PLATFORMS = 'Debian', 'Ubuntu'
|
||||
CHECK_COMMAND = 'openssl version -a'
|
||||
@@ -108,19 +129,27 @@ BUILD_TIME = 'Mon Apr 7 20:33:19 UTC 2014'
|
||||
OPENSSL_ERROR = ('Your openSSL was built on %s; '
|
||||
'rippled needs a version built on or after %s.')
|
||||
UNITY_BUILD_DIRECTORY = 'src/ripple/unity/'
|
||||
USE_CPP_14 = os.getenv('RIPPLED_USE_CPP_14')
|
||||
|
||||
def check_openssl():
|
||||
if Beast.system.platform in CHECK_PLATFORMS:
|
||||
for line in subprocess.check_output(CHECK_COMMAND.split()).splitlines():
|
||||
if line.startswith(CHECK_LINE):
|
||||
line = line[len(CHECK_LINE):]
|
||||
if parse_time(line) < parse_time(BUILD_TIME):
|
||||
raise Exception(OPENSSL_ERROR % (line, BUILD_TIME))
|
||||
else:
|
||||
break
|
||||
else:
|
||||
raise Exception("Didn't find any '%s' line in '$ %s'" %
|
||||
(CHECK_LINE, CHECK_COMMAND))
|
||||
if Beast.system.platform not in ['Debian', 'Ubuntu']:
|
||||
return
|
||||
line = subprocess.check_output('openssl version -b'.split()).strip()
|
||||
check_line = 'built on: '
|
||||
if not line.startswith(check_line):
|
||||
raise Exception("Didn't find any '%s' line in '$ %s'" %
|
||||
(check_line, 'openssl version -b'))
|
||||
d = line[len(check_line):]
|
||||
if 'date unspecified' in d:
|
||||
words = subprocess.check_output('openssl version'.split()).split()
|
||||
if len(words)!=5:
|
||||
raise Exception("Didn't find version date in '$ openssl version'")
|
||||
d = ' '.join(words[-3:])
|
||||
build_time = 'Mon Apr 7 20:33:19 UTC 2014'
|
||||
if parse_time(d) < parse_time(build_time):
|
||||
raise Exception('Your openSSL was built on %s; '
|
||||
'rippled needs a version built on or after %s.'
|
||||
% (line, build_time))
|
||||
|
||||
|
||||
def set_implicit_cache():
|
||||
@@ -250,6 +279,9 @@ def print_coms(target, source, env):
|
||||
# TODO Add 'PROTOCCOM' to this list and make it work
|
||||
Beast.print_coms(['CXXCOM', 'CCCOM', 'LINKCOM'], env)
|
||||
|
||||
def is_debug_variant(variant):
|
||||
return variant in ('debug', 'coverage')
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
# Set construction variables for the base environment
|
||||
@@ -266,13 +298,22 @@ def config_base(env):
|
||||
'OPENSSL_NO_SSL2'
|
||||
,'DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER'
|
||||
,{'HAVE_USLEEP' : '1'}
|
||||
,{'SOCI_CXX_C11' : '1'}
|
||||
,'_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS'
|
||||
])
|
||||
|
||||
if USE_CPP_14:
|
||||
env.Append(CPPDEFINES=[
|
||||
'-DBEAST_NO_CXX14_COMPATIBILITY',
|
||||
'-DBEAST_NO_CXX14_INTEGER_SEQUENCE',
|
||||
'-DBEAST_NO_CXX14_MAKE_UNIQUE',
|
||||
'-DBEAST_NO_CXX14_EQUAL',
|
||||
'-DBOOST_NO_AUTO_PTR',
|
||||
'-DBEAST_NO_CXX14_MAKE_REVERSE_ITERATOR',
|
||||
])
|
||||
|
||||
try:
|
||||
BOOST_ROOT = os.path.normpath(os.environ['BOOST_ROOT'])
|
||||
env.Append(CPPPATH=[
|
||||
BOOST_ROOT,
|
||||
])
|
||||
env.Append(LIBPATH=[
|
||||
os.path.join(BOOST_ROOT, 'stage', 'lib'),
|
||||
])
|
||||
@@ -287,7 +328,7 @@ def config_base(env):
|
||||
os.path.join(OPENSSL_ROOT, 'include'),
|
||||
])
|
||||
env.Append(LIBPATH=[
|
||||
os.path.join(OPENSSL_ROOT, 'lib', 'VC', 'static'),
|
||||
os.path.join(OPENSSL_ROOT, 'lib'),
|
||||
])
|
||||
except KeyError:
|
||||
pass
|
||||
@@ -307,14 +348,31 @@ def config_base(env):
|
||||
env.Append(CPPPATH=[os.path.join(profile_jemalloc, 'include')])
|
||||
env.Append(LINKFLAGS=['-Wl,-rpath,' + os.path.join(profile_jemalloc, 'lib')])
|
||||
|
||||
def gccStdLibDir():
|
||||
try:
|
||||
for l in subprocess.check_output(['gcc', '-v'], stderr=subprocess.STDOUT).split():
|
||||
if l.startswith('--prefix'):
|
||||
return l.split('=')[1] + '/lib64'
|
||||
except:
|
||||
pass
|
||||
raise SCons.UserError('Could not find gccStdLibDir')
|
||||
|
||||
# Set toolchain and variant specific construction variables
|
||||
def config_env(toolchain, variant, env):
|
||||
if variant == 'debug':
|
||||
if is_debug_variant(variant):
|
||||
env.Append(CPPDEFINES=['DEBUG', '_DEBUG'])
|
||||
|
||||
elif variant == 'release' or variant == 'profile':
|
||||
env.Append(CPPDEFINES=['NDEBUG'])
|
||||
|
||||
if 'BOOST_ROOT' in env:
|
||||
if toolchain == 'gcc':
|
||||
env.Append(CCFLAGS=['-isystem' + env['BOOST_ROOT']])
|
||||
else:
|
||||
env.Append(CPPPATH=[
|
||||
env['BOOST_ROOT'],
|
||||
])
|
||||
|
||||
if toolchain in Split('clang gcc'):
|
||||
if Beast.system.linux:
|
||||
env.ParseConfig('pkg-config --static --cflags --libs openssl')
|
||||
@@ -351,7 +409,7 @@ def config_env(toolchain, variant, env):
|
||||
|
||||
env.Append(CXXFLAGS=[
|
||||
'-frtti',
|
||||
'-std=c++11',
|
||||
'-std=c++14' if USE_CPP_14 else '-std=c++11',
|
||||
'-Wno-invalid-offsetof'])
|
||||
|
||||
env.Append(CPPDEFINES=['_FILE_OFFSET_BITS=64'])
|
||||
@@ -371,8 +429,24 @@ def config_env(toolchain, variant, env):
|
||||
])
|
||||
else:
|
||||
if toolchain == 'gcc':
|
||||
if os.getenv('RIPPLED_OLD_GCC_ABI'):
|
||||
gcc_ver = ''
|
||||
try:
|
||||
gcc_ver = subprocess.check_output(['gcc', '-dumpversion'],
|
||||
stderr=subprocess.STDOUT).strip()
|
||||
except:
|
||||
pass
|
||||
if gcc_ver.startswith('5'):
|
||||
# remove rpath and CXX11_ABI flag when distro uses
|
||||
# non-user installed gcc 5
|
||||
env.Append(CPPDEFINES={
|
||||
'-D_GLIBCXX_USE_CXX11_ABI' : 0
|
||||
})
|
||||
env.Append(LINKFLAGS=['-Wl,-rpath,' + gccStdLibDir()])
|
||||
|
||||
env.Append(CCFLAGS=[
|
||||
'-Wno-unused-but-set-variable'
|
||||
'-Wno-unused-but-set-variable',
|
||||
'-Wno-deprecated',
|
||||
])
|
||||
|
||||
boost_libs = [
|
||||
@@ -414,6 +488,12 @@ def config_env(toolchain, variant, env):
|
||||
'-fno-strict-aliasing'
|
||||
])
|
||||
|
||||
if variant == 'coverage':
|
||||
env.Append(CXXFLAGS=[
|
||||
'-fprofile-arcs', '-ftest-coverage'])
|
||||
env.Append(LINKFLAGS=[
|
||||
'-fprofile-arcs', '-ftest-coverage'])
|
||||
|
||||
if toolchain == 'clang':
|
||||
if Beast.system.osx:
|
||||
env.Replace(CC='clang', CXX='clang++', LINK='clang++')
|
||||
@@ -428,6 +508,8 @@ def config_env(toolchain, variant, env):
|
||||
env.Append(CXXFLAGS=[
|
||||
'-Wno-mismatched-tags',
|
||||
'-Wno-deprecated-register',
|
||||
'-Wno-unused-local-typedefs',
|
||||
'-Wno-unknown-warning-option',
|
||||
])
|
||||
|
||||
elif toolchain == 'gcc':
|
||||
@@ -441,7 +523,7 @@ def config_env(toolchain, variant, env):
|
||||
# If we are in debug mode, use GCC-specific functionality to add
|
||||
# extra error checking into the code (e.g. std::vector will throw
|
||||
# for out-of-bounds conditions)
|
||||
if variant == 'debug':
|
||||
if is_debug_variant(variant):
|
||||
env.Append(CPPDEFINES={
|
||||
'_FORTIFY_SOURCE': 2
|
||||
})
|
||||
@@ -486,8 +568,8 @@ def config_env(toolchain, variant, env):
|
||||
'WIN32_CONSOLE',
|
||||
])
|
||||
env.Append(LIBS=[
|
||||
'ssleay32MT.lib',
|
||||
'libeay32MT.lib',
|
||||
'ssleay32.lib',
|
||||
'libeay32.lib',
|
||||
'Shlwapi.lib',
|
||||
'kernel32.lib',
|
||||
'user32.lib',
|
||||
@@ -553,13 +635,14 @@ base.Append(CPPPATH=[
|
||||
os.path.join('src', 'beast'),
|
||||
os.path.join(build_dir, 'proto'),
|
||||
os.path.join('src','soci','src'),
|
||||
os.path.join('src','soci','include'),
|
||||
])
|
||||
|
||||
base.Decider('MD5-timestamp')
|
||||
set_implicit_cache()
|
||||
|
||||
# Configure the toolchains, variants, default toolchain, and default target
|
||||
variants = ['debug', 'release', 'profile']
|
||||
variants = ['debug', 'coverage', 'release', 'profile']
|
||||
all_toolchains = ['clang', 'gcc', 'msvc']
|
||||
if Beast.system.osx:
|
||||
toolchains = ['clang']
|
||||
@@ -634,6 +717,7 @@ def get_soci_sources(style):
|
||||
result = []
|
||||
cpp_path = [
|
||||
'src/soci/src/core',
|
||||
'src/soci/include/private',
|
||||
'src/sqlite', ]
|
||||
append_sources(result,
|
||||
'src/ripple/unity/soci.cpp',
|
||||
@@ -644,17 +728,20 @@ def get_soci_sources(style):
|
||||
CPPPATH=cpp_path)
|
||||
return result
|
||||
|
||||
def get_common_sources():
|
||||
def get_common_sources(toolchain):
|
||||
result = []
|
||||
if toolchain == 'msvc':
|
||||
warning_flags = {}
|
||||
else:
|
||||
warning_flags = {'CCFLAGS': ['-Wno-unused-function']}
|
||||
append_sources(
|
||||
result,
|
||||
'src/ripple/unity/secp256k1.cpp',
|
||||
CPPPATH=[
|
||||
'src/secp256k1',
|
||||
])
|
||||
CPPPATH=['src/secp256k1'],
|
||||
**warning_flags)
|
||||
return result
|
||||
|
||||
def get_classic_sources():
|
||||
def get_classic_sources(toolchain):
|
||||
result = []
|
||||
append_sources(
|
||||
result,
|
||||
@@ -676,6 +763,7 @@ def get_classic_sources():
|
||||
append_sources(result, *list_sources('src/ripple/rpc', '.cpp'))
|
||||
append_sources(result, *list_sources('src/ripple/shamap', '.cpp'))
|
||||
append_sources(result, *list_sources('src/ripple/test', '.cpp'))
|
||||
append_sources(result, *list_sources('src/ripple/unl', '.cpp'))
|
||||
|
||||
append_sources(
|
||||
result,
|
||||
@@ -687,11 +775,11 @@ def get_classic_sources():
|
||||
])
|
||||
|
||||
result += get_soci_sources('classic')
|
||||
result += get_common_sources()
|
||||
result += get_common_sources(toolchain)
|
||||
|
||||
return result
|
||||
|
||||
def get_unity_sources():
|
||||
def get_unity_sources(toolchain):
|
||||
result = []
|
||||
append_sources(
|
||||
result,
|
||||
@@ -713,6 +801,7 @@ def get_unity_sources():
|
||||
'src/ripple/unity/rpcx.cpp',
|
||||
'src/ripple/unity/shamap.cpp',
|
||||
'src/ripple/unity/test.cpp',
|
||||
'src/ripple/unity/unl.cpp',
|
||||
)
|
||||
|
||||
append_sources(
|
||||
@@ -725,7 +814,7 @@ def get_unity_sources():
|
||||
])
|
||||
|
||||
result += get_soci_sources('unity')
|
||||
result += get_common_sources()
|
||||
result += get_common_sources(toolchain)
|
||||
|
||||
return result
|
||||
|
||||
@@ -789,15 +878,11 @@ def should_build_ninja(style, toolchain, variant):
|
||||
return False
|
||||
|
||||
for tu_style in ['classic', 'unity']:
|
||||
if tu_style == 'classic':
|
||||
sources = get_classic_sources()
|
||||
else:
|
||||
sources = get_unity_sources()
|
||||
for toolchain in all_toolchains:
|
||||
for variant in variants:
|
||||
if not should_prepare_targets(tu_style, toolchain, variant):
|
||||
continue
|
||||
if variant == 'profile' and toolchain == 'msvc':
|
||||
if variant in ['profile', 'coverage'] and toolchain == 'msvc':
|
||||
continue
|
||||
# Configure this variant's construction environment
|
||||
env = base.Clone()
|
||||
@@ -817,6 +902,10 @@ for tu_style in ['classic', 'unity']:
|
||||
|
||||
object_builder = ObjectBuilder(env, variant_dirs)
|
||||
|
||||
if tu_style == 'classic':
|
||||
sources = get_classic_sources(toolchain)
|
||||
else:
|
||||
sources = get_unity_sources(toolchain)
|
||||
for s, k in sources:
|
||||
object_builder.add_source_files(*s, **k)
|
||||
|
||||
@@ -840,7 +929,6 @@ for tu_style in ['classic', 'unity']:
|
||||
'src/ripple/unity/ripple.proto.cpp',
|
||||
'src/ripple/unity/resource.cpp',
|
||||
'src/ripple/unity/server.cpp',
|
||||
'src/ripple/unity/validators.cpp',
|
||||
'src/ripple/unity/websocket02.cpp'
|
||||
)
|
||||
|
||||
@@ -926,7 +1014,7 @@ for key, value in aliases.iteritems():
|
||||
env.Alias(key, value)
|
||||
|
||||
vcxproj = base.VSProject(
|
||||
os.path.join('Builds', 'VisualStudio2013', 'RippleD'),
|
||||
os.path.join('Builds', 'VisualStudio2015', 'RippleD'),
|
||||
source = [],
|
||||
VSPROJECT_ROOT_DIRS = ['src/beast', 'src', '.'],
|
||||
VSPROJECT_CONFIGS = msvc_configs)
|
||||
|
||||
26
appveyor.yml
26
appveyor.yml
@@ -6,20 +6,22 @@ environment:
|
||||
# that it's a small download. We also use appveyor's free cache, avoiding fees
|
||||
# downloading from S3 each time.
|
||||
# TODO: script to create this package.
|
||||
RIPPLED_DEPS_URL: https://s3-ap-northeast-1.amazonaws.com/history-replay/rippled_deps.zip
|
||||
RIPPLED_DEPS_URL: https://github.com/ripple/Downloads/blob/gh-pages/appveyor/rippled_deps15.zip?raw=true
|
||||
|
||||
# Other dependencies we just download each time.
|
||||
PIP_URL: https://bootstrap.pypa.io/get-pip.py
|
||||
PYWIN32_URL: https://downloads.sourceforge.net/project/pywin32/pywin32/Build%20219/pywin32-219.win-amd64-py2.7.exe
|
||||
|
||||
# Scons honours these environment variables, setting the include/lib paths.
|
||||
BOOST_ROOT: C:/rippled_deps/boost
|
||||
OPENSSL_ROOT: C:/rippled_deps/openssl
|
||||
BOOST_ROOT: C:/rippled_deps15/boost
|
||||
OPENSSL_ROOT: C:/rippled_deps15/openssl
|
||||
|
||||
os: Visual Studio 2015
|
||||
|
||||
# At the end of each successful build we cache this directory. It must be less
|
||||
# than 100MB total compressed.
|
||||
cache:
|
||||
- "C:\\rippled_deps"
|
||||
- "C:\\rippled_deps15"
|
||||
|
||||
# This means we'll download a zip of the branch we want, rather than the full
|
||||
# history.
|
||||
@@ -27,7 +29,7 @@ shallow_clone: true
|
||||
|
||||
install:
|
||||
# We want easy_install, python and protoc.exe on PATH.
|
||||
- SET PATH=%PYTHON%;%PYTHON%/Scripts;C:/rippled_deps;%PATH%
|
||||
- SET PATH=%PYTHON%;%PYTHON%/Scripts;C:/rippled_deps15;%PATH%
|
||||
|
||||
# `ps` prefix means the command is executed by powershell.
|
||||
- ps: Start-FileDownload $env:PIP_URL
|
||||
@@ -46,9 +48,17 @@ install:
|
||||
# Download dependencies if appveyor didn't restore them from the cache.
|
||||
# Use 7zip to unzip.
|
||||
- ps: |
|
||||
if (-not(Test-Path 'C:/rippled_deps')) {
|
||||
if (-not(Test-Path 'C:/rippled_deps15')) {
|
||||
echo "Download from $env:RIPPLED_DEPS_URL"
|
||||
Start-FileDownload "$env:RIPPLED_DEPS_URL"
|
||||
7z x rippled_deps.zip -oC:\ -y > $null
|
||||
7z x rippled_deps15.zip -oC:\ -y > $null
|
||||
}
|
||||
|
||||
# Newer DEPS include a versions file.
|
||||
# Dump it so we can verify correct behavior.
|
||||
- ps: |
|
||||
if (Test-Path 'C:/rippled_deps15/versions.txt') {
|
||||
cat 'C:/rippled_deps15/versions.txt'
|
||||
}
|
||||
|
||||
# TODO: This is giving me grief
|
||||
@@ -58,7 +68,7 @@ install:
|
||||
|
||||
build_script:
|
||||
# We set the environment variables needed to put compilers on the PATH.
|
||||
- '"%VS120COMNTOOLS%../../VC/vcvarsall.bat" x86_amd64'
|
||||
- '"%VS140COMNTOOLS%../../VC/vcvarsall.bat" x86_amd64'
|
||||
# Show which version of the compiler we are using.
|
||||
- cl
|
||||
- scons msvc.debug -j%NUMBER_OF_PROCESSORS%
|
||||
|
||||
36
bin/ci/ubuntu/build-and-test.sh
Executable file
36
bin/ci/ubuntu/build-and-test.sh
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash -u
|
||||
# We use set -e and bash with -u to bail on first non zero exit code of any
|
||||
# processes launched or upon any unbound variable
|
||||
set -e
|
||||
__dirname=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
echo "using CC: $CC"
|
||||
echo "using TARGET: $TARGET"
|
||||
export RIPPLED_PATH="$PWD/build/$CC.$TARGET/rippled"
|
||||
echo "using RIPPLED_PATH: $RIPPLED_PATH"
|
||||
# Make sure vcxproj is up to date
|
||||
scons vcxproj
|
||||
git diff --exit-code
|
||||
# $CC will be either `clang` or `gcc`
|
||||
# http://docs.travis-ci.com/user/migrating-from-legacy/?utm_source=legacy-notice&utm_medium=banner&utm_campaign=legacy-upgrade
|
||||
# indicates that 2 cores are available to containers.
|
||||
scons -j${NUM_PROCESSORS:-2} $CC.$TARGET
|
||||
# We can be sure we're using the build/$CC.$TARGET variant
|
||||
# (-f so never err)
|
||||
rm -f build/rippled
|
||||
|
||||
# See what we've actually built
|
||||
ldd $RIPPLED_PATH
|
||||
if [[ $TARGET == "coverage" ]]; then
|
||||
$RIPPLED_PATH --unittest
|
||||
# We pass along -p to keep path segments so as to avoid collisions
|
||||
codecov --gcov-args=-p --gcov-source-match='^src/(ripple|beast)'
|
||||
else
|
||||
# Run unittests (under gdb)
|
||||
cat $__dirname/unittests.gdb | gdb \
|
||||
--return-child-result \
|
||||
--args $RIPPLED_PATH --unittest
|
||||
fi
|
||||
|
||||
# Run NPM tests
|
||||
npm install
|
||||
npm test --rippled=$RIPPLED_PATH
|
||||
25
bin/ci/ubuntu/install-dependencies.sh
Executable file
25
bin/ci/ubuntu/install-dependencies.sh
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash -u
|
||||
# Exit if anything fails.
|
||||
set -e
|
||||
# Override gcc version to $GCC_VER.
|
||||
# Put an appropriate symlink at the front of the path.
|
||||
mkdir -v $HOME/bin
|
||||
for g in gcc g++ gcov gcc-ar gcc-nm gcc-ranlib
|
||||
do
|
||||
test -x $( type -p ${g}-$GCC_VER )
|
||||
ln -sv $(type -p ${g}-$GCC_VER) $HOME/bin/${g}
|
||||
done
|
||||
export PATH=$PWD/bin:$PATH
|
||||
|
||||
# What versions are we ACTUALLY running?
|
||||
g++ -v
|
||||
clang -v
|
||||
# Avoid `spurious errors` caused by ~/.npm permission issues
|
||||
# Does it already exist? Who owns? What permissions?
|
||||
ls -lah ~/.npm || mkdir ~/.npm
|
||||
# Make sure we own it
|
||||
chown -Rc $USER ~/.npm
|
||||
# We use this so we can filter the subtrees from our coverage report
|
||||
pip install --user https://github.com/sublimator/codecov-python/zipball/source-match
|
||||
|
||||
bash bin/sh/install-boost.sh
|
||||
4
bin/ci/ubuntu/unittests.gdb
Normal file
4
bin/ci/ubuntu/unittests.gdb
Normal file
@@ -0,0 +1,4 @@
|
||||
set env MALLOC_CHECK_=3
|
||||
set print thread-events off
|
||||
run
|
||||
backtrace full
|
||||
22
bin/sh/install-boost.sh
Normal file
22
bin/sh/install-boost.sh
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
# Assumptions:
|
||||
# 1) BOOST_ROOT and BOOST_URL are already defined,
|
||||
# and contain valid values.
|
||||
# 2) The last namepart of BOOST_ROOT matches the
|
||||
# folder name internal to boost's .tar.gz
|
||||
# When testing you can force a boost build by clearing travis caches:
|
||||
# https://travis-ci.org/ripple/rippled/caches
|
||||
set -e
|
||||
if [ ! -d "$BOOST_ROOT/lib" ]
|
||||
then
|
||||
wget $BOOST_URL -O /tmp/boost.tar.gz
|
||||
cd `dirname $BOOST_ROOT`
|
||||
rm -fr ${BOOST_ROOT}
|
||||
tar xzf /tmp/boost.tar.gz
|
||||
cd $BOOST_ROOT && \
|
||||
./bootstrap.sh --prefix=$BOOST_ROOT && \
|
||||
./b2 -d1 define=_GLIBCXX_USE_CXX11_ABI=0 && ./b2 -d0 define=_GLIBCXX_USE_CXX11_ABI=0 install
|
||||
else
|
||||
echo "Using cached boost at $BOOST_ROOT"
|
||||
fi
|
||||
|
||||
@@ -26,3 +26,4 @@ A list of rippled version numbers, and the Github pull requests they contain.
|
||||
0.28.2-b7: Includes pulls 1077, 1080, 1086, 1095, 1098, 1106 and 1112.
|
||||
0.28.2-b8: Includes pulls 1078, 1100, 1108, 1114, 1118, 1119 and 1121.
|
||||
0.28.2-b9: Includes pulls 1053, 1109, 1111, 1117, 1122 and 1123.
|
||||
0.29.1-b11: Includes pulls 1279, 1271, 1289, 1291, 1290, 1267, 1294, 1276, 1231, and 1286.
|
||||
|
||||
@@ -359,38 +359,18 @@
|
||||
#
|
||||
#
|
||||
#
|
||||
# [overlay] EXPERIMENTAL
|
||||
# [overlay]
|
||||
#
|
||||
# This section is EXPERIMENTAL, and should not be
|
||||
# present for production configuration settings.
|
||||
# Controls settings related to the peer to peer overlay.
|
||||
#
|
||||
# A set of key/value pair parameters to configure the overlay.
|
||||
#
|
||||
# auto_connect = 0 | 1
|
||||
#
|
||||
# When set, activates the autoconnect feature. This maintains outgoing
|
||||
# connections using PeerFinder's "Outgoing Connection Strategy."
|
||||
#
|
||||
# become_superpeer = 'never' | 'always' | 'auto'
|
||||
#
|
||||
# Controls the selection of peer roles:
|
||||
#
|
||||
# 'never' Always handshake in the leaf role.
|
||||
# 'always' Always handshake in the superpeer role.
|
||||
# 'auto' Start as a leaf, promote to superpeer after
|
||||
# passing capability check (default).
|
||||
#
|
||||
# In the leaf role, a peer does not advertise its IP and port for
|
||||
# the purpose of receiving incoming connections. The peer also does
|
||||
# not forward transactions and validations received from other peers.
|
||||
#
|
||||
# In the superpeer role, a peer advertises its IP and port for
|
||||
# receiving incoming connections after passing an incoming connection
|
||||
# test. Superpeers forward transactions and protocol messages to all
|
||||
# other peers. Superpeers do not forward validations to other superpeers.
|
||||
# Instead, a validation received by a superpeer from a leaf is forwarded
|
||||
# only to other leaf connections.
|
||||
# public_ip = <IP-address>
|
||||
#
|
||||
# If the server has a known, fixed public IPv4 address,
|
||||
# specify that IP address here in dotted decimal notation.
|
||||
# Peers will use this information to reject attempt to proxy
|
||||
# connections to or from this server.
|
||||
#
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
11
package.json
11
package.json
@@ -7,19 +7,18 @@
|
||||
"test": "test"
|
||||
},
|
||||
"dependencies": {
|
||||
"assert-diff": "^1.0.1",
|
||||
"async": "~0.2.9",
|
||||
"babel": "^5.8.21",
|
||||
"coffee-script": "^1.8.0",
|
||||
"deep-equal": "0.0.0",
|
||||
"extend": "~1.2.0",
|
||||
"lodash": "^3.5.0",
|
||||
"mocha": "^2.1.0",
|
||||
"request": "^2.47.0",
|
||||
"ripple-lib": "0.10.0",
|
||||
"ripple-lib": "0.13.0-rc6.0",
|
||||
"simple-jsonrpc": "~0.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"assert-diff": "^1.0.1",
|
||||
"coffee-script": "^1.8.0",
|
||||
"mocha": "^2.1.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha test/websocket-test.js test/server-test.js test/*-test.{js,coffee}"
|
||||
},
|
||||
|
||||
@@ -164,13 +164,6 @@
|
||||
#define RIPPLE_SINGLE_IO_SERVICE_THREAD 0
|
||||
#endif
|
||||
|
||||
/** Config: RIPPLE_HOOK_VALIDATORS
|
||||
Activates code for handling validations and validators (work in progress).
|
||||
*/
|
||||
#ifndef RIPPLE_HOOK_VALIDATORS
|
||||
#define RIPPLE_HOOK_VALIDATORS 0
|
||||
#endif
|
||||
|
||||
/** Config: RIPPLE_ENABLE_TICKETS
|
||||
Enables processing of ticket transactions
|
||||
*/
|
||||
@@ -178,23 +171,9 @@
|
||||
#define RIPPLE_ENABLE_TICKETS 0
|
||||
#endif
|
||||
|
||||
/** Config: RIPPLE_ENABLE_MULTI_SIGN
|
||||
When set, activates the current state of the multi-sign feature which is
|
||||
under development. When the feature is complete and released this
|
||||
#define should be removed.
|
||||
*/
|
||||
#ifndef RIPPLE_ENABLE_MULTI_SIGN
|
||||
#define RIPPLE_ENABLE_MULTI_SIGN 0
|
||||
#endif
|
||||
|
||||
// Uses OpenSSL instead of alternatives
|
||||
#ifndef RIPPLE_USE_OPENSSL
|
||||
#define RIPPLE_USE_OPENSSL 0
|
||||
#endif
|
||||
|
||||
// Enables the experimental OpenLedger
|
||||
#ifndef RIPPLE_OPEN_LEDGER
|
||||
#define RIPPLE_OPEN_LEDGER 0
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -6,9 +6,9 @@ Wrappers and utilities to make working with boost::asio easier.
|
||||
|
||||
If an object calls asynchronous initiating functions it must either:
|
||||
|
||||
1. Manage its lifetime by being reference counted
|
||||
1. Manage its lifetime by being reference counted
|
||||
|
||||
or
|
||||
or
|
||||
|
||||
2. Wait for all pending completion handlers to be called before
|
||||
allowing itself to be destroyed.
|
||||
2. Wait for all pending completion handlers to be called before
|
||||
allowing itself to be destroyed.
|
||||
|
||||
@@ -69,12 +69,6 @@ public:
|
||||
|
||||
/** Returns the current time. */
|
||||
virtual time_point now() const = 0;
|
||||
|
||||
/** Returning elapsed ticks since the epoch. */
|
||||
rep elapsed() const
|
||||
{
|
||||
return now().time_since_epoch().count();
|
||||
}
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
@@ -50,7 +50,9 @@
|
||||
|
||||
// Disables beast's std::equal safe iterator overloads
|
||||
#ifndef BEAST_NO_CXX14_EQUAL
|
||||
# ifdef _MSC_VER
|
||||
# if defined(_MSC_VER) && _MSC_VER >= 1900
|
||||
# define BEAST_NO_CXX14_EQUAL 1
|
||||
# elif defined(_MSC_VER)
|
||||
# define BEAST_NO_CXX14_EQUAL 0
|
||||
# elif defined(__clang__) && defined(_LIBCPP_VERSION) && __cplusplus >= 201402
|
||||
# define BEAST_NO_CXX14_EQUAL 1
|
||||
@@ -61,7 +63,9 @@
|
||||
|
||||
// Disables beast's std::integer_sequence
|
||||
#ifndef BEAST_NO_CXX14_INTEGER_SEQUENCE
|
||||
# ifdef _MSC_VER
|
||||
# if defined(_MSC_VER) && _MSC_VER >= 1900
|
||||
# define BEAST_NO_CXX14_INTEGER_SEQUENCE 1
|
||||
# elif defined(_MSC_VER)
|
||||
# define BEAST_NO_CXX14_INTEGER_SEQUENCE 0
|
||||
# elif defined(__clang__) && defined(_LIBCPP_VERSION) && __cplusplus >= 201402
|
||||
# define BEAST_NO_CXX14_INTEGER_SEQUENCE 1
|
||||
@@ -72,7 +76,9 @@
|
||||
|
||||
// Disables beast's std::make_reverse_iterator
|
||||
#ifndef BEAST_NO_CXX14_MAKE_REVERSE_ITERATOR
|
||||
# ifdef _MSC_VER
|
||||
# if defined(_MSC_VER) && _MSC_VER >= 1900
|
||||
# define BEAST_NO_CXX14_MAKE_REVERSE_ITERATOR 1
|
||||
# elif defined(_MSC_VER)
|
||||
# define BEAST_NO_CXX14_MAKE_REVERSE_ITERATOR 0
|
||||
# elif defined(__clang__) && defined(_LIBCPP_VERSION) && __cplusplus >= 201402
|
||||
# define BEAST_NO_CXX14_MAKE_REVERSE_ITERATOR 1
|
||||
|
||||
@@ -90,9 +90,9 @@ maybe_reverse_bytes(T& t, Hasher&)
|
||||
// is_uniquely_represented<T>
|
||||
|
||||
// A type T is contiguously hashable if for all combinations of two values of
|
||||
// a type, say x and y, if x == y, then it must also be true that
|
||||
// memcmp(addressof(x), addressof(y), sizeof(T)) == 0. I.e. if x == y,
|
||||
// then x and y have the same bit pattern representation.
|
||||
// a type, say x and y, if x == y, then it must also be true that
|
||||
// memcmp(addressof(x), addressof(y), sizeof(T)) == 0. I.e. if x == y,
|
||||
// then x and y have the same bit pattern representation.
|
||||
|
||||
template <class T>
|
||||
struct is_uniquely_represented
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#endif
|
||||
|
||||
//==============================================================================
|
||||
|
||||
#include <beast/module/core/native/BasicNativeHeaders.h>
|
||||
#include <beast/module/core/core.h>
|
||||
|
||||
@@ -46,7 +47,10 @@
|
||||
#include <ws2tcpip.h>
|
||||
|
||||
#if ! BEAST_MINGW
|
||||
#pragma warning ( push )
|
||||
#pragma warning ( disable: 4091 )
|
||||
#include <Dbghelp.h>
|
||||
#pragma warning ( pop )
|
||||
|
||||
#if ! BEAST_DONT_AUTOLINK_TO_WIN32_LIBRARIES
|
||||
#pragma comment (lib, "DbgHelp.lib")
|
||||
|
||||
@@ -106,7 +106,10 @@
|
||||
#include <mapi.h>
|
||||
#include <float.h>
|
||||
#include <process.h>
|
||||
#pragma warning ( push )
|
||||
#pragma warning ( disable: 4091 )
|
||||
#include <shlobj.h>
|
||||
#pragma warning ( pop )
|
||||
#include <shlwapi.h>
|
||||
#include <mmsystem.h>
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ public:
|
||||
capacity off the block, so that its length matches the amount of actual data that
|
||||
has been written so far.
|
||||
*/
|
||||
void flush();
|
||||
void flush() override;
|
||||
|
||||
bool write (const void*, size_t) override;
|
||||
std::int64_t getPosition() override { return position; }
|
||||
|
||||
@@ -147,8 +147,7 @@ bool is_public (AddressV4 const& addr)
|
||||
{
|
||||
return
|
||||
! is_private (addr) &&
|
||||
! is_multicast (addr) &&
|
||||
(addr != AddressV4::broadcast (addr));
|
||||
! is_multicast (addr);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
@@ -62,6 +62,7 @@ private:
|
||||
}
|
||||
};
|
||||
|
||||
public:
|
||||
// Memberspace
|
||||
class log_t
|
||||
{
|
||||
@@ -80,6 +81,7 @@ private:
|
||||
abstract_ostream&
|
||||
stream();
|
||||
};
|
||||
private:
|
||||
|
||||
class scoped_testcase;
|
||||
|
||||
@@ -176,6 +178,48 @@ public:
|
||||
return expect (shouldBeTrue, "");
|
||||
}
|
||||
|
||||
/** Expect an exception from f() */
|
||||
/** @{ */
|
||||
template <class F, class String>
|
||||
bool
|
||||
except (F&& f, String const& reason);
|
||||
|
||||
template <class F>
|
||||
bool
|
||||
except (F&& f)
|
||||
{
|
||||
return except(f, "");
|
||||
}
|
||||
/** @} */
|
||||
|
||||
/** Expect an exception of the given type from f() */
|
||||
/** @{ */
|
||||
template <class E, class F, class String>
|
||||
bool
|
||||
except (F&& f, String const& reason);
|
||||
|
||||
template <class E, class F>
|
||||
bool
|
||||
except (F&& f)
|
||||
{
|
||||
return except<E>(f, "");
|
||||
}
|
||||
/** @} */
|
||||
|
||||
/** Fail if f() throws */
|
||||
/** @{ */
|
||||
template <class F, class String>
|
||||
bool
|
||||
unexcept (F&& f, String const& reason);
|
||||
|
||||
template <class F>
|
||||
bool
|
||||
unexcept (F&& f)
|
||||
{
|
||||
return unexcept(f, "");
|
||||
}
|
||||
/** @} */
|
||||
|
||||
/** Return the argument associated with the runner. */
|
||||
std::string const&
|
||||
arg() const
|
||||
@@ -355,6 +399,57 @@ suite::expect (Condition shouldBeTrue,
|
||||
return b;
|
||||
}
|
||||
|
||||
template <class F, class String>
|
||||
bool
|
||||
suite::except (F&& f, String const& reason)
|
||||
{
|
||||
try
|
||||
{
|
||||
f();
|
||||
fail(reason);
|
||||
return false;
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
pass();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
template <class E, class F, class String>
|
||||
bool
|
||||
suite::except (F&& f, String const& reason)
|
||||
{
|
||||
try
|
||||
{
|
||||
f();
|
||||
fail(reason);
|
||||
return false;
|
||||
}
|
||||
catch(E const&)
|
||||
{
|
||||
pass();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
template <class F, class String>
|
||||
bool
|
||||
suite::unexcept (F&& f, String const& reason)
|
||||
{
|
||||
try
|
||||
{
|
||||
f();
|
||||
pass();
|
||||
return true;
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
fail(reason);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
template <class Condition, class String>
|
||||
inline
|
||||
bool
|
||||
|
||||
@@ -69,17 +69,17 @@ public:
|
||||
}
|
||||
|
||||
beast::Journal::Severity
|
||||
severity() const
|
||||
severity() const override
|
||||
{
|
||||
return sink_.severity();
|
||||
}
|
||||
|
||||
void severity (beast::Journal::Severity level)
|
||||
void severity (beast::Journal::Severity level) override
|
||||
{
|
||||
sink_.severity (level);
|
||||
}
|
||||
|
||||
void write (beast::Journal::Severity level, std::string const& text)
|
||||
void write (beast::Journal::Severity level, std::string const& text) override
|
||||
{
|
||||
using beast::Journal;
|
||||
sink_.write (level, prefix_ + text);
|
||||
|
||||
@@ -25,10 +25,12 @@
|
||||
#define BEAST_UTILITY_NOEXCEPT_H_INCLUDED
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# ifdef noexcept
|
||||
# undef noexcept
|
||||
# if _MSC_VER < 1900
|
||||
# ifdef noexcept
|
||||
# undef noexcept
|
||||
# endif
|
||||
# define noexcept throw()
|
||||
# endif
|
||||
# define noexcept throw()
|
||||
# if _MSC_VER > 1600 && ! _ALLOW_KEYWORD_MACROS
|
||||
# define _ALLOW_KEYWORD_MACROS 1 // (to stop VC2012 complaining)
|
||||
# endif
|
||||
|
||||
@@ -158,7 +158,7 @@ static_initializer_test::test (cxx11_tag)
|
||||
t(counts);
|
||||
});
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#if defined(_MSC_VER) && _MSC_VER < 1900
|
||||
// Visual Studio 2013 and earlier can exhibit both double
|
||||
// construction, and access before construction when function
|
||||
// local statics are initialized concurrently.
|
||||
|
||||
@@ -30,19 +30,19 @@ import SCons.Util
|
||||
|
||||
UnicodeByteMarker = '\xEF\xBB\xBF'
|
||||
|
||||
V12DSPHeader = """\
|
||||
V14DSPHeader = """\
|
||||
<?xml version="1.0" encoding="%(encoding)s"?>\r
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
|
||||
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
|
||||
"""
|
||||
|
||||
V12DSPProjectConfiguration = """\
|
||||
V14DSPProjectConfiguration = """\
|
||||
<ProjectConfiguration Include="%(variant)s|%(platform)s">\r
|
||||
<Configuration>%(variant)s</Configuration>\r
|
||||
<Platform>%(platform)s</Platform>\r
|
||||
</ProjectConfiguration>\r
|
||||
"""
|
||||
|
||||
V12DSPGlobals = """\
|
||||
V14DSPGlobals = """\
|
||||
<PropertyGroup Label="Globals">\r
|
||||
<ProjectGuid>%(project_guid)s</ProjectGuid>\r
|
||||
<Keyword>Win32Proj</Keyword>\r
|
||||
@@ -51,11 +51,11 @@ V12DSPGlobals = """\
|
||||
</PropertyGroup>\r
|
||||
"""
|
||||
|
||||
V12DSPPropertyGroup = """\
|
||||
V14DSPPropertyGroup = """\
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'" Label="Configuration">\r
|
||||
<CharacterSet>MultiByte</CharacterSet>\r
|
||||
<ConfigurationType>Application</ConfigurationType>\r
|
||||
<PlatformToolset>v120</PlatformToolset>\r
|
||||
<PlatformToolset>v140</PlatformToolset>\r
|
||||
<LinkIncremental>False</LinkIncremental>\r
|
||||
<UseDebugLibraries>%(use_debug_libs)s</UseDebugLibraries>\r
|
||||
<UseOfMfc>False</UseOfMfc>\r
|
||||
@@ -65,17 +65,17 @@ V12DSPPropertyGroup = """\
|
||||
</PropertyGroup>\r
|
||||
"""
|
||||
|
||||
V12DSPImportGroup= """\
|
||||
V14DSPImportGroup= """\
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'" Label="PropertySheets">\r
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
|
||||
</ImportGroup>\r
|
||||
"""
|
||||
|
||||
V12DSPItemDefinitionGroup= """\
|
||||
V14DSPItemDefinitionGroup= """\
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'">\r
|
||||
"""
|
||||
|
||||
V12CustomBuildProtoc= """\
|
||||
V14CustomBuildProtoc= """\
|
||||
<FileType>Document</FileType>\r
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='%(name)s'">protoc --cpp_out=%(cpp_out)s --proto_path=%%(RelativeDir) %%(Identity)</Command>\r
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='%(name)s'">%(base_out)s.pb.h;%(base_out)s.pb.cc</Outputs>\r
|
||||
@@ -83,7 +83,7 @@ V12CustomBuildProtoc= """\
|
||||
<LinkObjects Condition="'$(Configuration)|$(Platform)'=='%(name)s'">false</LinkObjects>\r
|
||||
"""
|
||||
|
||||
V12DSPFiltersHeader = (
|
||||
V14DSPFiltersHeader = (
|
||||
'''<?xml version="1.0" encoding="utf-8"?>\r
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
|
||||
''')
|
||||
@@ -663,13 +663,13 @@ class _ProjectGenerator(object):
|
||||
|
||||
f = self.project_file
|
||||
f.write(UnicodeByteMarker)
|
||||
f.write(V12DSPHeader % locals())
|
||||
f.write(V12DSPGlobals % locals())
|
||||
f.write(V14DSPHeader % locals())
|
||||
f.write(V14DSPGlobals % locals())
|
||||
f.write(' <ItemGroup Label="ProjectConfigurations">\r\n')
|
||||
for config in self.configs:
|
||||
variant = config.variant
|
||||
platform = config.platform
|
||||
f.write(V12DSPProjectConfiguration % locals())
|
||||
f.write(V14DSPProjectConfiguration % locals())
|
||||
f.write(' </ItemGroup>\r\n')
|
||||
|
||||
f.write(' <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r\n')
|
||||
@@ -681,20 +681,20 @@ class _ProjectGenerator(object):
|
||||
config.target[0].get_abspath()), self.project_dir)
|
||||
out_dir = winpath(variant_dir) + ntpath.sep
|
||||
int_dir = winpath(ntpath.join(variant_dir, 'src')) + ntpath.sep
|
||||
f.write(V12DSPPropertyGroup % locals())
|
||||
f.write(V14DSPPropertyGroup % locals())
|
||||
|
||||
f.write(' <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r\n')
|
||||
f.write(' <ImportGroup Label="ExtensionSettings" />\r\n')
|
||||
for config in self.configs:
|
||||
variant = config.variant
|
||||
platform = config.platform
|
||||
f.write(V12DSPImportGroup % locals())
|
||||
f.write(V14DSPImportGroup % locals())
|
||||
|
||||
f.write(' <PropertyGroup Label="UserMacros" />\r\n')
|
||||
for config in self.configs:
|
||||
variant = config.variant
|
||||
platform = config.platform
|
||||
f.write(V12DSPItemDefinitionGroup % locals())
|
||||
f.write(V14DSPItemDefinitionGroup % locals())
|
||||
# Cl options
|
||||
f.write(' <ClCompile>\r\n')
|
||||
f.write(
|
||||
@@ -759,7 +759,7 @@ class _ProjectGenerator(object):
|
||||
out_parts = out_dir.split(os.sep)
|
||||
out_parts.append(os.path.splitext(os.path.basename(item.path()))[0])
|
||||
base_out = ntpath.join(*out_parts)
|
||||
props += V12CustomBuildProtoc % locals()
|
||||
props += V14CustomBuildProtoc % locals()
|
||||
|
||||
f.write(' <%(tag)s Include="%(path)s">\r\n' % locals())
|
||||
f.write(props)
|
||||
@@ -783,7 +783,7 @@ class _ProjectGenerator(object):
|
||||
|
||||
f = self.filters_file
|
||||
f.write(UnicodeByteMarker)
|
||||
f.write(V12DSPFiltersHeader)
|
||||
f.write(V14DSPFiltersHeader)
|
||||
|
||||
f.write(' <ItemGroup>\r\n')
|
||||
groups = set()
|
||||
|
||||
@@ -24,35 +24,18 @@
|
||||
|
||||
namespace ripple {
|
||||
|
||||
// VFALCO TODO Remove this global and make it a member of the App
|
||||
// Use a dependency injection to give AcceptedLedger access.
|
||||
//
|
||||
TaggedCache <uint256, AcceptedLedger> AcceptedLedger::s_cache (
|
||||
"AcceptedLedger", 4, 60, stopwatch(),
|
||||
deprecatedLogs().journal("TaggedCache"));
|
||||
|
||||
AcceptedLedger::AcceptedLedger (Ledger::ref ledger) : mLedger (ledger)
|
||||
AcceptedLedger::AcceptedLedger (
|
||||
std::shared_ptr<ReadView const> const& ledger,
|
||||
AccountIDCache const& accountCache, Logs& logs)
|
||||
: mLedger (ledger)
|
||||
{
|
||||
for (auto const& item : ledger->txMap())
|
||||
for (auto const& item : ledger->txs)
|
||||
{
|
||||
SerialIter sit (item.slice());
|
||||
insert (std::make_shared<AcceptedLedgerTx>(
|
||||
ledger, std::ref (sit)));
|
||||
ledger, item.first, item.second, accountCache, logs));
|
||||
}
|
||||
}
|
||||
|
||||
AcceptedLedger::pointer AcceptedLedger::makeAcceptedLedger (Ledger::ref ledger)
|
||||
{
|
||||
AcceptedLedger::pointer ret = s_cache.fetch (ledger->getHash());
|
||||
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = AcceptedLedger::pointer (new AcceptedLedger (ledger));
|
||||
s_cache.canonicalize (ledger->getHash (), ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void AcceptedLedger::insert (AcceptedLedgerTx::ref at)
|
||||
{
|
||||
assert (mMap.find (at->getIndex ()) == mMap.end ());
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#define RIPPLE_APP_LEDGER_ACCEPTEDLEDGER_H_INCLUDED
|
||||
|
||||
#include <ripple/app/ledger/AcceptedLedgerTx.h>
|
||||
#include <ripple/protocol/AccountID.h>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
@@ -45,18 +46,13 @@ class AcceptedLedger
|
||||
public:
|
||||
using pointer = std::shared_ptr<AcceptedLedger>;
|
||||
using ret = const pointer&;
|
||||
using map_t = std::map<int, AcceptedLedgerTx::pointer>; // Must be an ordered map!
|
||||
using map_t = std::map<int, AcceptedLedgerTx::pointer>;
|
||||
// mapt_t must be an ordered map!
|
||||
using value_type = map_t::value_type;
|
||||
using const_iterator = map_t::const_iterator;
|
||||
|
||||
public:
|
||||
static pointer makeAcceptedLedger (Ledger::ref ledger);
|
||||
static void sweep ()
|
||||
{
|
||||
s_cache.sweep ();
|
||||
}
|
||||
|
||||
Ledger::ref getLedger () const
|
||||
std::shared_ptr<ReadView const> const& getLedger () const
|
||||
{
|
||||
return mLedger;
|
||||
}
|
||||
@@ -70,23 +66,17 @@ public:
|
||||
return mMap.size ();
|
||||
}
|
||||
|
||||
static float getCacheHitRate ()
|
||||
{
|
||||
return s_cache.getHitRate ();
|
||||
}
|
||||
|
||||
AcceptedLedgerTx::pointer getTxn (int) const;
|
||||
|
||||
private:
|
||||
explicit AcceptedLedger (Ledger::ref ledger);
|
||||
AcceptedLedger (
|
||||
std::shared_ptr<ReadView const> const& ledger,
|
||||
AccountIDCache const& accountCache, Logs& logs);
|
||||
|
||||
private:
|
||||
void insert (AcceptedLedgerTx::ref);
|
||||
|
||||
private:
|
||||
static TaggedCache <uint256, AcceptedLedger> s_cache;
|
||||
|
||||
Ledger::pointer mLedger;
|
||||
map_t mMap;
|
||||
std::shared_ptr<ReadView const> mLedger;
|
||||
map_t mMap;
|
||||
};
|
||||
|
||||
} // ripple
|
||||
|
||||
@@ -20,46 +20,52 @@
|
||||
#include <BeastConfig.h>
|
||||
#include <ripple/app/main/Application.h>
|
||||
#include <ripple/app/ledger/AcceptedLedgerTx.h>
|
||||
#include <ripple/basics/Log.h>
|
||||
#include <ripple/basics/StringUtilities.h>
|
||||
#include <ripple/protocol/JsonFields.h>
|
||||
#include <ripple/protocol/types.h>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
AcceptedLedgerTx::AcceptedLedgerTx (Ledger::ref ledger, SerialIter& sit)
|
||||
: mLedger (ledger)
|
||||
{
|
||||
// VFALCO This is making a needless copy
|
||||
auto const vl = sit.getVL();
|
||||
SerialIter txnIt (makeSlice(vl));
|
||||
|
||||
mTxn = std::make_shared<STTx> (std::ref (txnIt));
|
||||
mRawMeta = sit.getVL ();
|
||||
mMeta = std::make_shared<TxMeta> (mTxn->getTransactionID (),
|
||||
ledger->info().seq, mRawMeta);
|
||||
mAffected = mMeta->getAffectedAccounts ();
|
||||
mResult = mMeta->getResultTER ();
|
||||
buildJson ();
|
||||
}
|
||||
|
||||
AcceptedLedgerTx::AcceptedLedgerTx (Ledger::ref ledger,
|
||||
STTx::ref txn, TxMeta::ref met)
|
||||
AcceptedLedgerTx::AcceptedLedgerTx (
|
||||
std::shared_ptr<ReadView const> const& ledger,
|
||||
std::shared_ptr<STTx const> const& txn,
|
||||
std::shared_ptr<STObject const> const& met,
|
||||
AccountIDCache const& accountCache,
|
||||
Logs& logs)
|
||||
: mLedger (ledger)
|
||||
, mTxn (txn)
|
||||
, mMeta (met)
|
||||
, mAffected (met->getAffectedAccounts ())
|
||||
, mMeta (std::make_shared<TxMeta> (
|
||||
txn->getTransactionID(), ledger->seq(), *met, logs.journal ("View")))
|
||||
, mAffected (mMeta->getAffectedAccounts ())
|
||||
, accountCache_ (accountCache)
|
||||
, logs_ (logs)
|
||||
{
|
||||
assert (! ledger->info().open);
|
||||
|
||||
mResult = mMeta->getResultTER ();
|
||||
|
||||
Serializer s;
|
||||
met->add(s);
|
||||
mRawMeta = std::move (s.modData());
|
||||
|
||||
buildJson ();
|
||||
}
|
||||
|
||||
AcceptedLedgerTx::AcceptedLedgerTx (Ledger::ref ledger,
|
||||
STTx::ref txn, TER result)
|
||||
AcceptedLedgerTx::AcceptedLedgerTx (
|
||||
std::shared_ptr<ReadView const> const& ledger,
|
||||
STTx::ref txn,
|
||||
TER result,
|
||||
AccountIDCache const& accountCache,
|
||||
Logs& logs)
|
||||
: mLedger (ledger)
|
||||
, mTxn (txn)
|
||||
, mResult (result)
|
||||
, mAffected (txn->getMentionedAccounts ())
|
||||
, accountCache_ (accountCache)
|
||||
, logs_ (logs)
|
||||
{
|
||||
assert (ledger->info().open);
|
||||
buildJson ();
|
||||
}
|
||||
|
||||
@@ -86,7 +92,7 @@ void AcceptedLedgerTx::buildJson ()
|
||||
{
|
||||
Json::Value& affected = (mJson[jss::affected] = Json::arrayValue);
|
||||
for (auto const& account: mAffected)
|
||||
affected.append (getApp().accountIDCache().toBase58(account));
|
||||
affected.append (accountCache_.toBase58(account));
|
||||
}
|
||||
|
||||
if (mTxn->getTxnType () == ttOFFER_CREATE)
|
||||
@@ -98,7 +104,7 @@ void AcceptedLedgerTx::buildJson ()
|
||||
if (account != amount.issue ().account)
|
||||
{
|
||||
auto const ownerFunds = accountFunds(*mLedger,
|
||||
account, amount, fhIGNORE_FREEZE, getConfig());
|
||||
account, amount, fhIGNORE_FREEZE, logs_.journal ("View"));
|
||||
mJson[jss::transaction][jss::owner_funds] = ownerFunds.getText ();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,10 +21,13 @@
|
||||
#define RIPPLE_APP_LEDGER_ACCEPTEDLEDGERTX_H_INCLUDED
|
||||
|
||||
#include <ripple/app/ledger/Ledger.h>
|
||||
#include <ripple/protocol/AccountID.h>
|
||||
#include <boost/container/flat_set.hpp>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
class Logs;
|
||||
|
||||
/**
|
||||
A transaction that is in a closed ledger.
|
||||
|
||||
@@ -51,16 +54,24 @@ public:
|
||||
using ref = const pointer&;
|
||||
|
||||
public:
|
||||
AcceptedLedgerTx (Ledger::ref ledger, SerialIter& sit);
|
||||
AcceptedLedgerTx (Ledger::ref ledger, STTx::ref,
|
||||
TxMeta::ref);
|
||||
AcceptedLedgerTx (Ledger::ref ledger, STTx::ref, TER result);
|
||||
AcceptedLedgerTx (
|
||||
std::shared_ptr<ReadView const> const& ledger,
|
||||
std::shared_ptr<STTx const> const&,
|
||||
std::shared_ptr<STObject const> const&,
|
||||
AccountIDCache const&,
|
||||
Logs&);
|
||||
AcceptedLedgerTx (
|
||||
std::shared_ptr<ReadView const> const&,
|
||||
STTx::ref,
|
||||
TER,
|
||||
AccountIDCache const&,
|
||||
Logs&);
|
||||
|
||||
STTx::ref getTxn () const
|
||||
std::shared_ptr <STTx const> const& getTxn () const
|
||||
{
|
||||
return mTxn;
|
||||
}
|
||||
TxMeta::ref getMeta () const
|
||||
std::shared_ptr <TxMeta> const& getMeta () const
|
||||
{
|
||||
return mMeta;
|
||||
}
|
||||
@@ -103,13 +114,15 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
Ledger::pointer mLedger;
|
||||
STTx::pointer mTxn;
|
||||
TxMeta::pointer mMeta;
|
||||
std::shared_ptr<ReadView const> mLedger;
|
||||
std::shared_ptr<STTx const> mTxn;
|
||||
std::shared_ptr<TxMeta> mMeta;
|
||||
TER mResult;
|
||||
boost::container::flat_set<AccountID> mAffected;
|
||||
Blob mRawMeta;
|
||||
Json::Value mJson;
|
||||
AccountIDCache const& accountCache_;
|
||||
Logs& logs_;
|
||||
|
||||
void buildJson ();
|
||||
};
|
||||
|
||||
@@ -28,6 +28,11 @@
|
||||
|
||||
namespace ripple {
|
||||
|
||||
AccountStateSF::AccountStateSF(Application& app)
|
||||
: app_ (app)
|
||||
{
|
||||
}
|
||||
|
||||
void AccountStateSF::gotNode (bool fromFilter,
|
||||
SHAMapNodeID const& id,
|
||||
uint256 const& nodeHash,
|
||||
@@ -37,7 +42,7 @@ void AccountStateSF::gotNode (bool fromFilter,
|
||||
// VFALCO SHAMapSync filters should be passed the SHAMap, the
|
||||
// SHAMap should provide an accessor to get the injected Database,
|
||||
// and this should use that Database instad of getNodeStore
|
||||
getApp().getNodeStore ().store (
|
||||
app_.getNodeStore ().store (
|
||||
hotACCOUNT_NODE, std::move (nodeData), nodeHash);
|
||||
}
|
||||
|
||||
@@ -45,7 +50,7 @@ bool AccountStateSF::haveNode (SHAMapNodeID const& id,
|
||||
uint256 const& nodeHash,
|
||||
Blob& nodeData)
|
||||
{
|
||||
return getApp().getLedgerMaster ().getFetchPack (nodeHash, nodeData);
|
||||
return app_.getLedgerMaster ().getFetchPack (nodeHash, nodeData);
|
||||
}
|
||||
|
||||
} // ripple
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#ifndef RIPPLE_APP_LEDGER_ACCOUNTSTATESF_H_INCLUDED
|
||||
#define RIPPLE_APP_LEDGER_ACCOUNTSTATESF_H_INCLUDED
|
||||
|
||||
#include <ripple/app/main/Application.h>
|
||||
#include <ripple/shamap/SHAMapSyncFilter.h>
|
||||
|
||||
namespace ripple {
|
||||
@@ -29,8 +30,12 @@ namespace ripple {
|
||||
class AccountStateSF
|
||||
: public SHAMapSyncFilter
|
||||
{
|
||||
private:
|
||||
Application& app_;
|
||||
|
||||
public:
|
||||
AccountStateSF() = default;
|
||||
explicit
|
||||
AccountStateSF (Application& app);
|
||||
|
||||
// Note that the nodeData is overwritten by this call
|
||||
void gotNode (bool fromFilter,
|
||||
|
||||
@@ -22,8 +22,11 @@
|
||||
|
||||
#include <ripple/app/ledger/LedgerConsensus.h>
|
||||
#include <ripple/app/ledger/LedgerMaster.h>
|
||||
#include <ripple/app/main/Application.h>
|
||||
#include <ripple/app/tx/InboundTransactions.h>
|
||||
#include <ripple/app/tx/LocalTxs.h>
|
||||
#include <ripple/basics/Log.h>
|
||||
#include <ripple/core/Config.h>
|
||||
|
||||
#include <beast/cxx14/memory.h> // <memory>
|
||||
|
||||
@@ -62,6 +65,7 @@ public:
|
||||
virtual
|
||||
std::shared_ptr<LedgerConsensus>
|
||||
startRound (
|
||||
Application& app,
|
||||
InboundTransactions& inboundTransactions,
|
||||
LocalTxs& localtx,
|
||||
LedgerMaster& ledgerMaster,
|
||||
@@ -82,7 +86,7 @@ public:
|
||||
};
|
||||
|
||||
std::unique_ptr<Consensus>
|
||||
make_Consensus ();
|
||||
make_Consensus (Config const& config, Logs& logs);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -30,13 +30,16 @@
|
||||
|
||||
namespace ripple {
|
||||
|
||||
ConsensusTransSetSF::ConsensusTransSetSF (NodeCache& nodeCache)
|
||||
: m_nodeCache (nodeCache)
|
||||
ConsensusTransSetSF::ConsensusTransSetSF (Application& app, NodeCache& nodeCache)
|
||||
: app_ (app)
|
||||
, m_nodeCache (nodeCache)
|
||||
, j_ (app.journal ("TransactionAcquire"))
|
||||
{
|
||||
}
|
||||
|
||||
void ConsensusTransSetSF::gotNode (bool fromFilter, const SHAMapNodeID& id, uint256 const& nodeHash,
|
||||
Blob& nodeData, SHAMapTreeNode::TNType type)
|
||||
void ConsensusTransSetSF::gotNode (
|
||||
bool fromFilter, const SHAMapNodeID& id, uint256 const& nodeHash,
|
||||
Blob& nodeData, SHAMapTreeNode::TNType type)
|
||||
{
|
||||
if (fromFilter)
|
||||
return;
|
||||
@@ -46,7 +49,8 @@ void ConsensusTransSetSF::gotNode (bool fromFilter, const SHAMapNodeID& id, uint
|
||||
if ((type == SHAMapTreeNode::tnTRANSACTION_NM) && (nodeData.size () > 16))
|
||||
{
|
||||
// this is a transaction, and we didn't have it
|
||||
WriteLog (lsDEBUG, TransactionAcquire) << "Node on our acquiring TX set is TXN we may not have";
|
||||
JLOG (j_.debug)
|
||||
<< "Node on our acquiring TX set is TXN we may not have";
|
||||
|
||||
try
|
||||
{
|
||||
@@ -55,31 +59,34 @@ void ConsensusTransSetSF::gotNode (bool fromFilter, const SHAMapNodeID& id, uint
|
||||
SerialIter sit (s.slice());
|
||||
STTx::pointer stx = std::make_shared<STTx> (std::ref (sit));
|
||||
assert (stx->getTransactionID () == nodeHash);
|
||||
getApp().getJobQueue ().addJob (
|
||||
auto const pap = &app_;
|
||||
app_.getJobQueue ().addJob (
|
||||
jtTRANSACTION, "TXS->TXN",
|
||||
std::bind (&NetworkOPs::submitTransaction, &getApp().getOPs (),
|
||||
std::placeholders::_1, stx));
|
||||
[pap, stx] (Job&) {
|
||||
pap->getOPs().submitTransaction(stx);
|
||||
});
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
WriteLog (lsWARNING, TransactionAcquire) << "Fetched invalid transaction in proposed set";
|
||||
JLOG (j_.warning)
|
||||
<< "Fetched invalid transaction in proposed set";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool ConsensusTransSetSF::haveNode (const SHAMapNodeID& id, uint256 const& nodeHash,
|
||||
Blob& nodeData)
|
||||
bool ConsensusTransSetSF::haveNode (
|
||||
const SHAMapNodeID& id, uint256 const& nodeHash, Blob& nodeData)
|
||||
{
|
||||
if (m_nodeCache.retrieve (nodeHash, nodeData))
|
||||
return true;
|
||||
|
||||
// VFALCO TODO Use a dependency injection here
|
||||
Transaction::pointer txn = getApp().getMasterTransaction().fetch(nodeHash, false);
|
||||
auto txn = app_.getMasterTransaction().fetch(nodeHash, false);
|
||||
|
||||
if (txn)
|
||||
{
|
||||
// this is a transaction, and we have it
|
||||
WriteLog (lsTRACE, TransactionAcquire) << "Node in our acquiring TX set is TXN we have";
|
||||
JLOG (j_.trace)
|
||||
<< "Node in our acquiring TX set is TXN we have";
|
||||
Serializer s;
|
||||
s.add32 (HashPrefix::transactionID);
|
||||
txn->getSTransaction ()->add (s);
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#ifndef RIPPLE_APP_LEDGER_CONSENSUSTRANSSETSF_H_INCLUDED
|
||||
#define RIPPLE_APP_LEDGER_CONSENSUSTRANSSETSF_H_INCLUDED
|
||||
|
||||
#include <ripple/app/main/Application.h>
|
||||
#include <ripple/shamap/SHAMapSyncFilter.h>
|
||||
#include <ripple/basics/TaggedCache.h>
|
||||
|
||||
@@ -35,8 +36,7 @@ class ConsensusTransSetSF : public SHAMapSyncFilter
|
||||
public:
|
||||
using NodeCache = TaggedCache <uint256, Blob>;
|
||||
|
||||
// VFALCO TODO Use a dependency injection to get the temp node cache
|
||||
ConsensusTransSetSF (NodeCache& nodeCache);
|
||||
ConsensusTransSetSF (Application& app, NodeCache& nodeCache);
|
||||
|
||||
// Note that the nodeData is overwritten by this call
|
||||
void gotNode (bool fromFilter,
|
||||
@@ -50,7 +50,9 @@ public:
|
||||
Blob& nodeData) override;
|
||||
|
||||
private:
|
||||
Application& app_;
|
||||
NodeCache& m_nodeCache;
|
||||
beast::Journal j_;
|
||||
};
|
||||
|
||||
} // ripple
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#ifndef RIPPLE_APP_LEDGER_INBOUNDLEDGER_H_INCLUDED
|
||||
#define RIPPLE_APP_LEDGER_INBOUNDLEDGER_H_INCLUDED
|
||||
|
||||
#include <ripple/app/main/Application.h>
|
||||
#include <ripple/app/ledger/Ledger.h>
|
||||
#include <ripple/overlay/PeerSet.h>
|
||||
#include <ripple/basics/CountedObject.h>
|
||||
@@ -37,7 +38,8 @@ public:
|
||||
static char const* getCountedObjectName () { return "InboundLedger"; }
|
||||
|
||||
using pointer = std::shared_ptr <InboundLedger>;
|
||||
using PeerDataPairType = std::pair < std::weak_ptr<Peer>, std::shared_ptr<protocol::TMLedgerData> >;
|
||||
using PeerDataPairType = std::pair<std::weak_ptr<Peer>,
|
||||
std::shared_ptr<protocol::TMLedgerData>>;
|
||||
|
||||
// These are the reasons we might acquire a ledger
|
||||
enum fcReason
|
||||
@@ -50,7 +52,8 @@ public:
|
||||
};
|
||||
|
||||
public:
|
||||
InboundLedger (uint256 const& hash, std::uint32_t seq, fcReason reason, clock_type& clock);
|
||||
InboundLedger(Application& app,
|
||||
uint256 const& hash, std::uint32_t seq, fcReason reason, clock_type&);
|
||||
|
||||
~InboundLedger ();
|
||||
|
||||
@@ -97,12 +100,14 @@ public:
|
||||
|
||||
bool gotData (std::weak_ptr<Peer>, std::shared_ptr<protocol::TMLedgerData>);
|
||||
|
||||
using neededHash_t = std::pair <protocol::TMGetObjectByHash::ObjectType, uint256>;
|
||||
using neededHash_t =
|
||||
std::pair <protocol::TMGetObjectByHash::ObjectType, uint256>;
|
||||
|
||||
std::vector<neededHash_t> getNeededHashes ();
|
||||
|
||||
// VFALCO TODO Replace uint256 with something semanticallyh meaningful
|
||||
void filterNodes (std::vector<SHAMapNodeID>& nodeIDs, std::vector<uint256>& nodeHashes,
|
||||
void filterNodes (
|
||||
std::vector<SHAMapNodeID>& nodeIDs, std::vector<uint256>& nodeHashes,
|
||||
int max, bool aggressive);
|
||||
|
||||
/** Return a Json::objectValue. */
|
||||
@@ -127,7 +132,8 @@ private:
|
||||
int processData (std::shared_ptr<Peer> peer, protocol::TMLedgerData& data);
|
||||
|
||||
bool takeHeader (std::string const& data);
|
||||
bool takeTxNode (const std::vector<SHAMapNodeID>& IDs, const std::vector<Blob>& data,
|
||||
bool takeTxNode (const std::vector<SHAMapNodeID>& IDs,
|
||||
const std::vector<Blob>& data,
|
||||
SHAMapAddNode&);
|
||||
bool takeTxRootNode (Blob const& data, SHAMapAddNode&);
|
||||
|
||||
@@ -135,7 +141,8 @@ private:
|
||||
// Don't use acronyms, but if we are going to use them at least
|
||||
// capitalize them correctly.
|
||||
//
|
||||
bool takeAsNode (const std::vector<SHAMapNodeID>& IDs, const std::vector<Blob>& data,
|
||||
bool takeAsNode (const std::vector<SHAMapNodeID>& IDs,
|
||||
const std::vector<Blob>& data,
|
||||
SHAMapAddNode&);
|
||||
bool takeAsRootNode (Blob const& data, SHAMapAddNode&);
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
std::shared_ptr<Peer>,
|
||||
std::shared_ptr <protocol::TMLedgerData>) = 0;
|
||||
|
||||
virtual void doLedgerData (Job&, LedgerHash hash) = 0;
|
||||
virtual void doLedgerData (LedgerHash hash) = 0;
|
||||
|
||||
virtual void gotStaleData (
|
||||
std::shared_ptr <protocol::TMLedgerData> packet) = 0;
|
||||
@@ -77,15 +77,16 @@ public:
|
||||
/** Called when a complete ledger is obtained. */
|
||||
virtual void onLedgerFetched (InboundLedger::fcReason why) = 0;
|
||||
|
||||
virtual void gotFetchPack (Job&) = 0;
|
||||
virtual void gotFetchPack () = 0;
|
||||
virtual void sweep () = 0;
|
||||
|
||||
virtual void onStop() = 0;
|
||||
};
|
||||
|
||||
std::unique_ptr<InboundLedgers>
|
||||
make_InboundLedgers (InboundLedgers::clock_type& clock, beast::Stoppable& parent,
|
||||
beast::insight::Collector::ptr const& collector);
|
||||
make_InboundLedgers (Application& app,
|
||||
InboundLedgers::clock_type& clock, beast::Stoppable& parent,
|
||||
beast::insight::Collector::ptr const& collector);
|
||||
|
||||
|
||||
} // ripple
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -22,8 +22,10 @@
|
||||
|
||||
#include <ripple/ledger/TxMeta.h>
|
||||
#include <ripple/ledger/View.h>
|
||||
#include <ripple/ledger/CachedView.h>
|
||||
#include <ripple/app/tx/Transaction.h>
|
||||
#include <ripple/basics/CountedObject.h>
|
||||
#include <ripple/core/TimeKeeper.h>
|
||||
#include <ripple/protocol/Indexes.h>
|
||||
#include <ripple/protocol/STLedgerEntry.h>
|
||||
#include <ripple/protocol/Serializer.h>
|
||||
@@ -35,6 +37,7 @@
|
||||
|
||||
namespace ripple {
|
||||
|
||||
class Application;
|
||||
class Job;
|
||||
class TransactionMaster;
|
||||
|
||||
@@ -67,8 +70,9 @@ extern create_genesis_t const create_genesis;
|
||||
3) Mutable ledgers cannot be shared.
|
||||
|
||||
@note Presented to clients as ReadView
|
||||
@note Calls virtuals in the constructor, so marked as final
|
||||
*/
|
||||
class Ledger
|
||||
class Ledger final
|
||||
: public std::enable_shared_from_this <Ledger>
|
||||
, public DigestAwareReadView
|
||||
, public TxsRawView
|
||||
@@ -95,14 +99,16 @@ public:
|
||||
starts in this account can ever exist, with amounts
|
||||
used to pay fees being destroyed.
|
||||
*/
|
||||
Ledger (create_genesis_t, Config const& config);
|
||||
Ledger (create_genesis_t, Config const& config, Family& family);
|
||||
|
||||
// Used for ledgers loaded from JSON files
|
||||
Ledger (uint256 const& parentHash, uint256 const& transHash,
|
||||
uint256 const& accountHash,
|
||||
std::uint64_t totDrops, std::uint32_t closeTime,
|
||||
std::uint32_t parentCloseTime, int closeFlags, int closeResolution,
|
||||
std::uint32_t ledgerSeq, bool & loaded, Config const& config);
|
||||
std::uint32_t ledgerSeq, bool & loaded, Config const& config,
|
||||
Family& family,
|
||||
beast::Journal j);
|
||||
|
||||
// Create a new ledger that's a snapshot of this one
|
||||
Ledger (Ledger const& target, bool isMutable);
|
||||
@@ -113,15 +119,17 @@ public:
|
||||
follows previous, and have
|
||||
parentCloseTime == previous.closeTime.
|
||||
*/
|
||||
Ledger (open_ledger_t, Ledger const& previous);
|
||||
Ledger (open_ledger_t, Ledger const& previous,
|
||||
NetClock::time_point closeTime);
|
||||
|
||||
Ledger (void const* data,
|
||||
std::size_t size, bool hasPrefix,
|
||||
Config const& config);
|
||||
Config const& config, Family& family);
|
||||
|
||||
// used for database ledgers
|
||||
Ledger (std::uint32_t ledgerSeq,
|
||||
std::uint32_t closeTime, Config const& config);
|
||||
std::uint32_t closeTime, Config const& config,
|
||||
Family& family);
|
||||
|
||||
~Ledger();
|
||||
|
||||
@@ -130,7 +138,7 @@ public:
|
||||
//
|
||||
|
||||
LedgerInfo const&
|
||||
info() const
|
||||
info() const override
|
||||
{
|
||||
return info_;
|
||||
}
|
||||
@@ -141,16 +149,31 @@ public:
|
||||
return fees_;
|
||||
}
|
||||
|
||||
Rules const&
|
||||
rules() const override
|
||||
{
|
||||
return rules_;
|
||||
}
|
||||
|
||||
bool
|
||||
exists (Keylet const& k) const override;
|
||||
|
||||
boost::optional<uint256>
|
||||
succ (uint256 const& key, boost::optional<
|
||||
uint256> last = boost::none) const override;
|
||||
uint256> const& last = boost::none) const override;
|
||||
|
||||
std::shared_ptr<SLE const>
|
||||
read (Keylet const& k) const override;
|
||||
|
||||
std::unique_ptr<sles_type::iter_base>
|
||||
slesBegin() const override;
|
||||
|
||||
std::unique_ptr<sles_type::iter_base>
|
||||
slesEnd() const override;
|
||||
|
||||
std::unique_ptr<sles_type::iter_base>
|
||||
slesUpperBound(uint256 const& key) const override;
|
||||
|
||||
std::unique_ptr<txs_type::iter_base>
|
||||
txsBegin() const override;
|
||||
|
||||
@@ -187,9 +210,9 @@ public:
|
||||
SLE> const& sle) override;
|
||||
|
||||
void
|
||||
rawDestroyXRP (std::uint64_t feeDrops) override
|
||||
rawDestroyXRP (XRPAmount const& fee) override
|
||||
{
|
||||
info_.drops -= feeDrops;
|
||||
info_.drops -= fee;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -215,11 +238,10 @@ public:
|
||||
}
|
||||
|
||||
void setAccepted (std::uint32_t closeTime,
|
||||
int closeResolution, bool correctCloseTime);
|
||||
int closeResolution, bool correctCloseTime,
|
||||
Config const& config);
|
||||
|
||||
void setAccepted ();
|
||||
|
||||
void setImmutable ();
|
||||
void setImmutable (Config const& config);
|
||||
|
||||
bool isImmutable () const
|
||||
{
|
||||
@@ -237,7 +259,7 @@ public:
|
||||
|
||||
// ledger signature operations
|
||||
void addRaw (Serializer& s) const;
|
||||
void setRaw (SerialIter& sit, bool hasPrefix);
|
||||
void setRaw (SerialIter& sit, bool hasPrefix, Family& family);
|
||||
|
||||
// DEPRECATED
|
||||
// Remove contract.h include
|
||||
@@ -302,11 +324,6 @@ public:
|
||||
|
||||
void visitStateItems (std::function<void (SLE::ref)>) const;
|
||||
|
||||
bool pendSaveValidated (bool isSynchronous, bool isCurrent);
|
||||
|
||||
// first node >hash, <last
|
||||
uint256 getNextLedgerIndex (uint256 const& hash,
|
||||
boost::optional<uint256> const& last = boost::none) const;
|
||||
|
||||
std::vector<uint256> getNeededTransactionHashes (
|
||||
int max, SHAMapSyncFilter* filter) const;
|
||||
@@ -314,64 +331,18 @@ public:
|
||||
std::vector<uint256> getNeededAccountStateHashes (
|
||||
int max, SHAMapSyncFilter* filter) const;
|
||||
|
||||
std::uint32_t getReferenceFeeUnits() const
|
||||
{
|
||||
// Returns the cost of the reference transaction in fee units
|
||||
deprecatedUpdateCachedFees ();
|
||||
return mReferenceFeeUnits;
|
||||
}
|
||||
bool walkLedger (beast::Journal j) const;
|
||||
|
||||
std::uint64_t getBaseFee() const
|
||||
{
|
||||
// Returns the cost of the reference transaction in drops
|
||||
deprecatedUpdateCachedFees ();
|
||||
return mBaseFee;
|
||||
}
|
||||
|
||||
// DEPRECATED use fees()
|
||||
std::uint64_t getReserve (int increments) const
|
||||
{
|
||||
// Returns the required reserve in drops
|
||||
deprecatedUpdateCachedFees ();
|
||||
return static_cast<std::uint64_t> (increments) * mReserveIncrement
|
||||
+ mReserveBase;
|
||||
}
|
||||
|
||||
// DEPRECATED use fees()
|
||||
std::uint64_t getReserveInc () const
|
||||
{
|
||||
deprecatedUpdateCachedFees ();
|
||||
return mReserveIncrement;
|
||||
}
|
||||
|
||||
bool walkLedger () const;
|
||||
|
||||
bool assertSane ();
|
||||
|
||||
// database functions (low-level)
|
||||
static Ledger::pointer loadByIndex (std::uint32_t ledgerIndex);
|
||||
|
||||
static Ledger::pointer loadByHash (uint256 const& ledgerHash);
|
||||
|
||||
static uint256 getHashByIndex (std::uint32_t index);
|
||||
|
||||
static bool getHashesByIndex (
|
||||
std::uint32_t index, uint256 & ledgerHash, uint256 & parentHash);
|
||||
|
||||
static std::map< std::uint32_t, std::pair<uint256, uint256> >
|
||||
getHashesByIndex (std::uint32_t minSeq, std::uint32_t maxSeq);
|
||||
bool assertSane (beast::Journal ledgerJ);
|
||||
|
||||
private:
|
||||
class sles_iter_impl;
|
||||
class txs_iter_impl;
|
||||
|
||||
void saveValidatedLedgerAsync(Job&, bool current)
|
||||
{
|
||||
saveValidatedLedger(current);
|
||||
}
|
||||
bool saveValidatedLedger (bool current);
|
||||
|
||||
void
|
||||
setFees (Config const& config);
|
||||
bool
|
||||
setup (Config const& config);
|
||||
|
||||
std::shared_ptr<SLE>
|
||||
peek (Keylet const& k) const;
|
||||
@@ -379,13 +350,6 @@ private:
|
||||
void
|
||||
updateHash();
|
||||
|
||||
// Updates the fees cached in the ledger.
|
||||
// Safe to call concurrently. We shouldn't be storing
|
||||
// fees in the Ledger object, they should be a local side-structure
|
||||
// associated with a particular module (rpc, tx processing, consensus)
|
||||
//
|
||||
void deprecatedUpdateCachedFees() const;
|
||||
|
||||
// The basic Ledger structure, can be opened, closed, or synching
|
||||
|
||||
bool mValidHash = false;
|
||||
@@ -398,26 +362,56 @@ private:
|
||||
std::mutex mutable mutex_;
|
||||
|
||||
Fees fees_;
|
||||
Rules rules_;
|
||||
LedgerInfo info_;
|
||||
|
||||
// Ripple cost of the reference transaction
|
||||
std::uint64_t mutable mBaseFee = 0;
|
||||
|
||||
// Fee units for the reference transaction
|
||||
std::uint32_t mutable mReferenceFeeUnits = 0;
|
||||
|
||||
// Reserve base in drops
|
||||
std::uint32_t mutable mReserveBase = 0;
|
||||
// Reserve increment in drops
|
||||
std::uint32_t mutable mReserveIncrement = 0;
|
||||
};
|
||||
|
||||
/** A ledger wrapped in a CachedView. */
|
||||
using CachedLedger = CachedView<Ledger>;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//
|
||||
// API
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
extern
|
||||
bool
|
||||
pendSaveValidated(
|
||||
Application& app,
|
||||
std::shared_ptr<Ledger> const& ledger,
|
||||
bool isSynchronous,
|
||||
bool isCurrent);
|
||||
|
||||
extern
|
||||
Ledger::pointer
|
||||
loadByIndex (std::uint32_t ledgerIndex,
|
||||
Application& app);
|
||||
|
||||
extern
|
||||
std::tuple<Ledger::pointer, std::uint32_t, uint256>
|
||||
loadLedgerHelper(std::string const& sqlSuffix,
|
||||
Application& app);
|
||||
|
||||
extern
|
||||
Ledger::pointer
|
||||
loadByHash (uint256 const& ledgerHash, Application& app);
|
||||
|
||||
extern
|
||||
uint256
|
||||
getHashByIndex(std::uint32_t index, Application& app);
|
||||
|
||||
extern
|
||||
bool
|
||||
getHashesByIndex(std::uint32_t index,
|
||||
uint256 &ledgerHash, uint256& parentHash,
|
||||
Application& app);
|
||||
|
||||
extern
|
||||
std::map< std::uint32_t, std::pair<uint256, uint256>>
|
||||
getHashesByIndex (std::uint32_t minSeq, std::uint32_t maxSeq,
|
||||
Application& app);
|
||||
|
||||
/** Deserialize a SHAMapItem containing a single STTx
|
||||
|
||||
Throw:
|
||||
@@ -441,9 +435,6 @@ std::pair<std::shared_ptr<
|
||||
STObject const>>
|
||||
deserializeTxPlusMeta (SHAMapItem const& item);
|
||||
|
||||
std::tuple<Ledger::pointer, std::uint32_t, uint256>
|
||||
loadLedgerHelper(std::string const& sqlSuffix);
|
||||
|
||||
// DEPRECATED
|
||||
inline
|
||||
std::shared_ptr<SLE const>
|
||||
@@ -457,23 +448,6 @@ cachedRead (ReadView const& ledger, uint256 const& key,
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
// VFALCO NOTE This is called from only one place
|
||||
Transaction::pointer
|
||||
getTransaction (Ledger const& ledger,
|
||||
uint256 const& transID, TransactionMaster& cache);
|
||||
|
||||
// VFALCO NOTE This is called from only one place
|
||||
bool
|
||||
getTransaction (Ledger const& ledger,
|
||||
uint256 const& transID, Transaction::pointer & txn,
|
||||
TxMeta::pointer & txMeta,
|
||||
TransactionMaster& cache);
|
||||
|
||||
bool
|
||||
getTransactionMeta (Ledger const&,
|
||||
uint256 const& transID,
|
||||
TxMeta::pointer & txMeta);
|
||||
|
||||
void
|
||||
ownerDirDescriber (SLE::ref, bool, AccountID const& owner);
|
||||
|
||||
@@ -483,7 +457,7 @@ qualityDirDescriber (
|
||||
SLE::ref, bool,
|
||||
Currency const& uTakerPaysCurrency, AccountID const& uTakerPaysIssuer,
|
||||
Currency const& uTakerGetsCurrency, AccountID const& uTakerGetsIssuer,
|
||||
const std::uint64_t & uRate);
|
||||
const std::uint64_t & uRate, Application& app);
|
||||
|
||||
} // ripple
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
#include <ripple/app/ledger/Ledger.h>
|
||||
#include <ripple/app/ledger/LedgerProposal.h>
|
||||
#include <ripple/app/main/Application.h>
|
||||
#include <ripple/app/misc/CanonicalTXSet.h>
|
||||
#include <ripple/app/misc/FeeVote.h>
|
||||
#include <ripple/app/tx/InboundTransactions.h>
|
||||
@@ -79,12 +80,28 @@ public:
|
||||
@param openLgr true if applyLedger is open, else false.
|
||||
*/
|
||||
void applyTransactions (
|
||||
Application& app,
|
||||
SHAMap const* set,
|
||||
OpenView& view,
|
||||
Ledger::ref checkLedger,
|
||||
CanonicalTXSet& retriableTransactions,
|
||||
ApplyFlags flags);
|
||||
|
||||
/** Apply a single transaction to a ledger
|
||||
@param view The open view to apply to
|
||||
@param txn The transaction to apply
|
||||
@param retryAssured True if another pass is assured
|
||||
@param flags Flags for transactor
|
||||
@return resultSuccess, resultFail or resultRetry
|
||||
*/
|
||||
int applyTransaction (
|
||||
Application& app,
|
||||
OpenView& view,
|
||||
std::shared_ptr<STTx const> const& txn,
|
||||
bool retryAssured,
|
||||
ApplyFlags flags,
|
||||
beast::Journal j);
|
||||
|
||||
} // ripple
|
||||
|
||||
#endif
|
||||
|
||||
@@ -39,13 +39,16 @@ namespace ripple {
|
||||
// FIXME: Need to clean up ledgers by index at some point
|
||||
|
||||
LedgerHistory::LedgerHistory (
|
||||
beast::insight::Collector::ptr const& collector)
|
||||
: collector_ (collector)
|
||||
beast::insight::Collector::ptr const& collector,
|
||||
Application& app)
|
||||
: app_ (app)
|
||||
, collector_ (collector)
|
||||
, mismatch_counter_ (collector->make_counter ("ledger.history", "mismatch"))
|
||||
, m_ledgers_by_hash ("LedgerCache", CACHED_LEDGER_NUM, CACHED_LEDGER_AGE,
|
||||
stopwatch(), deprecatedLogs().journal("TaggedCache"))
|
||||
stopwatch(), app_.journal("TaggedCache"))
|
||||
, m_consensus_validated ("ConsensusValidated", 64, 300,
|
||||
stopwatch(), deprecatedLogs().journal("TaggedCache"))
|
||||
stopwatch(), app_.journal("TaggedCache"))
|
||||
, j_ (app.journal ("LedgerHistory"))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -56,7 +59,8 @@ bool LedgerHistory::addLedger (Ledger::pointer ledger, bool validated)
|
||||
|
||||
LedgersByHash::ScopedLockType sl (m_ledgers_by_hash.peekMutex ());
|
||||
|
||||
const bool alreadyHad = m_ledgers_by_hash.canonicalize (ledger->getHash(), ledger, true);
|
||||
const bool alreadyHad = m_ledgers_by_hash.canonicalize (
|
||||
ledger->getHash(), ledger, true);
|
||||
if (validated)
|
||||
mLedgersByIndex[ledger->info().seq] = ledger->getHash();
|
||||
|
||||
@@ -66,7 +70,7 @@ bool LedgerHistory::addLedger (Ledger::pointer ledger, bool validated)
|
||||
LedgerHash LedgerHistory::getLedgerHash (LedgerIndex index)
|
||||
{
|
||||
LedgersByHash::ScopedLockType sl (m_ledgers_by_hash.peekMutex ());
|
||||
std::map<std::uint32_t, uint256>::iterator it (mLedgersByIndex.find (index));
|
||||
auto it = mLedgersByIndex.find (index);
|
||||
|
||||
if (it != mLedgersByIndex.end ())
|
||||
return it->second;
|
||||
@@ -78,7 +82,7 @@ Ledger::pointer LedgerHistory::getLedgerBySeq (LedgerIndex index)
|
||||
{
|
||||
{
|
||||
LedgersByHash::ScopedLockType sl (m_ledgers_by_hash.peekMutex ());
|
||||
std::map <std::uint32_t, uint256>::iterator it (mLedgersByIndex.find (index));
|
||||
auto it = mLedgersByIndex.find (index);
|
||||
|
||||
if (it != mLedgersByIndex.end ())
|
||||
{
|
||||
@@ -88,7 +92,7 @@ Ledger::pointer LedgerHistory::getLedgerBySeq (LedgerIndex index)
|
||||
}
|
||||
}
|
||||
|
||||
Ledger::pointer ret (Ledger::loadByIndex (index));
|
||||
Ledger::pointer ret = loadByIndex (index, app_);
|
||||
|
||||
if (!ret)
|
||||
return ret;
|
||||
@@ -117,7 +121,7 @@ Ledger::pointer LedgerHistory::getLedgerByHash (LedgerHash const& hash)
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = Ledger::loadByHash (hash);
|
||||
ret = loadByHash (hash, app_);
|
||||
|
||||
if (!ret)
|
||||
return ret;
|
||||
@@ -132,33 +136,41 @@ Ledger::pointer LedgerHistory::getLedgerByHash (LedgerHash const& hash)
|
||||
|
||||
static
|
||||
void
|
||||
log_one(Ledger::pointer ledger, uint256 const& tx, char const* msg)
|
||||
log_one(Ledger::pointer ledger, uint256 const& tx, char const* msg,
|
||||
beast::Journal& j)
|
||||
{
|
||||
TxMeta::pointer metaData;
|
||||
getTransactionMeta(*ledger, tx, metaData);
|
||||
auto metaData = ledger->txRead(tx).second;
|
||||
|
||||
if (metaData != nullptr)
|
||||
{
|
||||
WriteLog (lsERROR, LedgerMaster) << "MISMATCH on TX " << tx <<
|
||||
JLOG (j.debug) << "MISMATCH on TX " << tx <<
|
||||
": " << msg << " is missing this transaction:\n" <<
|
||||
metaData->getJson (0);
|
||||
}
|
||||
else
|
||||
{
|
||||
WriteLog (lsERROR, LedgerMaster) << "MISMATCH on TX " << tx <<
|
||||
JLOG (j.debug) << "MISMATCH on TX " << tx <<
|
||||
": " << msg << " is missing this transaction.";
|
||||
}
|
||||
}
|
||||
|
||||
static
|
||||
void
|
||||
log_metadata_difference(Ledger::pointer builtLedger, Ledger::pointer validLedger,
|
||||
uint256 const& tx)
|
||||
log_metadata_difference(
|
||||
Ledger::pointer builtLedger, Ledger::pointer validLedger, uint256 const& tx,
|
||||
beast::Journal j)
|
||||
{
|
||||
TxMeta::pointer validMetaData;
|
||||
getTransactionMeta(*validLedger, tx, validMetaData);
|
||||
TxMeta::pointer builtMetaData;
|
||||
getTransactionMeta(*builtLedger, tx, builtMetaData);
|
||||
auto getMeta = [j](Ledger const& ledger,
|
||||
uint256 const& txID) -> std::shared_ptr<TxMeta>
|
||||
{
|
||||
auto meta = ledger.txRead(txID).second;
|
||||
if (!meta)
|
||||
return {};
|
||||
return std::make_shared<TxMeta> (txID, ledger.seq(), *meta, j);
|
||||
};
|
||||
|
||||
auto validMetaData = getMeta (*validLedger, tx);
|
||||
auto builtMetaData = getMeta (*builtLedger, tx);
|
||||
assert(validMetaData != nullptr || builtMetaData != nullptr);
|
||||
|
||||
if (validMetaData != nullptr && builtMetaData != nullptr)
|
||||
@@ -176,7 +188,7 @@ log_metadata_difference(Ledger::pointer builtLedger, Ledger::pointer validLedger
|
||||
|
||||
if (!result_diff && !index_diff && !nodes_diff)
|
||||
{
|
||||
WriteLog (lsERROR, LedgerMaster) << "MISMATCH on TX " << tx <<
|
||||
JLOG (j.error) << "MISMATCH on TX " << tx <<
|
||||
": No apparent mismatches detected!";
|
||||
return;
|
||||
}
|
||||
@@ -185,31 +197,31 @@ log_metadata_difference(Ledger::pointer builtLedger, Ledger::pointer validLedger
|
||||
{
|
||||
if (result_diff && index_diff)
|
||||
{
|
||||
WriteLog (lsERROR, LedgerMaster) << "MISMATCH on TX " << tx <<
|
||||
JLOG (j.debug) << "MISMATCH on TX " << tx <<
|
||||
": Different result and index!";
|
||||
WriteLog (lsERROR, LedgerMaster) << " Built:" <<
|
||||
JLOG (j.debug) << " Built:" <<
|
||||
" Result: " << builtMetaData->getResult () <<
|
||||
" Index: " << builtMetaData->getIndex ();
|
||||
WriteLog (lsERROR, LedgerMaster) << " Valid:" <<
|
||||
JLOG (j.debug) << " Valid:" <<
|
||||
" Result: " << validMetaData->getResult () <<
|
||||
" Index: " << validMetaData->getIndex ();
|
||||
}
|
||||
else if (result_diff)
|
||||
{
|
||||
WriteLog (lsERROR, LedgerMaster) << "MISMATCH on TX " << tx <<
|
||||
JLOG (j.debug) << "MISMATCH on TX " << tx <<
|
||||
": Different result!";
|
||||
WriteLog (lsERROR, LedgerMaster) << " Built:" <<
|
||||
JLOG (j.debug) << " Built:" <<
|
||||
" Result: " << builtMetaData->getResult ();
|
||||
WriteLog (lsERROR, LedgerMaster) << " Valid:" <<
|
||||
JLOG (j.debug) << " Valid:" <<
|
||||
" Result: " << validMetaData->getResult ();
|
||||
}
|
||||
else if (index_diff)
|
||||
{
|
||||
WriteLog (lsERROR, LedgerMaster) << "MISMATCH on TX " << tx <<
|
||||
JLOG (j.debug) << "MISMATCH on TX " << tx <<
|
||||
": Different index!";
|
||||
WriteLog (lsERROR, LedgerMaster) << " Built:" <<
|
||||
JLOG (j.debug) << " Built:" <<
|
||||
" Index: " << builtMetaData->getIndex ();
|
||||
WriteLog (lsERROR, LedgerMaster) << " Valid:" <<
|
||||
JLOG (j.debug) << " Valid:" <<
|
||||
" Index: " << validMetaData->getIndex ();
|
||||
}
|
||||
}
|
||||
@@ -217,55 +229,55 @@ log_metadata_difference(Ledger::pointer builtLedger, Ledger::pointer validLedger
|
||||
{
|
||||
if (result_diff && index_diff)
|
||||
{
|
||||
WriteLog (lsERROR, LedgerMaster) << "MISMATCH on TX " << tx <<
|
||||
JLOG (j.debug) << "MISMATCH on TX " << tx <<
|
||||
": Different result, index and nodes!";
|
||||
WriteLog (lsERROR, LedgerMaster) << " Built:\n" <<
|
||||
JLOG (j.debug) << " Built:\n" <<
|
||||
builtMetaData->getJson (0);
|
||||
WriteLog (lsERROR, LedgerMaster) << " Valid:\n" <<
|
||||
JLOG (j.debug) << " Valid:\n" <<
|
||||
validMetaData->getJson (0);
|
||||
}
|
||||
else if (result_diff)
|
||||
{
|
||||
WriteLog (lsERROR, LedgerMaster) << "MISMATCH on TX " << tx <<
|
||||
JLOG (j.debug) << "MISMATCH on TX " << tx <<
|
||||
": Different result and nodes!";
|
||||
WriteLog (lsERROR, LedgerMaster) << " Built:" <<
|
||||
JLOG (j.debug) << " Built:" <<
|
||||
" Result: " << builtMetaData->getResult () <<
|
||||
" Nodes:\n" << builtNodes.getJson (0);
|
||||
WriteLog (lsERROR, LedgerMaster) << " Valid:" <<
|
||||
JLOG (j.debug) << " Valid:" <<
|
||||
" Result: " << validMetaData->getResult () <<
|
||||
" Nodes:\n" << validNodes.getJson (0);
|
||||
}
|
||||
else if (index_diff)
|
||||
{
|
||||
WriteLog (lsERROR, LedgerMaster) << "MISMATCH on TX " << tx <<
|
||||
JLOG (j.debug) << "MISMATCH on TX " << tx <<
|
||||
": Different index and nodes!";
|
||||
WriteLog (lsERROR, LedgerMaster) << " Built:" <<
|
||||
JLOG (j.debug) << " Built:" <<
|
||||
" Index: " << builtMetaData->getIndex () <<
|
||||
" Nodes:\n" << builtNodes.getJson (0);
|
||||
WriteLog (lsERROR, LedgerMaster) << " Valid:" <<
|
||||
JLOG (j.debug) << " Valid:" <<
|
||||
" Index: " << validMetaData->getIndex () <<
|
||||
" Nodes:\n" << validNodes.getJson (0);
|
||||
}
|
||||
else // nodes_diff
|
||||
{
|
||||
WriteLog (lsERROR, LedgerMaster) << "MISMATCH on TX " << tx <<
|
||||
JLOG (j.debug) << "MISMATCH on TX " << tx <<
|
||||
": Different nodes!";
|
||||
WriteLog (lsERROR, LedgerMaster) << " Built:" <<
|
||||
JLOG (j.debug) << " Built:" <<
|
||||
" Nodes:\n" << builtNodes.getJson (0);
|
||||
WriteLog (lsERROR, LedgerMaster) << " Valid:" <<
|
||||
JLOG (j.debug) << " Valid:" <<
|
||||
" Nodes:\n" << validNodes.getJson (0);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (validMetaData != nullptr)
|
||||
{
|
||||
WriteLog (lsERROR, LedgerMaster) << "MISMATCH on TX " << tx <<
|
||||
JLOG (j.error) << "MISMATCH on TX " << tx <<
|
||||
": Metadata Difference (built has none)\n" <<
|
||||
validMetaData->getJson (0);
|
||||
}
|
||||
else // builtMetaData != nullptr
|
||||
{
|
||||
WriteLog (lsERROR, LedgerMaster) << "MISMATCH on TX " << tx <<
|
||||
JLOG (j.error) << "MISMATCH on TX " << tx <<
|
||||
": Metadata Difference (valid has none)\n" <<
|
||||
builtMetaData->getJson (0);
|
||||
}
|
||||
@@ -288,7 +300,8 @@ leaves (SHAMap const& sm)
|
||||
}
|
||||
|
||||
|
||||
void LedgerHistory::handleMismatch (LedgerHash const& built, LedgerHash const& valid)
|
||||
void LedgerHistory::handleMismatch (
|
||||
LedgerHash const& built, LedgerHash const& valid)
|
||||
{
|
||||
assert (built != valid);
|
||||
++mismatch_counter_;
|
||||
@@ -298,7 +311,7 @@ void LedgerHistory::handleMismatch (LedgerHash const& built, LedgerHash const& v
|
||||
|
||||
if (!builtLedger || !validLedger)
|
||||
{
|
||||
WriteLog (lsERROR, LedgerMaster) << "MISMATCH cannot be analyzed:" <<
|
||||
JLOG (j_.error) << "MISMATCH cannot be analyzed:" <<
|
||||
" builtLedger: " << to_string (built) << " -> " << builtLedger <<
|
||||
" validLedger: " << to_string (valid) << " -> " << validLedger;
|
||||
return;
|
||||
@@ -312,14 +325,14 @@ void LedgerHistory::handleMismatch (LedgerHash const& built, LedgerHash const& v
|
||||
if (builtLedger->info().parentHash != validLedger->info().parentHash)
|
||||
{
|
||||
// Disagreement over prior ledger indicates sync issue
|
||||
WriteLog (lsERROR, LedgerMaster) << "MISMATCH on prior ledger";
|
||||
JLOG (j_.error) << "MISMATCH on prior ledger";
|
||||
return;
|
||||
}
|
||||
|
||||
if (builtLedger->info().closeTime != validLedger->info().closeTime)
|
||||
{
|
||||
// Disagreement over close time indicates Byzantine failure
|
||||
WriteLog (lsERROR, LedgerMaster) << "MISMATCH on close time";
|
||||
JLOG (j_.error) << "MISMATCH on close time";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -327,16 +340,16 @@ void LedgerHistory::handleMismatch (LedgerHash const& built, LedgerHash const& v
|
||||
auto const builtTx = leaves(builtLedger->txMap());
|
||||
auto const validTx = leaves(validLedger->txMap());
|
||||
if (builtTx == validTx)
|
||||
WriteLog (lsERROR, LedgerMaster) <<
|
||||
JLOG (j_.error) <<
|
||||
"MISMATCH with same " << builtTx.size() << " transactions";
|
||||
else
|
||||
WriteLog (lsERROR, LedgerMaster) << "MISMATCH with " <<
|
||||
JLOG (j_.error) << "MISMATCH with " <<
|
||||
builtTx.size() << " built and " <<
|
||||
validTx.size() << " valid transactions.";
|
||||
|
||||
WriteLog(lsERROR, LedgerMaster) << "built\n" <<
|
||||
JLOG (j_.error) << "built\n" <<
|
||||
getJson(*builtLedger);
|
||||
WriteLog(lsERROR, LedgerMaster) << "valid\n" <<
|
||||
JLOG (j_.error) << "valid\n" <<
|
||||
getJson(*validLedger);
|
||||
|
||||
// Log all differences between built and valid ledgers
|
||||
@@ -346,12 +359,12 @@ void LedgerHistory::handleMismatch (LedgerHash const& built, LedgerHash const& v
|
||||
{
|
||||
if ((*b)->key() < (*v)->key())
|
||||
{
|
||||
log_one (builtLedger, (*b)->key(), "valid");
|
||||
log_one (builtLedger, (*b)->key(), "valid", j_);
|
||||
++b;
|
||||
}
|
||||
else if ((*b)->key() > (*v)->key())
|
||||
{
|
||||
log_one(validLedger, (*v)->key(), "built");
|
||||
log_one(validLedger, (*v)->key(), "built", j_);
|
||||
++v;
|
||||
}
|
||||
else
|
||||
@@ -359,16 +372,16 @@ void LedgerHistory::handleMismatch (LedgerHash const& built, LedgerHash const& v
|
||||
if ((*b)->peekData() != (*v)->peekData())
|
||||
{
|
||||
// Same transaction with different metadata
|
||||
log_metadata_difference(builtLedger, validLedger, (*b)->key());
|
||||
log_metadata_difference(builtLedger, validLedger, (*b)->key(), j_);
|
||||
}
|
||||
++b;
|
||||
++v;
|
||||
}
|
||||
}
|
||||
for (; b != builtTx.end(); ++b)
|
||||
log_one (builtLedger, (*b)->key(), "valid");
|
||||
log_one (builtLedger, (*b)->key(), "valid", j_);
|
||||
for (; v != validTx.end(); ++v)
|
||||
log_one (validLedger, (*v)->key(), "built");
|
||||
log_one (validLedger, (*v)->key(), "built", j_);
|
||||
}
|
||||
|
||||
void LedgerHistory::builtLedger (Ledger::ref ledger)
|
||||
@@ -386,7 +399,7 @@ void LedgerHistory::builtLedger (Ledger::ref ledger)
|
||||
{
|
||||
if (entry->second.isNonZero() && (entry->second != hash))
|
||||
{
|
||||
WriteLog (lsERROR, LedgerMaster) << "MISMATCH: seq=" << index
|
||||
JLOG (j_.error) << "MISMATCH: seq=" << index
|
||||
<< " validated:" << entry->second
|
||||
<< " then:" << hash;
|
||||
handleMismatch (hash, entry->first);
|
||||
@@ -403,14 +416,14 @@ void LedgerHistory::validatedLedger (Ledger::ref ledger)
|
||||
ConsensusValidated::ScopedLockType sl (
|
||||
m_consensus_validated.peekMutex());
|
||||
|
||||
std::shared_ptr< std::pair< LedgerHash, LedgerHash > > entry = std::make_shared<std::pair< LedgerHash, LedgerHash >>();
|
||||
auto entry = std::make_shared<std::pair<LedgerHash, LedgerHash>>();
|
||||
m_consensus_validated.canonicalize(index, entry, false);
|
||||
|
||||
if (entry->second != hash)
|
||||
{
|
||||
if (entry->first.isNonZero() && (entry->first != hash))
|
||||
{
|
||||
WriteLog (lsERROR, LedgerMaster) << "MISMATCH: seq=" << index
|
||||
JLOG (j_.error) << "MISMATCH: seq=" << index
|
||||
<< " built:" << entry->first
|
||||
<< " then:" << hash;
|
||||
handleMismatch (entry->first, hash);
|
||||
@@ -422,10 +435,11 @@ void LedgerHistory::validatedLedger (Ledger::ref ledger)
|
||||
|
||||
/** Ensure m_ledgers_by_hash doesn't have the wrong hash for a particular index
|
||||
*/
|
||||
bool LedgerHistory::fixIndex (LedgerIndex ledgerIndex, LedgerHash const& ledgerHash)
|
||||
bool LedgerHistory::fixIndex (
|
||||
LedgerIndex ledgerIndex, LedgerHash const& ledgerHash)
|
||||
{
|
||||
LedgersByHash::ScopedLockType sl (m_ledgers_by_hash.peekMutex ());
|
||||
std::map<std::uint32_t, uint256>::iterator it (mLedgersByIndex.find (ledgerIndex));
|
||||
auto it = mLedgersByIndex.find (ledgerIndex);
|
||||
|
||||
if ((it != mLedgersByIndex.end ()) && (it->second != ledgerHash) )
|
||||
{
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#define RIPPLE_APP_LEDGER_LEDGERHISTORY_H_INCLUDED
|
||||
|
||||
#include <ripple/app/ledger/Ledger.h>
|
||||
#include <ripple/app/main/Application.h>
|
||||
#include <ripple/protocol/RippleLedgerHash.h>
|
||||
#include <beast/insight/Collector.h>
|
||||
#include <beast/insight/Event.h>
|
||||
@@ -33,8 +34,8 @@ namespace ripple {
|
||||
class LedgerHistory
|
||||
{
|
||||
public:
|
||||
explicit
|
||||
LedgerHistory (beast::insight::Collector::ptr const& collector);
|
||||
LedgerHistory (beast::insight::Collector::ptr const& collector,
|
||||
Application& app);
|
||||
|
||||
/** Track a ledger
|
||||
@return `true` if the ledger was already tracked
|
||||
@@ -106,6 +107,7 @@ private:
|
||||
*/
|
||||
void handleMismatch (LedgerHash const& built, LedgerHash const& valid);
|
||||
|
||||
Application& app_;
|
||||
beast::insight::Collector::ptr collector_;
|
||||
beast::insight::Counter mismatch_counter_;
|
||||
|
||||
@@ -124,6 +126,8 @@ private:
|
||||
|
||||
// Maps ledger indexes to the corresponding hash.
|
||||
std::map <LedgerIndex, LedgerHash> mLedgersByIndex; // validated ledgers
|
||||
|
||||
beast::Journal j_;
|
||||
};
|
||||
|
||||
} // ripple
|
||||
|
||||
@@ -20,13 +20,13 @@
|
||||
#ifndef RIPPLE_APP_LEDGER_LEDGERMASTER_H_INCLUDED
|
||||
#define RIPPLE_APP_LEDGER_LEDGERMASTER_H_INCLUDED
|
||||
|
||||
#include <ripple/app/main/Application.h>
|
||||
#include <ripple/app/ledger/Ledger.h>
|
||||
#include <ripple/app/ledger/LedgerHolder.h>
|
||||
#include <ripple/basics/chrono.h>
|
||||
#include <ripple/basics/StringUtilities.h>
|
||||
#include <ripple/protocol/RippleLedgerHash.h>
|
||||
#include <ripple/protocol/STValidation.h>
|
||||
#include <ripple/core/Config.h>
|
||||
#include <beast/insight/Collector.h>
|
||||
#include <beast/threads/Stoppable.h>
|
||||
#include <beast/threads/UnlockGuard.h>
|
||||
@@ -38,6 +38,14 @@ namespace ripple {
|
||||
|
||||
class Peer;
|
||||
|
||||
struct LedgerReplay
|
||||
{
|
||||
std::map< int, std::shared_ptr<STTx const> > txns_;
|
||||
std::uint32_t closeTime_;
|
||||
int closeFlags_;
|
||||
Ledger::pointer prevLedger_;
|
||||
};
|
||||
|
||||
// Tracks the current ledger and any ledgers in the process of closing
|
||||
// Tracks ledger history
|
||||
// Tracks held transactions
|
||||
@@ -64,13 +72,13 @@ public:
|
||||
virtual LedgerIndex getCurrentLedgerIndex () = 0;
|
||||
virtual LedgerIndex getValidLedgerIndex () = 0;
|
||||
|
||||
virtual bool isCompatible (Ledger::pointer,
|
||||
beast::Journal::Stream, const char* reason) = 0;
|
||||
|
||||
virtual LockType& peekMutex () = 0;
|
||||
|
||||
// The current ledger is the ledger we believe new transactions should go in
|
||||
virtual Ledger::pointer getCurrentLedger () = 0;
|
||||
|
||||
// The holder for the current ledger
|
||||
virtual LedgerHolder& getCurrentLedgerHolder() = 0;
|
||||
virtual std::shared_ptr<ReadView const> getCurrentLedger () = 0;
|
||||
|
||||
// The finalized ledger is the last closed/accepted ledger
|
||||
virtual Ledger::pointer getClosedLedger () = 0;
|
||||
@@ -78,7 +86,11 @@ public:
|
||||
// The validated ledger is the last fully validated ledger
|
||||
virtual Ledger::pointer getValidatedLedger () = 0;
|
||||
|
||||
// This is the last ledger we published to clients and can lag the validated ledger
|
||||
// The Rules are in the last fully validated ledger if there is one.
|
||||
virtual Rules getValidatedRules() = 0;
|
||||
|
||||
// This is the last ledger we published to clients and can lag the validated
|
||||
// ledger
|
||||
virtual Ledger::ref getPublishedLedger () = 0;
|
||||
|
||||
virtual bool isValidLedger(LedgerInfo const&) = 0;
|
||||
@@ -89,18 +101,17 @@ public:
|
||||
|
||||
virtual int getMinValidations () = 0;
|
||||
|
||||
virtual void setMinValidations (int v) = 0;
|
||||
virtual void setMinValidations (int v, bool strict) = 0;
|
||||
|
||||
virtual std::uint32_t getEarliestFetch () = 0;
|
||||
|
||||
virtual void pushLedger (Ledger::pointer newLedger) = 0;
|
||||
virtual void pushLedger (Ledger::pointer newLCL, Ledger::pointer newOL) = 0;
|
||||
virtual bool storeLedger (Ledger::pointer) = 0;
|
||||
virtual void forceValid (Ledger::pointer) = 0;
|
||||
|
||||
virtual void setFullLedger (Ledger::pointer ledger, bool isSynchronous, bool isCurrent) = 0;
|
||||
virtual void setFullLedger (
|
||||
Ledger::pointer ledger, bool isSynchronous, bool isCurrent) = 0;
|
||||
|
||||
virtual void switchLedgers (Ledger::pointer lastClosed, Ledger::pointer newCurrent) = 0;
|
||||
virtual void switchLCL (Ledger::pointer lastClosed) = 0;
|
||||
|
||||
virtual void failedSave(std::uint32_t seq, uint256 const& hash) = 0;
|
||||
|
||||
@@ -115,23 +126,28 @@ public:
|
||||
/** Walk to a ledger's hash using the skip list
|
||||
*/
|
||||
virtual uint256 walkHashBySeq (std::uint32_t index) = 0;
|
||||
virtual uint256 walkHashBySeq (std::uint32_t index, Ledger::ref referenceLedger) = 0;
|
||||
virtual uint256 walkHashBySeq (
|
||||
std::uint32_t index, Ledger::ref referenceLedger) = 0;
|
||||
|
||||
virtual Ledger::pointer getLedgerBySeq (std::uint32_t index) = 0;
|
||||
|
||||
virtual Ledger::pointer getLedgerByHash (uint256 const& hash) = 0;
|
||||
|
||||
virtual void setLedgerRangePresent (std::uint32_t minV, std::uint32_t maxV) = 0;
|
||||
virtual void setLedgerRangePresent (
|
||||
std::uint32_t minV, std::uint32_t maxV) = 0;
|
||||
|
||||
virtual uint256 getLedgerHash(std::uint32_t desiredSeq, Ledger::ref knownGoodLedger) = 0;
|
||||
virtual uint256 getLedgerHash(
|
||||
std::uint32_t desiredSeq, Ledger::ref knownGoodLedger) = 0;
|
||||
|
||||
virtual void addHeldTransaction (Transaction::ref trans) = 0;
|
||||
virtual void fixMismatch (Ledger::ref ledger) = 0;
|
||||
|
||||
virtual bool haveLedger (std::uint32_t seq) = 0;
|
||||
virtual void clearLedger (std::uint32_t seq) = 0;
|
||||
virtual bool getValidatedRange (std::uint32_t& minVal, std::uint32_t& maxVal) = 0;
|
||||
virtual bool getFullValidatedRange (std::uint32_t& minVal, std::uint32_t& maxVal) = 0;
|
||||
virtual bool getValidatedRange (
|
||||
std::uint32_t& minVal, std::uint32_t& maxVal) = 0;
|
||||
virtual bool getFullValidatedRange (
|
||||
std::uint32_t& minVal, std::uint32_t& maxVal) = 0;
|
||||
|
||||
virtual void tune (int size, int age) = 0;
|
||||
virtual void sweep () = 0;
|
||||
@@ -149,7 +165,8 @@ public:
|
||||
virtual bool isNewPathRequest () = 0;
|
||||
virtual void newOrderBookDB () = 0;
|
||||
|
||||
virtual bool fixIndex (LedgerIndex ledgerIndex, LedgerHash const& ledgerHash) = 0;
|
||||
virtual bool fixIndex (
|
||||
LedgerIndex ledgerIndex, LedgerHash const& ledgerHash) = 0;
|
||||
virtual void doLedgerCleaner(Json::Value const& parameters) = 0;
|
||||
|
||||
virtual beast::PropertyStream::Source& getPropertySource () = 0;
|
||||
@@ -158,6 +175,10 @@ public:
|
||||
|
||||
virtual void clearLedgerCachePrior (LedgerIndex seq) = 0;
|
||||
|
||||
// ledger replay
|
||||
virtual void takeReplay (std::unique_ptr<LedgerReplay> replay) = 0;
|
||||
virtual std::unique_ptr<LedgerReplay> releaseReplay () = 0;
|
||||
|
||||
// Fetch Packs
|
||||
virtual
|
||||
void gotFetchPack (
|
||||
@@ -176,7 +197,7 @@ public:
|
||||
|
||||
virtual
|
||||
void makeFetchPack (
|
||||
Job&, std::weak_ptr<Peer> const& wPeer,
|
||||
std::weak_ptr<Peer> const& wPeer,
|
||||
std::shared_ptr<protocol::TMGetObjectByHash> const& request,
|
||||
uint256 haveLedgerHash,
|
||||
std::uint32_t uUptime) = 0;
|
||||
@@ -187,7 +208,7 @@ public:
|
||||
|
||||
std::unique_ptr <LedgerMaster>
|
||||
make_LedgerMaster (
|
||||
Config const& config,
|
||||
Application& app,
|
||||
Stopwatch& stopwatch,
|
||||
beast::Stoppable& parent,
|
||||
beast::insight::Collector::ptr const& collector,
|
||||
|
||||
@@ -115,7 +115,8 @@ public:
|
||||
return mTime <= cutoff;
|
||||
}
|
||||
|
||||
bool changePosition (uint256 const& newPosition, std::uint32_t newCloseTime);
|
||||
bool changePosition (
|
||||
uint256 const& newPosition, std::uint32_t newCloseTime);
|
||||
void bowOut ();
|
||||
Json::Value getJson () const;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include <ripple/ledger/CachedSLEs.h>
|
||||
#include <ripple/ledger/OpenView.h>
|
||||
#include <ripple/app/misc/CanonicalTXSet.h>
|
||||
#include <ripple/app/misc/IHashRouter.h>
|
||||
#include <ripple/app/misc/HashRouter.h>
|
||||
#include <ripple/basics/Log.h>
|
||||
#include <ripple/basics/UnorderedContainers.h>
|
||||
#include <ripple/core/Config.h>
|
||||
@@ -68,11 +68,27 @@ public:
|
||||
@param ledger A closed ledger
|
||||
*/
|
||||
explicit
|
||||
OpenLedger (std::shared_ptr<
|
||||
OpenLedger(std::shared_ptr<
|
||||
Ledger const> const& ledger,
|
||||
Config const& config, CachedSLEs& cache,
|
||||
beast::Journal journal);
|
||||
|
||||
/** Returns `true` if there are no transactions.
|
||||
|
||||
The behavior of ledger closing can be different
|
||||
depending on whether or not transactions exist
|
||||
in the open ledger.
|
||||
|
||||
@note The value returned is only meaningful for
|
||||
that specific instant in time. An open,
|
||||
empty ledger can become non empty from
|
||||
subsequent modifications. Caller is
|
||||
responsible for synchronizing the meaning of
|
||||
the return value.
|
||||
*/
|
||||
bool
|
||||
empty() const;
|
||||
|
||||
/** Returns a view to the current open ledger.
|
||||
|
||||
Thread safety:
|
||||
@@ -127,14 +143,16 @@ public:
|
||||
The current view is atomically set to the
|
||||
new open view.
|
||||
|
||||
@param rules The rules for the open ledger
|
||||
@param ledger A new closed ledger
|
||||
*/
|
||||
void
|
||||
accept(std::shared_ptr<Ledger const> const& ledger,
|
||||
OrderedTxs const& locals, bool retriesFirst,
|
||||
OrderedTxs& retries, ApplyFlags flags,
|
||||
IHashRouter& router,
|
||||
std::string const& suffix = "");
|
||||
accept (Application& app, Rules const& rules,
|
||||
std::shared_ptr<Ledger const> const& ledger,
|
||||
OrderedTxs const& locals, bool retriesFirst,
|
||||
OrderedTxs& retries, ApplyFlags flags,
|
||||
HashRouter& router,
|
||||
std::string const& suffix = "");
|
||||
|
||||
/** Algorithm for applying transactions.
|
||||
|
||||
@@ -144,10 +162,11 @@ public:
|
||||
template <class FwdRange>
|
||||
static
|
||||
void
|
||||
apply (OpenView& view, ReadView const& check,
|
||||
FwdRange const& txs, OrderedTxs& retries,
|
||||
ApplyFlags flags, IHashRouter& router,
|
||||
Config const& config, beast::Journal j);
|
||||
apply (Application& app, OpenView& view,
|
||||
ReadView const& check, FwdRange const& txs,
|
||||
OrderedTxs& retries, ApplyFlags flags,
|
||||
HashRouter& router, Config const& config,
|
||||
beast::Journal j);
|
||||
|
||||
private:
|
||||
enum Result
|
||||
@@ -158,36 +177,26 @@ private:
|
||||
};
|
||||
|
||||
std::shared_ptr<OpenView>
|
||||
create (std::shared_ptr<
|
||||
Ledger const> const& ledger);
|
||||
create (Rules const& rules,
|
||||
std::shared_ptr<Ledger const> const& ledger);
|
||||
|
||||
static
|
||||
Result
|
||||
apply_one (OpenView& view, std::shared_ptr<
|
||||
STTx const> const& tx, bool retry,
|
||||
ApplyFlags flags, IHashRouter& router,
|
||||
Config const& config, beast::Journal j);
|
||||
|
||||
public:
|
||||
//--------------------------------------------------------------------------
|
||||
//
|
||||
// TEST CODE
|
||||
//
|
||||
// Verify that the open ledger has the right contents
|
||||
// This is called while holding the master and ledger master mutexes
|
||||
bool
|
||||
verify (Ledger const& ledger,
|
||||
std::string const& suffix = "") const;
|
||||
apply_one (Application& app, OpenView& view,
|
||||
std::shared_ptr< STTx const> const& tx,
|
||||
bool retry, ApplyFlags flags,
|
||||
HashRouter& router, Config const& config,
|
||||
beast::Journal j);
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
template <class FwdRange>
|
||||
void
|
||||
OpenLedger::apply (OpenView& view,
|
||||
OpenLedger::apply (Application& app, OpenView& view,
|
||||
ReadView const& check, FwdRange const& txs,
|
||||
OrderedTxs& retries, ApplyFlags flags,
|
||||
IHashRouter& router, Config const& config,
|
||||
HashRouter& router, Config const& config,
|
||||
beast::Journal j)
|
||||
{
|
||||
for (auto iter = txs.begin();
|
||||
@@ -200,7 +209,7 @@ OpenLedger::apply (OpenView& view,
|
||||
auto const tx = *iter;
|
||||
if (check.txExists(tx->getTransactionID()))
|
||||
continue;
|
||||
auto const result = apply_one(view,
|
||||
auto const result = apply_one(app, view,
|
||||
tx, true, flags, router, config, j);
|
||||
if (result == Result::retry)
|
||||
retries.insert(tx);
|
||||
@@ -220,7 +229,7 @@ OpenLedger::apply (OpenView& view,
|
||||
auto iter = retries.begin();
|
||||
while (iter != retries.end())
|
||||
{
|
||||
switch (apply_one(view,
|
||||
switch (apply_one(app, view,
|
||||
iter->second, retry, flags,
|
||||
router, config, j))
|
||||
{
|
||||
|
||||
@@ -28,9 +28,11 @@
|
||||
|
||||
namespace ripple {
|
||||
|
||||
OrderBookDB::OrderBookDB (Stoppable& parent)
|
||||
OrderBookDB::OrderBookDB (Application& app, Stoppable& parent)
|
||||
: Stoppable ("OrderBookDB", parent)
|
||||
, app_ (app)
|
||||
, mSeq (0)
|
||||
, j_ (app.journal ("OrderBookDB"))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -40,7 +42,8 @@ void OrderBookDB::invalidate ()
|
||||
mSeq = 0;
|
||||
}
|
||||
|
||||
void OrderBookDB::setup (Ledger::ref ledger)
|
||||
void OrderBookDB::setup(
|
||||
std::shared_ptr<ReadView const> const& ledger)
|
||||
{
|
||||
{
|
||||
ScopedLockType sl (mLock);
|
||||
@@ -57,77 +60,74 @@ void OrderBookDB::setup (Ledger::ref ledger)
|
||||
return;
|
||||
}
|
||||
|
||||
WriteLog (lsDEBUG, OrderBookDB)
|
||||
JLOG (j_.debug)
|
||||
<< "Advancing from " << mSeq << " to " << seq;
|
||||
|
||||
mSeq = seq;
|
||||
}
|
||||
|
||||
if (getConfig().RUN_STANDALONE)
|
||||
if (app_.config().RUN_STANDALONE)
|
||||
update(ledger);
|
||||
else
|
||||
getApp().getJobQueue().addJob(jtUPDATE_PF, "OrderBookDB::update",
|
||||
std::bind(&OrderBookDB::update, this, ledger));
|
||||
app_.getJobQueue().addJob(
|
||||
jtUPDATE_PF, "OrderBookDB::update",
|
||||
[this, ledger] (Job&) { update(ledger); });
|
||||
}
|
||||
|
||||
static void updateHelper (SLE::ref entry,
|
||||
hash_set< uint256 >& seen,
|
||||
OrderBookDB::IssueToOrderBook& destMap,
|
||||
OrderBookDB::IssueToOrderBook& sourceMap,
|
||||
hash_set< Issue >& XRPBooks,
|
||||
int& books)
|
||||
{
|
||||
if (entry->getType () == ltDIR_NODE &&
|
||||
entry->isFieldPresent (sfExchangeRate) &&
|
||||
entry->getFieldH256 (sfRootIndex) == entry->getIndex())
|
||||
{
|
||||
Book book;
|
||||
book.in.currency.copyFrom (entry->getFieldH160 (sfTakerPaysCurrency));
|
||||
book.in.account.copyFrom (entry->getFieldH160 (sfTakerPaysIssuer));
|
||||
book.out.account.copyFrom (entry->getFieldH160 (sfTakerGetsIssuer));
|
||||
book.out.currency.copyFrom (entry->getFieldH160 (sfTakerGetsCurrency));
|
||||
|
||||
uint256 index = getBookBase (book);
|
||||
if (seen.insert (index).second)
|
||||
{
|
||||
auto orderBook = std::make_shared<OrderBook> (index, book);
|
||||
sourceMap[book.in].push_back (orderBook);
|
||||
destMap[book.out].push_back (orderBook);
|
||||
if (isXRP(book.out))
|
||||
XRPBooks.insert(book.in);
|
||||
++books;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void OrderBookDB::update (Ledger::pointer ledger)
|
||||
void OrderBookDB::update(
|
||||
std::shared_ptr<ReadView const> const& ledger)
|
||||
{
|
||||
hash_set< uint256 > seen;
|
||||
OrderBookDB::IssueToOrderBook destMap;
|
||||
OrderBookDB::IssueToOrderBook sourceMap;
|
||||
hash_set< Issue > XRPBooks;
|
||||
|
||||
WriteLog (lsDEBUG, OrderBookDB) << "OrderBookDB::update>";
|
||||
JLOG (j_.debug) << "OrderBookDB::update>";
|
||||
|
||||
// walk through the entire ledger looking for orderbook entries
|
||||
int books = 0;
|
||||
|
||||
try
|
||||
{
|
||||
ledger->visitStateItems(std::bind(&updateHelper, std::placeholders::_1,
|
||||
std::ref(seen), std::ref(destMap),
|
||||
std::ref(sourceMap), std::ref(XRPBooks), std::ref(books)));
|
||||
for(auto& sle : ledger->sles)
|
||||
{
|
||||
if (sle->getType () == ltDIR_NODE &&
|
||||
sle->isFieldPresent (sfExchangeRate) &&
|
||||
sle->getFieldH256 (sfRootIndex) == sle->getIndex())
|
||||
{
|
||||
Book book;
|
||||
book.in.currency.copyFrom(sle->getFieldH160(
|
||||
sfTakerPaysCurrency));
|
||||
book.in.account.copyFrom(sle->getFieldH160 (
|
||||
sfTakerPaysIssuer));
|
||||
book.out.account.copyFrom(sle->getFieldH160(
|
||||
sfTakerGetsIssuer));
|
||||
book.out.currency.copyFrom (sle->getFieldH160(
|
||||
sfTakerGetsCurrency));
|
||||
|
||||
uint256 index = getBookBase (book);
|
||||
if (seen.insert (index).second)
|
||||
{
|
||||
auto orderBook = std::make_shared<OrderBook> (index, book);
|
||||
sourceMap[book.in].push_back (orderBook);
|
||||
destMap[book.out].push_back (orderBook);
|
||||
if (isXRP(book.out))
|
||||
XRPBooks.insert(book.in);
|
||||
++books;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (const SHAMapMissingNode&)
|
||||
{
|
||||
WriteLog (lsINFO, OrderBookDB)
|
||||
JLOG (j_.info)
|
||||
<< "OrderBookDB::update encountered a missing node";
|
||||
ScopedLockType sl (mLock);
|
||||
mSeq = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
WriteLog (lsDEBUG, OrderBookDB)
|
||||
JLOG (j_.debug)
|
||||
<< "OrderBookDB::update< " << books << " books found";
|
||||
{
|
||||
ScopedLockType sl (mLock);
|
||||
@@ -136,7 +136,7 @@ void OrderBookDB::update (Ledger::pointer ledger)
|
||||
mSourceMap.swap(sourceMap);
|
||||
mDestMap.swap(destMap);
|
||||
}
|
||||
getApp().getLedgerMaster().newOrderBookDB();
|
||||
app_.getLedgerMaster().newOrderBookDB();
|
||||
}
|
||||
|
||||
void OrderBookDB::addOrderBook(Book const& book)
|
||||
@@ -225,7 +225,8 @@ BookListeners::pointer OrderBookDB::getBookListeners (Book const& book)
|
||||
// Based on the meta, send the meta to the streams that are listening.
|
||||
// We need to determine which streams a given meta effects.
|
||||
void OrderBookDB::processTxn (
|
||||
Ledger::ref ledger, const AcceptedLedgerTx& alTx, Json::Value const& jvObj)
|
||||
std::shared_ptr<ReadView const> const& ledger,
|
||||
const AcceptedLedgerTx& alTx, Json::Value const& jvObj)
|
||||
{
|
||||
ScopedLockType sl (mLock);
|
||||
|
||||
@@ -271,7 +272,7 @@ void OrderBookDB::processTxn (
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
WriteLog (lsINFO, OrderBookDB)
|
||||
JLOG (j_.info)
|
||||
<< "Fields not found in OrderBookDB::processTxn";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
#include <ripple/app/ledger/AcceptedLedgerTx.h>
|
||||
#include <ripple/app/ledger/BookListeners.h>
|
||||
#include <ripple/app/main/Application.h>
|
||||
#include <ripple/app/misc/OrderBook.h>
|
||||
|
||||
namespace ripple {
|
||||
@@ -30,10 +31,10 @@ class OrderBookDB
|
||||
: public beast::Stoppable
|
||||
{
|
||||
public:
|
||||
explicit OrderBookDB (Stoppable& parent);
|
||||
OrderBookDB (Application& app, Stoppable& parent);
|
||||
|
||||
void setup (Ledger::ref ledger);
|
||||
void update (Ledger::pointer ledger);
|
||||
void setup (std::shared_ptr<ReadView const> const& ledger);
|
||||
void update (std::shared_ptr<ReadView const> const& ledger);
|
||||
void invalidate ();
|
||||
|
||||
void addOrderBook(Book const&);
|
||||
@@ -42,8 +43,8 @@ public:
|
||||
*/
|
||||
OrderBook::List getBooksByTakerPays (Issue const&);
|
||||
|
||||
/** @return a count of all orderbooks that want this issuerID and currencyID.
|
||||
*/
|
||||
/** @return a count of all orderbooks that want this issuerID and
|
||||
currencyID. */
|
||||
int getBookSize(Issue const&);
|
||||
|
||||
bool isBookToXRP (Issue const&);
|
||||
@@ -53,14 +54,16 @@ public:
|
||||
|
||||
// see if this txn effects any orderbook
|
||||
void processTxn (
|
||||
Ledger::ref ledger, const AcceptedLedgerTx& alTx,
|
||||
Json::Value const& jvObj);
|
||||
std::shared_ptr<ReadView const> const& ledger,
|
||||
const AcceptedLedgerTx& alTx, Json::Value const& jvObj);
|
||||
|
||||
using IssueToOrderBook = hash_map <Issue, OrderBook::List>;
|
||||
|
||||
private:
|
||||
void rawAddBook(Book const&);
|
||||
|
||||
Application& app_;
|
||||
|
||||
// by ci/ii
|
||||
IssueToOrderBook mSourceMap;
|
||||
|
||||
@@ -79,6 +82,8 @@ private:
|
||||
BookToListenersMap mListeners;
|
||||
|
||||
std::uint32_t mSeq;
|
||||
|
||||
beast::Journal j_;
|
||||
};
|
||||
|
||||
} // ripple
|
||||
|
||||
@@ -28,6 +28,11 @@
|
||||
|
||||
namespace ripple {
|
||||
|
||||
TransactionStateSF::TransactionStateSF(Application& app)
|
||||
: app_ (app)
|
||||
{
|
||||
}
|
||||
|
||||
// VFALCO This might be better as Blob&&
|
||||
void TransactionStateSF::gotNode (bool fromFilter,
|
||||
SHAMapNodeID const& id,
|
||||
@@ -40,7 +45,7 @@ void TransactionStateSF::gotNode (bool fromFilter,
|
||||
// and this should use that Database instad of getNodeStore
|
||||
assert(type !=
|
||||
SHAMapTreeNode::tnTRANSACTION_NM);
|
||||
getApp().getNodeStore().store(
|
||||
app_.getNodeStore().store(
|
||||
hotTRANSACTION_NODE,
|
||||
std::move (nodeData), nodeHash);
|
||||
}
|
||||
@@ -49,7 +54,7 @@ bool TransactionStateSF::haveNode (SHAMapNodeID const& id,
|
||||
uint256 const& nodeHash,
|
||||
Blob& nodeData)
|
||||
{
|
||||
return getApp().getLedgerMaster ().getFetchPack (nodeHash, nodeData);
|
||||
return app_.getLedgerMaster ().getFetchPack (nodeHash, nodeData);
|
||||
}
|
||||
|
||||
} // ripple
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#ifndef RIPPLE_APP_LEDGER_TRANSACTIONSTATESF_H_INCLUDED
|
||||
#define RIPPLE_APP_LEDGER_TRANSACTIONSTATESF_H_INCLUDED
|
||||
|
||||
#include <ripple/app/main/Application.h>
|
||||
#include <ripple/shamap/SHAMapSyncFilter.h>
|
||||
#include <cstdint>
|
||||
|
||||
@@ -30,8 +31,12 @@ namespace ripple {
|
||||
class TransactionStateSF
|
||||
: public SHAMapSyncFilter
|
||||
{
|
||||
private:
|
||||
Application& app_;
|
||||
|
||||
public:
|
||||
TransactionStateSF() = default;
|
||||
explicit
|
||||
TransactionStateSF(Application& app);
|
||||
|
||||
// Note that the nodeData is overwritten by this call
|
||||
void gotNode (bool fromFilter,
|
||||
|
||||
@@ -21,15 +21,15 @@
|
||||
#include <ripple/app/ledger/LedgerTiming.h>
|
||||
#include <ripple/app/ledger/impl/ConsensusImp.h>
|
||||
#include <ripple/app/ledger/impl/LedgerConsensusImp.h>
|
||||
#include <ripple/basics/Log.h>
|
||||
#include <beast/utility/Journal.h>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
ConsensusImp::ConsensusImp ()
|
||||
: journal_ (deprecatedLogs().journal("Consensus"))
|
||||
, feeVote_ (make_FeeVote (setup_FeeVote (getConfig().section ("voting")),
|
||||
deprecatedLogs().journal("FeeVote")))
|
||||
ConsensusImp::ConsensusImp (
|
||||
FeeVote::Setup const& voteSetup,
|
||||
Logs& logs)
|
||||
: journal_ (logs.journal("Consensus"))
|
||||
, feeVote_ (make_FeeVote (voteSetup,
|
||||
logs.journal("FeeVote")))
|
||||
, proposing_ (false)
|
||||
, validating_ (false)
|
||||
, lastCloseProposers_ (0)
|
||||
@@ -65,6 +65,7 @@ ConsensusImp::getLastCloseDuration () const
|
||||
|
||||
std::shared_ptr<LedgerConsensus>
|
||||
ConsensusImp::startRound (
|
||||
Application& app,
|
||||
InboundTransactions& inboundTransactions,
|
||||
LocalTxs& localtx,
|
||||
LedgerMaster& ledgerMaster,
|
||||
@@ -72,7 +73,7 @@ ConsensusImp::startRound (
|
||||
Ledger::ref previousLedger,
|
||||
std::uint32_t closeTime)
|
||||
{
|
||||
return make_LedgerConsensus (*this, lastCloseProposers_,
|
||||
return make_LedgerConsensus (app, *this, lastCloseProposers_,
|
||||
lastCloseConvergeTook_, inboundTransactions, localtx, ledgerMaster,
|
||||
prevLCLHash, previousLedger, closeTime, *feeVote_);
|
||||
}
|
||||
@@ -173,9 +174,11 @@ ConsensusImp::peekStoredProposals ()
|
||||
//==============================================================================
|
||||
|
||||
std::unique_ptr<Consensus>
|
||||
make_Consensus ()
|
||||
make_Consensus (Config const& config, Logs& logs)
|
||||
{
|
||||
return std::make_unique<ConsensusImp> ();
|
||||
return std::make_unique<ConsensusImp> (
|
||||
setup_FeeVote (config.section ("voting")),
|
||||
logs);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <ripple/app/ledger/Consensus.h>
|
||||
#include <ripple/app/ledger/LedgerConsensus.h>
|
||||
#include <ripple/app/misc/FeeVote.h>
|
||||
#include <ripple/basics/Log.h>
|
||||
#include <ripple/protocol/STValidation.h>
|
||||
#include <ripple/shamap/SHAMap.h>
|
||||
#include <beast/utility/Journal.h>
|
||||
@@ -35,7 +36,7 @@ class ConsensusImp
|
||||
: public Consensus
|
||||
{
|
||||
public:
|
||||
ConsensusImp ();
|
||||
ConsensusImp (FeeVote::Setup const& voteSetup, Logs& logs);
|
||||
|
||||
~ConsensusImp () = default;
|
||||
|
||||
@@ -53,6 +54,7 @@ public:
|
||||
|
||||
std::shared_ptr<LedgerConsensus>
|
||||
startRound (
|
||||
Application& app,
|
||||
InboundTransactions& inboundTransactions,
|
||||
LocalTxs& localtx,
|
||||
LedgerMaster& ledgerMaster,
|
||||
|
||||
@@ -35,13 +35,13 @@ void DisputedTx::setVote (NodeID const& peer, bool votesYes)
|
||||
{
|
||||
if (votesYes)
|
||||
{
|
||||
WriteLog (lsDEBUG, LedgerConsensus)
|
||||
JLOG (j_.debug)
|
||||
<< "Peer " << peer << " votes YES on " << mTransactionID;
|
||||
++mYays;
|
||||
}
|
||||
else
|
||||
{
|
||||
WriteLog (lsDEBUG, LedgerConsensus)
|
||||
JLOG (j_.debug)
|
||||
<< "Peer " << peer << " votes NO on " << mTransactionID;
|
||||
++mNays;
|
||||
}
|
||||
@@ -49,7 +49,7 @@ void DisputedTx::setVote (NodeID const& peer, bool votesYes)
|
||||
// changes vote to yes
|
||||
else if (votesYes && !res.first->second)
|
||||
{
|
||||
WriteLog (lsDEBUG, LedgerConsensus)
|
||||
JLOG (j_.debug)
|
||||
<< "Peer " << peer << " now votes YES on " << mTransactionID;
|
||||
--mNays;
|
||||
++mYays;
|
||||
@@ -58,8 +58,8 @@ void DisputedTx::setVote (NodeID const& peer, bool votesYes)
|
||||
// changes vote to no
|
||||
else if (!votesYes && res.first->second)
|
||||
{
|
||||
WriteLog (lsDEBUG, LedgerConsensus) << "Peer " << peer
|
||||
<< " now votes NO on " << mTransactionID;
|
||||
JLOG (j_.debug)
|
||||
<< "Peer " << peer << " now votes NO on " << mTransactionID;
|
||||
++mNays;
|
||||
--mYays;
|
||||
res.first->second = false;
|
||||
@@ -124,18 +124,18 @@ bool DisputedTx::updateVote (int percentTime, bool proposing)
|
||||
|
||||
if (newPosition == mOurVote)
|
||||
{
|
||||
WriteLog (lsINFO, LedgerConsensus)
|
||||
JLOG (j_.info)
|
||||
<< "No change (" << (mOurVote ? "YES" : "NO") << ") : weight "
|
||||
<< weight << ", percent " << percentTime;
|
||||
WriteLog (lsDEBUG, LedgerConsensus) << getJson ();
|
||||
JLOG (j_.debug) << getJson ();
|
||||
return false;
|
||||
}
|
||||
|
||||
mOurVote = newPosition;
|
||||
WriteLog (lsDEBUG, LedgerConsensus)
|
||||
JLOG (j_.debug)
|
||||
<< "We now vote " << (mOurVote ? "YES" : "NO")
|
||||
<< " on " << mTransactionID;
|
||||
WriteLog (lsDEBUG, LedgerConsensus) << getJson ();
|
||||
JLOG (j_.debug) << getJson ();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <ripple/protocol/UintTypes.h>
|
||||
#include <ripple/protocol/Serializer.h>
|
||||
#include <ripple/basics/base_uint.h>
|
||||
#include <beast/utility/Journal.h>
|
||||
#include <memory>
|
||||
|
||||
namespace ripple {
|
||||
@@ -40,12 +41,13 @@ class DisputedTx
|
||||
public:
|
||||
// VFALCO `Blob` is a poor choice of parameter
|
||||
DisputedTx (uint256 const& txID,
|
||||
Blob const& tx, bool ourVote)
|
||||
Blob const& tx, bool ourVote, beast::Journal j)
|
||||
: mTransactionID (txID)
|
||||
, mYays (0)
|
||||
, mNays (0)
|
||||
, mOurVote (ourVote)
|
||||
, transaction (tx.data(), tx.size())
|
||||
, j_ (j)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -71,8 +73,8 @@ public:
|
||||
mOurVote = o;
|
||||
}
|
||||
|
||||
// VFALCO NOTE its not really a peer, its the 160 bit hash of the validator's public key
|
||||
//
|
||||
// VFALCO NOTE its not really a peer, its the 160 bit hash of the
|
||||
// validator's public key.
|
||||
void setVote (NodeID const& peer, bool votesYes);
|
||||
void unVote (NodeID const& peer);
|
||||
|
||||
@@ -88,6 +90,7 @@ private:
|
||||
Serializer transaction;
|
||||
|
||||
hash_map <NodeID, bool> mVotes;
|
||||
beast::Journal j_;
|
||||
};
|
||||
|
||||
} // ripple
|
||||
|
||||
@@ -57,10 +57,10 @@ enum
|
||||
,fetchSmallNodes = 32
|
||||
};
|
||||
|
||||
InboundLedger::InboundLedger (uint256 const& hash, std::uint32_t seq, fcReason reason,
|
||||
clock_type& clock)
|
||||
: PeerSet (hash, ledgerAcquireTimeoutMillis, false, clock,
|
||||
deprecatedLogs().journal("InboundLedger"))
|
||||
InboundLedger::InboundLedger (
|
||||
Application& app, uint256 const& hash, std::uint32_t seq, fcReason reason, clock_type& clock)
|
||||
: PeerSet (app, hash, ledgerAcquireTimeoutMillis, false, clock,
|
||||
app.journal("InboundLedger"))
|
||||
, mHaveHeader (false)
|
||||
, mHaveState (false)
|
||||
, mHaveTransactions (false)
|
||||
@@ -72,7 +72,7 @@ InboundLedger::InboundLedger (uint256 const& hash, std::uint32_t seq, fcReason r
|
||||
, mReceiveDispatched (false)
|
||||
{
|
||||
|
||||
if (m_journal.trace) m_journal.trace <<
|
||||
JLOG (m_journal.trace) <<
|
||||
"Acquiring ledger " << mHash;
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ InboundLedger::~InboundLedger ()
|
||||
for (auto& entry : mReceivedData)
|
||||
{
|
||||
if (entry.second->type () == protocol::liAS_NODE)
|
||||
getApp().getInboundLedgers().gotStaleData(entry.second);
|
||||
app_.getInboundLedgers().gotStaleData(entry.second);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -129,14 +129,18 @@ void InboundLedger::init (ScopedLockType& collectionLock)
|
||||
if (m_journal.debug) m_journal.debug <<
|
||||
"Acquiring ledger we already have locally: " << getHash ();
|
||||
mLedger->setClosed ();
|
||||
mLedger->setImmutable ();
|
||||
mLedger->setImmutable (app_.config());
|
||||
|
||||
if (mReason != fcHISTORY)
|
||||
getApp ().getLedgerMaster ().storeLedger (mLedger);
|
||||
app_.getLedgerMaster ().storeLedger (mLedger);
|
||||
|
||||
// Check if this could be a newer fully-validated ledger
|
||||
if ((mReason == fcVALIDATION) || (mReason == fcCURRENT) || (mReason == fcCONSENSUS))
|
||||
getApp ().getLedgerMaster ().checkAccept (mLedger);
|
||||
if (mReason == fcVALIDATION ||
|
||||
mReason == fcCURRENT ||
|
||||
mReason == fcCONSENSUS)
|
||||
{
|
||||
app_.getLedgerMaster ().checkAccept (mLedger);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,26 +154,28 @@ bool InboundLedger::tryLocal ()
|
||||
if (!mHaveHeader)
|
||||
{
|
||||
// Nothing we can do without the ledger header
|
||||
std::shared_ptr<NodeObject> node = getApp().getNodeStore ().fetch (mHash);
|
||||
auto node = app_.getNodeStore ().fetch (mHash);
|
||||
|
||||
if (!node)
|
||||
{
|
||||
Blob data;
|
||||
|
||||
if (!getApp().getLedgerMaster ().getFetchPack (mHash, data))
|
||||
if (!app_.getLedgerMaster ().getFetchPack (mHash, data))
|
||||
return false;
|
||||
|
||||
if (m_journal.trace) m_journal.trace <<
|
||||
"Ledger header found in fetch pack";
|
||||
mLedger = std::make_shared<Ledger> (
|
||||
data.data(), data.size(), true, getConfig());
|
||||
getApp().getNodeStore ().store (
|
||||
data.data(), data.size(), true,
|
||||
app_.config(), app_.family());
|
||||
app_.getNodeStore ().store (
|
||||
hotLEDGER, std::move (data), mHash);
|
||||
}
|
||||
else
|
||||
{
|
||||
mLedger = std::make_shared<Ledger>(
|
||||
node->getData().data(), node->getData().size(), true, getConfig());
|
||||
node->getData().data(), node->getData().size(),
|
||||
true, app_.config(), app_.family());
|
||||
}
|
||||
|
||||
if (mLedger->getHash () != mHash)
|
||||
@@ -194,7 +200,7 @@ bool InboundLedger::tryLocal ()
|
||||
}
|
||||
else
|
||||
{
|
||||
TransactionStateSF filter;
|
||||
TransactionStateSF filter(app_);
|
||||
|
||||
if (mLedger->txMap().fetchRoot (
|
||||
mLedger->info().txHash, &filter))
|
||||
@@ -222,7 +228,7 @@ bool InboundLedger::tryLocal ()
|
||||
}
|
||||
else
|
||||
{
|
||||
AccountStateSF filter;
|
||||
AccountStateSF filter(app_);
|
||||
|
||||
if (mLedger->stateMap().fetchRoot (
|
||||
mLedger->info().accountHash, &filter))
|
||||
@@ -245,7 +251,7 @@ bool InboundLedger::tryLocal ()
|
||||
"Had everything locally";
|
||||
mComplete = true;
|
||||
mLedger->setClosed ();
|
||||
mLedger->setImmutable ();
|
||||
mLedger->setImmutable (app_.config());
|
||||
}
|
||||
|
||||
return mComplete;
|
||||
@@ -289,7 +295,7 @@ void InboundLedger::onTimer (bool wasProgress, ScopedLockType&)
|
||||
mByHash = true;
|
||||
|
||||
std::size_t pc = getPeerCount ();
|
||||
WriteLog (lsDEBUG, InboundLedger) <<
|
||||
JLOG (m_journal.debug) <<
|
||||
"No progress(" << pc <<
|
||||
") for ledger " << mHash;
|
||||
|
||||
@@ -308,7 +314,7 @@ void InboundLedger::onTimer (bool wasProgress, ScopedLockType&)
|
||||
/** Add more peers to the set, if possible */
|
||||
void InboundLedger::addPeers ()
|
||||
{
|
||||
getApp().overlay().selectPeers (*this,
|
||||
app_.overlay().selectPeers (*this,
|
||||
(getPeerCount() > 0) ? peerCountStart : peerCountAdd,
|
||||
ScoreHasLedger (getHash(), mSeq));
|
||||
}
|
||||
@@ -321,17 +327,16 @@ std::weak_ptr<PeerSet> InboundLedger::pmDowncast ()
|
||||
/** Dispatch acquire completion
|
||||
*/
|
||||
static void LADispatch (
|
||||
Job& job,
|
||||
InboundLedger::pointer la,
|
||||
std::vector< std::function<void (InboundLedger::pointer)> > trig)
|
||||
{
|
||||
if (la->isComplete() && !la->isFailed())
|
||||
{
|
||||
getApp().getLedgerMaster().checkAccept(la->getLedger());
|
||||
getApp().getLedgerMaster().tryAdvance();
|
||||
la->app().getLedgerMaster().checkAccept(la->getLedger());
|
||||
la->app().getLedgerMaster().tryAdvance();
|
||||
}
|
||||
else
|
||||
getApp().getInboundLedgers().logFailure (la->getHash(), la->getSeq());
|
||||
la->app().getInboundLedgers().logFailure (la->getHash(), la->getSeq());
|
||||
|
||||
for (unsigned int i = 0; i < trig.size (); ++i)
|
||||
trig[i] (la);
|
||||
@@ -359,16 +364,17 @@ void InboundLedger::done ()
|
||||
if (isComplete () && !isFailed () && mLedger)
|
||||
{
|
||||
mLedger->setClosed ();
|
||||
mLedger->setImmutable ();
|
||||
mLedger->setImmutable (app_.config());
|
||||
if (mReason != fcHISTORY)
|
||||
getApp().getLedgerMaster ().storeLedger (mLedger);
|
||||
getApp().getInboundLedgers().onLedgerFetched(mReason);
|
||||
app_.getLedgerMaster ().storeLedger (mLedger);
|
||||
app_.getInboundLedgers().onLedgerFetched(mReason);
|
||||
}
|
||||
|
||||
// We hold the PeerSet lock, so must dispatch
|
||||
getApp().getJobQueue ().addJob (jtLEDGER_DATA, "triggers",
|
||||
std::bind (LADispatch, std::placeholders::_1, shared_from_this (),
|
||||
triggers));
|
||||
auto that = shared_from_this ();
|
||||
app_.getJobQueue ().addJob (
|
||||
jtLEDGER_DATA, "triggers",
|
||||
[that, triggers] (Job&) { LADispatch(that, triggers); });
|
||||
}
|
||||
|
||||
bool InboundLedger::addOnComplete (
|
||||
@@ -466,11 +472,11 @@ void InboundLedger::trigger (Peer::ptr const& peer)
|
||||
Message::pointer packet (std::make_shared <Message> (
|
||||
tmBH, protocol::mtGET_OBJECTS));
|
||||
{
|
||||
for (PeerSetMap::iterator it = mPeers.begin (), end = mPeers.end ();
|
||||
it != end; ++it)
|
||||
for (auto it = mPeers.begin (), end = mPeers .end ();
|
||||
it != end; ++it)
|
||||
{
|
||||
Peer::ptr iPeer (
|
||||
getApp().overlay ().findPeerByShortID (it->first));
|
||||
app_.overlay ().findPeerByShortID (it->first));
|
||||
|
||||
if (iPeer)
|
||||
{
|
||||
@@ -499,8 +505,9 @@ void InboundLedger::trigger (Peer::ptr const& peer)
|
||||
if (!mHaveHeader && !mFailed)
|
||||
{
|
||||
tmGL.set_itype (protocol::liBASE);
|
||||
if (m_journal.trace) m_journal.trace <<
|
||||
"Sending header request to " << (peer ? "selected peer" : "all peers");
|
||||
if (m_journal.trace) m_journal.trace
|
||||
<< "Sending header request to "
|
||||
<< (peer ? "selected peer" : "all peers");
|
||||
sendRequest (tmGL, peer);
|
||||
return;
|
||||
}
|
||||
@@ -529,8 +536,9 @@ void InboundLedger::trigger (Peer::ptr const& peer)
|
||||
// we need the root node
|
||||
tmGL.set_itype (protocol::liAS_NODE);
|
||||
*tmGL.add_nodeids () = SHAMapNodeID ().getRawString ();
|
||||
if (m_journal.trace) m_journal.trace <<
|
||||
"Sending AS root request to " << (peer ? "selected peer" : "all peers");
|
||||
if (m_journal.trace) m_journal.trace
|
||||
<< "Sending AS root request to "
|
||||
<< (peer ? "selected peer" : "all peers");
|
||||
sendRequest (tmGL, peer);
|
||||
return;
|
||||
}
|
||||
@@ -541,7 +549,7 @@ void InboundLedger::trigger (Peer::ptr const& peer)
|
||||
// VFALCO Why 256? Make this a constant
|
||||
nodeIDs.reserve (256);
|
||||
nodeHashes.reserve (256);
|
||||
AccountStateSF filter;
|
||||
AccountStateSF filter(app_);
|
||||
|
||||
// Release the lock while we process the large state map
|
||||
sl.unlock();
|
||||
@@ -587,8 +595,8 @@ void InboundLedger::trigger (Peer::ptr const& peer)
|
||||
"Sending AS node " << nodeIDs.size () <<
|
||||
" request to " << (
|
||||
peer ? "selected peer" : "all peers");
|
||||
if (nodeIDs.size () == 1 && m_journal.trace) m_journal.trace <<
|
||||
"AS node: " << nodeIDs[0];
|
||||
if (nodeIDs.size () == 1 && m_journal.trace)
|
||||
m_journal.trace << "AS node: " << nodeIDs[0];
|
||||
sendRequest (tmGL, peer);
|
||||
return;
|
||||
}
|
||||
@@ -625,7 +633,7 @@ void InboundLedger::trigger (Peer::ptr const& peer)
|
||||
std::vector<uint256> nodeHashes;
|
||||
nodeIDs.reserve (256);
|
||||
nodeHashes.reserve (256);
|
||||
TransactionStateSF filter;
|
||||
TransactionStateSF filter(app_);
|
||||
mLedger->txMap().getMissingNodes (
|
||||
nodeIDs, nodeHashes, 256, &filter);
|
||||
|
||||
@@ -762,7 +770,8 @@ bool InboundLedger::takeHeader (std::string const& data)
|
||||
return true;
|
||||
|
||||
mLedger = std::make_shared<Ledger>(
|
||||
data.data(), data.size(), false, getConfig());
|
||||
data.data(), data.size(), false,
|
||||
app_.config(), app_.family());
|
||||
|
||||
if (mLedger->getHash () != mHash)
|
||||
{
|
||||
@@ -779,7 +788,7 @@ bool InboundLedger::takeHeader (std::string const& data)
|
||||
Serializer s (data.size () + 4);
|
||||
s.add32 (HashPrefix::ledgerMaster);
|
||||
s.addRaw (data.data(), data.size());
|
||||
getApp().getNodeStore ().store (
|
||||
app_.getNodeStore ().store (
|
||||
hotLEDGER, std::move (s.modData ()), mHash);
|
||||
|
||||
progress ();
|
||||
@@ -816,7 +825,7 @@ bool InboundLedger::takeTxNode (const std::vector<SHAMapNodeID>& nodeIDs,
|
||||
|
||||
auto nodeIDit = nodeIDs.cbegin ();
|
||||
auto nodeDatait = data.begin ();
|
||||
TransactionStateSF tFilter;
|
||||
TransactionStateSF tFilter(app_);
|
||||
|
||||
while (nodeIDit != nodeIDs.cend ())
|
||||
{
|
||||
@@ -883,7 +892,7 @@ bool InboundLedger::takeAsNode (const std::vector<SHAMapNodeID>& nodeIDs,
|
||||
|
||||
auto nodeIDit = nodeIDs.cbegin ();
|
||||
auto nodeDatait = data.begin ();
|
||||
AccountStateSF tFilter;
|
||||
AccountStateSF tFilter(app_);
|
||||
|
||||
while (nodeIDit != nodeIDs.cend ())
|
||||
{
|
||||
@@ -947,7 +956,7 @@ bool InboundLedger::takeAsRootNode (Blob const& data, SHAMapAddNode& san)
|
||||
return false;
|
||||
}
|
||||
|
||||
AccountStateSF tFilter;
|
||||
AccountStateSF tFilter(app_);
|
||||
san += mLedger->stateMap().addRootNode (
|
||||
mLedger->info().accountHash, data, snfWIRE, &tFilter);
|
||||
return san.isGood();
|
||||
@@ -971,7 +980,7 @@ bool InboundLedger::takeTxRootNode (Blob const& data, SHAMapAddNode& san)
|
||||
return false;
|
||||
}
|
||||
|
||||
TransactionStateSF tFilter;
|
||||
TransactionStateSF tFilter(app_);
|
||||
san += mLedger->txMap().addRootNode (
|
||||
mLedger->info().txHash, data, snfWIRE, &tFilter);
|
||||
return san.isGood();
|
||||
@@ -990,7 +999,7 @@ std::vector<InboundLedger::neededHash_t> InboundLedger::getNeededHashes ()
|
||||
|
||||
if (!mHaveState)
|
||||
{
|
||||
AccountStateSF filter;
|
||||
AccountStateSF filter(app_);
|
||||
// VFALCO NOTE What's the number 4?
|
||||
for (auto const& h : mLedger->getNeededAccountStateHashes (4, &filter))
|
||||
{
|
||||
@@ -1001,7 +1010,7 @@ std::vector<InboundLedger::neededHash_t> InboundLedger::getNeededHashes ()
|
||||
|
||||
if (!mHaveTransactions)
|
||||
{
|
||||
TransactionStateSF filter;
|
||||
TransactionStateSF filter(app_);
|
||||
// VFALCO NOTE What's the number 4?
|
||||
for (auto const& h : mLedger->getNeededTransactionHashes (4, &filter))
|
||||
{
|
||||
|
||||
@@ -37,26 +37,31 @@ class InboundLedgersImp
|
||||
, public beast::Stoppable
|
||||
{
|
||||
private:
|
||||
Application& app_;
|
||||
std::mutex fetchRateMutex_;
|
||||
// measures ledgers per second, constants are important
|
||||
DecayWindow<30, clock_type> fetchRate_;
|
||||
beast::Journal j_;
|
||||
|
||||
public:
|
||||
using u256_acq_pair = std::pair<uint256, InboundLedger::pointer>;
|
||||
// How long before we try again to acquire the same ledger
|
||||
static const std::chrono::minutes kReacquireInterval;
|
||||
|
||||
InboundLedgersImp (clock_type& clock, Stoppable& parent,
|
||||
InboundLedgersImp (Application& app, clock_type& clock, Stoppable& parent,
|
||||
beast::insight::Collector::ptr const& collector)
|
||||
: Stoppable ("InboundLedgers", parent)
|
||||
, app_ (app)
|
||||
, fetchRate_(clock.now())
|
||||
, j_ (app.journal ("InboundLedger"))
|
||||
, m_clock (clock)
|
||||
, mRecentFailures (clock)
|
||||
, mCounter(collector->make_counter("ledger_fetches"))
|
||||
{
|
||||
}
|
||||
|
||||
Ledger::pointer acquire (uint256 const& hash, std::uint32_t seq, InboundLedger::fcReason reason)
|
||||
Ledger::pointer acquire (
|
||||
uint256 const& hash, std::uint32_t seq, InboundLedger::fcReason reason)
|
||||
{
|
||||
assert (hash.isNonZero ());
|
||||
bool isNew = true;
|
||||
@@ -74,7 +79,7 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
inbound = std::make_shared <InboundLedger> (
|
||||
inbound = std::make_shared <InboundLedger> (app_,
|
||||
hash, seq, reason, std::ref (m_clock));
|
||||
mLedgers.emplace (hash, inbound);
|
||||
inbound->init (sl);
|
||||
@@ -99,7 +104,8 @@ public:
|
||||
{
|
||||
ScopedLockType sl (mLock);
|
||||
|
||||
hash_map<uint256, InboundLedger::pointer>::iterator it = mLedgers.find (hash);
|
||||
auto it = mLedgers.
|
||||
find (hash);
|
||||
if (it != mLedgers.end ())
|
||||
{
|
||||
ret = it->second;
|
||||
@@ -147,19 +153,24 @@ public:
|
||||
{
|
||||
protocol::TMLedgerData& packet = *packet_ptr;
|
||||
|
||||
WriteLog (lsTRACE, InboundLedger) << "Got data (" << packet.nodes ().size () << ") for acquiring ledger: " << hash;
|
||||
JLOG (j_.trace)
|
||||
<< "Got data (" << packet.nodes ().size ()
|
||||
<< ") for acquiring ledger: " << hash;
|
||||
|
||||
InboundLedger::pointer ledger = find (hash);
|
||||
|
||||
if (!ledger)
|
||||
{
|
||||
WriteLog (lsTRACE, InboundLedger) << "Got data for ledger we're no longer acquiring";
|
||||
JLOG (j_.trace)
|
||||
<< "Got data for ledger we're no longer acquiring";
|
||||
|
||||
// If it's state node data, stash it because it still might be useful
|
||||
// If it's state node data, stash it because it still might be
|
||||
// useful.
|
||||
if (packet.type () == protocol::liAS_NODE)
|
||||
{
|
||||
getApp().getJobQueue().addJob(jtLEDGER_DATA, "gotStaleData",
|
||||
std::bind(&InboundLedgers::gotStaleData, this, packet_ptr));
|
||||
app_.getJobQueue().addJob(
|
||||
jtLEDGER_DATA, "gotStaleData",
|
||||
[this, packet_ptr] (Job&) { gotStaleData(packet_ptr); });
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -167,9 +178,9 @@ public:
|
||||
|
||||
// Stash the data for later processing and see if we need to dispatch
|
||||
if (ledger->gotData(std::weak_ptr<Peer>(peer), packet_ptr))
|
||||
getApp().getJobQueue().addJob (jtLEDGER_DATA, "processLedgerData",
|
||||
std::bind (&InboundLedgers::doLedgerData, this,
|
||||
std::placeholders::_1, hash));
|
||||
app_.getJobQueue().addJob (
|
||||
jtLEDGER_DATA, "processLedgerData",
|
||||
[this, hash] (Job&) { doLedgerData(hash); });
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -217,7 +228,7 @@ public:
|
||||
return mRecentFailures.find (h) != mRecentFailures.end();
|
||||
}
|
||||
|
||||
void doLedgerData (Job&, LedgerHash hash)
|
||||
void doLedgerData (LedgerHash hash)
|
||||
{
|
||||
InboundLedger::pointer ledger = find (hash);
|
||||
|
||||
@@ -225,9 +236,11 @@ public:
|
||||
ledger->runData ();
|
||||
}
|
||||
|
||||
/** We got some data for a ledger we are no longer acquiring
|
||||
Since we paid the price to receive it, we might as well stash it in case we need it.
|
||||
Nodes are received in wire format and must be stashed/hashed in prefix format
|
||||
/** We got some data for a ledger we are no longer acquiring Since we paid
|
||||
the price to receive it, we might as well stash it in case we need it.
|
||||
|
||||
Nodes are received in wire format and must be stashed/hashed in prefix
|
||||
format
|
||||
*/
|
||||
void gotStaleData (std::shared_ptr<protocol::TMLedgerData> packet_ptr)
|
||||
{
|
||||
@@ -244,7 +257,7 @@ public:
|
||||
|
||||
auto newNode = SHAMapAbstractNode::make(
|
||||
Blob (node.nodedata().begin(), node.nodedata().end()),
|
||||
0, snfWIRE, uZero, false);
|
||||
0, snfWIRE, uZero, false, app_.journal ("SHAMapNodeID"));
|
||||
|
||||
if (!newNode)
|
||||
return;
|
||||
@@ -254,7 +267,8 @@ public:
|
||||
|
||||
auto blob = std::make_shared<Blob> (s.begin(), s.end());
|
||||
|
||||
getApp().getLedgerMaster().addFetchPack (newNode->getNodeHash(), blob);
|
||||
app_.getLedgerMaster().addFetchPack(
|
||||
newNode->getNodeHash(), blob);
|
||||
}
|
||||
}
|
||||
catch (...)
|
||||
@@ -317,15 +331,15 @@ public:
|
||||
// getJson is expensive, so call without the lock
|
||||
std::uint32_t seq = it.second->getSeq();
|
||||
if (seq > 1)
|
||||
ret[beast::lexicalCastThrow <std::string>(seq)] = it.second->getJson(0);
|
||||
ret[std::to_string(seq)] = it.second->getJson(0);
|
||||
else
|
||||
ret[to_string (it.first)] = it.second->getJson(0);
|
||||
}
|
||||
|
||||
return ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
void gotFetchPack (Job&)
|
||||
void gotFetchPack ()
|
||||
{
|
||||
std::vector<InboundLedger::pointer> acquires;
|
||||
{
|
||||
@@ -365,7 +379,8 @@ public:
|
||||
it->second->touch ();
|
||||
++it;
|
||||
}
|
||||
else if ((it->second->getLastAction () + std::chrono::minutes (1)) < now)
|
||||
else if ((it->second->getLastAction () +
|
||||
std::chrono::minutes (1)) < now)
|
||||
{
|
||||
stuffToSweep.push_back (it->second);
|
||||
// shouldn't cause the actual final delete
|
||||
@@ -382,7 +397,7 @@ public:
|
||||
|
||||
}
|
||||
|
||||
WriteLog (lsDEBUG, InboundLedger) <<
|
||||
JLOG (j_.debug) <<
|
||||
"Swept " << stuffToSweep.size () <<
|
||||
" out of " << total << " inbound ledgers.";
|
||||
}
|
||||
@@ -414,17 +429,19 @@ private:
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
decltype(InboundLedgersImp::kReacquireInterval) InboundLedgersImp::kReacquireInterval{5};
|
||||
decltype(InboundLedgersImp::kReacquireInterval)
|
||||
InboundLedgersImp::kReacquireInterval{5};
|
||||
|
||||
InboundLedgers::~InboundLedgers()
|
||||
{
|
||||
}
|
||||
|
||||
std::unique_ptr<InboundLedgers>
|
||||
make_InboundLedgers (InboundLedgers::clock_type& clock, beast::Stoppable& parent,
|
||||
beast::insight::Collector::ptr const& collector)
|
||||
make_InboundLedgers (Application& app,
|
||||
InboundLedgers::clock_type& clock, beast::Stoppable& parent,
|
||||
beast::insight::Collector::ptr const& collector)
|
||||
{
|
||||
return std::make_unique<InboundLedgersImp> (clock, parent, collector);
|
||||
return std::make_unique<InboundLedgersImp> (app, clock, parent, collector);
|
||||
}
|
||||
|
||||
} // ripple
|
||||
|
||||
@@ -63,25 +63,37 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
LedgerIndex minRange; // The lowest ledger in the range we're checking
|
||||
LedgerIndex maxRange; // The highest ledger in the range we're checking
|
||||
bool checkNodes; // Check all state/transaction nodes
|
||||
bool fixTxns; // Rewrite SQL databases
|
||||
int failures; // Number of errors encountered since last success
|
||||
// The lowest ledger in the range we're checking.
|
||||
LedgerIndex minRange;
|
||||
|
||||
// The highest ledger in the range we're checking
|
||||
LedgerIndex maxRange;
|
||||
|
||||
// Check all state/transaction nodes
|
||||
bool checkNodes;
|
||||
|
||||
// Rewrite SQL databases
|
||||
bool fixTxns;
|
||||
|
||||
// Number of errors encountered since last success
|
||||
int failures;
|
||||
};
|
||||
|
||||
using SharedState = beast::SharedData <State>;
|
||||
|
||||
Application& app_;
|
||||
SharedState m_state;
|
||||
beast::Journal m_journal;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
LedgerCleanerImp (
|
||||
Application& app,
|
||||
Stoppable& stoppable,
|
||||
beast::Journal journal)
|
||||
: LedgerCleaner (stoppable)
|
||||
, Thread ("LedgerCleaner")
|
||||
, app_ (app)
|
||||
, m_journal (journal)
|
||||
{
|
||||
}
|
||||
@@ -147,7 +159,7 @@ public:
|
||||
{
|
||||
LedgerIndex minRange;
|
||||
LedgerIndex maxRange;
|
||||
getApp().getLedgerMaster().getFullValidatedRange (minRange, maxRange);
|
||||
app_.getLedgerMaster().getFullValidatedRange (minRange, maxRange);
|
||||
|
||||
{
|
||||
SharedState::Access state (m_state);
|
||||
@@ -174,7 +186,7 @@ public:
|
||||
ledger numbers to clean. If unspecified, clean all ledgers.
|
||||
|
||||
"full"
|
||||
A boolean. When set to true, means clean everything possible.
|
||||
A boolean. When true, means clean everything possible.
|
||||
|
||||
"fix_txns"
|
||||
A boolean value indicating whether or not to fix the
|
||||
@@ -184,7 +196,7 @@ public:
|
||||
A boolean, when set to true means check the nodes.
|
||||
|
||||
"stop"
|
||||
A boolean, when set to true informs the cleaner to gracefully
|
||||
A boolean, when true informs the cleaner to gracefully
|
||||
stop its current activities if any cleaning is taking place.
|
||||
*/
|
||||
|
||||
@@ -260,8 +272,9 @@ public:
|
||||
{
|
||||
m_journal.warning <<
|
||||
"Node missing from ledger " << ledger->info().seq;
|
||||
getApp().getInboundLedgers().acquire (
|
||||
ledger->getHash(), ledger->info().seq, InboundLedger::fcGENERIC);
|
||||
app_.getInboundLedgers().acquire (
|
||||
ledger->getHash(), ledger->info().seq,
|
||||
InboundLedger::fcGENERIC);
|
||||
}
|
||||
return hash ? *hash : zero; // kludge
|
||||
}
|
||||
@@ -280,7 +293,7 @@ public:
|
||||
bool doTxns)
|
||||
{
|
||||
Ledger::pointer nodeLedger =
|
||||
getApp().getInboundLedgers().acquire (
|
||||
app_.getInboundLedgers().acquire (
|
||||
ledgerHash, ledgerIndex, InboundLedger::fcGENERIC);
|
||||
if (!nodeLedger)
|
||||
{
|
||||
@@ -288,7 +301,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
Ledger::pointer dbLedger = Ledger::loadByIndex(ledgerIndex);
|
||||
Ledger::pointer dbLedger = loadByIndex(ledgerIndex, app_);
|
||||
if (! dbLedger ||
|
||||
(dbLedger->getHash() != ledgerHash) ||
|
||||
(dbLedger->info().parentHash != nodeLedger->info().parentHash))
|
||||
@@ -299,21 +312,22 @@ public:
|
||||
doTxns = true;
|
||||
}
|
||||
|
||||
if(! getApp().getLedgerMaster().fixIndex(ledgerIndex, ledgerHash))
|
||||
if(! app_.getLedgerMaster().fixIndex(ledgerIndex, ledgerHash))
|
||||
{
|
||||
m_journal.debug << "ledger " << ledgerIndex << " had wrong entry in history";
|
||||
m_journal.debug << "ledger " << ledgerIndex
|
||||
<< " had wrong entry in history";
|
||||
doTxns = true;
|
||||
}
|
||||
|
||||
if (doNodes && !nodeLedger->walkLedger())
|
||||
if (doNodes && !nodeLedger->walkLedger(app_.journal ("Ledger")))
|
||||
{
|
||||
m_journal.debug << "Ledger " << ledgerIndex << " is missing nodes";
|
||||
getApp().getInboundLedgers().acquire(
|
||||
app_.getInboundLedgers().acquire(
|
||||
ledgerHash, ledgerIndex, InboundLedger::fcGENERIC);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (doTxns && !nodeLedger->pendSaveValidated(true, false))
|
||||
if (doTxns && !pendSaveValidated(app_, nodeLedger, true, false))
|
||||
{
|
||||
m_journal.debug << "Failed to save ledger " << ledgerIndex;
|
||||
return false;
|
||||
@@ -335,7 +349,7 @@ public:
|
||||
|
||||
if (!referenceLedger || (referenceLedger->info().seq < ledgerIndex))
|
||||
{
|
||||
referenceLedger = getApp().getLedgerMaster().getValidatedLedger();
|
||||
referenceLedger = app_.getLedgerMaster().getValidatedLedger();
|
||||
if (!referenceLedger)
|
||||
{
|
||||
m_journal.warning << "No validated ledger";
|
||||
@@ -349,8 +363,9 @@ public:
|
||||
ledgerHash = getLedgerHash(referenceLedger, ledgerIndex);
|
||||
if (ledgerHash.isZero())
|
||||
{
|
||||
// No, Try to get another ledger that might have the hash we need
|
||||
// Compute the index and hash of a ledger that will have the hash we need
|
||||
// No. Try to get another ledger that might have the hash we
|
||||
// need: compute the index and hash of a ledger that will have
|
||||
// the hash we need.
|
||||
LedgerIndex refIndex = getCandidateLedger (ledgerIndex);
|
||||
LedgerHash refHash = getLedgerHash (referenceLedger, refIndex);
|
||||
|
||||
@@ -358,12 +373,14 @@ public:
|
||||
assert (nonzero);
|
||||
if (nonzero)
|
||||
{
|
||||
// We found the hash and sequence of a better reference ledger
|
||||
// We found the hash and sequence of a better reference
|
||||
// ledger.
|
||||
referenceLedger =
|
||||
getApp().getInboundLedgers().acquire(
|
||||
app_.getInboundLedgers().acquire(
|
||||
refHash, refIndex, InboundLedger::fcGENERIC);
|
||||
if (referenceLedger)
|
||||
ledgerHash = getLedgerHash(referenceLedger, ledgerIndex);
|
||||
ledgerHash = getLedgerHash(
|
||||
referenceLedger, ledgerIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -385,7 +402,7 @@ public:
|
||||
bool doNodes;
|
||||
bool doTxns;
|
||||
|
||||
while (getApp().getFeeTrack().isLoadedLocal())
|
||||
while (app_.getFeeTrack().isLoadedLocal())
|
||||
{
|
||||
m_journal.debug << "Waiting for load to subside";
|
||||
std::this_thread::sleep_for(std::chrono::seconds(5));
|
||||
@@ -411,7 +428,8 @@ public:
|
||||
bool fail = false;
|
||||
if (ledgerHash.isZero())
|
||||
{
|
||||
m_journal.info << "Unable to get hash for ledger " << ledgerIndex;
|
||||
m_journal.info << "Unable to get hash for ledger "
|
||||
<< ledgerIndex;
|
||||
fail = true;
|
||||
}
|
||||
else if (!doLedger(ledgerIndex, ledgerHash, doNodes, doTxns))
|
||||
@@ -460,9 +478,10 @@ LedgerCleaner::~LedgerCleaner ()
|
||||
}
|
||||
|
||||
std::unique_ptr<LedgerCleaner>
|
||||
make_LedgerCleaner (beast::Stoppable& parent, beast::Journal journal)
|
||||
make_LedgerCleaner (Application& app,
|
||||
beast::Stoppable& parent, beast::Journal journal)
|
||||
{
|
||||
return std::make_unique <LedgerCleanerImp> (parent, journal);
|
||||
return std::make_unique<LedgerCleanerImp>(app, parent, journal);
|
||||
}
|
||||
|
||||
} // ripple
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#ifndef RIPPLE_APP_LEDGER_LEDGERCLEANER_H_INCLUDED
|
||||
#define RIPPLE_APP_LEDGER_LEDGERCLEANER_H_INCLUDED
|
||||
|
||||
#include <ripple/app/main/Application.h>
|
||||
#include <ripple/json/json_value.h>
|
||||
#include <beast/threads/Stoppable.h>
|
||||
#include <beast/utility/PropertyStream.h>
|
||||
@@ -53,8 +54,9 @@ public:
|
||||
virtual void doClean (Json::Value const& parameters) = 0;
|
||||
};
|
||||
|
||||
std::unique_ptr<LedgerCleaner> make_LedgerCleaner (beast::Stoppable& parent,
|
||||
beast::Journal journal);
|
||||
std::unique_ptr<LedgerCleaner>
|
||||
make_LedgerCleaner (Application& app,
|
||||
beast::Stoppable& parent, beast::Journal journal);
|
||||
|
||||
} // ripple
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -24,6 +24,7 @@
|
||||
#include <ripple/app/ledger/LedgerMaster.h>
|
||||
#include <ripple/app/ledger/impl/ConsensusImp.h>
|
||||
#include <ripple/app/ledger/impl/DisputedTx.h>
|
||||
#include <ripple/app/main/Application.h>
|
||||
#include <ripple/app/misc/CanonicalTXSet.h>
|
||||
#include <ripple/app/misc/FeeVote.h>
|
||||
#include <ripple/basics/CountedObject.h>
|
||||
@@ -92,16 +93,17 @@ public:
|
||||
@param feeVote Our desired fee levels and voting logic.
|
||||
*/
|
||||
LedgerConsensusImp (
|
||||
ConsensusImp& consensus,
|
||||
int previousProposers,
|
||||
int previousConvergeTime,
|
||||
InboundTransactions& inboundTransactions,
|
||||
LocalTxs& localtx,
|
||||
LedgerMaster& ledgerMaster,
|
||||
LedgerHash const & prevLCLHash,
|
||||
Ledger::ref previousLedger,
|
||||
std::uint32_t closeTime,
|
||||
FeeVote& feeVote);
|
||||
Application& app,
|
||||
ConsensusImp& consensus,
|
||||
int previousProposers,
|
||||
int previousConvergeTime,
|
||||
InboundTransactions& inboundTransactions,
|
||||
LocalTxs& localtx,
|
||||
LedgerMaster& ledgerMaster,
|
||||
LedgerHash const & prevLCLHash,
|
||||
Ledger::ref previousLedger,
|
||||
std::uint32_t closeTime,
|
||||
FeeVote& feeVote);
|
||||
|
||||
/**
|
||||
Get the Json state of the consensus process.
|
||||
@@ -259,7 +261,7 @@ private:
|
||||
|
||||
@param initialLedger The ledger that contains our initial position.
|
||||
*/
|
||||
void takeInitialPosition (Ledger& initialLedger);
|
||||
void takeInitialPosition (std::shared_ptr<ReadView const> const& initialLedger);
|
||||
|
||||
/**
|
||||
Called while trying to avalanche towards consensus.
|
||||
@@ -292,6 +294,7 @@ private:
|
||||
void addLoad(STValidation::ref val);
|
||||
|
||||
private:
|
||||
Application& app_;
|
||||
ConsensusImp& consensus_;
|
||||
InboundTransactions& inboundTransactions_;
|
||||
LocalTxs& m_localTX;
|
||||
@@ -337,15 +340,17 @@ private:
|
||||
|
||||
// nodes that have bowed out of this consensus process
|
||||
hash_set<NodeID> mDeadNodes;
|
||||
beast::Journal j_;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
std::shared_ptr <LedgerConsensus>
|
||||
make_LedgerConsensus (ConsensusImp& consensus, int previousProposers,
|
||||
make_LedgerConsensus (Application& app, ConsensusImp& consensus, int previousProposers,
|
||||
int previousConvergeTime, InboundTransactions& inboundTransactions,
|
||||
LocalTxs& localtx, LedgerMaster& ledgerMaster, LedgerHash const &prevLCLHash,
|
||||
Ledger::ref previousLedger, std::uint32_t closeTime, FeeVote& feeVote);
|
||||
LocalTxs& localtx, LedgerMaster& ledgerMaster,
|
||||
LedgerHash const &prevLCLHash, Ledger::ref previousLedger,
|
||||
std::uint32_t closeTime, FeeVote& feeVote);
|
||||
|
||||
} // ripple
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -43,7 +43,7 @@ int getNextLedgerTimeResolution (
|
||||
|
||||
// If we did not previously agree, we try to decrease the resolution to
|
||||
// improve the chance that we will agree now.
|
||||
if (!previousAgree && ((ledgerSeq % decreaseLedgerTimeResolutionEvery) == 0))
|
||||
if (!previousAgree && ledgerSeq % decreaseLedgerTimeResolutionEvery == 0)
|
||||
{
|
||||
if (++iter != std::end (ledgerPossibleTimeResolutions))
|
||||
return *iter;
|
||||
@@ -51,7 +51,7 @@ int getNextLedgerTimeResolution (
|
||||
|
||||
// If we previously agreed, we try to increase the resolution to determine
|
||||
// if we can continue to agree.
|
||||
if (previousAgree && ((ledgerSeq % increaseLedgerTimeResolutionEvery) == 0))
|
||||
if (previousAgree && ledgerSeq % increaseLedgerTimeResolutionEvery == 0)
|
||||
{
|
||||
if (iter-- != std::begin (ledgerPossibleTimeResolutions))
|
||||
return *iter;
|
||||
|
||||
@@ -65,14 +65,17 @@ void fillJson(Object& json, LedgerInfo const& info, bool bFull)
|
||||
json[jss::hash] = to_string (info.hash);
|
||||
json[jss::totalCoins] = to_string (info.drops);
|
||||
json[jss::accepted] = ! info.open;
|
||||
json[jss::close_flags] = info.closeFlags;
|
||||
|
||||
// Always show fields that contribute to the ledger hash
|
||||
json[jss::parent_close_time] = info.parentCloseTime;
|
||||
json[jss::close_time] = info.closeTime;
|
||||
json[jss::close_time_resolution] = info.closeTimeResolution;
|
||||
|
||||
if (auto closeTime = info.closeTime)
|
||||
{
|
||||
json[jss::close_time] = closeTime;
|
||||
json[jss::close_time_human] = boost::posix_time::to_simple_string (
|
||||
ptFromSeconds (closeTime));
|
||||
json[jss::close_time_resolution] = info.closeTimeResolution;
|
||||
|
||||
if (! getCloseAgree(info))
|
||||
json[jss::close_time_estimated] = true;
|
||||
}
|
||||
@@ -131,20 +134,20 @@ void fillJsonState(Object& json, LedgerFill const& fill)
|
||||
auto expanded = isExpanded(fill);
|
||||
auto binary = isBinary(fill);
|
||||
|
||||
forEachSLE(ledger, [&] (SLE const& sle) {
|
||||
for(auto const& sle : ledger.sles)
|
||||
{
|
||||
count.yield();
|
||||
if (binary)
|
||||
{
|
||||
auto&& obj = appendObject(array);
|
||||
obj[jss::hash] = to_string(sle.key());
|
||||
obj[jss::tx_blob] = serializeHex(sle);
|
||||
obj[jss::hash] = to_string(sle->key());
|
||||
obj[jss::tx_blob] = serializeHex(*sle);
|
||||
}
|
||||
else if (expanded)
|
||||
array.append(sle.getJson(0));
|
||||
array.append(sle->getJson(0));
|
||||
else
|
||||
array.append(to_string(sle.key()));
|
||||
return true;
|
||||
});
|
||||
array.append(to_string(sle->key()));
|
||||
}
|
||||
}
|
||||
|
||||
template <class Object>
|
||||
|
||||
@@ -20,22 +20,30 @@
|
||||
#include <BeastConfig.h>
|
||||
#include <ripple/app/ledger/OpenLedger.h>
|
||||
#include <ripple/app/tx/apply.h>
|
||||
#include <ripple/ledger/CachingReadView.h>
|
||||
#include <ripple/ledger/CachedView.h>
|
||||
#include <boost/range/adaptor/transformed.hpp>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
OpenLedger::OpenLedger(
|
||||
std::shared_ptr<Ledger const> const& ledger,
|
||||
OpenLedger::OpenLedger(std::shared_ptr<
|
||||
Ledger const> const& ledger,
|
||||
Config const& config, CachedSLEs& cache,
|
||||
beast::Journal journal)
|
||||
: j_ (journal)
|
||||
, cache_ (cache)
|
||||
, config_ (config)
|
||||
, current_ (create(ledger))
|
||||
, current_ (create(ledger->rules(), ledger))
|
||||
{
|
||||
}
|
||||
|
||||
bool
|
||||
OpenLedger::empty() const
|
||||
{
|
||||
std::lock_guard<
|
||||
std::mutex> lock(modify_mutex_);
|
||||
return current_->txCount() == 0;
|
||||
}
|
||||
|
||||
std::shared_ptr<ReadView const>
|
||||
OpenLedger::current() const
|
||||
{
|
||||
@@ -65,22 +73,22 @@ OpenLedger::modify (std::function<
|
||||
}
|
||||
|
||||
void
|
||||
OpenLedger::accept (std::shared_ptr<
|
||||
Ledger const> const& ledger,
|
||||
OpenLedger::accept(Application& app, Rules const& rules,
|
||||
std::shared_ptr<Ledger const> const& ledger,
|
||||
OrderedTxs const& locals, bool retriesFirst,
|
||||
OrderedTxs& retries, ApplyFlags flags,
|
||||
IHashRouter& router, std::string const& suffix)
|
||||
HashRouter& router, std::string const& suffix)
|
||||
{
|
||||
JLOG(j_.error) <<
|
||||
JLOG(j_.trace) <<
|
||||
"accept ledger " << ledger->seq() << " " << suffix;
|
||||
auto next = create(ledger);
|
||||
auto next = create(rules, ledger);
|
||||
if (retriesFirst)
|
||||
{
|
||||
// Handle disputed tx, outside lock
|
||||
using empty =
|
||||
std::vector<std::shared_ptr<
|
||||
STTx const>>;
|
||||
apply (*next, *ledger, empty{},
|
||||
apply (app, *next, *ledger, empty{},
|
||||
retries, flags, router, config_, j_);
|
||||
}
|
||||
// Block calls to modify, otherwise
|
||||
@@ -90,7 +98,7 @@ OpenLedger::accept (std::shared_ptr<
|
||||
std::mutex> lock1(modify_mutex_);
|
||||
// Apply tx from the current open view
|
||||
if (! current_->txs.empty())
|
||||
apply (*next, *ledger,
|
||||
apply (app, *next, *ledger,
|
||||
boost::adaptors::transform(
|
||||
current_->txs,
|
||||
[](std::pair<std::shared_ptr<
|
||||
@@ -102,8 +110,9 @@ OpenLedger::accept (std::shared_ptr<
|
||||
retries, flags, router, config_, j_);
|
||||
// Apply local tx
|
||||
for (auto const& item : locals)
|
||||
ripple::apply(*next, *item.second,
|
||||
flags, config_, j_);
|
||||
ripple::apply(app, *next, *item.second,
|
||||
flags, router.sigVerify(),
|
||||
config_, j_);
|
||||
// Switch to the new open view
|
||||
std::lock_guard<
|
||||
std::mutex> lock2(current_mutex_);
|
||||
@@ -113,20 +122,20 @@ OpenLedger::accept (std::shared_ptr<
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
std::shared_ptr<OpenView>
|
||||
OpenLedger::create (std::shared_ptr<
|
||||
Ledger const> const& ledger)
|
||||
OpenLedger::create (Rules const& rules,
|
||||
std::shared_ptr<Ledger const> const& ledger)
|
||||
{
|
||||
return std::make_shared<OpenView>(
|
||||
open_ledger, std::make_shared<
|
||||
CachingReadView const>(ledger,
|
||||
open_ledger, rules, std::make_shared<
|
||||
CachedLedger const>(ledger,
|
||||
cache_));
|
||||
}
|
||||
|
||||
auto
|
||||
OpenLedger::apply_one (OpenView& view,
|
||||
OpenLedger::apply_one (Application& app, OpenView& view,
|
||||
std::shared_ptr<STTx const> const& tx,
|
||||
bool retry, ApplyFlags flags,
|
||||
IHashRouter& router, Config const& config,
|
||||
HashRouter& router, Config const& config,
|
||||
beast::Journal j) -> Result
|
||||
{
|
||||
if (retry)
|
||||
@@ -136,7 +145,8 @@ OpenLedger::apply_one (OpenView& view,
|
||||
SF_SIGGOOD)
|
||||
flags = flags | tapNO_CHECK_SIGN;
|
||||
auto const result = ripple::apply(
|
||||
view, *tx, flags, config, j);
|
||||
app, view, *tx, flags, router.
|
||||
sigVerify(), config, j);
|
||||
if (result.second)
|
||||
return Result::success;
|
||||
if (isTefFailure (result.first) ||
|
||||
@@ -148,40 +158,6 @@ OpenLedger::apply_one (OpenView& view,
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
static
|
||||
std::vector<uint256>
|
||||
txList (ReadView const& view)
|
||||
{
|
||||
std::vector<uint256> v;
|
||||
for (auto const& item : view.txs)
|
||||
v.push_back(item.first->getTransactionID());
|
||||
std::sort(v.begin(), v.end());
|
||||
return v;
|
||||
}
|
||||
|
||||
bool
|
||||
OpenLedger::verify (Ledger const& ledger,
|
||||
std::string const& suffix) const
|
||||
{
|
||||
#if 1
|
||||
std::lock_guard<
|
||||
std::mutex> lock(modify_mutex_);
|
||||
auto list1 = txList(ledger);
|
||||
auto list2 = txList(*current_);
|
||||
if (list1 == list2)
|
||||
return true;
|
||||
JLOG(j_.error) <<
|
||||
"verify ledger " << ledger.seq() << ": " <<
|
||||
list1.size() << " / " << list2.size() <<
|
||||
" " << " MISMATCH " << suffix;
|
||||
return false;
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
std::string
|
||||
debugTxstr (std::shared_ptr<STTx const> const& tx)
|
||||
{
|
||||
|
||||
@@ -1,152 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of rippled: https://github.com/ripple/rippled
|
||||
Copyright (c) 2012, 2013 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.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include <ripple/app/ledger/tests/common_ledger.h>
|
||||
|
||||
namespace ripple {
|
||||
namespace test {
|
||||
|
||||
#if 0
|
||||
|
||||
class Ledger_test : public beast::unit_test::suite
|
||||
{
|
||||
void test_genesisLedger (bool sign, KeyType keyType)
|
||||
{
|
||||
std::uint64_t const xrp = std::mega::num;
|
||||
|
||||
auto master = createAccount ("masterpassphrase", keyType);
|
||||
|
||||
std::shared_ptr<Ledger const> LCL;
|
||||
Ledger::pointer ledger;
|
||||
std::tie(LCL, ledger) = createGenesisLedger(100000*xrp, master);
|
||||
|
||||
// User accounts
|
||||
auto gw1 = createAccount ("gw1", keyType);
|
||||
expect (gw1.pk != master.pk, "gw1.pk != master.pk");
|
||||
expect (gw1.sk != master.sk, "gw1.sk != master.sk");
|
||||
auto gw2 = createAccount ("gw2", keyType);
|
||||
auto gw3 = createAccount ("gw3", keyType);
|
||||
auto alice = createAccount ("alice", keyType);
|
||||
auto mark = createAccount ("mark", keyType);
|
||||
|
||||
// Fund gw1, gw2, gw3, alice, mark from master
|
||||
pay(master, gw1, 5000 * xrp, ledger, sign);
|
||||
pay(master, gw2, 4000 * xrp, ledger, sign);
|
||||
pay(master, gw3, 3000 * xrp, ledger, sign);
|
||||
pay(master, alice, 2000 * xrp, ledger, sign);
|
||||
pay(master, mark, 1000 * xrp, ledger, sign);
|
||||
|
||||
close_and_advance(ledger, LCL);
|
||||
|
||||
// alice trusts FOO/gw1
|
||||
trust (alice, gw1, "FOO", 1, ledger, sign);
|
||||
|
||||
// mark trusts FOO/gw2
|
||||
trust (mark, gw2, "FOO", 1, ledger, sign);
|
||||
|
||||
// mark trusts FOO/gw3
|
||||
trust (mark, gw3, "FOO", 1, ledger, sign);
|
||||
|
||||
// gw2 pays mark with FOO
|
||||
pay(gw2, mark, "FOO", "0.1", ledger, sign);
|
||||
|
||||
// gw3 pays mark with FOO
|
||||
pay(gw3, mark, "FOO", "0.2", ledger, sign);
|
||||
|
||||
// gw1 pays alice with FOO
|
||||
pay(gw1, alice, "FOO", "0.3", ledger, sign);
|
||||
|
||||
verifyBalance(ledger, mark, Amount(0.1, "FOO", gw2));
|
||||
verifyBalance(ledger, mark, Amount(0.2, "FOO", gw3));
|
||||
verifyBalance(ledger, alice, Amount(0.3, "FOO", gw1));
|
||||
|
||||
close_and_advance(ledger, LCL);
|
||||
|
||||
createOffer (mark, Amount (1, "FOO", gw1), Amount (1, "FOO", gw2), ledger, sign);
|
||||
createOffer (mark, Amount (1, "FOO", gw2), Amount (1, "FOO", gw3), ledger, sign);
|
||||
cancelOffer (mark, ledger, sign);
|
||||
freezeAccount (alice, ledger, sign);
|
||||
|
||||
close_and_advance(ledger, LCL);
|
||||
|
||||
pay(alice, mark, 1 * xrp, ledger, sign);
|
||||
|
||||
close_and_advance(ledger, LCL);
|
||||
|
||||
pass ();
|
||||
}
|
||||
|
||||
void test_unsigned_fails (KeyType keyType)
|
||||
{
|
||||
std::uint64_t const xrp = std::mega::num;
|
||||
|
||||
auto master = createAccount ("masterpassphrase", keyType);
|
||||
|
||||
std::shared_ptr<Ledger const> LCL;
|
||||
Ledger::pointer ledger;
|
||||
std::tie(LCL, ledger) = createGenesisLedger (100000 * xrp, master);
|
||||
|
||||
auto gw1 = createAccount ("gw1", keyType);
|
||||
|
||||
auto tx = getPaymentTx(master, gw1, 5000 * xrp, false);
|
||||
|
||||
try
|
||||
{
|
||||
applyTransaction (ledger, tx, true);
|
||||
fail ("apply unsigned transaction should fail");
|
||||
}
|
||||
catch (std::runtime_error const& e)
|
||||
{
|
||||
if (std::string (e.what()) != "r != tesSUCCESS")
|
||||
throw std::runtime_error(e.what());
|
||||
}
|
||||
|
||||
pass ();
|
||||
}
|
||||
|
||||
void test_getQuality ()
|
||||
{
|
||||
uint256 uBig = from_hex_text<uint256> (
|
||||
"D2DC44E5DC189318DB36EF87D2104CDF0A0FE3A4B698BEEE55038D7EA4C68000");
|
||||
expect (6125895493223874560 == getQuality (uBig));
|
||||
|
||||
pass ();
|
||||
}
|
||||
public:
|
||||
void run ()
|
||||
{
|
||||
test_genesisLedger (true, KeyType::secp256k1);
|
||||
test_genesisLedger (true, KeyType::ed25519);
|
||||
|
||||
// test_genesisLedger (false, KeyType::secp256k1);
|
||||
// test_genesisLedger (false, KeyType::ed25519);
|
||||
|
||||
test_unsigned_fails (KeyType::secp256k1);
|
||||
test_unsigned_fails (KeyType::ed25519);
|
||||
|
||||
test_getQuality ();
|
||||
}
|
||||
};
|
||||
|
||||
BEAST_DEFINE_TESTSUITE(Ledger,ripple_app,ripple);
|
||||
|
||||
#endif
|
||||
|
||||
} // test
|
||||
} // ripple
|
||||
@@ -1,569 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of rippled: https://github.com/ripple/rippled
|
||||
Copyright (c) 2012-2015 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.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include <ripple/app/ledger/tests/common_ledger.h>
|
||||
#include <ripple/app/main/Application.h>
|
||||
#include <ripple/app/paths/FindPaths.h>
|
||||
#include <ripple/app/tx/apply.h>
|
||||
#include <ripple/protocol/RippleAddress.h>
|
||||
#include <ripple/protocol/Indexes.h>
|
||||
#include <ripple/protocol/types.h>
|
||||
#include <ripple/rpc/RipplePathFind.h>
|
||||
#include <ripple/json/json_writer.h>
|
||||
|
||||
#if 0
|
||||
|
||||
namespace ripple {
|
||||
namespace test {
|
||||
|
||||
Json::Value
|
||||
TestJson::getJson() const
|
||||
{
|
||||
Json::Value tx_json;
|
||||
getJson(tx_json);
|
||||
return tx_json;
|
||||
}
|
||||
|
||||
Currency::Currency(std::string currency)
|
||||
: currency_(currency)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
Currency::getJson(Json::Value& tx_json) const
|
||||
{
|
||||
tx_json[jss::currency] = currency_;
|
||||
}
|
||||
|
||||
std::string
|
||||
Currency::getCurrency() const
|
||||
{
|
||||
return currency_;
|
||||
}
|
||||
|
||||
|
||||
Issuer::Issuer(TestAccount issuer)
|
||||
:issuer_(issuer)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
Issuer::getJson(Json::Value& tx_json) const
|
||||
{
|
||||
tx_json[jss::issuer] = toBase58(calcAccountID(issuer_.pk));
|
||||
}
|
||||
|
||||
TestAccount const&
|
||||
Issuer::getAccount() const
|
||||
{
|
||||
return issuer_;
|
||||
}
|
||||
|
||||
|
||||
Amount::Amount(double value, std::string currency, TestAccount issuer)
|
||||
: value_(value)
|
||||
, currency_(Currency(currency))
|
||||
, issuer_(Issuer(issuer))
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
Amount::getJson(Json::Value& tx_json) const
|
||||
{
|
||||
currency_.getJson(tx_json);
|
||||
issuer_.getJson(tx_json);
|
||||
tx_json[jss::value] = std::to_string(value_);
|
||||
}
|
||||
|
||||
double
|
||||
Amount::getValue() const
|
||||
{
|
||||
return value_;
|
||||
}
|
||||
|
||||
TestAccount const&
|
||||
Amount::getIssuer() const
|
||||
{
|
||||
return issuer_.getAccount();
|
||||
}
|
||||
|
||||
Currency const&
|
||||
Amount::getCurrency() const
|
||||
{
|
||||
return currency_;
|
||||
}
|
||||
|
||||
|
||||
// Helper function to parse a transaction in Json, sign it with account,
|
||||
// and return it as a STTx
|
||||
STTx
|
||||
parseTransaction(TestAccount& account, Json::Value const& tx_json, bool sign)
|
||||
{
|
||||
STParsedJSONObject parsed("tx_json", tx_json);
|
||||
if (!parsed.object)
|
||||
throw std::runtime_error(
|
||||
"object not parseable");
|
||||
parsed.object->setFieldVL(sfSigningPubKey, account.pk.getAccountPublic());
|
||||
auto tx = STTx(std::move (*parsed.object));
|
||||
if (sign)
|
||||
tx.sign(account.sk);
|
||||
return tx;
|
||||
}
|
||||
|
||||
// Helper function to apply a transaction to a ledger
|
||||
void
|
||||
applyTransaction(Ledger::pointer const& ledger, STTx const& tx, bool check)
|
||||
{
|
||||
auto const r = apply (*ledger, tx,
|
||||
check ? tapNONE : tapNO_CHECK_SIGN, getConfig(),
|
||||
beast::Journal{});
|
||||
if (r.first != tesSUCCESS)
|
||||
throw std::runtime_error("r != tesSUCCESS");
|
||||
if (!r.second)
|
||||
throw std::runtime_error("didApply");
|
||||
}
|
||||
|
||||
// Create genesis ledger from a start amount in drops, and the public
|
||||
// master RippleAddress
|
||||
std::pair<std::shared_ptr<Ledger const>, Ledger::pointer>
|
||||
createGenesisLedger(std::uint64_t start_amount_drops, TestAccount const& master)
|
||||
{
|
||||
initializePathfinding();
|
||||
auto ledger = std::make_shared<Ledger>(master.pk,
|
||||
start_amount_drops);
|
||||
ledger->getHash(); // updates the hash
|
||||
ledger->setClosed();
|
||||
if (!ledger->assertSane())
|
||||
throw std::runtime_error(
|
||||
"! ledger->assertSane()");
|
||||
return std::make_pair(std::move(ledger), std::make_shared<Ledger>(false, *ledger));
|
||||
}
|
||||
|
||||
// Create an account represented by public RippleAddress and private
|
||||
// RippleAddress
|
||||
TestAccount
|
||||
createAccount(std::string const& passphrase, KeyType keyType)
|
||||
{
|
||||
RippleAddress const seed
|
||||
= RippleAddress::createSeedGeneric(passphrase);
|
||||
|
||||
auto keyPair = generateKeysFromSeed(keyType, seed);
|
||||
|
||||
return {
|
||||
std::move(keyPair.publicKey),
|
||||
std::move(keyPair.secretKey),
|
||||
std::uint64_t(0)
|
||||
};
|
||||
}
|
||||
|
||||
TestAccount
|
||||
createAndFundAccount(TestAccount& from, std::string const& passphrase,
|
||||
KeyType keyType, std::uint64_t amountDrops,
|
||||
Ledger::pointer const& ledger, bool sign)
|
||||
{
|
||||
auto to = createAccount(passphrase, keyType);
|
||||
pay(from, to, amountDrops, ledger, sign);
|
||||
return to;
|
||||
}
|
||||
|
||||
std::map<std::string, TestAccount>
|
||||
createAndFundAccounts(TestAccount& from, std::vector<std::string> passphrases,
|
||||
KeyType keyType, std::uint64_t amountDrops,
|
||||
Ledger::pointer const& ledger, bool sign)
|
||||
{
|
||||
std::map<std::string, TestAccount> accounts;
|
||||
for (auto const& passphrase : passphrases)
|
||||
{
|
||||
auto to = createAndFundAccount(from, passphrase, keyType,
|
||||
amountDrops, ledger, sign);
|
||||
accounts.emplace(passphrase, std::move(to));
|
||||
}
|
||||
return accounts;
|
||||
}
|
||||
|
||||
std::map<std::string, TestAccount>
|
||||
createAndFundAccountsWithFlags(TestAccount& from,
|
||||
std::vector<std::string> passphrases,
|
||||
KeyType keyType, std::uint64_t amountDrops,
|
||||
Ledger::pointer& ledger,
|
||||
std::shared_ptr<Ledger const>& LCL,
|
||||
const std::uint32_t flags, bool sign)
|
||||
{
|
||||
auto accounts = createAndFundAccounts(from,
|
||||
passphrases, keyType, amountDrops, ledger, sign);
|
||||
close_and_advance(ledger, LCL);
|
||||
setAllAccountFlags(accounts, ledger, flags);
|
||||
close_and_advance(ledger, LCL);
|
||||
return accounts;
|
||||
}
|
||||
|
||||
Json::Value
|
||||
getCommonTransactionJson(TestAccount& account)
|
||||
{
|
||||
Json::Value tx_json;
|
||||
tx_json[jss::Account] = toBase58(calcAccountID(account.pk));
|
||||
tx_json[jss::Fee] = std::to_string(10);
|
||||
tx_json[jss::Sequence] = ++account.sequence;
|
||||
return tx_json;
|
||||
}
|
||||
|
||||
void
|
||||
setAccountFlags(TestAccount& account, Ledger::pointer const& ledger,
|
||||
const std::uint32_t flags, bool sign)
|
||||
{
|
||||
Json::Value tx_json = getCommonTransactionJson(account);
|
||||
tx_json[jss::TransactionType] = "AccountSet";
|
||||
tx_json[jss::SetFlag] = flags;
|
||||
STTx tx = parseTransaction(account, tx_json, sign);
|
||||
applyTransaction(ledger, tx, sign);
|
||||
}
|
||||
|
||||
void
|
||||
setAllAccountFlags(std::vector<TestAccount>& accounts, Ledger::pointer const& ledger,
|
||||
const std::uint32_t flags, bool sign)
|
||||
{
|
||||
for (auto& account : accounts)
|
||||
{
|
||||
setAccountFlags(account, ledger, flags, sign);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
clearAccountFlags(TestAccount& account, Ledger::pointer const& ledger,
|
||||
const std::uint32_t flags, bool sign)
|
||||
{
|
||||
Json::Value tx_json = getCommonTransactionJson(account);
|
||||
tx_json[jss::TransactionType] = "AccountSet";
|
||||
tx_json[jss::ClearFlag] = flags;
|
||||
STTx tx = parseTransaction(account, tx_json, sign);
|
||||
applyTransaction(ledger, tx, sign);
|
||||
}
|
||||
|
||||
void
|
||||
freezeAccount(TestAccount& account, Ledger::pointer const& ledger, bool sign)
|
||||
{
|
||||
setAccountFlags(account, ledger, asfGlobalFreeze, sign);
|
||||
}
|
||||
|
||||
void
|
||||
unfreezeAccount(TestAccount& account, Ledger::pointer const& ledger, bool sign)
|
||||
{
|
||||
clearAccountFlags(account, ledger, asfGlobalFreeze, sign);
|
||||
}
|
||||
|
||||
Json::Value
|
||||
getPaymentJson(TestAccount& from, TestAccount const& to,
|
||||
Json::Value amountJson)
|
||||
{
|
||||
Json::Value tx_json = getCommonTransactionJson(from);
|
||||
tx_json[jss::Amount] = amountJson;
|
||||
tx_json[jss::Destination] = toBase58(calcAccountID(to.pk));
|
||||
tx_json[jss::TransactionType] = "Payment";
|
||||
tx_json[jss::Flags] = tfUniversal;
|
||||
return tx_json;
|
||||
}
|
||||
|
||||
STTx
|
||||
getPaymentTx(TestAccount& from, TestAccount const& to,
|
||||
std::uint64_t amountDrops,
|
||||
bool sign)
|
||||
{
|
||||
Json::Value tx_json = getPaymentJson(from, to,
|
||||
std::to_string(amountDrops));
|
||||
return parseTransaction(from, tx_json, sign);
|
||||
}
|
||||
|
||||
STTx
|
||||
pay(TestAccount& from, TestAccount const& to,
|
||||
std::uint64_t amountDrops,
|
||||
Ledger::pointer const& ledger, bool sign)
|
||||
{
|
||||
auto tx = getPaymentTx(from, to, amountDrops, sign);
|
||||
applyTransaction(ledger, tx, sign);
|
||||
return tx;
|
||||
}
|
||||
|
||||
STTx
|
||||
getPaymentTx(TestAccount& from, TestAccount const& to,
|
||||
std::string const& currency, std::string const& amount,
|
||||
bool sign)
|
||||
{
|
||||
Json::Value tx_json = getPaymentJson(from, to,
|
||||
Amount(std::stod(amount), currency, to).getJson());
|
||||
return parseTransaction(from, tx_json, sign);
|
||||
}
|
||||
|
||||
STTx
|
||||
pay(TestAccount& from, TestAccount const& to,
|
||||
std::string const& currency, std::string const& amount,
|
||||
Ledger::pointer const& ledger, bool sign)
|
||||
{
|
||||
auto tx = getPaymentTx(from, to, currency, amount, sign);
|
||||
applyTransaction(ledger, tx, sign);
|
||||
return tx;
|
||||
}
|
||||
|
||||
STTx
|
||||
getPaymentTxWithPath(TestAccount& from, TestAccount const& to,
|
||||
std::string const& currency, std::string const& amount,
|
||||
Ledger::pointer const& ledger, bool sign)
|
||||
{
|
||||
auto amountJson = Amount(std::stod(amount), currency, to).getJson();
|
||||
Json::Value tx_json = getPaymentJson(from, to, amountJson);
|
||||
|
||||
// Find path. Note that the sign command can do this transparently
|
||||
// with the "build_path" field, but we don't have that here.
|
||||
auto cache = std::make_shared<RippleLineCache>(ledger);
|
||||
STPathSet pathSet;
|
||||
STPath fullLiquidityPath;
|
||||
auto stDstAmount = amountFromJson(sfGeneric, amountJson);
|
||||
Issue srcIssue = Issue(stDstAmount.getCurrency(),
|
||||
calcAccountID(from.pk));
|
||||
|
||||
auto found = findPathsForOneIssuer(cache,
|
||||
calcAccountID(from.pk), calcAccountID(to.pk),
|
||||
srcIssue, stDstAmount, 7, 4, pathSet, fullLiquidityPath);
|
||||
if (!found)
|
||||
throw std::runtime_error(
|
||||
"!found");
|
||||
if (pathSet.isDefault())
|
||||
throw std::runtime_error(
|
||||
"pathSet.isDefault()");
|
||||
|
||||
tx_json[jss::Paths] = pathSet.getJson(0);
|
||||
|
||||
return parseTransaction(from, tx_json, sign);
|
||||
}
|
||||
|
||||
STTx
|
||||
payWithPath(TestAccount& from, TestAccount const& to,
|
||||
std::string const& currency, std::string const& amount,
|
||||
Ledger::pointer const& ledger, bool sign)
|
||||
{
|
||||
auto tx = getPaymentTxWithPath(from, to, currency, amount, ledger, sign);
|
||||
applyTransaction(ledger, tx, sign);
|
||||
return tx;
|
||||
}
|
||||
|
||||
STTx
|
||||
payWithPath(TestAccount& from, TestAccount const& to,
|
||||
std::string const& currency, std::string const& amount,
|
||||
Ledger::pointer const& ledger, Json::Value const& path,
|
||||
std::uint32_t flags, bool sign)
|
||||
{
|
||||
auto amountJson = Amount(std::stod(amount), currency, to).getJson();
|
||||
Json::Value tx_json = getPaymentJson(from, to, amountJson);
|
||||
|
||||
tx_json[jss::Paths] = path;
|
||||
tx_json[jss::Flags] = flags;
|
||||
|
||||
auto tx = parseTransaction(from, tx_json, sign);
|
||||
applyTransaction(ledger, tx, sign);
|
||||
return tx;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
createOffer(TestAccount& from, Amount const& in, Amount const& out,
|
||||
Ledger::pointer ledger, bool sign)
|
||||
{
|
||||
Json::Value tx_json = getCommonTransactionJson(from);
|
||||
tx_json[jss::TransactionType] = "OfferCreate";
|
||||
tx_json[jss::TakerPays] = in.getJson();
|
||||
tx_json[jss::TakerGets] = out.getJson();
|
||||
STTx tx = parseTransaction(from, tx_json, sign);
|
||||
applyTransaction(ledger, tx, sign);
|
||||
}
|
||||
|
||||
void
|
||||
createOfferWithFlags(TestAccount& from, Amount const& in, Amount const& out,
|
||||
Ledger::pointer ledger, std::uint32_t flags,
|
||||
bool sign)
|
||||
{
|
||||
Json::Value tx_json = getCommonTransactionJson(from);
|
||||
tx_json[jss::TransactionType] = "OfferCreate";
|
||||
tx_json[jss::TakerPays] = in.getJson();
|
||||
tx_json[jss::TakerGets] = out.getJson();
|
||||
tx_json[jss::Flags] = flags;
|
||||
STTx tx = parseTransaction(from, tx_json, sign);
|
||||
applyTransaction(ledger, tx, sign);
|
||||
}
|
||||
|
||||
|
||||
// As currently implemented, this will cancel only the last offer made
|
||||
// from this account.
|
||||
void
|
||||
cancelOffer(TestAccount& from, Ledger::pointer ledger, bool sign)
|
||||
{
|
||||
auto seq = from.sequence;
|
||||
Json::Value tx_json = getCommonTransactionJson(from);
|
||||
tx_json[jss::TransactionType] = "OfferCancel";
|
||||
tx_json[jss::OfferSequence] = seq;
|
||||
STTx tx = parseTransaction(from, tx_json, sign);
|
||||
applyTransaction(ledger, tx, sign);
|
||||
}
|
||||
|
||||
void
|
||||
trust(TestAccount& from, TestAccount const& issuer,
|
||||
std::string const& currency, double amount,
|
||||
Ledger::pointer const& ledger, bool sign)
|
||||
{
|
||||
Json::Value tx_json = getCommonTransactionJson(from);
|
||||
Json::Value& limitAmount = tx_json[jss::LimitAmount];
|
||||
limitAmount[jss::currency] = currency;
|
||||
limitAmount[jss::issuer] = toBase58(calcAccountID(issuer.pk));
|
||||
limitAmount[jss::value] = std::to_string(amount);
|
||||
tx_json[jss::TransactionType] = "TrustSet";
|
||||
tx_json[jss::Flags] = 0; // tfClearNoRipple;
|
||||
STTx tx = parseTransaction(from, tx_json, sign);
|
||||
applyTransaction(ledger, tx, sign);
|
||||
}
|
||||
|
||||
void
|
||||
close_and_advance(Ledger::pointer& ledger, std::shared_ptr<Ledger const>& LCL)
|
||||
{
|
||||
auto const& set = ledger->txMap();
|
||||
CanonicalTXSet retriableTransactions(set.getHash());
|
||||
// Make a non-const copy of LCL. This won't be necessary once
|
||||
// that other Ledger constructor can take a const Ledger.
|
||||
Ledger oldLCL(*LCL, false);
|
||||
Ledger::pointer newLCL = std::make_shared<Ledger>(false, oldLCL);
|
||||
MetaView accum(*newLCL, tapNONE);
|
||||
// Set up to write SHAMap changes to our database,
|
||||
// perform updates, extract changes
|
||||
applyTransactions(&set, accum, newLCL, retriableTransactions);
|
||||
accum.apply(*newLCL, {});
|
||||
newLCL->updateSkipList();
|
||||
newLCL->setClosed();
|
||||
newLCL->stateMap().flushDirty(
|
||||
hotACCOUNT_NODE, newLCL->info().seq);
|
||||
newLCL->txMap().flushDirty(
|
||||
hotTRANSACTION_NODE, newLCL->info().seq);
|
||||
using namespace std::chrono;
|
||||
auto const epoch_offset = days(10957); // 2000-01-01
|
||||
std::uint32_t closeTime = time_point_cast<seconds> // now
|
||||
(system_clock::now() - epoch_offset).
|
||||
time_since_epoch().count();
|
||||
int closeResolution = seconds(ledgerDefaultTimeResolution).count();
|
||||
bool closeTimeCorrect = true;
|
||||
newLCL->setAccepted(closeTime, closeResolution, closeTimeCorrect);
|
||||
|
||||
if (!newLCL->assertSane())
|
||||
throw std::runtime_error(
|
||||
"!newLCL->assertSane()");
|
||||
|
||||
LCL = newLCL;
|
||||
ledger = std::make_shared<Ledger>(false, *newLCL);
|
||||
}
|
||||
|
||||
Json::Value findPath(Ledger::pointer ledger, TestAccount const& src,
|
||||
TestAccount const& dest, std::vector<Currency> srcCurrencies,
|
||||
Amount const& dstAmount, beast::abstract_ostream& log,
|
||||
boost::optional<Json::Value> contextPaths)
|
||||
{
|
||||
int const level = 8;
|
||||
|
||||
auto cache = std::make_shared<RippleLineCache>(ledger);
|
||||
|
||||
STAmount saDstAmount;
|
||||
if (!amountFromJsonNoThrow(saDstAmount, dstAmount.getJson()))
|
||||
throw std::runtime_error(
|
||||
"!amountFromJsonNoThrow(saDstAmount, dstAmount.getJson())");
|
||||
log << "Dst amount: " << saDstAmount;
|
||||
|
||||
auto jvSrcCurrencies = Json::Value(Json::arrayValue);
|
||||
for (auto const& srcCurrency : srcCurrencies)
|
||||
{
|
||||
jvSrcCurrencies.append(srcCurrency.getJson());
|
||||
}
|
||||
log << "Source currencies: " << jvSrcCurrencies;
|
||||
|
||||
auto result = ripplePathFind(cache, calcAccountID(src.pk),
|
||||
calcAccountID(dest.pk), saDstAmount,
|
||||
jvSrcCurrencies, contextPaths, level);
|
||||
if(!result.first)
|
||||
throw std::runtime_error(
|
||||
"ripplePathFind find failed");
|
||||
|
||||
return result.second;
|
||||
}
|
||||
|
||||
std::shared_ptr<SLE const>
|
||||
getLedgerEntryRippleState(Ledger::pointer ledger,
|
||||
TestAccount const& account1, TestAccount const& account2,
|
||||
Currency currency)
|
||||
{
|
||||
auto k = keylet::line(
|
||||
calcAccountID(account1.pk), calcAccountID(account2.pk),
|
||||
to_currency(currency.getCurrency()));
|
||||
|
||||
if (! k.key.isNonZero())
|
||||
throw std::runtime_error(
|
||||
"!k.key.isNonZero()");
|
||||
|
||||
return ledger->read(k);
|
||||
}
|
||||
|
||||
void
|
||||
verifyBalance(Ledger::pointer ledger, TestAccount const& account,
|
||||
Amount const& amount)
|
||||
{
|
||||
auto const sle = getLedgerEntryRippleState(ledger, account,
|
||||
amount.getIssuer(), amount.getCurrency());
|
||||
if (!sle)
|
||||
throw std::runtime_error(
|
||||
"!sle");
|
||||
STAmount amountReq;
|
||||
amountFromJsonNoThrow(amountReq, amount.getJson());
|
||||
|
||||
auto high = sle->getFieldAmount(sfHighLimit);
|
||||
auto balance = sle->getFieldAmount(sfBalance);
|
||||
if (high.getIssuer() == calcAccountID(account.pk))
|
||||
{
|
||||
balance.negate();
|
||||
}
|
||||
if (balance != amountReq)
|
||||
throw std::runtime_error(
|
||||
"balance != amountReq");
|
||||
}
|
||||
|
||||
Json::Value pathNode (TestAccount const& acc)
|
||||
{
|
||||
Json::Value result;
|
||||
result["account"] = toBase58(calcAccountID(acc.pk));
|
||||
result["type"] = 1;
|
||||
result["type_hex"] = "0000000000000001";
|
||||
return result;
|
||||
}
|
||||
|
||||
Json::Value pathNode (OfferPathNode const& offer)
|
||||
{
|
||||
Json::Value result;
|
||||
result["currency"] = offer.currency;
|
||||
result["type"] = 48;
|
||||
result["type_hex"] = "0000000000000030";
|
||||
if (offer.issuer)
|
||||
result["issuer"] = toBase58(calcAccountID(offer.issuer->pk));
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,294 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of rippled: https://github.com/ripple/rippled
|
||||
Copyright (c) 2012, 2013 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_APP_TESTS_COMMON_LEDGER_H_INCLUDED
|
||||
#define RIPPLE_APP_TESTS_COMMON_LEDGER_H_INCLUDED
|
||||
|
||||
#include <ripple/app/ledger/Ledger.h>
|
||||
#include <ripple/app/ledger/LedgerConsensus.h>
|
||||
#include <ripple/app/ledger/LedgerTiming.h>
|
||||
#include <ripple/app/misc/CanonicalTXSet.h>
|
||||
#include <ripple/app/tx/impl/Transactor.h>
|
||||
#include <ripple/basics/chrono.h>
|
||||
#include <ripple/crypto/KeyType.h>
|
||||
#include <ripple/json/json_value.h>
|
||||
#include <ripple/protocol/JsonFields.h>
|
||||
#include <ripple/protocol/Indexes.h>
|
||||
#include <ripple/protocol/RippleAddress.h>
|
||||
#include <ripple/protocol/STParsedJSON.h>
|
||||
#include <ripple/protocol/TxFlags.h>
|
||||
#include <ripple/protocol/STLedgerEntry.h>
|
||||
#include <beast/unit_test/suite.h>
|
||||
#include <beast/streams/abstract_ostream.h>
|
||||
#include <chrono>
|
||||
#include <string>
|
||||
|
||||
namespace ripple {
|
||||
namespace test {
|
||||
|
||||
struct TestAccount
|
||||
{
|
||||
RippleAddress pk;
|
||||
RippleAddress sk;
|
||||
unsigned sequence;
|
||||
};
|
||||
|
||||
struct TestJson
|
||||
{
|
||||
Json::Value
|
||||
getJson() const;
|
||||
|
||||
virtual void
|
||||
getJson(Json::Value& tx_json) const = 0;
|
||||
};
|
||||
|
||||
struct Currency : TestJson
|
||||
{
|
||||
Currency(std::string currency);
|
||||
|
||||
void
|
||||
getJson(Json::Value& tx_json) const override;
|
||||
|
||||
std::string
|
||||
getCurrency() const;
|
||||
|
||||
using TestJson::getJson;
|
||||
|
||||
private:
|
||||
std::string currency_;
|
||||
};
|
||||
|
||||
struct Issuer : TestJson
|
||||
{
|
||||
Issuer(TestAccount issuer);
|
||||
|
||||
void
|
||||
getJson(Json::Value& tx_json) const override;
|
||||
|
||||
TestAccount const&
|
||||
getAccount() const;
|
||||
|
||||
using TestJson::getJson;
|
||||
|
||||
private:
|
||||
TestAccount issuer_;
|
||||
};
|
||||
|
||||
struct Amount : TestJson
|
||||
{
|
||||
Amount(double value, std::string currency, TestAccount issuer);
|
||||
|
||||
void
|
||||
getJson(Json::Value& tx_json) const override;
|
||||
|
||||
double
|
||||
getValue() const;
|
||||
|
||||
TestAccount const&
|
||||
getIssuer() const;
|
||||
|
||||
Currency const&
|
||||
getCurrency() const;
|
||||
|
||||
using TestJson::getJson;
|
||||
|
||||
private:
|
||||
double value_;
|
||||
Currency currency_;
|
||||
Issuer issuer_;
|
||||
};
|
||||
|
||||
// Helper function to parse a transaction in Json, sign it with account,
|
||||
// and return it as a STTx
|
||||
STTx
|
||||
parseTransaction(TestAccount& account, Json::Value const& tx_json, bool sign = true);
|
||||
|
||||
// Helper function to apply a transaction to a ledger
|
||||
void
|
||||
applyTransaction(Ledger::pointer const& ledger, STTx const& tx, bool check = true);
|
||||
|
||||
// Create genesis ledger from a start amount in drops, and the public
|
||||
// master RippleAddress
|
||||
std::pair<std::shared_ptr<Ledger const>, Ledger::pointer>
|
||||
createGenesisLedger(std::uint64_t start_amount_drops, TestAccount const& master);
|
||||
|
||||
// Create an account represented by public RippleAddress and private
|
||||
// RippleAddress
|
||||
TestAccount
|
||||
createAccount(std::string const& passphrase, KeyType keyType);
|
||||
|
||||
TestAccount
|
||||
createAndFundAccount(TestAccount& from, std::string const& passphrase,
|
||||
KeyType keyType, std::uint64_t amountDrops,
|
||||
Ledger::pointer const& ledger, bool sign = true);
|
||||
|
||||
std::map<std::string, TestAccount>
|
||||
createAndFundAccounts(TestAccount& from, std::vector<std::string> passphrases,
|
||||
KeyType keyType, std::uint64_t amountDrops,
|
||||
Ledger::pointer const& ledger, bool sign = true);
|
||||
|
||||
std::map<std::string, TestAccount>
|
||||
createAndFundAccountsWithFlags(TestAccount& from,
|
||||
std::vector<std::string> passphrases,
|
||||
KeyType keyType, std::uint64_t amountDrops,
|
||||
Ledger::pointer& ledger,
|
||||
std::shared_ptr<Ledger const>& LCL,
|
||||
const std::uint32_t flags, bool sign = true);
|
||||
|
||||
void
|
||||
setAccountFlags(TestAccount& account, Ledger::pointer const& ledger,
|
||||
const std::uint32_t flags, bool sign = true);
|
||||
|
||||
void
|
||||
setAllAccountFlags(std::vector<TestAccount>& accounts, Ledger::pointer const& ledger,
|
||||
const std::uint32_t flags, bool sign = true);
|
||||
|
||||
template<class key_t>
|
||||
void
|
||||
setAllAccountFlags(std::map<key_t, TestAccount>& accounts, Ledger::pointer const& ledger,
|
||||
const std::uint32_t flags, bool sign = true)
|
||||
{
|
||||
for (auto& pair : accounts)
|
||||
{
|
||||
setAccountFlags(pair.second, ledger, flags, sign);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
clearAccountFlags(TestAccount& account, Ledger::pointer const& ledger,
|
||||
const std::uint32_t flags, bool sign = true);
|
||||
|
||||
void
|
||||
freezeAccount(TestAccount& account, Ledger::pointer const& ledger, bool sign = true);
|
||||
|
||||
void
|
||||
unfreezeAccount(TestAccount& account, Ledger::pointer const& ledger, bool sign = true);
|
||||
|
||||
STTx
|
||||
getPaymentTx(TestAccount& from, TestAccount const& to,
|
||||
std::uint64_t amountDrops,
|
||||
bool sign = true);
|
||||
|
||||
STTx
|
||||
pay(TestAccount& from, TestAccount const& to,
|
||||
std::uint64_t amountDrops,
|
||||
Ledger::pointer const& ledger, bool sign = true);
|
||||
|
||||
STTx
|
||||
getPaymentTx(TestAccount& from, TestAccount const& to,
|
||||
std::string const& currency, std::string const& amount,
|
||||
bool sign = true);
|
||||
|
||||
STTx
|
||||
pay(TestAccount& from, TestAccount const& to,
|
||||
std::string const& currency, std::string const& amount,
|
||||
Ledger::pointer const& ledger, bool sign = true);
|
||||
|
||||
STTx
|
||||
getPaymentTxWithPath(TestAccount& from, TestAccount const& to,
|
||||
std::string const& currency, std::string const& amount,
|
||||
Ledger::pointer const& ledger, bool sign = true);
|
||||
|
||||
STTx
|
||||
payWithPath(TestAccount& from, TestAccount const& to,
|
||||
std::string const& currency, std::string const& amount,
|
||||
Ledger::pointer const& ledger, bool sign = true);
|
||||
|
||||
STTx
|
||||
payWithPath(TestAccount& from, TestAccount const& to,
|
||||
std::string const& currency, std::string const& amount,
|
||||
Ledger::pointer const& ledger, Json::Value const& path,
|
||||
std::uint32_t flags,
|
||||
bool sign = true);
|
||||
|
||||
void
|
||||
createOffer(TestAccount& from, Amount const& in, Amount const& out,
|
||||
Ledger::pointer ledger, bool sign = true);
|
||||
|
||||
void
|
||||
createOfferWithFlags(TestAccount& from, Amount const& in, Amount const& out,
|
||||
Ledger::pointer ledger, std::uint32_t flags,
|
||||
bool sign = true);
|
||||
|
||||
// As currently implemented, this will cancel only the last offer made
|
||||
// from this account.
|
||||
void
|
||||
cancelOffer(TestAccount& from, Ledger::pointer ledger, bool sign = true);
|
||||
|
||||
void
|
||||
trust(TestAccount& from, TestAccount const& issuer,
|
||||
std::string const& currency, double amount,
|
||||
Ledger::pointer const& ledger, bool sign = true);
|
||||
|
||||
void
|
||||
close_and_advance(Ledger::pointer& ledger, std::shared_ptr<Ledger const>& LCL);
|
||||
|
||||
Json::Value findPath(Ledger::pointer ledger, TestAccount const& src,
|
||||
TestAccount const& dest, std::vector<Currency> srcCurrencies,
|
||||
Amount const& dstAmount, beast::abstract_ostream& log,
|
||||
boost::optional<Json::Value> contextPaths = boost::none);
|
||||
|
||||
struct OfferPathNode
|
||||
{
|
||||
std::string currency;
|
||||
boost::optional<TestAccount> issuer;
|
||||
OfferPathNode(std::string s, TestAccount const& iss)
|
||||
:currency(std::move(s)), issuer(iss) {}
|
||||
};
|
||||
|
||||
Json::Value pathNode (TestAccount const& acc);
|
||||
|
||||
Json::Value pathNode (OfferPathNode const& offer);
|
||||
|
||||
inline void createPathHelper (Json::Value& result)
|
||||
{
|
||||
// base case
|
||||
}
|
||||
|
||||
template<class First, class... Rest>
|
||||
void createPathHelper (Json::Value& result,
|
||||
First&& first,
|
||||
Rest&&... rest)
|
||||
{
|
||||
result.append (pathNode (std::forward<First> (first)));
|
||||
createPathHelper(result, rest...);
|
||||
}
|
||||
|
||||
template<class First, class... Rest>
|
||||
Json::Value createPath (First&& first,
|
||||
Rest&&... rest)
|
||||
{
|
||||
Json::Value result;
|
||||
createPathHelper (result, first, rest...);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
SLE::pointer
|
||||
get_ledger_entry_ripple_state(Ledger::pointer ledger,
|
||||
RippleAddress account1, RippleAddress account2,
|
||||
Currency currency);
|
||||
|
||||
void
|
||||
verifyBalance(Ledger::pointer ledger, TestAccount const& account, Amount const& amount);
|
||||
|
||||
} // test
|
||||
} // ripple
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -23,6 +23,7 @@
|
||||
#include <ripple/shamap/FullBelowCache.h>
|
||||
#include <ripple/shamap/TreeNodeCache.h>
|
||||
#include <ripple/basics/TaggedCache.h>
|
||||
#include <ripple/core/Config.h>
|
||||
#include <beast/utility/PropertyStream.h>
|
||||
#include <beast/cxx14/memory.h> // <memory>
|
||||
#include <mutex>
|
||||
@@ -31,7 +32,7 @@ namespace boost { namespace asio { class io_service; } }
|
||||
|
||||
namespace ripple {
|
||||
|
||||
namespace Validators { class Manager; }
|
||||
namespace unl { class Manager; }
|
||||
namespace Resource { class Manager; }
|
||||
namespace NodeStore { class Database; }
|
||||
|
||||
@@ -39,10 +40,8 @@ namespace NodeStore { class Database; }
|
||||
class AmendmentTable;
|
||||
class CachedSLEs;
|
||||
class CollectorManager;
|
||||
namespace shamap {
|
||||
class Family;
|
||||
} // shamap
|
||||
class IHashRouter;
|
||||
class HashRouter;
|
||||
class Logs;
|
||||
class LoadFeeTrack;
|
||||
class LocalCredentials;
|
||||
@@ -50,6 +49,7 @@ class UniqueNodeList;
|
||||
class JobQueue;
|
||||
class InboundLedgers;
|
||||
class InboundTransactions;
|
||||
class AcceptedLedger;
|
||||
class LedgerMaster;
|
||||
class LoadManager;
|
||||
class NetworkOPs;
|
||||
@@ -60,6 +60,7 @@ class PathRequests;
|
||||
class PendingSaves;
|
||||
class AccountIDCache;
|
||||
class STLedgerEntry;
|
||||
class TimeKeeper;
|
||||
class TransactionMaster;
|
||||
class Validations;
|
||||
|
||||
@@ -89,16 +90,17 @@ public:
|
||||
Application ();
|
||||
|
||||
virtual ~Application () = default;
|
||||
|
||||
virtual Config const& config() const = 0;
|
||||
virtual Logs& logs() = 0;
|
||||
virtual boost::asio::io_service& getIOService () = 0;
|
||||
virtual CollectorManager& getCollectorManager () = 0;
|
||||
virtual shamap::Family& family() = 0;
|
||||
virtual Family& family() = 0;
|
||||
virtual TimeKeeper& timeKeeper() = 0;
|
||||
virtual JobQueue& getJobQueue () = 0;
|
||||
virtual NodeCache& getTempNodeCache () = 0;
|
||||
virtual CachedSLEs& cachedSLEs() = 0;
|
||||
virtual Validators::Manager& getValidators () = 0;
|
||||
virtual AmendmentTable& getAmendmentTable() = 0;
|
||||
virtual IHashRouter& getHashRouter () = 0;
|
||||
virtual HashRouter& getHashRouter () = 0;
|
||||
virtual LoadFeeTrack& getFeeTrack () = 0;
|
||||
virtual LoadManager& getLoadManager () = 0;
|
||||
virtual Overlay& overlay () = 0;
|
||||
@@ -107,6 +109,8 @@ public:
|
||||
virtual NodeStore::Database& getNodeStore () = 0;
|
||||
virtual InboundLedgers& getInboundLedgers () = 0;
|
||||
virtual InboundTransactions& getInboundTransactions () = 0;
|
||||
virtual TaggedCache <uint256, AcceptedLedger>&
|
||||
getAcceptedLedgerCache () = 0;
|
||||
virtual LedgerMaster& getLedgerMaster () = 0;
|
||||
virtual NetworkOPs& getOPs () = 0;
|
||||
virtual OrderBookDB& getOrderBookDB () = 0;
|
||||
@@ -123,6 +127,9 @@ public:
|
||||
|
||||
virtual std::chrono::milliseconds getIOLatency () = 0;
|
||||
|
||||
virtual bool serverOkay (std::string& reason) = 0;
|
||||
|
||||
virtual beast::Journal journal (std::string const& name) = 0;
|
||||
/** Retrieve the "wallet database"
|
||||
|
||||
It looks like this is used to store the unique node list.
|
||||
@@ -132,7 +139,6 @@ public:
|
||||
//
|
||||
virtual DatabaseCon& getWalletDB () = 0;
|
||||
|
||||
virtual bool getSystemTimeOffset (int& offset) = 0;
|
||||
virtual bool isShutdown () = 0;
|
||||
virtual bool running () = 0;
|
||||
virtual void setup () = 0;
|
||||
@@ -140,27 +146,12 @@ public:
|
||||
virtual void signalStop () = 0;
|
||||
};
|
||||
|
||||
/** Create an instance of the Application object.
|
||||
As long as there are legacy calls to getApp it is not safe
|
||||
to create more than one Application object at a time.
|
||||
*/
|
||||
std::unique_ptr <Application>
|
||||
make_Application(Logs& logs);
|
||||
make_Application(
|
||||
std::unique_ptr<Config const> config,
|
||||
std::unique_ptr<Logs> logs);
|
||||
|
||||
// VFALCO DEPRECATED
|
||||
//
|
||||
// Please do not write new code that calls getApp(). Instead,
|
||||
// Use dependency injection to construct your class with a
|
||||
// reference to the desired interface (Application in this case).
|
||||
// Or better yet, instead of relying on the entire Application
|
||||
// object, construct with just the interfaces that you need.
|
||||
//
|
||||
// When working in existing code, try to clean it up by rewriting
|
||||
// calls to getApp to use a data member instead, and inject the
|
||||
// needed interfaces in the constructor.
|
||||
//
|
||||
// http://en.wikipedia.org/wiki/Dependency_injection
|
||||
//
|
||||
// DEPRECATED
|
||||
extern Application& getApp ();
|
||||
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
BasicApp::BasicApp(std::size_t numberOfThreads)
|
||||
{
|
||||
work_ = boost::in_place(std::ref(io_service_));
|
||||
work_.emplace (io_service_);
|
||||
threads_.reserve(numberOfThreads);
|
||||
while(numberOfThreads--)
|
||||
threads_.emplace_back(
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
#include <BeastConfig.h>
|
||||
#include <ripple/app/main/CollectorManager.h>
|
||||
#include <beast/cxx14/memory.h>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
@@ -56,12 +57,12 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
beast::insight::Collector::ptr const& collector ()
|
||||
beast::insight::Collector::ptr const& collector () override
|
||||
{
|
||||
return m_collector;
|
||||
}
|
||||
|
||||
beast::insight::Group::ptr const& group (std::string const& name)
|
||||
beast::insight::Group::ptr const& group (std::string const& name) override
|
||||
{
|
||||
return m_groups->get (name);
|
||||
}
|
||||
@@ -73,10 +74,10 @@ CollectorManager::~CollectorManager ()
|
||||
{
|
||||
}
|
||||
|
||||
CollectorManager* CollectorManager::New (Section const& params,
|
||||
std::unique_ptr<CollectorManager> CollectorManager::New(Section const& params,
|
||||
beast::Journal journal)
|
||||
{
|
||||
return new CollectorManagerImp (params, journal);
|
||||
return std::make_unique<CollectorManagerImp>(params, journal);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -29,11 +29,13 @@ namespace ripple {
|
||||
class CollectorManager
|
||||
{
|
||||
public:
|
||||
static CollectorManager* New (Section const& params,
|
||||
beast::Journal journal);
|
||||
static std::unique_ptr<CollectorManager> New (
|
||||
Section const& params, beast::Journal journal);
|
||||
|
||||
virtual ~CollectorManager () = 0;
|
||||
virtual beast::insight::Collector::ptr const& collector () = 0;
|
||||
virtual beast::insight::Group::ptr const& group (std::string const& name) = 0;
|
||||
virtual beast::insight::Group::ptr const& group (
|
||||
std::string const& name) = 0;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -37,11 +37,11 @@ class LoadManagerImp
|
||||
, public beast::Thread
|
||||
{
|
||||
public:
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
beast::Journal m_journal;
|
||||
using LockType = std::mutex;
|
||||
using ScopedLockType = std::lock_guard <LockType>;
|
||||
|
||||
Application& app_;
|
||||
beast::Journal m_journal;
|
||||
LockType mLock;
|
||||
|
||||
bool mArmed;
|
||||
@@ -49,9 +49,11 @@ public:
|
||||
int mDeadLock; // Detect server deadlocks
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
LoadManagerImp (Stoppable& parent, beast::Journal journal)
|
||||
LoadManagerImp (Application& app,
|
||||
Stoppable& parent, beast::Journal journal)
|
||||
: LoadManager (parent)
|
||||
, Thread ("loadmgr")
|
||||
, app_ (app)
|
||||
, m_journal (journal)
|
||||
, mArmed (false)
|
||||
, mDeadLock (0)
|
||||
@@ -166,21 +168,21 @@ public:
|
||||
// VFALCO TODO Eliminate the dependence on the Application object.
|
||||
// Choices include constructing with the job queue / feetracker.
|
||||
// Another option is using an observer pattern to invert the dependency.
|
||||
if (getApp().getJobQueue ().isOverloaded ())
|
||||
if (app_.getJobQueue ().isOverloaded ())
|
||||
{
|
||||
if (m_journal.info)
|
||||
m_journal.info << getApp().getJobQueue ().getJson (0);
|
||||
change = getApp().getFeeTrack ().raiseLocalFee ();
|
||||
m_journal.info << app_.getJobQueue ().getJson (0);
|
||||
change = app_.getFeeTrack ().raiseLocalFee ();
|
||||
}
|
||||
else
|
||||
{
|
||||
change = getApp().getFeeTrack ().lowerLocalFee ();
|
||||
change = app_.getFeeTrack ().lowerLocalFee ();
|
||||
}
|
||||
|
||||
if (change)
|
||||
{
|
||||
// VFALCO TODO replace this with a Listener / observer and subscribe in NetworkOPs or Application
|
||||
getApp().getOPs ().reportFeeChange ();
|
||||
app_.getOPs ().reportFeeChange ();
|
||||
}
|
||||
|
||||
t += std::chrono::seconds (1);
|
||||
@@ -211,9 +213,10 @@ LoadManager::LoadManager (Stoppable& parent)
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
std::unique_ptr<LoadManager>
|
||||
make_LoadManager (beast::Stoppable& parent, beast::Journal journal)
|
||||
make_LoadManager (Application& app,
|
||||
beast::Stoppable& parent, beast::Journal journal)
|
||||
{
|
||||
return std::make_unique <LoadManagerImp> (parent, journal);
|
||||
return std::make_unique<LoadManagerImp>(app, parent, journal);
|
||||
}
|
||||
|
||||
} // ripple
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#ifndef RIPPLE_APP_MAIN_LOADMANAGER_H_INCLUDED
|
||||
#define RIPPLE_APP_MAIN_LOADMANAGER_H_INCLUDED
|
||||
|
||||
#include <ripple/app/main/Application.h>
|
||||
#include <beast/threads/Stoppable.h>
|
||||
#include <beast/cxx14/memory.h> // <memory>
|
||||
|
||||
@@ -71,7 +72,8 @@ public:
|
||||
};
|
||||
|
||||
std::unique_ptr<LoadManager>
|
||||
make_LoadManager (beast::Stoppable& parent, beast::Journal journal);
|
||||
make_LoadManager (Application& app,
|
||||
beast::Stoppable& parent, beast::Journal journal);
|
||||
|
||||
} // ripple
|
||||
|
||||
|
||||
@@ -30,6 +30,11 @@
|
||||
|
||||
namespace ripple {
|
||||
|
||||
LocalCredentials::LocalCredentials(Application& app)
|
||||
: app_ (app)
|
||||
{
|
||||
}
|
||||
|
||||
void LocalCredentials::start ()
|
||||
{
|
||||
// We need our node identity before we begin networking.
|
||||
@@ -44,16 +49,16 @@ void LocalCredentials::start ()
|
||||
throw std::runtime_error ("unable to retrieve new node identity.");
|
||||
}
|
||||
|
||||
if (!getConfig ().QUIET)
|
||||
if (!app_.config().QUIET)
|
||||
std::cerr << "NodeIdentity: " << mNodePublicKey.humanNodePublic () << std::endl;
|
||||
|
||||
getApp().getUNL ().start ();
|
||||
app_.getUNL ().start ();
|
||||
}
|
||||
|
||||
// Retrieve network identity.
|
||||
bool LocalCredentials::nodeIdentityLoad ()
|
||||
{
|
||||
auto db = getApp().getWalletDB ().checkoutDb ();
|
||||
auto db = app_.getWalletDB ().checkoutDb ();
|
||||
bool bSuccess = false;
|
||||
|
||||
boost::optional<std::string> pubKO, priKO;
|
||||
@@ -71,10 +76,10 @@ bool LocalCredentials::nodeIdentityLoad ()
|
||||
bSuccess = true;
|
||||
}
|
||||
|
||||
if (getConfig ().NODE_PUB.isValid () && getConfig ().NODE_PRIV.isValid ())
|
||||
if (app_.config().NODE_PUB.isValid () && app_.config().NODE_PRIV.isValid ())
|
||||
{
|
||||
mNodePublicKey = getConfig ().NODE_PUB;
|
||||
mNodePrivateKey = getConfig ().NODE_PRIV;
|
||||
mNodePublicKey = app_.config().NODE_PUB;
|
||||
mNodePrivateKey = app_.config().NODE_PRIV;
|
||||
}
|
||||
|
||||
return bSuccess;
|
||||
@@ -83,7 +88,7 @@ bool LocalCredentials::nodeIdentityLoad ()
|
||||
// Create and store a network identity.
|
||||
bool LocalCredentials::nodeIdentityCreate ()
|
||||
{
|
||||
if (!getConfig ().QUIET)
|
||||
if (!app_.config().QUIET)
|
||||
std::cerr << "NodeIdentity: Creating." << std::endl;
|
||||
|
||||
//
|
||||
@@ -96,14 +101,14 @@ bool LocalCredentials::nodeIdentityCreate ()
|
||||
//
|
||||
// Store the node information
|
||||
//
|
||||
auto db = getApp().getWalletDB ().checkoutDb ();
|
||||
auto db = app_.getWalletDB ().checkoutDb ();
|
||||
|
||||
*db << str (boost::format (
|
||||
"INSERT INTO NodeIdentity (PublicKey,PrivateKey) VALUES ('%s','%s');")
|
||||
% naNodePublic.humanNodePublic ()
|
||||
% naNodePrivate.humanNodePrivate ());
|
||||
|
||||
if (!getConfig ().QUIET)
|
||||
if (!app_.config().QUIET)
|
||||
std::cerr << "NodeIdentity: Created." << std::endl;
|
||||
|
||||
return true;
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#ifndef RIPPLE_APP_MAIN_LOCALCREDENTIALS_H_INCLUDED
|
||||
#define RIPPLE_APP_MAIN_LOCALCREDENTIALS_H_INCLUDED
|
||||
|
||||
#include <ripple/app/main/Application.h>
|
||||
#include <ripple/protocol/RippleAddress.h>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
@@ -30,7 +31,7 @@ namespace ripple {
|
||||
class LocalCredentials
|
||||
{
|
||||
public:
|
||||
LocalCredentials () = default;
|
||||
LocalCredentials (Application& app);
|
||||
LocalCredentials (LocalCredentials const&) = delete;
|
||||
LocalCredentials& operator= (LocalCredentials const&) = delete;
|
||||
|
||||
@@ -53,6 +54,7 @@ private:
|
||||
bool nodeIdentityCreate ();
|
||||
|
||||
private:
|
||||
Application& app_;
|
||||
std::recursive_mutex mLock;
|
||||
|
||||
RippleAddress mNodePublicKey;
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace po = boost::program_options;
|
||||
|
||||
namespace ripple {
|
||||
|
||||
void setupServer ()
|
||||
void setupServer (Application& app)
|
||||
{
|
||||
#ifdef RLIMIT_NOFILE
|
||||
struct rlimit rl;
|
||||
@@ -67,48 +67,52 @@ void setupServer ()
|
||||
}
|
||||
#endif
|
||||
|
||||
getApp().setup ();
|
||||
app.setup ();
|
||||
}
|
||||
|
||||
boost::filesystem::path
|
||||
getEntropyFile()
|
||||
getEntropyFile(Config const& config)
|
||||
{
|
||||
return boost::filesystem::path (
|
||||
getConfig().legacy("database_path")) / "random.seed";
|
||||
auto const path = config.legacy("database_path");
|
||||
if (path.empty ())
|
||||
return {};
|
||||
return boost::filesystem::path (path) / "random.seed";
|
||||
}
|
||||
|
||||
void startServer ()
|
||||
void startServer (Application& app)
|
||||
{
|
||||
//
|
||||
// Execute start up rpc commands.
|
||||
//
|
||||
if (getConfig ().RPC_STARTUP.isArray ())
|
||||
if (app.config().RPC_STARTUP.isArray ())
|
||||
{
|
||||
for (int i = 0; i != getConfig ().RPC_STARTUP.size (); ++i)
|
||||
for (int i = 0; i != app.config().RPC_STARTUP.size (); ++i)
|
||||
{
|
||||
Json::Value const& jvCommand = getConfig ().RPC_STARTUP[i];
|
||||
Json::Value const& jvCommand = app.config().RPC_STARTUP[i];
|
||||
|
||||
if (!getConfig ().QUIET)
|
||||
if (!app.config().QUIET)
|
||||
std::cerr << "Startup RPC: " << jvCommand << std::endl;
|
||||
|
||||
Resource::Charge loadType = Resource::feeReferenceRPC;
|
||||
RPC::Context context {
|
||||
jvCommand, loadType, getApp().getOPs (),
|
||||
getApp().getLedgerMaster(), Role::ADMIN};
|
||||
app.journal ("RPCHandler"), jvCommand, app, loadType, app.getOPs (),
|
||||
app.getLedgerMaster(), Role::ADMIN, app};
|
||||
|
||||
Json::Value jvResult;
|
||||
RPC::doCommand (context, jvResult);
|
||||
|
||||
if (!getConfig ().QUIET)
|
||||
if (!app.config().QUIET)
|
||||
std::cerr << "Result: " << jvResult << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
// Block until we get a stop RPC.
|
||||
getApp().run ();
|
||||
app.run ();
|
||||
|
||||
// Try to write out some entropy to use the next time we start.
|
||||
stir_entropy (getEntropyFile ().string ());
|
||||
auto entropy = getEntropyFile (app.config());
|
||||
if (!entropy.empty ())
|
||||
stir_entropy (entropy.string ());
|
||||
}
|
||||
|
||||
void printHelp (const po::options_description& desc)
|
||||
@@ -146,14 +150,10 @@ void printHelp (const po::options_description& desc)
|
||||
" version\n"
|
||||
" server_info\n"
|
||||
" sign <private_key> <json> [offline]\n"
|
||||
#if RIPPLE_ENABLE_MULTI_SIGN
|
||||
" sign_for\n"
|
||||
#endif // RIPPLE_ENABLE_MULTI_SIGN
|
||||
" stop\n"
|
||||
" submit <tx_blob>|[<private_key> <json>]\n"
|
||||
#if RIPPLE_ENABLE_MULTI_SIGN
|
||||
" submit_multisigned\n"
|
||||
#endif // RIPPLE_ENABLE_MULTI_SIGN
|
||||
" tx <id>\n"
|
||||
" validation_create [<seed>|<pass_phrase>|<key>]\n"
|
||||
" validation_seed [<seed>|<pass_phrase>|<key>]\n"
|
||||
@@ -173,18 +173,22 @@ setupConfigForUnitTests (Config& config)
|
||||
config.legacy("database_path", "DummyForUnitTests");
|
||||
}
|
||||
|
||||
static int runShutdownTests ()
|
||||
static int runShutdownTests (std::unique_ptr<Config> config)
|
||||
{
|
||||
// Shutdown tests can not be part of the normal unit tests in 'runUnitTests'
|
||||
// because it needs to create and destroy an application object.
|
||||
int const numShutdownIterations = 20;
|
||||
// FIXME: we only loop once, since the Config object will get destroyed
|
||||
int const numShutdownIterations = 1; //20;
|
||||
|
||||
// Give it enough time to sync and run a bit while synced.
|
||||
std::chrono::seconds const serverUptimePerIteration (4 * 60);
|
||||
for (int i = 0; i < numShutdownIterations; ++i)
|
||||
{
|
||||
std::cerr << "\n\nStarting server. Iteration: " << i << "\n"
|
||||
<< std::endl;
|
||||
std::unique_ptr<Application> app (make_Application (deprecatedLogs()));
|
||||
auto app = make_Application (
|
||||
std::move(config),
|
||||
std::make_unique<Logs>());
|
||||
auto shutdownApp = [&app](std::chrono::seconds sleepTime, int iteration)
|
||||
{
|
||||
std::this_thread::sleep_for (sleepTime);
|
||||
@@ -193,20 +197,25 @@ static int runShutdownTests ()
|
||||
app->signalStop();
|
||||
};
|
||||
std::thread shutdownThread (shutdownApp, serverUptimePerIteration, i);
|
||||
setupServer();
|
||||
startServer();
|
||||
setupServer(*app);
|
||||
startServer(*app);
|
||||
shutdownThread.join();
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
static int runUnitTests (std::string const& pattern,
|
||||
std::string const& argument)
|
||||
static int runUnitTests (
|
||||
std::unique_ptr<Config> config,
|
||||
std::string const& pattern,
|
||||
std::string const& argument)
|
||||
{
|
||||
// Config needs to be set up before creating Application
|
||||
setupConfigForUnitTests (getConfig ());
|
||||
// VFALCO TODO Remove dependence on constructing Application object
|
||||
std::unique_ptr <Application> app (make_Application (deprecatedLogs()));
|
||||
setupConfigForUnitTests (*config);
|
||||
|
||||
auto app = make_Application (
|
||||
std::move(config),
|
||||
std::make_unique<Logs>());
|
||||
|
||||
using namespace beast::unit_test;
|
||||
beast::debug_ostream stream;
|
||||
reporter r (stream);
|
||||
@@ -228,52 +237,6 @@ int run (int argc, char** argv)
|
||||
using namespace std;
|
||||
|
||||
setCallingThreadName ("main");
|
||||
int iResult = 0;
|
||||
po::variables_map vm;
|
||||
|
||||
std::string importText;
|
||||
{
|
||||
importText += "Import an existing node database (specified in the [";
|
||||
importText += ConfigSection::importNodeDatabase ();
|
||||
importText += "] configuration file section) into the current ";
|
||||
importText += "node database (specified in the [";
|
||||
importText += ConfigSection::nodeDatabase ();
|
||||
importText += "] configuration file section).";
|
||||
}
|
||||
|
||||
// VFALCO TODO Replace boost program options with something from Beast.
|
||||
//
|
||||
// Set up option parsing.
|
||||
//
|
||||
po::options_description desc ("General Options");
|
||||
desc.add_options ()
|
||||
("help,h", "Display this message.")
|
||||
("conf", po::value<std::string> (), "Specify the configuration file.")
|
||||
("rpc", "Perform rpc command (default).")
|
||||
("rpc_ip", po::value <std::string> (), "Specify the IP address for RPC command. Format: <ip-address>[':'<port-number>]")
|
||||
("rpc_port", po::value <int> (), "Specify the port number for RPC command.")
|
||||
("standalone,a", "Run with no peers.")
|
||||
("shutdowntest", po::value <std::string> ()->implicit_value (""), "Perform shutdown tests.")
|
||||
("unittest,u", po::value <std::string> ()->implicit_value (""), "Perform unit tests.")
|
||||
("unittest-arg", po::value <std::string> ()->implicit_value (""), "Supplies argument to unit tests.")
|
||||
("parameters", po::value< vector<string> > (), "Specify comma separated parameters.")
|
||||
("quiet,q", "Reduce diagnotics.")
|
||||
("quorum", po::value <int> (), "Set the validation quorum.")
|
||||
("verbose,v", "Verbose logging.")
|
||||
("load", "Load the current ledger from the local DB.")
|
||||
("replay","Replay a ledger close.")
|
||||
("ledger", po::value<std::string> (), "Load the specified ledger and start from .")
|
||||
("ledgerfile", po::value<std::string> (), "Load the specified ledger file.")
|
||||
("start", "Start from a fresh Ledger.")
|
||||
("net", "Get the initial ledger from the network.")
|
||||
("fg", "Run in the foreground.")
|
||||
("import", importText.c_str ())
|
||||
("version", "Display the build version.")
|
||||
;
|
||||
|
||||
// Interpret positional arguments as --parameters.
|
||||
po::positional_options_description p;
|
||||
p.add ("parameters", -1);
|
||||
|
||||
{
|
||||
// We want to seed the RNG early. We acquire a small amount of
|
||||
@@ -299,27 +262,72 @@ int run (int argc, char** argv)
|
||||
add_entropy (entropy.get (), sizeof (entropy_t));
|
||||
}
|
||||
|
||||
if (!iResult)
|
||||
po::variables_map vm;
|
||||
|
||||
std::string importText;
|
||||
{
|
||||
// Parse options, if no error.
|
||||
try
|
||||
{
|
||||
po::store (po::command_line_parser (argc, argv)
|
||||
.options (desc) // Parse options.
|
||||
.positional (p) // Remainder as --parameters.
|
||||
.run (),
|
||||
vm);
|
||||
po::notify (vm); // Invoke option notify functions.
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
iResult = 1;
|
||||
}
|
||||
importText += "Import an existing node database (specified in the [";
|
||||
importText += ConfigSection::importNodeDatabase ();
|
||||
importText += "] configuration file section) into the current ";
|
||||
importText += "node database (specified in the [";
|
||||
importText += ConfigSection::nodeDatabase ();
|
||||
importText += "] configuration file section).";
|
||||
}
|
||||
|
||||
if (!iResult && vm.count ("help"))
|
||||
// Set up option parsing.
|
||||
//
|
||||
po::options_description desc ("General Options");
|
||||
desc.add_options ()
|
||||
("help,h", "Display this message.")
|
||||
("conf", po::value<std::string> (), "Specify the configuration file.")
|
||||
("rpc", "Perform rpc command (default).")
|
||||
("rpc_ip", po::value <std::string> (), "Specify the IP address for RPC command. Format: <ip-address>[':'<port-number>]")
|
||||
("rpc_port", po::value <std::uint16_t> (), "Specify the port number for RPC command.")
|
||||
("standalone,a", "Run with no peers.")
|
||||
("shutdowntest", po::value <std::string> ()->implicit_value (""), "Perform shutdown tests.")
|
||||
("unittest,u", po::value <std::string> ()->implicit_value (""), "Perform unit tests.")
|
||||
("unittest-arg", po::value <std::string> ()->implicit_value (""), "Supplies argument to unit tests.")
|
||||
("parameters", po::value< vector<string> > (), "Specify comma separated parameters.")
|
||||
("quiet,q", "Reduce diagnotics.")
|
||||
("quorum", po::value <int> (), "Set the validation quorum.")
|
||||
("verbose,v", "Verbose logging.")
|
||||
("load", "Load the current ledger from the local DB.")
|
||||
("valid", "Consider the initial ledger a valid network ledger.")
|
||||
("replay","Replay a ledger close.")
|
||||
("ledger", po::value<std::string> (), "Load the specified ledger and start from .")
|
||||
("ledgerfile", po::value<std::string> (), "Load the specified ledger file.")
|
||||
("start", "Start from a fresh Ledger.")
|
||||
("net", "Get the initial ledger from the network.")
|
||||
("fg", "Run in the foreground.")
|
||||
("import", importText.c_str ())
|
||||
("version", "Display the build version.")
|
||||
;
|
||||
|
||||
// Interpret positional arguments as --parameters.
|
||||
po::positional_options_description p;
|
||||
p.add ("parameters", -1);
|
||||
|
||||
// Parse options, if no error.
|
||||
try
|
||||
{
|
||||
iResult = 1;
|
||||
po::store (po::command_line_parser (argc, argv)
|
||||
.options (desc) // Parse options.
|
||||
.positional (p) // Remainder as --parameters.
|
||||
.run (),
|
||||
vm);
|
||||
po::notify (vm); // Invoke option notify functions.
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
std::cerr << "rippled: Incorrect command line syntax." << std::endl;
|
||||
std::cerr << "Use '--help' for a list of options." << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (vm.count ("help"))
|
||||
{
|
||||
printHelp (desc);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (vm.count ("version"))
|
||||
@@ -332,32 +340,18 @@ int run (int argc, char** argv)
|
||||
// Use a watchdog process unless we're invoking a stand alone type of mode
|
||||
//
|
||||
if (HaveSustain ()
|
||||
&& !iResult
|
||||
&& !vm.count ("parameters")
|
||||
&& !vm.count ("fg")
|
||||
&& !vm.count ("standalone")
|
||||
&& !vm.count ("shutdowntest")
|
||||
&& !vm.count ("unittest"))
|
||||
{
|
||||
std::string logMe = DoSustain (getConfig ().getDebugLogFile ().string());
|
||||
std::string logMe = DoSustain ();
|
||||
|
||||
if (!logMe.empty ())
|
||||
std::cerr << logMe;
|
||||
}
|
||||
|
||||
if (vm.count ("quiet"))
|
||||
{
|
||||
deprecatedLogs().severity(beast::Journal::kFatal);
|
||||
}
|
||||
else if (vm.count ("verbose"))
|
||||
{
|
||||
deprecatedLogs().severity(beast::Journal::kTrace);
|
||||
}
|
||||
else
|
||||
{
|
||||
deprecatedLogs().severity(beast::Journal::kInfo);
|
||||
}
|
||||
|
||||
// Run the unit tests if requested.
|
||||
// The unit tests will exit the application with an appropriate return code.
|
||||
//
|
||||
@@ -368,136 +362,160 @@ int run (int argc, char** argv)
|
||||
if (vm.count("unittest-arg"))
|
||||
argument = vm["unittest-arg"].as<std::string>();
|
||||
|
||||
return runUnitTests(vm["unittest"].as<std::string>(), argument);
|
||||
return runUnitTests(
|
||||
std::make_unique<Config> (),
|
||||
vm["unittest"].as<std::string>(),
|
||||
argument);
|
||||
}
|
||||
|
||||
if (!iResult)
|
||||
auto config = std::make_unique<Config>();
|
||||
|
||||
auto configFile = vm.count ("conf") ?
|
||||
vm["conf"].as<std::string> () : std::string();
|
||||
|
||||
// config file, quiet flag.
|
||||
config->setup (configFile, bool (vm.count ("quiet")));
|
||||
|
||||
if (vm.count ("standalone"))
|
||||
{
|
||||
auto configFile = vm.count ("conf") ?
|
||||
vm["conf"].as<std::string> () : std::string();
|
||||
|
||||
// config file, quiet flag.
|
||||
getConfig ().setup (configFile, bool (vm.count ("quiet")));
|
||||
|
||||
if (vm.count ("standalone"))
|
||||
{
|
||||
getConfig ().RUN_STANDALONE = true;
|
||||
getConfig ().LEDGER_HISTORY = 0;
|
||||
}
|
||||
|
||||
// Use any previously available entropy to stir the pool
|
||||
stir_entropy (getEntropyFile ().string ());
|
||||
config->RUN_STANDALONE = true;
|
||||
config->LEDGER_HISTORY = 0;
|
||||
}
|
||||
|
||||
if (vm.count ("start")) getConfig ().START_UP = Config::FRESH;
|
||||
// Use any previously available entropy to stir the pool
|
||||
auto entropy = getEntropyFile (*config);
|
||||
if (!entropy.empty ())
|
||||
stir_entropy (entropy.string ());
|
||||
|
||||
if (vm.count ("start"))
|
||||
config->START_UP = Config::FRESH;
|
||||
|
||||
// Handle a one-time import option
|
||||
//
|
||||
if (vm.count ("import"))
|
||||
{
|
||||
getConfig ().doImport = true;
|
||||
}
|
||||
config->doImport = true;
|
||||
|
||||
if (vm.count ("ledger"))
|
||||
{
|
||||
getConfig ().START_LEDGER = vm["ledger"].as<std::string> ();
|
||||
config->START_LEDGER = vm["ledger"].as<std::string> ();
|
||||
if (vm.count("replay"))
|
||||
getConfig ().START_UP = Config::REPLAY;
|
||||
config->START_UP = Config::REPLAY;
|
||||
else
|
||||
getConfig ().START_UP = Config::LOAD;
|
||||
config->START_UP = Config::LOAD;
|
||||
}
|
||||
else if (vm.count ("ledgerfile"))
|
||||
{
|
||||
getConfig ().START_LEDGER = vm["ledgerfile"].as<std::string> ();
|
||||
getConfig ().START_UP = Config::LOAD_FILE;
|
||||
config->START_LEDGER = vm["ledgerfile"].as<std::string> ();
|
||||
config->START_UP = Config::LOAD_FILE;
|
||||
}
|
||||
else if (vm.count ("load"))
|
||||
{
|
||||
getConfig ().START_UP = Config::LOAD;
|
||||
}
|
||||
else if (vm.count ("net"))
|
||||
{
|
||||
getConfig ().START_UP = Config::NETWORK;
|
||||
|
||||
if (getConfig ().VALIDATION_QUORUM < 2)
|
||||
getConfig ().VALIDATION_QUORUM = 2;
|
||||
config->START_UP = Config::LOAD;
|
||||
}
|
||||
|
||||
if (iResult == 0)
|
||||
if (vm.count ("valid"))
|
||||
{
|
||||
// These overrides must happen after the config file is loaded.
|
||||
config->START_VALID = true;
|
||||
}
|
||||
|
||||
// Override the RPC destination IP address
|
||||
//
|
||||
if (vm.count ("rpc_ip"))
|
||||
if (vm.count ("net"))
|
||||
{
|
||||
if ((config->START_UP == Config::LOAD) ||
|
||||
(config->START_UP == Config::REPLAY))
|
||||
{
|
||||
try
|
||||
{
|
||||
getConfig().rpc_ip =
|
||||
boost::asio::ip::address_v4::from_string(
|
||||
vm["rpc_ip"].as<std::string>());
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
std::cerr <<
|
||||
"Invalid rpc_ip = " << vm["rpc_ip"].as<std::string>();
|
||||
return -1;
|
||||
}
|
||||
std::cerr <<
|
||||
"Net and load/reply options are incompatible" << std::endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Override the RPC destination port number
|
||||
//
|
||||
if (vm.count ("rpc_port"))
|
||||
config->START_UP = Config::NETWORK;
|
||||
|
||||
if (config->VALIDATION_QUORUM < 2)
|
||||
config->VALIDATION_QUORUM = 2;
|
||||
}
|
||||
|
||||
// Override the RPC destination IP address. This must
|
||||
// happen after the config file is loaded.
|
||||
if (vm.count ("rpc_ip"))
|
||||
{
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
getConfig().rpc_port = vm["rpc_port"].as<int>();
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
std::cerr <<
|
||||
"Invalid rpc_port = " << vm["rpc_port"].as<std::string>();
|
||||
return -1;
|
||||
}
|
||||
config->rpc_ip.emplace (
|
||||
boost::asio::ip::address_v4::from_string(
|
||||
vm["rpc_ip"].as<std::string>()));
|
||||
}
|
||||
|
||||
if (vm.count ("quorum"))
|
||||
catch(...)
|
||||
{
|
||||
getConfig ().VALIDATION_QUORUM = vm["quorum"].as <int> ();
|
||||
std::cerr << "Invalid rpc_ip = " <<
|
||||
vm["rpc_ip"].as<std::string>() << std::endl;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (getConfig ().VALIDATION_QUORUM < 0)
|
||||
iResult = 1;
|
||||
// Override the RPC destination port number
|
||||
//
|
||||
if (vm.count ("rpc_port"))
|
||||
{
|
||||
try
|
||||
{
|
||||
config->rpc_port.emplace (
|
||||
vm["rpc_port"].as<std::uint16_t>());
|
||||
|
||||
if (*config->rpc_port == 0)
|
||||
throw std::domain_error ("");
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
std::cerr << "Invalid rpc_port = " <<
|
||||
vm["rpc_port"].as<std::string>() << std::endl;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (vm.count ("quorum"))
|
||||
{
|
||||
try
|
||||
{
|
||||
config->VALIDATION_QUORUM = vm["quorum"].as <int> ();
|
||||
config->LOCK_QUORUM = true;
|
||||
|
||||
if (config->VALIDATION_QUORUM < 0)
|
||||
throw std::domain_error ("");
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
std::cerr << "Invalid quorum = " <<
|
||||
vm["quorum"].as <std::string> () << std::endl;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (vm.count ("shutdowntest"))
|
||||
{
|
||||
return runShutdownTests ();
|
||||
}
|
||||
return runShutdownTests (std::move(config));
|
||||
|
||||
if (iResult == 0)
|
||||
// No arguments. Run server.
|
||||
if (!vm.count ("parameters"))
|
||||
{
|
||||
if (!vm.count ("parameters"))
|
||||
{
|
||||
// No arguments. Run server.
|
||||
std::unique_ptr <Application> app (make_Application (deprecatedLogs()));
|
||||
setupServer ();
|
||||
startServer ();
|
||||
}
|
||||
auto logs = std::make_unique<Logs>();
|
||||
|
||||
if (vm.count ("quiet"))
|
||||
logs->severity (beast::Journal::kFatal);
|
||||
else if (vm.count ("verbose"))
|
||||
logs->severity (beast::Journal::kTrace);
|
||||
else
|
||||
{
|
||||
// Have a RPC command.
|
||||
setCallingThreadName ("rpc");
|
||||
std::vector<std::string> vCmd = vm["parameters"].as<std::vector<std::string> > ();
|
||||
logs->severity (beast::Journal::kInfo);
|
||||
|
||||
iResult = RPCCall::fromCommandLine (vCmd);
|
||||
}
|
||||
auto app = make_Application (
|
||||
std::move(config),
|
||||
std::move (logs));
|
||||
setupServer (*app);
|
||||
startServer (*app);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (1 == iResult && !vm.count ("quiet"))
|
||||
printHelp (desc);
|
||||
|
||||
return iResult;
|
||||
// We have an RPC command to process:
|
||||
setCallingThreadName ("rpc");
|
||||
return RPCCall::fromCommandLine (
|
||||
*config,
|
||||
vm["parameters"].as<std::vector<std::string>>(), deprecatedLogs());
|
||||
}
|
||||
|
||||
extern int run (int argc, char** argv);
|
||||
|
||||
@@ -50,11 +50,10 @@ void NodeStoreScheduler::scheduleTask (NodeStore::Task& task)
|
||||
m_jobQueue->addJob (
|
||||
jtWRITE,
|
||||
"NodeObject::store",
|
||||
std::bind (&NodeStoreScheduler::doTask,
|
||||
this, std::ref(task), std::placeholders::_1));
|
||||
[this, &task] (Job&) { doTask(task); });
|
||||
}
|
||||
|
||||
void NodeStoreScheduler::doTask (NodeStore::Task& task, Job&)
|
||||
void NodeStoreScheduler::doTask (NodeStore::Task& task)
|
||||
{
|
||||
task.performScheduledTask ();
|
||||
if ((--m_taskCount == 0) && isStopping())
|
||||
|
||||
@@ -40,14 +40,14 @@ public:
|
||||
//
|
||||
void setJobQueue (JobQueue& jobQueue);
|
||||
|
||||
void onStop ();
|
||||
void onChildrenStopped ();
|
||||
void scheduleTask (NodeStore::Task& task);
|
||||
void onStop () override;
|
||||
void onChildrenStopped () override;
|
||||
void scheduleTask (NodeStore::Task& task) override;
|
||||
void onFetch (NodeStore::FetchReport const& report) override;
|
||||
void onBatchWrite (NodeStore::BatchWriteReport const& report) override;
|
||||
|
||||
private:
|
||||
void doTask (NodeStore::Task& task, Job&);
|
||||
void doTask (NodeStore::Task& task);
|
||||
|
||||
JobQueue* m_jobQueue;
|
||||
std::atomic <int> m_taskCount;
|
||||
|
||||
@@ -76,17 +76,17 @@ public:
|
||||
using const_iterator = std::map <Key, std::shared_ptr<STTx const>>::const_iterator;
|
||||
|
||||
public:
|
||||
explicit CanonicalTXSet (LedgerHash const& lastClosedLedgerHash)
|
||||
: mSetHash (lastClosedLedgerHash)
|
||||
explicit CanonicalTXSet (LedgerHash const& saltHash)
|
||||
: mSetHash (saltHash)
|
||||
{
|
||||
}
|
||||
|
||||
void insert (std::shared_ptr<STTx const> const& txn);
|
||||
|
||||
// VFALCO TODO remove this function
|
||||
void reset (LedgerHash const& newLastClosedLedgerHash)
|
||||
void reset (LedgerHash const& saltHash)
|
||||
{
|
||||
mSetHash = newLastClosedLedgerHash;
|
||||
mSetHash = saltHash;
|
||||
|
||||
mMap.clear ();
|
||||
}
|
||||
|
||||
@@ -41,6 +41,9 @@ public:
|
||||
/** The cost of a reference transaction in drops. */
|
||||
std::uint64_t reference_fee = 10;
|
||||
|
||||
/** The cost of a reference transaction in fee units. */
|
||||
std::uint32_t const reference_fee_units = 10;
|
||||
|
||||
/** The account reserve requirement in drops. */
|
||||
std::uint64_t account_reserve = 20 * SYSTEM_CURRENCY_PARTS;
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
//==============================================================================
|
||||
|
||||
#include <BeastConfig.h>
|
||||
#include <ripple/protocol/st.h>
|
||||
#include <ripple/app/misc/FeeVote.h>
|
||||
#include <ripple/app/main/Application.h>
|
||||
#include <ripple/app/misc/Validations.h>
|
||||
@@ -118,7 +119,7 @@ void
|
||||
FeeVoteImpl::doValidation (Ledger::ref lastClosedLedger,
|
||||
STObject& baseValidation)
|
||||
{
|
||||
if (lastClosedLedger->getBaseFee () != target_.reference_fee)
|
||||
if (lastClosedLedger->fees().base != target_.reference_fee)
|
||||
{
|
||||
if (journal_.info) journal_.info <<
|
||||
"Voting for base fee of " << target_.reference_fee;
|
||||
@@ -126,7 +127,7 @@ FeeVoteImpl::doValidation (Ledger::ref lastClosedLedger,
|
||||
baseValidation.setFieldU64 (sfBaseFee, target_.reference_fee);
|
||||
}
|
||||
|
||||
if (lastClosedLedger->getReserve (0) != target_.account_reserve)
|
||||
if (lastClosedLedger->fees().accountReserve(0) != target_.account_reserve)
|
||||
{
|
||||
if (journal_.info) journal_.info <<
|
||||
"Voting for base resrve of " << target_.account_reserve;
|
||||
@@ -134,7 +135,7 @@ FeeVoteImpl::doValidation (Ledger::ref lastClosedLedger,
|
||||
baseValidation.setFieldU32(sfReserveBase, target_.account_reserve);
|
||||
}
|
||||
|
||||
if (lastClosedLedger->getReserveInc () != target_.owner_reserve)
|
||||
if (lastClosedLedger->fees().increment != target_.owner_reserve)
|
||||
{
|
||||
if (journal_.info) journal_.info <<
|
||||
"Voting for reserve increment of " << target_.owner_reserve;
|
||||
@@ -153,13 +154,13 @@ FeeVoteImpl::doVoting (Ledger::ref lastClosedLedger,
|
||||
assert ((lastClosedLedger->info().seq % 256) == 0);
|
||||
|
||||
detail::VotableInteger<std::uint64_t> baseFeeVote (
|
||||
lastClosedLedger->getBaseFee (), target_.reference_fee);
|
||||
lastClosedLedger->fees().base, target_.reference_fee);
|
||||
|
||||
detail::VotableInteger<std::uint32_t> baseReserveVote (
|
||||
lastClosedLedger->getReserve (0), target_.account_reserve);
|
||||
lastClosedLedger->fees().accountReserve(0).drops(), target_.account_reserve);
|
||||
|
||||
detail::VotableInteger<std::uint32_t> incReserveVote (
|
||||
lastClosedLedger->getReserveInc (), target_.owner_reserve);
|
||||
lastClosedLedger->fees().increment, target_.owner_reserve);
|
||||
|
||||
for (auto const& e : set)
|
||||
{
|
||||
@@ -202,9 +203,9 @@ FeeVoteImpl::doVoting (Ledger::ref lastClosedLedger,
|
||||
std::uint32_t const incReserve = incReserveVote.getVotes ();
|
||||
|
||||
// add transactions to our position
|
||||
if ((baseFee != lastClosedLedger->getBaseFee ()) ||
|
||||
(baseReserve != lastClosedLedger->getReserve (0)) ||
|
||||
(incReserve != lastClosedLedger->getReserveInc ()))
|
||||
if ((baseFee != lastClosedLedger->fees().base) ||
|
||||
(baseReserve != lastClosedLedger->fees().accountReserve(0)) ||
|
||||
(incReserve != lastClosedLedger->fees().increment))
|
||||
{
|
||||
if (journal_.warning) journal_.warning <<
|
||||
"We are voting for a fee change: " << baseFee <<
|
||||
@@ -212,11 +213,11 @@ FeeVoteImpl::doVoting (Ledger::ref lastClosedLedger,
|
||||
"/" << incReserve;
|
||||
|
||||
STTx trans (ttFEE);
|
||||
trans.setAccountID (sfAccount, AccountID ());
|
||||
trans.setFieldU64 (sfBaseFee, baseFee);
|
||||
trans.setFieldU32 (sfReferenceFeeUnits, 10);
|
||||
trans.setFieldU32 (sfReserveBase, baseReserve);
|
||||
trans.setFieldU32 (sfReserveIncrement, incReserve);
|
||||
trans[sfAccount] = AccountID();
|
||||
trans[sfBaseFee] = baseFee;
|
||||
trans[sfReferenceFeeUnits] = target_.reference_fee_units;
|
||||
trans[sfReserveBase] = baseReserve;
|
||||
trans[sfReserveIncrement] = incReserve;
|
||||
|
||||
uint256 txID = trans.getTransactionID ();
|
||||
|
||||
|
||||
@@ -18,112 +18,35 @@
|
||||
//==============================================================================
|
||||
|
||||
#include <BeastConfig.h>
|
||||
#include <ripple/app/misc/IHashRouter.h>
|
||||
#include <ripple/basics/CountedObject.h>
|
||||
#include <ripple/basics/UnorderedContainers.h>
|
||||
#include <ripple/app/misc/HashRouter.h>
|
||||
#include <ripple/protocol/STTx.h>
|
||||
#include <ripple/basics/UptimeTimer.h>
|
||||
#include <map>
|
||||
#include <mutex>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
// VFALCO TODO Inline the function definitions
|
||||
class HashRouter : public IHashRouter
|
||||
std::function<bool(STTx const&, std::function<bool(STTx const&)>)>
|
||||
HashRouter::sigVerify()
|
||||
{
|
||||
private:
|
||||
/** An entry in the routing table.
|
||||
*/
|
||||
class Entry : public CountedObject <Entry>
|
||||
return
|
||||
[&] (STTx const& tx, std::function<bool(STTx const&)> sigCheck)
|
||||
{
|
||||
public:
|
||||
static char const* getCountedObjectName () { return "HashRouterEntry"; }
|
||||
|
||||
Entry ()
|
||||
: mFlags (0)
|
||||
auto const id = tx.getTransactionID();
|
||||
auto const flags = getFlags(id);
|
||||
if (flags & SF_SIGGOOD)
|
||||
return true;
|
||||
if (flags & SF_BAD)
|
||||
return false;
|
||||
if (! sigCheck(tx))
|
||||
{
|
||||
setFlags(id, SF_BAD);
|
||||
return false;
|
||||
}
|
||||
|
||||
std::set <PeerShortID> const& peekPeers () const
|
||||
{
|
||||
return mPeers;
|
||||
}
|
||||
|
||||
void addPeer (PeerShortID peer)
|
||||
{
|
||||
if (peer != 0)
|
||||
mPeers.insert (peer);
|
||||
}
|
||||
|
||||
bool hasPeer (PeerShortID peer) const
|
||||
{
|
||||
return mPeers.count (peer) > 0;
|
||||
}
|
||||
|
||||
int getFlags (void) const
|
||||
{
|
||||
return mFlags;
|
||||
}
|
||||
|
||||
bool hasFlag (int mask) const
|
||||
{
|
||||
return (mFlags & mask) != 0;
|
||||
}
|
||||
|
||||
void setFlag (int flagsToSet)
|
||||
{
|
||||
mFlags |= flagsToSet;
|
||||
}
|
||||
|
||||
void clearFlag (int flagsToClear)
|
||||
{
|
||||
mFlags &= ~flagsToClear;
|
||||
}
|
||||
|
||||
void swapSet (std::set <PeerShortID>& other)
|
||||
{
|
||||
mPeers.swap (other);
|
||||
}
|
||||
|
||||
private:
|
||||
int mFlags;
|
||||
std::set <PeerShortID> mPeers;
|
||||
setFlags(id, SF_SIGGOOD);
|
||||
return true;
|
||||
};
|
||||
|
||||
public:
|
||||
explicit HashRouter (int holdTime)
|
||||
: mHoldTime (holdTime)
|
||||
{
|
||||
}
|
||||
|
||||
bool addSuppression (uint256 const& index);
|
||||
|
||||
bool addSuppressionPeer (uint256 const& index, PeerShortID peer);
|
||||
bool addSuppressionPeer (uint256 const& index, PeerShortID peer, int& flags);
|
||||
bool addSuppressionFlags (uint256 const& index, int flag);
|
||||
bool setFlag (uint256 const& index, int flag);
|
||||
int getFlags (uint256 const& index);
|
||||
|
||||
bool swapSet (uint256 const& index, std::set<PeerShortID>& peers, int flag);
|
||||
|
||||
private:
|
||||
Entry getEntry (uint256 const& );
|
||||
|
||||
Entry& findCreateEntry (uint256 const& , bool& created);
|
||||
|
||||
using MutexType = std::mutex;
|
||||
using ScopedLockType = std::lock_guard <MutexType>;
|
||||
MutexType mMutex;
|
||||
|
||||
// Stores all suppressed hashes and their expiration time
|
||||
hash_map <uint256, Entry> mSuppressionMap;
|
||||
|
||||
// Stores all expiration times and the hashes indexed for them
|
||||
std::map< int, std::list<uint256> > mSuppressionTimes;
|
||||
|
||||
int mHoldTime;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
HashRouter::Entry& HashRouter::findCreateEntry (uint256 const& index, bool& created)
|
||||
{
|
||||
@@ -204,28 +127,28 @@ bool HashRouter::addSuppressionFlags (uint256 const& index, int flag)
|
||||
ScopedLockType lock (mMutex);
|
||||
|
||||
bool created;
|
||||
findCreateEntry (index, created).setFlag (flag);
|
||||
findCreateEntry (index, created).setFlags (flag);
|
||||
return created;
|
||||
}
|
||||
|
||||
bool HashRouter::setFlag (uint256 const& index, int flag)
|
||||
bool HashRouter::setFlags (uint256 const& index, int flags)
|
||||
{
|
||||
// VFALCO NOTE Comments like this belong in the HEADER file,
|
||||
// and more importantly in a Javadoc comment so
|
||||
// they appear in the generated documentation.
|
||||
//
|
||||
// return: true = changed, false = unchanged
|
||||
assert (flag != 0);
|
||||
assert (flags != 0);
|
||||
|
||||
ScopedLockType lock (mMutex);
|
||||
|
||||
bool created;
|
||||
Entry& s = findCreateEntry (index, created);
|
||||
|
||||
if ((s.getFlags () & flag) == flag)
|
||||
if ((s.getFlags () & flags) == flags)
|
||||
return false;
|
||||
|
||||
s.setFlag (flag);
|
||||
s.setFlags (flags);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -240,14 +163,9 @@ bool HashRouter::swapSet (uint256 const& index, std::set<PeerShortID>& peers, in
|
||||
return false;
|
||||
|
||||
s.swapSet (peers);
|
||||
s.setFlag (flag);
|
||||
s.setFlags (flag);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
IHashRouter* IHashRouter::New (int holdTime)
|
||||
{
|
||||
return new HashRouter (holdTime);
|
||||
}
|
||||
|
||||
} // ripple
|
||||
|
||||
180
src/ripple/app/misc/HashRouter.h
Normal file
180
src/ripple/app/misc/HashRouter.h
Normal file
@@ -0,0 +1,180 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of rippled: https://github.com/ripple/rippled
|
||||
Copyright (c) 2012, 2013 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_APP_MISC_HASHROUTER_H_INCLUDED
|
||||
#define RIPPLE_APP_MISC_HASHROUTER_H_INCLUDED
|
||||
|
||||
#include <ripple/basics/base_uint.h>
|
||||
#include <ripple/basics/CountedObject.h>
|
||||
#include <ripple/basics/UnorderedContainers.h>
|
||||
#include <cstdint>
|
||||
#include <functional>
|
||||
#include <set>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
class STTx;
|
||||
|
||||
// VFALCO NOTE Are these the flags?? Why aren't we using a packed struct?
|
||||
// VFALCO TODO convert these macros to int constants
|
||||
#define SF_RELAYED 0x01 // Has already been relayed to other nodes
|
||||
// VFALCO NOTE How can both bad and good be set on a hash?
|
||||
#define SF_BAD 0x02 // Signature/format is bad
|
||||
#define SF_SIGGOOD 0x04 // Signature is good
|
||||
#define SF_SAVED 0x08
|
||||
#define SF_RETRY 0x10 // Transaction can be retried
|
||||
#define SF_TRUSTED 0x20 // comes from trusted source
|
||||
|
||||
/** Routing table for objects identified by hash.
|
||||
|
||||
This table keeps track of which hashes have been received by which peers.
|
||||
It is used to manage the routing and broadcasting of messages in the peer
|
||||
to peer overlay.
|
||||
*/
|
||||
class HashRouter
|
||||
{
|
||||
public:
|
||||
// The type here *MUST* match the type of Peer::id_t
|
||||
using PeerShortID = std::uint32_t;
|
||||
|
||||
private:
|
||||
/** An entry in the routing table.
|
||||
*/
|
||||
class Entry : public CountedObject <Entry>
|
||||
{
|
||||
public:
|
||||
static char const* getCountedObjectName () { return "HashRouterEntry"; }
|
||||
|
||||
Entry ()
|
||||
: mFlags (0)
|
||||
{
|
||||
}
|
||||
|
||||
std::set <PeerShortID> const& peekPeers () const
|
||||
{
|
||||
return mPeers;
|
||||
}
|
||||
|
||||
void addPeer (PeerShortID peer)
|
||||
{
|
||||
if (peer != 0)
|
||||
mPeers.insert (peer);
|
||||
}
|
||||
|
||||
bool hasPeer (PeerShortID peer) const
|
||||
{
|
||||
return mPeers.count (peer) > 0;
|
||||
}
|
||||
|
||||
int getFlags (void) const
|
||||
{
|
||||
return mFlags;
|
||||
}
|
||||
|
||||
bool hasFlag (int mask) const
|
||||
{
|
||||
return (mFlags & mask) != 0;
|
||||
}
|
||||
|
||||
void setFlags (int flagsToSet)
|
||||
{
|
||||
mFlags |= flagsToSet;
|
||||
}
|
||||
|
||||
void clearFlag (int flagsToClear)
|
||||
{
|
||||
mFlags &= ~flagsToClear;
|
||||
}
|
||||
|
||||
void swapSet (std::set <PeerShortID>& other)
|
||||
{
|
||||
mPeers.swap (other);
|
||||
}
|
||||
|
||||
private:
|
||||
int mFlags;
|
||||
std::set <PeerShortID> mPeers;
|
||||
};
|
||||
|
||||
public:
|
||||
// VFALCO NOTE this preferred alternative to default parameters makes
|
||||
// behavior clear.
|
||||
//
|
||||
static inline int getDefaultHoldTime ()
|
||||
{
|
||||
return 300;
|
||||
}
|
||||
|
||||
explicit HashRouter (int entryHoldTimeInSeconds)
|
||||
: mHoldTime (entryHoldTimeInSeconds)
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~HashRouter() = default;
|
||||
|
||||
// VFALCO TODO Replace "Supression" terminology with something more
|
||||
// semantically meaningful.
|
||||
bool addSuppression (uint256 const& index);
|
||||
|
||||
bool addSuppressionPeer (uint256 const& index, PeerShortID peer);
|
||||
|
||||
bool addSuppressionPeer (uint256 const& index, PeerShortID peer,
|
||||
int& flags);
|
||||
|
||||
bool addSuppressionFlags (uint256 const& index, int flag);
|
||||
|
||||
/** Set the flags on a hash.
|
||||
|
||||
@return `true` if the flags were changed.
|
||||
*/
|
||||
bool setFlags (uint256 const& index, int flags);
|
||||
|
||||
int getFlags (uint256 const& index);
|
||||
|
||||
bool swapSet (uint256 const& index, std::set<PeerShortID>& peers, int flag);
|
||||
|
||||
/**
|
||||
Function wrapper that will check the signature status
|
||||
of a STTx before calling an expensive signature
|
||||
checking function.
|
||||
*/
|
||||
std::function<bool(STTx const&, std::function<bool(STTx const&)>)>
|
||||
sigVerify();
|
||||
|
||||
private:
|
||||
Entry getEntry (uint256 const& );
|
||||
|
||||
Entry& findCreateEntry (uint256 const& , bool& created);
|
||||
|
||||
using MutexType = std::mutex;
|
||||
using ScopedLockType = std::lock_guard <MutexType>;
|
||||
MutexType mMutex;
|
||||
|
||||
// Stores all suppressed hashes and their expiration time
|
||||
hash_map <uint256, Entry> mSuppressionMap;
|
||||
|
||||
// Stores all expiration times and the hashes indexed for them
|
||||
std::map< int, std::list<uint256> > mSuppressionTimes;
|
||||
|
||||
int mHoldTime;
|
||||
};
|
||||
|
||||
} // ripple
|
||||
|
||||
#endif
|
||||
@@ -1,87 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of rippled: https://github.com/ripple/rippled
|
||||
Copyright (c) 2012, 2013 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_APP_MISC_IHASHROUTER_H_INCLUDED
|
||||
#define RIPPLE_APP_MISC_IHASHROUTER_H_INCLUDED
|
||||
|
||||
#include <ripple/basics/base_uint.h>
|
||||
#include <cstdint>
|
||||
#include <set>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
// VFALCO NOTE Are these the flags?? Why aren't we using a packed struct?
|
||||
// VFALCO TODO convert these macros to int constants
|
||||
#define SF_RELAYED 0x01 // Has already been relayed to other nodes
|
||||
// VFALCO NOTE How can both bad and good be set on a hash?
|
||||
#define SF_BAD 0x02 // Signature/format is bad
|
||||
#define SF_SIGGOOD 0x04 // Signature is good
|
||||
#define SF_SAVED 0x08
|
||||
#define SF_RETRY 0x10 // Transaction can be retried
|
||||
#define SF_TRUSTED 0x20 // comes from trusted source
|
||||
|
||||
/** Routing table for objects identified by hash.
|
||||
|
||||
This table keeps track of which hashes have been received by which peers.
|
||||
It is used to manage the routing and broadcasting of messages in the peer
|
||||
to peer overlay.
|
||||
*/
|
||||
class IHashRouter
|
||||
{
|
||||
public:
|
||||
// The type here *MUST* match the type of Peer::id_t
|
||||
using PeerShortID = std::uint32_t;
|
||||
|
||||
// VFALCO NOTE this preferred alternative to default parameters makes
|
||||
// behavior clear.
|
||||
//
|
||||
static inline int getDefaultHoldTime ()
|
||||
{
|
||||
return 300;
|
||||
}
|
||||
|
||||
// VFALCO TODO rename the parameter to entryHoldTimeInSeconds
|
||||
static IHashRouter* New (int holdTime);
|
||||
|
||||
virtual ~IHashRouter () { }
|
||||
|
||||
// VFALCO TODO Replace "Supression" terminology with something more semantically meaningful.
|
||||
virtual bool addSuppression (uint256 const& index) = 0;
|
||||
|
||||
virtual bool addSuppressionPeer (uint256 const& index, PeerShortID peer) = 0;
|
||||
|
||||
virtual bool addSuppressionPeer (uint256 const& index, PeerShortID peer, int& flags) = 0;
|
||||
|
||||
virtual bool addSuppressionFlags (uint256 const& index, int flag) = 0;
|
||||
|
||||
/** Set the flags on a hash.
|
||||
|
||||
@return `true` if the flags were changed.
|
||||
*/
|
||||
// VFALCO TODO Rename to setFlags since it works with multiple flags.
|
||||
virtual bool setFlag (uint256 const& index, int mask) = 0;
|
||||
|
||||
virtual int getFlags (uint256 const& index) = 0;
|
||||
|
||||
virtual bool swapSet (uint256 const& index, std::set<PeerShortID>& peers, int flag) = 0;
|
||||
};
|
||||
|
||||
} // ripple
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -101,12 +101,6 @@ public:
|
||||
// Network information
|
||||
//
|
||||
|
||||
// Our best estimate of wall time in seconds from 1/1/2000
|
||||
virtual std::uint32_t getNetworkTimeNC () const = 0;
|
||||
// Our best estimate of current ledger close time
|
||||
virtual std::uint32_t getCloseTimeNC () const = 0;
|
||||
virtual void closeTimeOffset (int) = 0;
|
||||
|
||||
virtual OperatingMode getOperatingMode () const = 0;
|
||||
virtual std::string strOperatingMode () const = 0;
|
||||
|
||||
@@ -116,7 +110,7 @@ public:
|
||||
//
|
||||
|
||||
// must complete immediately
|
||||
virtual void submitTransaction (Job&, STTx::pointer) = 0;
|
||||
virtual void submitTransaction (STTx::pointer) = 0;
|
||||
|
||||
/**
|
||||
* Process transactions as they arrive from the network or which are
|
||||
@@ -135,7 +129,7 @@ public:
|
||||
// Owner functions
|
||||
//
|
||||
|
||||
virtual Json::Value getOwnerInfo (Ledger::pointer lpLedger,
|
||||
virtual Json::Value getOwnerInfo (std::shared_ptr<ReadView const> lpLedger,
|
||||
AccountID const& account) = 0;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -233,15 +227,17 @@ public:
|
||||
// Monitoring: publisher side
|
||||
//
|
||||
virtual void pubLedger (Ledger::ref lpAccepted) = 0;
|
||||
virtual void pubProposedTransaction (Ledger::ref lpCurrent,
|
||||
virtual void pubProposedTransaction (
|
||||
std::shared_ptr<ReadView const> const& lpCurrent,
|
||||
STTx::ref stTxn, TER terResult) = 0;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
std::unique_ptr<NetworkOPs>
|
||||
make_NetworkOPs (NetworkOPs::clock_type& clock, bool standalone,
|
||||
std::size_t network_quorum, JobQueue& job_queue, LedgerMaster& ledgerMaster,
|
||||
make_NetworkOPs (Application& app, NetworkOPs::clock_type& clock, bool standalone,
|
||||
std::size_t network_quorum, bool start_valid,
|
||||
JobQueue& job_queue, LedgerMaster& ledgerMaster,
|
||||
beast::Stoppable& parent, beast::Journal journal);
|
||||
|
||||
} // ripple
|
||||
|
||||
@@ -79,13 +79,15 @@ SHAMapStore::Setup
|
||||
setup_SHAMapStore(Config const& c);
|
||||
|
||||
std::unique_ptr<SHAMapStore>
|
||||
make_SHAMapStore(SHAMapStore::Setup const& s,
|
||||
beast::Stoppable& parent,
|
||||
NodeStore::Scheduler& scheduler,
|
||||
beast::Journal journal,
|
||||
beast::Journal nodeStoreJournal,
|
||||
TransactionMaster& transactionMaster,
|
||||
BasicConfig const& conf);
|
||||
make_SHAMapStore(
|
||||
Application& app,
|
||||
SHAMapStore::Setup const& s,
|
||||
beast::Stoppable& parent,
|
||||
NodeStore::Scheduler& scheduler,
|
||||
beast::Journal journal,
|
||||
beast::Journal nodeStoreJournal,
|
||||
TransactionMaster& transactionMaster,
|
||||
BasicConfig const& conf);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -160,7 +160,11 @@ SHAMapStoreImp::SavedStateDB::setLastRotated (LedgerIndex seq)
|
||||
;
|
||||
}
|
||||
|
||||
SHAMapStoreImp::SHAMapStoreImp (Setup const& setup,
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
SHAMapStoreImp::SHAMapStoreImp (
|
||||
Application& app,
|
||||
Setup const& setup,
|
||||
Stoppable& parent,
|
||||
NodeStore::Scheduler& scheduler,
|
||||
beast::Journal journal,
|
||||
@@ -168,6 +172,7 @@ SHAMapStoreImp::SHAMapStoreImp (Setup const& setup,
|
||||
TransactionMaster& transactionMaster,
|
||||
BasicConfig const& config)
|
||||
: SHAMapStore (parent)
|
||||
, app_ (app)
|
||||
, setup_ (setup)
|
||||
, scheduler_ (scheduler)
|
||||
, journal_ (journal)
|
||||
@@ -262,12 +267,12 @@ void
|
||||
SHAMapStoreImp::run()
|
||||
{
|
||||
LedgerIndex lastRotated = state_db_.getState().lastRotated;
|
||||
netOPs_ = &getApp().getOPs();
|
||||
ledgerMaster_ = &getApp().getLedgerMaster();
|
||||
fullBelowCache_ = &getApp().family().fullbelow();
|
||||
treeNodeCache_ = &getApp().family().treecache();
|
||||
transactionDb_ = &getApp().getTxnDB();
|
||||
ledgerDb_ = &getApp().getLedgerDB();
|
||||
netOPs_ = &app_.getOPs();
|
||||
ledgerMaster_ = &app_.getLedgerMaster();
|
||||
fullBelowCache_ = &app_.family().fullbelow();
|
||||
treeNodeCache_ = &app_.family().treecache();
|
||||
transactionDb_ = &app_.getTxnDB();
|
||||
ledgerDb_ = &app_.getLedgerDB();
|
||||
|
||||
if (setup_.advisoryDelete)
|
||||
canDelete_ = state_db_.getCanDelete ();
|
||||
@@ -666,25 +671,35 @@ setup_SHAMapStore (Config const& c)
|
||||
{
|
||||
SHAMapStore::Setup setup;
|
||||
|
||||
auto const& sec = c.section (ConfigSection::nodeDatabase ());
|
||||
get_if_exists (sec, "online_delete", setup.deleteInterval);
|
||||
// Get existing settings and add some default values if not specified:
|
||||
setup.nodeDatabase = c.section (ConfigSection::nodeDatabase ());
|
||||
|
||||
// These two parameters apply only to RocksDB. We want to give them sensible
|
||||
// defaults if no values are specified.
|
||||
if (!setup.nodeDatabase.exists ("cache_mb"))
|
||||
setup.nodeDatabase.set ("cache_mb", std::to_string (c.getSize (siHashNodeDBCache)));
|
||||
|
||||
if (!setup.nodeDatabase.exists ("filter_bits") && (c.NODE_SIZE >= 2))
|
||||
setup.nodeDatabase.set ("filter_bits", "10");
|
||||
|
||||
get_if_exists (setup.nodeDatabase, "online_delete", setup.deleteInterval);
|
||||
|
||||
if (setup.deleteInterval)
|
||||
get_if_exists (sec, "advisory_delete", setup.advisoryDelete);
|
||||
get_if_exists (setup.nodeDatabase, "advisory_delete", setup.advisoryDelete);
|
||||
|
||||
setup.ledgerHistory = c.LEDGER_HISTORY;
|
||||
setup.nodeDatabase = c[ConfigSection::nodeDatabase ()];
|
||||
setup.databasePath = c.legacy("database_path");
|
||||
|
||||
get_if_exists (sec, "delete_batch", setup.deleteBatch);
|
||||
get_if_exists (sec, "backOff", setup.backOff);
|
||||
get_if_exists (sec, "age_threshold", setup.ageThreshold);
|
||||
get_if_exists (setup.nodeDatabase, "delete_batch", setup.deleteBatch);
|
||||
get_if_exists (setup.nodeDatabase, "backOff", setup.backOff);
|
||||
get_if_exists (setup.nodeDatabase, "age_threshold", setup.ageThreshold);
|
||||
|
||||
return setup;
|
||||
}
|
||||
|
||||
std::unique_ptr<SHAMapStore>
|
||||
make_SHAMapStore (SHAMapStore::Setup const& s,
|
||||
make_SHAMapStore (Application& app,
|
||||
SHAMapStore::Setup const& s,
|
||||
beast::Stoppable& parent,
|
||||
NodeStore::Scheduler& scheduler,
|
||||
beast::Journal journal,
|
||||
@@ -692,7 +707,7 @@ make_SHAMapStore (SHAMapStore::Setup const& s,
|
||||
TransactionMaster& transactionMaster,
|
||||
BasicConfig const& config)
|
||||
{
|
||||
return std::make_unique<SHAMapStoreImp>(s, parent, scheduler,
|
||||
return std::make_unique<SHAMapStoreImp>(app, s, parent, scheduler,
|
||||
journal, nodeStoreJournal, transactionMaster,
|
||||
config);
|
||||
}
|
||||
|
||||
@@ -71,6 +71,8 @@ private:
|
||||
void setLastRotated (LedgerIndex seq);
|
||||
};
|
||||
|
||||
Application& app_;
|
||||
|
||||
// name of state database
|
||||
std::string const dbName_ = "state";
|
||||
// prefix of on-disk nodestore backend instances
|
||||
@@ -105,7 +107,8 @@ private:
|
||||
DatabaseCon* ledgerDb_ = nullptr;
|
||||
|
||||
public:
|
||||
SHAMapStoreImp (Setup const& setup,
|
||||
SHAMapStoreImp (Application& app,
|
||||
Setup const& setup,
|
||||
Stoppable& parent,
|
||||
NodeStore::Scheduler& scheduler,
|
||||
beast::Journal journal,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user