mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-21 19:45:53 +00:00
Merge branch 'master' of github.com:jedmccaleb/NewCoin
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -30,6 +30,10 @@ tmp
|
|||||||
db/*.db
|
db/*.db
|
||||||
db/*.db-journal
|
db/*.db-journal
|
||||||
|
|
||||||
|
# Ignore obj files
|
||||||
|
Debug/*.*
|
||||||
|
Release/*.*
|
||||||
|
|
||||||
# Ignore customized configs
|
# Ignore customized configs
|
||||||
rippled.cfg
|
rippled.cfg
|
||||||
validators.txt
|
validators.txt
|
||||||
|
|||||||
@@ -1,149 +0,0 @@
|
|||||||
#
|
|
||||||
# Sample newcoind.cfg
|
|
||||||
#
|
|
||||||
# This file should be named newcoind.cfg. This file is UTF-8 with Dos, UNIX,
|
|
||||||
# or Mac style end of lines. Blank lines and lines beginning with '#' are
|
|
||||||
# ignored. Undefined sections are reserved. No escapes are currently defined.
|
|
||||||
#
|
|
||||||
# When you launch newcoind, it will attempt to find this file.
|
|
||||||
#
|
|
||||||
# --conf=<path>:
|
|
||||||
# You may specify the location of this file with --conf=<path>. The config
|
|
||||||
# directory is the directory containing this file. The data directory is a
|
|
||||||
# the subdirectory named "dbs".
|
|
||||||
#
|
|
||||||
# Windows and no --conf:
|
|
||||||
# The config directory is the same directory as the newcoind program. The
|
|
||||||
# data directory is a the subdirectory named "dbs".
|
|
||||||
#
|
|
||||||
# Other OSes and no --conf:
|
|
||||||
# This file will be looked for in these places in the following order:
|
|
||||||
# ./newcoind.cfg
|
|
||||||
# $XDG_CONFIG_HOME/newcoin/newcoind.cfg
|
|
||||||
#
|
|
||||||
# If newcoind.cfg, is found in the current working directory, the directory
|
|
||||||
# will be used as the config directory. The data directory is a the
|
|
||||||
# subdirectory named "dbs".
|
|
||||||
#
|
|
||||||
# Otherwise, the data directory data is:
|
|
||||||
# $XDG_DATA_HOME/newcoin/
|
|
||||||
#
|
|
||||||
# Note: $XDG_CONFIG_HOME defaults to $HOME/.config
|
|
||||||
# $XDG_DATA_HOME defaults to $HOME/.local/share
|
|
||||||
#
|
|
||||||
# [debug_logfile]
|
|
||||||
# Specifies were a debug logfile is kept. By default, no debug log is kept
|
|
||||||
#
|
|
||||||
# Example: debug.log
|
|
||||||
#
|
|
||||||
# [validators_site]:
|
|
||||||
# Specifies where to find validators.txt for UNL boostrapping and RPC command unl_network.
|
|
||||||
# During alpha testing, this defaults to: redstem.com
|
|
||||||
#
|
|
||||||
# Example: newcoin.org
|
|
||||||
#
|
|
||||||
# [unl_default]:
|
|
||||||
# XXX This should be called: [validators_file]
|
|
||||||
# Specifies how to bootstrap the UNL list. The UNL list is based on a
|
|
||||||
# validators.txt file and is maintained in the databases. When newcoind
|
|
||||||
# starts up, if the databases are missing or are obsolete due to an upgrade
|
|
||||||
# of newcoind, newcoind will reconstruct the UNL list as specified here.
|
|
||||||
#
|
|
||||||
# If this entry is not present or empty, newcoind will look for a validators.txt in the
|
|
||||||
# config directory. If not found there, it will attempt to retrieve the file
|
|
||||||
# from the newcoin foundation's web site.
|
|
||||||
#
|
|
||||||
# This entry is also used by the RPC command unl_load.
|
|
||||||
#
|
|
||||||
# Specify the file by specifying its full path.
|
|
||||||
#
|
|
||||||
# Examples:
|
|
||||||
# C:/home/johndoe/newcoin/validators.txt
|
|
||||||
# /home/johndoe/newcoin/validators.txt
|
|
||||||
#
|
|
||||||
# [validators]:
|
|
||||||
# Only valid in "newcoind.cfg", "newcoin.txt", and the referered [validators_url].
|
|
||||||
# List of nodes to accept as validators speficied by public key or domain.
|
|
||||||
#
|
|
||||||
# For domains, newcoind will probe for https web servers at the specied
|
|
||||||
# domain in the following order: newcoin.DOMAIN, www.DOMAIN, DOMAIN
|
|
||||||
#
|
|
||||||
# Examples:
|
|
||||||
# redstem.com
|
|
||||||
# n9KorY8QtTdRx7TVDpwnG9NvyxsDwHUKUEeDLY3AkiGncVaSXZi5
|
|
||||||
# n9MqiExBcoG19UXwoLjBJnhsxEhAZMuWwJDRdkyDz1EkEkwzQTNt John Doe
|
|
||||||
#
|
|
||||||
# [ips]:
|
|
||||||
# Only valid in "newcoind.cfg", "newcoin.txt", and the referered [ips_url].
|
|
||||||
# List of ips where the Newcoin protocol is avialable.
|
|
||||||
# One ipv4 or ipv6 address per line.
|
|
||||||
# A port may optionally be specified after adding a space to the address.
|
|
||||||
# By convention, if known, IPs are listed in from most to least trusted.
|
|
||||||
#
|
|
||||||
# Examples:
|
|
||||||
# 192.168.0.1
|
|
||||||
# 192.168.0.1 3939
|
|
||||||
# 2001:0db8:0100:f101:0210:a4ff:fee3:9566
|
|
||||||
#
|
|
||||||
# [peer_ip]:
|
|
||||||
# IP address or domain to bind to allow external connections from peers.
|
|
||||||
# Defaults to not allow external connections from peers.
|
|
||||||
#
|
|
||||||
# Examples: 0.0.0.0 - Bind on all interfaces.
|
|
||||||
#
|
|
||||||
# [peer_port]:
|
|
||||||
# Port to bind to allow external connections from peers.
|
|
||||||
#
|
|
||||||
# [rpc_ip]:
|
|
||||||
# IP address or domain to bind to allow insecure RPC connections.
|
|
||||||
# Defaults to not allow RPC connections.
|
|
||||||
#
|
|
||||||
# [rpc_port]:
|
|
||||||
# Port to bind to if allowing insecure RPC connections.
|
|
||||||
#
|
|
||||||
# [rpc_allow_remote]:
|
|
||||||
# 0 or 1. 0 only allows RPC connections from 127.0.0.1. [default 0]
|
|
||||||
#
|
|
||||||
# [websocket_ip]:
|
|
||||||
# IP address or domain to bind to allow client connections.
|
|
||||||
#
|
|
||||||
# Examples: 0.0.0.0 - Bind on all interfaces.
|
|
||||||
# 127.0.0.1 - Bind on localhost interface. Only local programs may connect.
|
|
||||||
#
|
|
||||||
# [websocket_port]:
|
|
||||||
# Port to bind to allow client connections.
|
|
||||||
#
|
|
||||||
# [validation_seed]:
|
|
||||||
# To perform validation, this section should contain either a validation seed or key.
|
|
||||||
# The validation seed is used to generate the validation public/private key pair.
|
|
||||||
# To obtain a validation seed, use the validation_create command.
|
|
||||||
#
|
|
||||||
# Examples: RASH BUSH MILK LOOK BAD BRIM AVID GAFF BAIT ROT POD LOVE
|
|
||||||
# shfArahZT9Q9ckTf3s1psJ7C7qzVN
|
|
||||||
#
|
|
||||||
|
|
||||||
[peer_ip]
|
|
||||||
0.0.0.0
|
|
||||||
|
|
||||||
[peer_port]
|
|
||||||
51235
|
|
||||||
|
|
||||||
[rpc_ip]
|
|
||||||
127.0.0.1
|
|
||||||
|
|
||||||
[rpc_port]
|
|
||||||
5005
|
|
||||||
|
|
||||||
[rpc_allow_remote]
|
|
||||||
1
|
|
||||||
|
|
||||||
[debug_logfile]
|
|
||||||
debug.log
|
|
||||||
|
|
||||||
[unl_default]
|
|
||||||
validators.txt
|
|
||||||
|
|
||||||
[ips]
|
|
||||||
23.21.167.100 51235
|
|
||||||
23.23.201.55 51235
|
|
||||||
107.21.116.214 51235
|
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
Name "CoinToss"
|
Name "Rippled"
|
||||||
|
|
||||||
; The file to write
|
; The file to write
|
||||||
OutFile "toss install.exe"
|
OutFile "ripple install.exe"
|
||||||
|
|
||||||
; The default installation directory
|
; The default installation directory
|
||||||
InstallDir "$PROGRAMFILES\CoinToss"
|
InstallDir "$PROGRAMFILES\Rippled"
|
||||||
|
|
||||||
; Request application privileges for Windows Vista
|
; Request application privileges for Windows Vista
|
||||||
RequestExecutionLevel user
|
RequestExecutionLevel user
|
||||||
@@ -25,12 +25,12 @@ Section "" ;No components page, name is not important
|
|||||||
SetOutPath $INSTDIR
|
SetOutPath $INSTDIR
|
||||||
|
|
||||||
; Put file there
|
; Put file there
|
||||||
File ..\Release\newcoin.exe
|
File ..\Release\rippled.exe
|
||||||
File ..\*.dll
|
File ..\*.dll
|
||||||
File "start CoinToss.bat"
|
;File "start rippled.bat"
|
||||||
File newcoind.cfg
|
File rippled.cfg
|
||||||
File validators.txt
|
File validators.txt
|
||||||
File /r /x .git ..\..\nc-client\*.*
|
;File /r /x .git ..\..\nc-client\*.*
|
||||||
|
|
||||||
CreateDirectory $INSTDIR\db
|
CreateDirectory $INSTDIR\db
|
||||||
|
|
||||||
@@ -41,9 +41,11 @@
|
|||||||
<PropertyGroup Label="UserMacros" />
|
<PropertyGroup Label="UserMacros" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<LinkIncremental>true</LinkIncremental>
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
<TargetName>rippled</TargetName>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
<LinkIncremental>false</LinkIncremental>
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
<TargetName>rippled</TargetName>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
@@ -76,14 +78,14 @@
|
|||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<PreprocessorDefinitions>BOOST_TEST_ALTERNATIVE_INIT_API;BOOST_TEST_NO_MAIN;_CRT_SECURE_NO_WARNINGS;_WIN32_WINNT=0x0501;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>BOOST_TEST_ALTERNATIVE_INIT_API;BOOST_TEST_NO_MAIN;_CRT_SECURE_NO_WARNINGS;_WIN32_WINNT=0x0501;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<AdditionalIncludeDirectories>..\OpenSSL\include;..\boost_1_47_0;..\protobuf-2.4.1\src</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>.\;..\OpenSSL\include;..\boost_1_52_0;..\protobuf\src</AdditionalIncludeDirectories>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
<AdditionalLibraryDirectories>..\OpenSSL\lib\VC;..\boost_1_47_0\stage\lib;..\protobuf-2.4.1\vsprojects\Release</AdditionalLibraryDirectories>
|
<AdditionalLibraryDirectories>..\OpenSSL\lib\VC;..\boost_1_52_0\stage\lib;..\protobuf\vsprojects\Release</AdditionalLibraryDirectories>
|
||||||
<AdditionalDependencies>libprotobuf.lib;ssleay32MD.lib;libeay32MD.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>libprotobuf.lib;ssleay32MD.lib;libeay32MD.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
@@ -91,7 +93,6 @@
|
|||||||
<ClCompile Include="src\cpp\database\database.cpp" />
|
<ClCompile Include="src\cpp\database\database.cpp" />
|
||||||
<ClCompile Include="src\cpp\database\sqlite3.c" />
|
<ClCompile Include="src\cpp\database\sqlite3.c" />
|
||||||
<ClCompile Include="src\cpp\database\SqliteDatabase.cpp" />
|
<ClCompile Include="src\cpp\database\SqliteDatabase.cpp" />
|
||||||
<ClCompile Include="src\cpp\database\win\windatabase.cpp" />
|
|
||||||
<ClCompile Include="src\cpp\json\json_reader.cpp" />
|
<ClCompile Include="src\cpp\json\json_reader.cpp" />
|
||||||
<ClCompile Include="src\cpp\json\json_value.cpp" />
|
<ClCompile Include="src\cpp\json\json_value.cpp" />
|
||||||
<ClCompile Include="src\cpp\json\json_writer.cpp" />
|
<ClCompile Include="src\cpp\json\json_writer.cpp" />
|
||||||
@@ -158,6 +159,7 @@
|
|||||||
<ClCompile Include="src\cpp\ripple\RPCErr.cpp" />
|
<ClCompile Include="src\cpp\ripple\RPCErr.cpp" />
|
||||||
<ClCompile Include="src\cpp\ripple\RPCHandler.cpp" />
|
<ClCompile Include="src\cpp\ripple\RPCHandler.cpp" />
|
||||||
<ClCompile Include="src\cpp\ripple\RPCServer.cpp" />
|
<ClCompile Include="src\cpp\ripple\RPCServer.cpp" />
|
||||||
|
<ClCompile Include="src\cpp\ripple\RPCSub.cpp" />
|
||||||
<ClCompile Include="src\cpp\ripple\ScriptData.cpp" />
|
<ClCompile Include="src\cpp\ripple\ScriptData.cpp" />
|
||||||
<ClCompile Include="src\cpp\ripple\SerializedLedger.cpp" />
|
<ClCompile Include="src\cpp\ripple\SerializedLedger.cpp" />
|
||||||
<ClCompile Include="src\cpp\ripple\SerializedObject.cpp" />
|
<ClCompile Include="src\cpp\ripple\SerializedObject.cpp" />
|
||||||
@@ -322,8 +324,10 @@
|
|||||||
<None Include="SConstruct" />
|
<None Include="SConstruct" />
|
||||||
<CustomBuild Include="src\cpp\ripple\ripple.proto">
|
<CustomBuild Include="src\cpp\ripple\ripple.proto">
|
||||||
<FileType>Document</FileType>
|
<FileType>Document</FileType>
|
||||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">/code/protobuf/protoc -I=..\newcoin --cpp_out=\code\newcoin\ ..\newcoin/src/cpp/ripple/ripple.proto</Command>
|
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">"../protobuf/protoc" -I=..\newcoin --cpp_out=..\newcoin\ ..\newcoin/src/cpp/ripple/ripple.proto</Command>
|
||||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\code\newcoin\src\ripple.pb.h</Outputs>
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\code\newcoin\src\ripple.pb.h</Outputs>
|
||||||
|
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">/code/protobuf/protoc -I=..\newcoin --cpp_out=\code\newcoin\ ..\newcoin/src/cpp/ripple/ripple.proto</Command>
|
||||||
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\code\newcoin\src\ripple.pb.h</Outputs>
|
||||||
</CustomBuild>
|
</CustomBuild>
|
||||||
<None Include="test\buster.js" />
|
<None Include="test\buster.js" />
|
||||||
<None Include="test\server.js" />
|
<None Include="test\server.js" />
|
||||||
|
|||||||
@@ -42,9 +42,6 @@
|
|||||||
<ClCompile Include="src\cpp\database\SqliteDatabase.cpp">
|
<ClCompile Include="src\cpp\database\SqliteDatabase.cpp">
|
||||||
<Filter>Source Files\database</Filter>
|
<Filter>Source Files\database</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="src\cpp\database\win\windatabase.cpp">
|
|
||||||
<Filter>Source Files\database</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="src\cpp\json\json_reader.cpp">
|
<ClCompile Include="src\cpp\json\json_reader.cpp">
|
||||||
<Filter>Source Files\json</Filter>
|
<Filter>Source Files\json</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
@@ -363,6 +360,9 @@
|
|||||||
<ClCompile Include="src\cpp\ripple\LoadManager.cpp">
|
<ClCompile Include="src\cpp\ripple\LoadManager.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\cpp\ripple\RPCSub.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="util\pugiconfig.hpp">
|
<ClInclude Include="util\pugiconfig.hpp">
|
||||||
|
|||||||
51
newcoin2012.sln
Normal file
51
newcoin2012.sln
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio 2012
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "newcoin", "newcoin.vcxproj", "{19465545-42EE-42FA-9CC8-F8975F8F1CC7}"
|
||||||
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
|
{3E283F37-A4ED-41B7-A3E6-A2D89D131A30} = {3E283F37-A4ED-41B7-A3E6-A2D89D131A30}
|
||||||
|
EndProjectSection
|
||||||
|
EndProject
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libprotobuf", "..\protobuf\vsprojects\libprotobuf.vcxproj", "{3E283F37-A4ED-41B7-A3E6-A2D89D131A30}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Win32 = Debug|Win32
|
||||||
|
Debug|x64 = Debug|x64
|
||||||
|
FlashDebug|Win32 = FlashDebug|Win32
|
||||||
|
FlashDebug|x64 = FlashDebug|x64
|
||||||
|
Release|Win32 = Release|Win32
|
||||||
|
Release|x64 = Release|x64
|
||||||
|
ReleaseD|Win32 = ReleaseD|Win32
|
||||||
|
ReleaseD|x64 = ReleaseD|x64
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{19465545-42EE-42FA-9CC8-F8975F8F1CC7}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||||
|
{19465545-42EE-42FA-9CC8-F8975F8F1CC7}.Debug|Win32.Build.0 = Debug|Win32
|
||||||
|
{19465545-42EE-42FA-9CC8-F8975F8F1CC7}.Debug|x64.ActiveCfg = Debug|Win32
|
||||||
|
{19465545-42EE-42FA-9CC8-F8975F8F1CC7}.FlashDebug|Win32.ActiveCfg = Debug|Win32
|
||||||
|
{19465545-42EE-42FA-9CC8-F8975F8F1CC7}.FlashDebug|Win32.Build.0 = Debug|Win32
|
||||||
|
{19465545-42EE-42FA-9CC8-F8975F8F1CC7}.FlashDebug|x64.ActiveCfg = Debug|Win32
|
||||||
|
{19465545-42EE-42FA-9CC8-F8975F8F1CC7}.Release|Win32.ActiveCfg = Release|Win32
|
||||||
|
{19465545-42EE-42FA-9CC8-F8975F8F1CC7}.Release|Win32.Build.0 = Release|Win32
|
||||||
|
{19465545-42EE-42FA-9CC8-F8975F8F1CC7}.Release|x64.ActiveCfg = Release|Win32
|
||||||
|
{19465545-42EE-42FA-9CC8-F8975F8F1CC7}.ReleaseD|Win32.ActiveCfg = Release|Win32
|
||||||
|
{19465545-42EE-42FA-9CC8-F8975F8F1CC7}.ReleaseD|Win32.Build.0 = Release|Win32
|
||||||
|
{19465545-42EE-42FA-9CC8-F8975F8F1CC7}.ReleaseD|x64.ActiveCfg = Release|Win32
|
||||||
|
{3E283F37-A4ED-41B7-A3E6-A2D89D131A30}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||||
|
{3E283F37-A4ED-41B7-A3E6-A2D89D131A30}.Debug|Win32.Build.0 = Debug|Win32
|
||||||
|
{3E283F37-A4ED-41B7-A3E6-A2D89D131A30}.Debug|x64.ActiveCfg = Debug|Win32
|
||||||
|
{3E283F37-A4ED-41B7-A3E6-A2D89D131A30}.FlashDebug|Win32.ActiveCfg = Debug|Win32
|
||||||
|
{3E283F37-A4ED-41B7-A3E6-A2D89D131A30}.FlashDebug|Win32.Build.0 = Debug|Win32
|
||||||
|
{3E283F37-A4ED-41B7-A3E6-A2D89D131A30}.FlashDebug|x64.ActiveCfg = Debug|Win32
|
||||||
|
{3E283F37-A4ED-41B7-A3E6-A2D89D131A30}.Release|Win32.ActiveCfg = Release|Win32
|
||||||
|
{3E283F37-A4ED-41B7-A3E6-A2D89D131A30}.Release|Win32.Build.0 = Release|Win32
|
||||||
|
{3E283F37-A4ED-41B7-A3E6-A2D89D131A30}.Release|x64.ActiveCfg = Release|Win32
|
||||||
|
{3E283F37-A4ED-41B7-A3E6-A2D89D131A30}.ReleaseD|Win32.ActiveCfg = Release|Win32
|
||||||
|
{3E283F37-A4ED-41B7-A3E6-A2D89D131A30}.ReleaseD|Win32.Build.0 = Release|Win32
|
||||||
|
{3E283F37-A4ED-41B7-A3E6-A2D89D131A30}.ReleaseD|x64.ActiveCfg = Release|Win32
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
@@ -54,6 +54,7 @@ Application::Application() :
|
|||||||
|
|
||||||
extern const char *RpcDBInit[], *TxnDBInit[], *LedgerDBInit[], *WalletDBInit[], *HashNodeDBInit[], *NetNodeDBInit[];
|
extern const char *RpcDBInit[], *TxnDBInit[], *LedgerDBInit[], *WalletDBInit[], *HashNodeDBInit[], *NetNodeDBInit[];
|
||||||
extern int RpcDBCount, TxnDBCount, LedgerDBCount, WalletDBCount, HashNodeDBCount, NetNodeDBCount;
|
extern int RpcDBCount, TxnDBCount, LedgerDBCount, WalletDBCount, HashNodeDBCount, NetNodeDBCount;
|
||||||
|
bool Instance::running = true;
|
||||||
|
|
||||||
void Application::stop()
|
void Application::stop()
|
||||||
{
|
{
|
||||||
@@ -65,6 +66,7 @@ void Application::stop()
|
|||||||
mAuxService.stop();
|
mAuxService.stop();
|
||||||
|
|
||||||
cLog(lsINFO) << "Stopped: " << mIOService.stopped();
|
cLog(lsINFO) << "Stopped: " << mIOService.stopped();
|
||||||
|
Instance::shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void InitDB(DatabaseCon** dbCon, const char *fileName, const char *dbInit[], int dbCount)
|
static void InitDB(DatabaseCon** dbCon, const char *fileName, const char *dbInit[], int dbCount)
|
||||||
|
|||||||
@@ -53,7 +53,23 @@ std::string EncodeBase64(const std::string& s)
|
|||||||
|
|
||||||
Json::Value RPCParser::parseAsIs(const Json::Value& jvParams)
|
Json::Value RPCParser::parseAsIs(const Json::Value& jvParams)
|
||||||
{
|
{
|
||||||
return Json::Value(Json::objectValue);
|
Json::Value v(Json::objectValue);
|
||||||
|
if (jvParams.isArray() && (jvParams.size() > 0))
|
||||||
|
v["params"] = jvParams;
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
|
||||||
|
Json::Value RPCParser::parseInternal(const Json::Value& jvParams)
|
||||||
|
{
|
||||||
|
Json::Value v(Json::objectValue);
|
||||||
|
v["internal_command"] = jvParams[0u];
|
||||||
|
|
||||||
|
Json::Value params(Json::arrayValue);
|
||||||
|
for (unsigned i = 1; i < jvParams.size(); ++i)
|
||||||
|
params.append(jvParams[i]);
|
||||||
|
v["params"] = params;
|
||||||
|
|
||||||
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
// account_info <account>|<nickname>|<account_public_key>
|
// account_info <account>|<nickname>|<account_public_key>
|
||||||
@@ -496,6 +512,8 @@ Json::Value RPCParser::parseCommand(std::string strMethod, Json::Value jvParams)
|
|||||||
{ "wallet_propose", &RPCParser::parseWalletPropose, 0, 1 },
|
{ "wallet_propose", &RPCParser::parseWalletPropose, 0, 1 },
|
||||||
{ "wallet_seed", &RPCParser::parseWalletSeed, 0, 1 },
|
{ "wallet_seed", &RPCParser::parseWalletSeed, 0, 1 },
|
||||||
|
|
||||||
|
{ "internal", &RPCParser::parseInternal, 1, -1 },
|
||||||
|
|
||||||
#if ENABLE_INSECURE
|
#if ENABLE_INSECURE
|
||||||
// XXX Unnecessary commands which should be removed.
|
// XXX Unnecessary commands which should be removed.
|
||||||
{ "login", &RPCParser::parseLogin, 2, 2 },
|
{ "login", &RPCParser::parseLogin, 2, 2 },
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ protected:
|
|||||||
Json::Value parseEvented(const Json::Value& jvParams);
|
Json::Value parseEvented(const Json::Value& jvParams);
|
||||||
Json::Value parseGetCounts(const Json::Value& jvParams);
|
Json::Value parseGetCounts(const Json::Value& jvParams);
|
||||||
Json::Value parseLedger(const Json::Value& jvParams);
|
Json::Value parseLedger(const Json::Value& jvParams);
|
||||||
|
Json::Value parseInternal(const Json::Value& jvParams);
|
||||||
#if ENABLE_INSECURE
|
#if ENABLE_INSECURE
|
||||||
Json::Value parseLogin(const Json::Value& jvParams);
|
Json::Value parseLogin(const Json::Value& jvParams);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -86,11 +86,13 @@ public:
|
|||||||
class Instance
|
class Instance
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
static bool running;
|
||||||
InstanceType& mType;
|
InstanceType& mType;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Instance(InstanceType& t) : mType(t) { mType.addInstance(); }
|
Instance(InstanceType& t) : mType(t) { mType.addInstance(); }
|
||||||
~Instance() { mType.decInstance(); }
|
~Instance() { if (running) mType.decInstance(); }
|
||||||
|
static void shutdown() { running = false; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ protected:
|
|||||||
const std::string mName;
|
const std::string mName;
|
||||||
boost::mutex mNCLock;
|
boost::mutex mNCLock;
|
||||||
map_type mCache;
|
map_type mCache;
|
||||||
int mTargetSize, mTargetAge;
|
unsigned int mTargetSize, mTargetAge;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ DECLARE_INSTANCE(LedgerAcquire);
|
|||||||
#define TRUST_NETWORK
|
#define TRUST_NETWORK
|
||||||
|
|
||||||
PeerSet::PeerSet(const uint256& hash, int interval) : mHash(hash), mTimerInterval(interval), mTimeouts(0),
|
PeerSet::PeerSet(const uint256& hash, int interval) : mHash(hash), mTimerInterval(interval), mTimeouts(0),
|
||||||
mComplete(false), mFailed(false), mProgress(true), mTimer(theApp->getIOService())
|
mComplete(false), mFailed(false), mProgress(true), mAggressive(true), mTimer(theApp->getIOService())
|
||||||
{
|
{
|
||||||
mLastAction = time(NULL);
|
mLastAction = time(NULL);
|
||||||
assert((mTimerInterval > 10) && (mTimerInterval < 30000));
|
assert((mTimerInterval > 10) && (mTimerInterval < 30000));
|
||||||
@@ -94,9 +94,18 @@ bool LedgerAcquire::tryLocal()
|
|||||||
{ // return value: true = no more work to do
|
{ // return value: true = no more work to do
|
||||||
HashedObject::pointer node = theApp->getHashedObjectStore().retrieve(mHash);
|
HashedObject::pointer node = theApp->getHashedObjectStore().retrieve(mHash);
|
||||||
if (!node)
|
if (!node)
|
||||||
return false;
|
{
|
||||||
|
mLedger = theApp->getLedgerMaster().getLedgerByHash(mHash);
|
||||||
mLedger = boost::make_shared<Ledger>(strCopy(node->getData()), true);
|
if (!mLedger)
|
||||||
|
{
|
||||||
|
cLog(lsDEBUG) << "root ledger node not local";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mLedger = boost::make_shared<Ledger>(strCopy(node->getData()), true);
|
||||||
|
}
|
||||||
if (mLedger->getHash() != mHash)
|
if (mLedger->getHash() != mHash)
|
||||||
{ // We know for a fact the ledger can never be acquired
|
{ // We know for a fact the ledger can never be acquired
|
||||||
cLog(lsWARNING) << mHash << " cannot be a ledger";
|
cLog(lsWARNING) << mHash << " cannot be a ledger";
|
||||||
@@ -106,15 +115,22 @@ bool LedgerAcquire::tryLocal()
|
|||||||
mHaveBase = true;
|
mHaveBase = true;
|
||||||
|
|
||||||
if (!mLedger->getTransHash())
|
if (!mLedger->getTransHash())
|
||||||
|
{
|
||||||
|
cLog(lsDEBUG) << "No TXNs to fetch";
|
||||||
mHaveTransactions = true;
|
mHaveTransactions = true;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
mLedger->peekTransactionMap()->fetchRoot(mLedger->getTransHash());
|
mLedger->peekTransactionMap()->fetchRoot(mLedger->getTransHash());
|
||||||
|
cLog(lsDEBUG) << "Got root txn map locally";
|
||||||
std::vector<uint256> h = mLedger->peekTransactionMap()->getNeededHashes(1);
|
std::vector<uint256> h = mLedger->peekTransactionMap()->getNeededHashes(1);
|
||||||
if (h.empty())
|
if (h.empty())
|
||||||
|
{
|
||||||
|
cLog(lsDEBUG) << "Had full txn map locally";
|
||||||
mHaveTransactions = true;
|
mHaveTransactions = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (SHAMapMissingNode&)
|
catch (SHAMapMissingNode&)
|
||||||
{
|
{
|
||||||
@@ -128,9 +144,13 @@ bool LedgerAcquire::tryLocal()
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
mLedger->peekAccountStateMap()->fetchRoot(mLedger->getAccountHash());
|
mLedger->peekAccountStateMap()->fetchRoot(mLedger->getAccountHash());
|
||||||
|
cLog(lsDEBUG) << "Got root AS map locally";
|
||||||
std::vector<uint256> h = mLedger->peekAccountStateMap()->getNeededHashes(1);
|
std::vector<uint256> h = mLedger->peekAccountStateMap()->getNeededHashes(1);
|
||||||
if (h.empty())
|
if (h.empty())
|
||||||
|
{
|
||||||
|
cLog(lsDEBUG) << "Had full AS map locally";
|
||||||
mHaveState = true;
|
mHaveState = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (SHAMapMissingNode&)
|
catch (SHAMapMissingNode&)
|
||||||
{
|
{
|
||||||
@@ -138,7 +158,10 @@ bool LedgerAcquire::tryLocal()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (mHaveTransactions && mHaveState)
|
if (mHaveTransactions && mHaveState)
|
||||||
|
{
|
||||||
|
cLog(lsDEBUG) << "Had everything locally";
|
||||||
mComplete = true;
|
mComplete = true;
|
||||||
|
}
|
||||||
|
|
||||||
return mComplete;
|
return mComplete;
|
||||||
}
|
}
|
||||||
@@ -158,6 +181,7 @@ void LedgerAcquire::onTimer(bool progress)
|
|||||||
|
|
||||||
if (!progress)
|
if (!progress)
|
||||||
{
|
{
|
||||||
|
mAggressive = true;
|
||||||
cLog(lsDEBUG) << "No progress for ledger " << mHash;
|
cLog(lsDEBUG) << "No progress for ledger " << mHash;
|
||||||
if (!getPeerCount())
|
if (!getPeerCount())
|
||||||
addPeers();
|
addPeers();
|
||||||
@@ -172,9 +196,17 @@ void LedgerAcquire::addPeers()
|
|||||||
{
|
{
|
||||||
std::vector<Peer::pointer> peerList = theApp->getConnectionPool().getPeerVector();
|
std::vector<Peer::pointer> peerList = theApp->getConnectionPool().getPeerVector();
|
||||||
|
|
||||||
|
int vSize = peerList.size();
|
||||||
|
if (vSize == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// We traverse the peer list in random order so as not to favor any particular peer
|
||||||
|
int firstPeer = rand() & vSize;
|
||||||
|
|
||||||
bool found = false;
|
bool found = false;
|
||||||
BOOST_FOREACH(Peer::ref peer, peerList)
|
for (int i = 0; i < vSize; ++i)
|
||||||
{
|
{
|
||||||
|
Peer::ref peer = peerList[(i + firstPeer) % vSize];
|
||||||
if (peer->hasLedger(getHash()))
|
if (peer->hasLedger(getHash()))
|
||||||
{
|
{
|
||||||
found = true;
|
found = true;
|
||||||
@@ -183,10 +215,8 @@ void LedgerAcquire::addPeers()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!found)
|
if (!found)
|
||||||
{
|
for (int i = 0; i < vSize; ++i)
|
||||||
BOOST_FOREACH(Peer::ref peer, peerList)
|
peerHas(peerList[(i + firstPeer) % vSize]);
|
||||||
peerHas(peer);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::weak_ptr<PeerSet> LedgerAcquire::pmDowncast()
|
boost::weak_ptr<PeerSet> LedgerAcquire::pmDowncast()
|
||||||
@@ -322,6 +352,7 @@ void LedgerAcquire::trigger(Peer::ref peer)
|
|||||||
mHaveBase = true;
|
mHaveBase = true;
|
||||||
mHaveTransactions = true;
|
mHaveTransactions = true;
|
||||||
mHaveState = true;
|
mHaveState = true;
|
||||||
|
mComplete = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -368,7 +399,8 @@ void LedgerAcquire::trigger(Peer::ref peer)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
filterNodes(nodeIDs, nodeHashes, mRecentTXNodes, 128, !isProgress());
|
if (!mAggressive)
|
||||||
|
filterNodes(nodeIDs, nodeHashes, mRecentTXNodes, 128, !isProgress());
|
||||||
if (!nodeIDs.empty())
|
if (!nodeIDs.empty())
|
||||||
{
|
{
|
||||||
tmGL.set_itype(ripple::liTX_NODE);
|
tmGL.set_itype(ripple::liTX_NODE);
|
||||||
@@ -415,7 +447,8 @@ void LedgerAcquire::trigger(Peer::ref peer)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
filterNodes(nodeIDs, nodeHashes, mRecentASNodes, 128, !isProgress());
|
if (!mAggressive)
|
||||||
|
filterNodes(nodeIDs, nodeHashes, mRecentASNodes, 128, !isProgress());
|
||||||
if (!nodeIDs.empty())
|
if (!nodeIDs.empty())
|
||||||
{
|
{
|
||||||
tmGL.set_itype(ripple::liAS_NODE);
|
tmGL.set_itype(ripple::liAS_NODE);
|
||||||
@@ -489,9 +522,9 @@ void LedgerAcquire::filterNodes(std::vector<SHAMapNode>& nodeIDs, std::vector<ui
|
|||||||
std::vector<bool> duplicates;
|
std::vector<bool> duplicates;
|
||||||
duplicates.reserve(nodeIDs.size());
|
duplicates.reserve(nodeIDs.size());
|
||||||
|
|
||||||
int dupCount;
|
int dupCount=0;
|
||||||
|
|
||||||
for (int i = 0; i < nodeIDs.size(); ++i)
|
for (unsigned int i = 0; i < nodeIDs.size(); ++i)
|
||||||
{
|
{
|
||||||
bool isDup = recentNodes.count(nodeIDs[i]) != 0;
|
bool isDup = recentNodes.count(nodeIDs[i]) != 0;
|
||||||
duplicates.push_back(isDup);
|
duplicates.push_back(isDup);
|
||||||
@@ -511,7 +544,7 @@ void LedgerAcquire::filterNodes(std::vector<SHAMapNode>& nodeIDs, std::vector<ui
|
|||||||
else if (dupCount > 0)
|
else if (dupCount > 0)
|
||||||
{ // some, but not all, duplicates
|
{ // some, but not all, duplicates
|
||||||
int insertPoint = 0;
|
int insertPoint = 0;
|
||||||
for (int i = 0; i < nodeIDs.size(); ++i)
|
for (unsigned int i = 0; i < nodeIDs.size(); ++i)
|
||||||
if (!duplicates[i])
|
if (!duplicates[i])
|
||||||
{ // Keep this node
|
{ // Keep this node
|
||||||
if (insertPoint != i)
|
if (insertPoint != i)
|
||||||
@@ -687,6 +720,8 @@ LedgerAcquire::pointer LedgerAcquireMaster::findCreate(const uint256& hash)
|
|||||||
ptr->addPeers();
|
ptr->addPeers();
|
||||||
ptr->setTimer(); // Cannot call in constructor
|
ptr->setTimer(); // Cannot call in constructor
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
cLog(lsINFO) << "LedgerAcquireMaster acquiring ledger we already have";
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -726,6 +761,39 @@ std::vector<LedgerAcquire::neededHash_t> LedgerAcquire::getNeededHashes()
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Json::Value LedgerAcquire::getJson(int)
|
||||||
|
{
|
||||||
|
Json::Value ret(Json::objectValue);
|
||||||
|
ret["hash"] = mHash.GetHex();
|
||||||
|
if (mComplete)
|
||||||
|
ret["complete"] = true;
|
||||||
|
if (mFailed)
|
||||||
|
ret["failed"] = true;
|
||||||
|
ret["have_base"] = mHaveBase;
|
||||||
|
ret["have_state"] = mHaveState;
|
||||||
|
ret["have_transactions"] = mHaveTransactions;
|
||||||
|
if (mAborted)
|
||||||
|
ret["aborted"] = true;
|
||||||
|
ret["timeouts"] = getTimeouts();
|
||||||
|
if (mHaveBase && !mHaveState)
|
||||||
|
{
|
||||||
|
Json::Value hv(Json::arrayValue);
|
||||||
|
std::vector<uint256> v = mLedger->peekAccountStateMap()->getNeededHashes(16);
|
||||||
|
BOOST_FOREACH(const uint256& h, v)
|
||||||
|
hv.append(h.GetHex());
|
||||||
|
ret["needed_state_hashes"] = hv;
|
||||||
|
}
|
||||||
|
if (mHaveBase && !mHaveTransactions)
|
||||||
|
{
|
||||||
|
Json::Value hv(Json::arrayValue);
|
||||||
|
std::vector<uint256> v = mLedger->peekTransactionMap()->getNeededHashes(16);
|
||||||
|
BOOST_FOREACH(const uint256& h, v)
|
||||||
|
hv.append(h.GetHex());
|
||||||
|
ret["needed_transaction_hashes"] = hv;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
bool LedgerAcquireMaster::hasLedger(const uint256& hash)
|
bool LedgerAcquireMaster::hasLedger(const uint256& hash)
|
||||||
{
|
{
|
||||||
assert(hash.isNonZero());
|
assert(hash.isNonZero());
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class PeerSet
|
|||||||
protected:
|
protected:
|
||||||
uint256 mHash;
|
uint256 mHash;
|
||||||
int mTimerInterval, mTimeouts;
|
int mTimerInterval, mTimeouts;
|
||||||
bool mComplete, mFailed, mProgress;
|
bool mComplete, mFailed, mProgress, mAggressive;
|
||||||
time_t mLastAction;
|
time_t mLastAction;
|
||||||
|
|
||||||
boost::recursive_mutex mLock;
|
boost::recursive_mutex mLock;
|
||||||
@@ -51,7 +51,7 @@ public:
|
|||||||
int getTimeouts() const { return mTimeouts; }
|
int getTimeouts() const { return mTimeouts; }
|
||||||
|
|
||||||
bool isActive();
|
bool isActive();
|
||||||
void progress() { mProgress = true; }
|
void progress() { mProgress = true; mAggressive = false; }
|
||||||
bool isProgress() { return mProgress; }
|
bool isProgress() { return mProgress; }
|
||||||
void touch() { mLastAction = time(NULL); }
|
void touch() { mLastAction = time(NULL); }
|
||||||
time_t getLastAction() { return mLastAction; }
|
time_t getLastAction() { return mLastAction; }
|
||||||
@@ -129,6 +129,8 @@ public:
|
|||||||
|
|
||||||
static void filterNodes(std::vector<SHAMapNode>& nodeIDs, std::vector<uint256>& nodeHashes,
|
static void filterNodes(std::vector<SHAMapNode>& nodeIDs, std::vector<uint256>& nodeHashes,
|
||||||
std::set<SHAMapNode>& recentNodes, int max, bool aggressive);
|
std::set<SHAMapNode>& recentNodes, int max, bool aggressive);
|
||||||
|
|
||||||
|
Json::Value getJson(int);
|
||||||
};
|
};
|
||||||
|
|
||||||
class LedgerAcquireMaster
|
class LedgerAcquireMaster
|
||||||
|
|||||||
@@ -2534,6 +2534,13 @@ Json::Value RPCHandler::doRpcCommand(const std::string& strMethod, Json::Value&
|
|||||||
return jvResult;
|
return jvResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Json::Value RPCHandler::doInternal(Json::Value jvRequest)
|
||||||
|
{ // Used for debug or special-purpose RPC commands
|
||||||
|
if (!jvRequest.isMember("internal_command"))
|
||||||
|
return rpcError(rpcINVALID_PARAMS);
|
||||||
|
return RPCInternalHandler::runHandler(jvRequest["internal_command"].asString(), jvRequest["params"]);
|
||||||
|
}
|
||||||
|
|
||||||
Json::Value RPCHandler::doCommand(Json::Value& jvRequest, int iRole)
|
Json::Value RPCHandler::doCommand(Json::Value& jvRequest, int iRole)
|
||||||
{
|
{
|
||||||
if (!jvRequest.isMember("command"))
|
if (!jvRequest.isMember("command"))
|
||||||
@@ -2562,6 +2569,7 @@ Json::Value RPCHandler::doCommand(Json::Value& jvRequest, int iRole)
|
|||||||
{ "account_tx", &RPCHandler::doAccountTransactions, false, optNetwork },
|
{ "account_tx", &RPCHandler::doAccountTransactions, false, optNetwork },
|
||||||
{ "connect", &RPCHandler::doConnect, true, optNone },
|
{ "connect", &RPCHandler::doConnect, true, optNone },
|
||||||
{ "get_counts", &RPCHandler::doGetCounts, true, optNone },
|
{ "get_counts", &RPCHandler::doGetCounts, true, optNone },
|
||||||
|
{ "internal", &RPCHandler::doInternal, true, optNone },
|
||||||
{ "ledger", &RPCHandler::doLedger, false, optNetwork },
|
{ "ledger", &RPCHandler::doLedger, false, optNetwork },
|
||||||
{ "ledger_accept", &RPCHandler::doLedgerAccept, true, optCurrent },
|
{ "ledger_accept", &RPCHandler::doLedgerAccept, true, optCurrent },
|
||||||
{ "ledger_closed", &RPCHandler::doLedgerClosed, false, optClosed },
|
{ "ledger_closed", &RPCHandler::doLedgerClosed, false, optClosed },
|
||||||
@@ -2674,4 +2682,29 @@ Json::Value RPCHandler::doCommand(Json::Value& jvRequest, int iRole)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RPCInternalHandler* RPCInternalHandler::sHeadHandler = NULL;
|
||||||
|
|
||||||
|
RPCInternalHandler::RPCInternalHandler(const std::string& name, handler_t Handler) : mName(name), mHandler(Handler)
|
||||||
|
{
|
||||||
|
mNextHandler = sHeadHandler;
|
||||||
|
sHeadHandler = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
Json::Value RPCInternalHandler::runHandler(const std::string& name, const Json::Value& params)
|
||||||
|
{
|
||||||
|
RPCInternalHandler* h = sHeadHandler;
|
||||||
|
while (h != NULL)
|
||||||
|
{
|
||||||
|
if (name == h->mName)
|
||||||
|
{
|
||||||
|
cLog(lsWARNING) << "Internal command " << name << ": " << params;
|
||||||
|
Json::Value ret = h->mHandler(params);
|
||||||
|
cLog(lsWARNING) << "Internal command returns: " << ret;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
h = h->mNextHandler;
|
||||||
|
}
|
||||||
|
return rpcError(rpcBAD_SYNTAX);
|
||||||
|
}
|
||||||
|
|
||||||
// vim:ts=4
|
// vim:ts=4
|
||||||
|
|||||||
@@ -1,8 +1,17 @@
|
|||||||
#ifndef __RPCHANDLER__
|
#ifndef __RPCHANDLER__
|
||||||
#define __RPCHANDLER__
|
#define __RPCHANDLER__
|
||||||
|
|
||||||
|
#include <boost/unordered_set.hpp>
|
||||||
|
|
||||||
|
#include "../json/value.h"
|
||||||
|
|
||||||
|
#include "RippleAddress.h"
|
||||||
|
#include "SerializedTypes.h"
|
||||||
|
#include "Ledger.h"
|
||||||
|
|
||||||
// used by the RPCServer or WSDoor to carry out these RPC commands
|
// used by the RPCServer or WSDoor to carry out these RPC commands
|
||||||
class NetworkOPs;
|
class NetworkOPs;
|
||||||
|
class InfoSub;
|
||||||
|
|
||||||
class RPCHandler
|
class RPCHandler
|
||||||
{
|
{
|
||||||
@@ -47,6 +56,7 @@ class RPCHandler
|
|||||||
Json::Value doDataStore(Json::Value params);
|
Json::Value doDataStore(Json::Value params);
|
||||||
#endif
|
#endif
|
||||||
Json::Value doGetCounts(Json::Value params);
|
Json::Value doGetCounts(Json::Value params);
|
||||||
|
Json::Value doInternal(Json::Value params);
|
||||||
Json::Value doLedger(Json::Value params);
|
Json::Value doLedger(Json::Value params);
|
||||||
Json::Value doLogLevel(Json::Value params);
|
Json::Value doLogLevel(Json::Value params);
|
||||||
Json::Value doLogRotate(Json::Value params);
|
Json::Value doLogRotate(Json::Value params);
|
||||||
@@ -108,5 +118,22 @@ public:
|
|||||||
Json::Value doRpcCommand(const std::string& strCommand, Json::Value& jvParams, int iRole);
|
Json::Value doRpcCommand(const std::string& strCommand, Json::Value& jvParams, int iRole);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class RPCInternalHandler
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef Json::Value (*handler_t)(const Json::Value&);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
static RPCInternalHandler* sHeadHandler;
|
||||||
|
|
||||||
|
RPCInternalHandler* mNextHandler;
|
||||||
|
std::string mName;
|
||||||
|
handler_t mHandler;
|
||||||
|
|
||||||
|
public:
|
||||||
|
RPCInternalHandler(const std::string& name, handler_t handler);
|
||||||
|
static Json::Value runHandler(const std::string& name, const Json::Value& params);
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
// vim:ts=4
|
// vim:ts=4
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ protected:
|
|||||||
mutable boost::recursive_mutex mLock;
|
mutable boost::recursive_mutex mLock;
|
||||||
|
|
||||||
std::string mName; // Used for logging
|
std::string mName; // Used for logging
|
||||||
int mTargetSize; // Desired number of cache entries (0 = ignore)
|
unsigned int mTargetSize; // Desired number of cache entries (0 = ignore)
|
||||||
int mTargetAge; // Desired maximum cache age
|
int mTargetAge; // Desired maximum cache age
|
||||||
|
|
||||||
cache_type mCache; // Hold strong reference to recent objects
|
cache_type mCache; // Hold strong reference to recent objects
|
||||||
|
|||||||
@@ -1625,7 +1625,7 @@ void UniqueNodeList::nodeBootstrap()
|
|||||||
cLog(lsINFO) << boost::str(boost::format("Bootstrapping UNL: loading from '%s'.")
|
cLog(lsINFO) << boost::str(boost::format("Bootstrapping UNL: loading from '%s'.")
|
||||||
% theConfig.CONFIG_FILE);
|
% theConfig.CONFIG_FILE);
|
||||||
|
|
||||||
if (processValidators("local", theConfig.CONFIG_FILE.native(), naInvalid, vsConfig, &theConfig.VALIDATORS))
|
if (processValidators("local", theConfig.CONFIG_FILE.string(), naInvalid, vsConfig, &theConfig.VALIDATORS))
|
||||||
bLoaded = true;
|
bLoaded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Submodule src/js/sjcl updated: dbdef434e7...d04d0bdccd
Reference in New Issue
Block a user