Compare commits
387 commits
feature/po
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d3d967a2d7 | ||
|
|
178756bd34 | ||
|
|
1f70857d64 | ||
|
|
97e85a849d | ||
|
|
dc4cdd6e4b | ||
|
|
1472066af6 | ||
|
|
a641b8e93f | ||
|
|
aa099f960f | ||
|
|
f0654e5ffd | ||
|
|
9fe351300b | ||
|
|
5fd79c3e78 | ||
|
|
b56818b8ae | ||
|
|
bc0fbeb707 | ||
|
|
accd334a86 | ||
|
|
84a66c6722 | ||
|
|
abd446d80b | ||
|
|
93fb57c080 | ||
|
|
a8845ffde9 | ||
|
|
435c1f8e96 | ||
|
|
1123ff6f93 | ||
|
|
c34415b403 | ||
|
|
daca2813ef | ||
|
|
0b37a48b02 | ||
|
|
e3b10cf1ec | ||
|
|
f5c6a6310b | ||
|
|
75ee6fbed3 | ||
|
|
7516126d01 | ||
|
|
f32a51d03b | ||
|
|
c421453621 | ||
|
|
54ff842db1 | ||
|
|
16ba10ffab | ||
|
|
79974280c0 | ||
|
|
5867a8ae27 | ||
|
|
741534c47f | ||
|
|
f3227fb33d | ||
|
|
bfb961c7be | ||
|
|
5e08b793c5 | ||
|
|
7af3d037b5 | ||
|
|
2788281062 | ||
|
|
4e2850f826 | ||
|
|
f477af6771 | ||
|
|
80d168e5b6 | ||
|
|
e44ed0cfe5 | ||
|
|
142cf5b903 | ||
|
|
ebc1529c48 | ||
|
|
19e0911d64 | ||
|
|
70cd09495e | ||
|
|
e9c7021e16 | ||
|
|
9c9aaa03d3 | ||
|
|
038fa37cc6 | ||
|
|
73b2ba635b | ||
|
|
936f13d2a1 | ||
|
|
fc1cdf2629 | ||
|
|
71f0806b25 | ||
|
|
da3a858aa6 | ||
|
|
1883f97be2 | ||
|
|
559769db2b | ||
|
|
0b64f0cfcc | ||
|
|
96d737fbc2 | ||
|
|
d89e5e1f23 | ||
|
|
6f472d3d3b | ||
|
|
cb60cbe5d1 | ||
|
|
576c54a260 | ||
|
|
2f5e12b28e | ||
|
|
68fbd6f40b | ||
|
|
674b38910d | ||
|
|
d264398a6f | ||
|
|
c1d5691ce2 | ||
|
|
ca69a692cc | ||
|
|
bd041bc13f | ||
|
|
6037e89df0 | ||
|
|
bb7c534b10 | ||
|
|
1be6636bbf | ||
|
|
578edc56d8 | ||
|
|
d387e324fe | ||
|
|
1bf5c82101 | ||
|
|
4883dfe38d | ||
|
|
249276b009 | ||
|
|
ab1e08a756 | ||
|
|
440e4fbb43 | ||
|
|
42b3890a7c | ||
|
|
5dff0830fb | ||
|
|
c3eab0a80b | ||
|
|
12c0c66f4b | ||
|
|
b7113c4ff3 | ||
|
|
d76b752c8c | ||
|
|
804376b149 | ||
|
|
1b340345f3 | ||
|
|
022fdeb40a | ||
|
|
f6d22466fd | ||
|
|
811d68ef4d | ||
|
|
a6da2a6413 | ||
|
|
8853a76752 | ||
|
|
f209ab8ee6 | ||
|
|
9620e3c211 | ||
|
|
3ebcd29e10 | ||
|
|
d5b2b7aeda | ||
|
|
759dac5d41 | ||
|
|
058937a3ee | ||
|
|
da73e31038 | ||
|
|
a30325660d | ||
|
|
d5d6390030 | ||
|
|
400c3cfb89 | ||
|
|
aa90f715fd | ||
|
|
c3b2a598b4 | ||
|
|
06bc65cc79 | ||
|
|
8e8142235a | ||
|
|
194fa6abfa | ||
|
|
283fbd28f7 | ||
|
|
71c113c190 | ||
|
|
846366139f | ||
|
|
0856e898bb | ||
|
|
4db9f3a15b | ||
|
|
1b1df25023 | ||
|
|
f9314a4c0c | ||
|
|
d4c015d400 | ||
|
|
e6474f5f2a | ||
|
|
f2f4b57ced | ||
|
|
2c95ac0b9d | ||
|
|
9831579bfe | ||
|
|
2d6dec5943 | ||
|
|
46f4770071 | ||
|
|
2accee53e2 | ||
|
|
54a11e7662 | ||
|
|
c1f93f58ee | ||
|
|
2fd6f60112 | ||
|
|
5f97eb7662 | ||
|
|
b4e8b76a30 | ||
|
|
a9267544de | ||
|
|
e287d8a845 | ||
|
|
0f64947f4a | ||
|
|
b895b52b7b | ||
|
|
9c5aab826d | ||
|
|
6a38fb2382 | ||
|
|
0a9a324277 | ||
|
|
5c416e3a5b | ||
|
|
9268c31ac4 | ||
|
|
c4f6f522a4 | ||
|
|
f127495c0e | ||
|
|
9b2c60f76c | ||
|
|
22fc780a91 | ||
|
|
005478e3ef | ||
|
|
5bfd685684 | ||
|
|
662139ca22 | ||
|
|
6844b74e29 | ||
|
|
99ed37e834 | ||
|
|
629a6672fd | ||
|
|
3b5e928094 | ||
|
|
09579fbab1 | ||
|
|
ff462234af | ||
|
|
873dfd788b | ||
|
|
b186a2f0ed | ||
|
|
1a196bfcc2 | ||
|
|
611a63076b | ||
|
|
d234c3a8f8 | ||
|
|
bc7b0e7788 | ||
|
|
d650e197a9 | ||
|
|
a7f5e1f603 | ||
|
|
0a38927b0e | ||
|
|
9012e86bd1 | ||
|
|
eb2894c3d3 | ||
|
|
11834c7f53 | ||
|
|
1ae9470dab | ||
|
|
e575334e30 | ||
|
|
1788038224 | ||
|
|
8ce0db6ec3 | ||
|
|
02d898d4dc | ||
|
|
bcdb355f48 | ||
|
|
d78e0d0e48 | ||
|
|
4d112936d2 | ||
|
|
c102bef768 | ||
|
|
092a46ae61 | ||
|
|
f03cc7ee90 | ||
|
|
3294480e20 | ||
|
|
7fd12ccce8 | ||
|
|
03e37896d5 | ||
|
|
bc7d03cb22 | ||
|
|
b3e426999d | ||
|
|
ab32415d0c | ||
|
|
3152d47eea | ||
|
|
8f32e4cdb5 | ||
|
|
b4501167ee | ||
|
|
d13551a277 | ||
|
|
9dd0747e5d | ||
|
|
29189b3897 | ||
|
|
2a373a70f7 | ||
|
|
b05c36b4fe | ||
|
|
e2d9741af8 | ||
|
|
1846b1709e | ||
|
|
2c02591e24 | ||
|
|
aa2dea6ddf | ||
|
|
9af213190a | ||
|
|
0b04faec83 | ||
|
|
a7b4d1cef5 | ||
|
|
0fd22a9945 | ||
|
|
3980512543 | ||
|
|
fc324559eb | ||
|
|
f16aa73b3e | ||
|
|
ca5dc441a7 | ||
|
|
2e55b1818a | ||
|
|
a2702cd1f4 | ||
|
|
564af2e19e | ||
|
|
5b4a4d18d8 | ||
|
|
23cdcec381 | ||
|
|
82a84a06da | ||
|
|
8562a4c655 | ||
|
|
852565dcb1 | ||
|
|
d461c718ef | ||
|
|
2903fc6446 | ||
|
|
95c5280be2 | ||
|
|
ffbe0cd592 | ||
|
|
27c77ba74b | ||
|
|
cb3302160b | ||
|
|
c79c8987dc | ||
|
|
e0d7a6314a | ||
|
|
223d2a528d | ||
|
|
62f8983c5e | ||
|
|
c973131ed2 | ||
|
|
0c01935ff4 | ||
|
|
520505b667 | ||
|
|
000aeaa721 | ||
|
|
c1048e1509 | ||
|
|
3664ee67ca | ||
|
|
bd6f265409 | ||
|
|
0f0cf62b20 | ||
|
|
13c782ccd6 | ||
|
|
659a3c9185 | ||
|
|
b0c7a527fa | ||
|
|
157e6c2fd8 | ||
|
|
6a59d9efba | ||
|
|
93b60efba5 | ||
|
|
6eccec2ba4 | ||
|
|
d7c654500e | ||
|
|
d49017ff21 | ||
|
|
6ee37d0916 | ||
|
|
44b2d21d78 | ||
|
|
03836d3770 | ||
|
|
4809619892 | ||
|
|
ad0b5afb79 | ||
|
|
0e5d599fdd | ||
|
|
d39f838eb8 | ||
|
|
d07c343be6 | ||
|
|
c0bbcca0cf | ||
|
|
4ef0163bf2 | ||
|
|
65ba17adb0 | ||
|
|
ddd0d2fd16 | ||
|
|
bfa7b13193 | ||
|
|
7f5a92fb1e | ||
|
|
a408ed0dda | ||
|
|
ee018cf513 | ||
|
|
23e40e1004 | ||
|
|
f4a0b3fb6d | ||
|
|
d1e425e3c9 | ||
|
|
237889f621 | ||
|
|
a5a8d6c617 | ||
|
|
f3666d7468 | ||
|
|
21e13ac4d4 | ||
|
|
7729c09c2e | ||
|
|
d347d3d01b | ||
|
|
f169e7a7ef | ||
|
|
0740bceb74 | ||
|
|
2c411b63d3 | ||
|
|
ae5237a781 | ||
|
|
4efa7e4fb8 | ||
|
|
5e81fc0024 | ||
|
|
49c39afbe1 | ||
|
|
8dc8ac0aec | ||
|
|
7d25589499 | ||
|
|
5602790db9 | ||
|
|
d46c7201bb | ||
|
|
5b8f14dd68 | ||
|
|
8b732acf17 | ||
|
|
2981613a9e | ||
|
|
93b57f294d | ||
|
|
5860002d0a | ||
|
|
6e2fb6fac5 | ||
|
|
f7b3c8935d | ||
|
|
65cc4a4df2 | ||
|
|
6960ccbde9 | ||
|
|
04eb8c33e0 | ||
|
|
6d8a158372 | ||
|
|
639e242693 | ||
|
|
8be4dd5e3c | ||
|
|
050c0b27e5 | ||
|
|
fcd360c2fd | ||
|
|
8486b7a736 | ||
|
|
339adbb054 | ||
|
|
8b611c3f95 | ||
|
|
bd08c4c6b0 | ||
|
|
a284f42ac9 | ||
|
|
d7e24bfb07 | ||
|
|
99119dbd7d | ||
|
|
18bf848119 | ||
|
|
494482eba5 | ||
|
|
18775061ad | ||
|
|
3c19ea74dd | ||
|
|
eb77c9dfb3 | ||
|
|
7a9c90a218 | ||
|
|
66699f1e15 | ||
|
|
78fbf7c3cd | ||
|
|
5247f76fc2 | ||
|
|
39fcacd397 | ||
|
|
10799a2148 | ||
|
|
8c3a424bb6 | ||
|
|
6f6811eec4 | ||
|
|
0bcb0487a7 | ||
|
|
b5a9a0101a | ||
|
|
5e85079281 | ||
|
|
9fd18b32c4 | ||
|
|
632eb4a231 | ||
|
|
bfc778068c | ||
|
|
f9a40c647e | ||
|
|
e828e7813c | ||
|
|
0dca13ea7e | ||
|
|
b619815077 | ||
|
|
78730a4564 | ||
|
|
c888274846 | ||
|
|
de2a89ebce | ||
|
|
f69fb7adae | ||
|
|
666dc76ee4 | ||
|
|
f81b6460d1 | ||
|
|
861e9389ac | ||
|
|
2ba8a7f3a5 | ||
|
|
d8cecab20f | ||
|
|
dc04759686 | ||
|
|
696f99e6c9 | ||
|
|
4067291094 | ||
|
|
9ebc1ee462 | ||
|
|
6de45cebb8 | ||
|
|
a9bb6cb1dc | ||
|
|
932b696556 | ||
|
|
732cae963d | ||
|
|
77791b2d20 | ||
|
|
ec0398c83f | ||
|
|
727d54feb0 | ||
|
|
c72c2bb70b | ||
|
|
7354de75ef | ||
|
|
92e017e3b0 | ||
|
|
3612e1ec23 | ||
|
|
d5e02551e2 | ||
|
|
7bc7f17b3e | ||
|
|
b875f0b841 | ||
|
|
9955b390ee | ||
|
|
536e07d726 | ||
|
|
433c75769f | ||
|
|
7b2161e87a | ||
|
|
7f67397137 | ||
|
|
8fbe85babb | ||
|
|
f0bacb3cc1 | ||
|
|
685e9d500c | ||
|
|
f279065c79 | ||
|
|
873310e16d | ||
|
|
bf0cdbdc6e | ||
|
|
ceffe4cf3c | ||
|
|
43c29ce1bf | ||
|
|
4eaef1c171 | ||
|
|
8e5dfb0e72 | ||
|
|
01f860e15b | ||
|
|
2778a99842 | ||
|
|
d75177b7a1 | ||
|
|
6035d29428 | ||
|
|
ba69da5d5c | ||
|
|
183906370b | ||
|
|
8b84459e8c | ||
|
|
5dc753054b | ||
|
|
e6b57a2285 | ||
|
|
5ae230e533 | ||
|
|
0a5e3d7080 | ||
|
|
20c9e0f9a3 | ||
|
|
6c8aed3c18 | ||
|
|
557270db39 | ||
|
|
93c980ab2c | ||
|
|
7eba0eb2a8 | ||
|
|
d8246bc404 | ||
|
|
ec464694a4 | ||
|
|
997941611c | ||
|
|
b22086ff7e | ||
|
|
8b3952d26b | ||
|
|
668f677867 | ||
|
|
cd0bcf3087 | ||
|
|
010b873c8e | ||
|
|
2c396f6b19 | ||
|
|
0b0718f739 | ||
|
|
974c8f987e | ||
|
|
652d37e206 | ||
|
|
30e4b50891 | ||
|
|
ad5f89ba99 |
252 changed files with 237582 additions and 12353 deletions
|
|
@ -1,6 +1,5 @@
|
||||||
---
|
---
|
||||||
Language: Cpp
|
Language: Cpp
|
||||||
# BasedOnStyle: LLVM
|
|
||||||
AccessModifierOffset: -3
|
AccessModifierOffset: -3
|
||||||
AlignAfterOpenBracket: Align
|
AlignAfterOpenBracket: Align
|
||||||
AlignConsecutiveMacros: false
|
AlignConsecutiveMacros: false
|
||||||
|
|
@ -12,7 +11,7 @@ AlignTrailingComments: true
|
||||||
AllowAllArgumentsOnNextLine: true
|
AllowAllArgumentsOnNextLine: true
|
||||||
AllowAllConstructorInitializersOnNextLine: false
|
AllowAllConstructorInitializersOnNextLine: false
|
||||||
AllowAllParametersOfDeclarationOnNextLine: true
|
AllowAllParametersOfDeclarationOnNextLine: true
|
||||||
AllowShortBlocksOnASingleLine: false
|
AllowShortBlocksOnASingleLine: Never
|
||||||
AllowShortCaseLabelsOnASingleLine: false
|
AllowShortCaseLabelsOnASingleLine: false
|
||||||
AllowShortFunctionsOnASingleLine: None
|
AllowShortFunctionsOnASingleLine: None
|
||||||
AllowShortLambdasOnASingleLine: None
|
AllowShortLambdasOnASingleLine: None
|
||||||
|
|
@ -57,6 +56,7 @@ ConstructorInitializerAllOnOneLineOrOnePerLine: true
|
||||||
ConstructorInitializerIndentWidth: 6
|
ConstructorInitializerIndentWidth: 6
|
||||||
ContinuationIndentWidth: 6
|
ContinuationIndentWidth: 6
|
||||||
Cpp11BracedListStyle: true
|
Cpp11BracedListStyle: true
|
||||||
|
DeriveLineEnding: true
|
||||||
DerivePointerAlignment: false
|
DerivePointerAlignment: false
|
||||||
DisableFormat: false
|
DisableFormat: false
|
||||||
ExperimentalAutoDetectBinPacking: false
|
ExperimentalAutoDetectBinPacking: false
|
||||||
|
|
@ -69,12 +69,17 @@ IncludeBlocks: Preserve
|
||||||
IncludeCategories:
|
IncludeCategories:
|
||||||
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
|
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
|
||||||
Priority: 2
|
Priority: 2
|
||||||
|
SortPriority: 0
|
||||||
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
|
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
|
||||||
Priority: 3
|
Priority: 3
|
||||||
|
SortPriority: 0
|
||||||
- Regex: '.*'
|
- Regex: '.*'
|
||||||
Priority: 1
|
Priority: 1
|
||||||
|
SortPriority: 0
|
||||||
IncludeIsMainRegex: '(Test)?$'
|
IncludeIsMainRegex: '(Test)?$'
|
||||||
|
IncludeIsMainSourceRegex: ''
|
||||||
IndentCaseLabels: false
|
IndentCaseLabels: false
|
||||||
|
IndentGotoLabels: false
|
||||||
IndentPPDirectives: None
|
IndentPPDirectives: None
|
||||||
IndentWidth: 3
|
IndentWidth: 3
|
||||||
IndentWrappedFunctionNames: false
|
IndentWrappedFunctionNames: false
|
||||||
|
|
@ -110,18 +115,22 @@ SpaceBeforeCtorInitializerColon: true
|
||||||
SpaceBeforeInheritanceColon: true
|
SpaceBeforeInheritanceColon: true
|
||||||
SpaceBeforeParens: ControlStatements
|
SpaceBeforeParens: ControlStatements
|
||||||
SpaceBeforeRangeBasedForLoopColon: true
|
SpaceBeforeRangeBasedForLoopColon: true
|
||||||
|
SpaceInEmptyBlock: false
|
||||||
SpaceInEmptyParentheses: false
|
SpaceInEmptyParentheses: false
|
||||||
SpacesBeforeTrailingComments: 1
|
SpacesBeforeTrailingComments: 1
|
||||||
SpacesInAngles: false
|
SpacesInAngles: false
|
||||||
|
SpacesInConditionalStatement: false
|
||||||
SpacesInContainerLiterals: true
|
SpacesInContainerLiterals: true
|
||||||
SpacesInCStyleCastParentheses: false
|
SpacesInCStyleCastParentheses: false
|
||||||
SpacesInParentheses: false
|
SpacesInParentheses: false
|
||||||
SpacesInSquareBrackets: false
|
SpacesInSquareBrackets: false
|
||||||
Standard: Cpp11
|
SpaceBeforeSquareBrackets: false
|
||||||
|
Standard: Latest
|
||||||
StatementMacros:
|
StatementMacros:
|
||||||
- Q_UNUSED
|
- Q_UNUSED
|
||||||
- QT_REQUIRE_VERSION
|
- QT_REQUIRE_VERSION
|
||||||
TabWidth: 3
|
TabWidth: 3
|
||||||
|
UseCRLF: false
|
||||||
UseTab: Never
|
UseTab: Never
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -14,6 +14,7 @@ data
|
||||||
CMakeDoxyfile.in
|
CMakeDoxyfile.in
|
||||||
|
|
||||||
build
|
build
|
||||||
|
build__*
|
||||||
|
|
||||||
libraries/utilities/git_revision.cpp
|
libraries/utilities/git_revision.cpp
|
||||||
|
|
||||||
|
|
|
||||||
136
.gitlab-ci.yml
136
.gitlab-ci.yml
|
|
@ -8,8 +8,11 @@ include:
|
||||||
stages:
|
stages:
|
||||||
- build
|
- build
|
||||||
- test
|
- test
|
||||||
|
- dockerize
|
||||||
|
- python-test
|
||||||
|
- deploy
|
||||||
|
|
||||||
build:
|
build-mainnet:
|
||||||
stage: build
|
stage: build
|
||||||
script:
|
script:
|
||||||
- rm -rf .git/modules/docs .git/modules/libraries/fc ./docs ./libraries/fc
|
- rm -rf .git/modules/docs .git/modules/libraries/fc ./docs ./libraries/fc
|
||||||
|
|
@ -29,13 +32,140 @@ build:
|
||||||
tags:
|
tags:
|
||||||
- builder
|
- builder
|
||||||
|
|
||||||
test:
|
test-mainnet:
|
||||||
stage: test
|
stage: test
|
||||||
dependencies:
|
dependencies:
|
||||||
- build
|
- build-mainnet
|
||||||
script:
|
script:
|
||||||
|
- ./build/libraries/fc/tests/all_tests
|
||||||
- ./build/tests/betting_test --log_level=message
|
- ./build/tests/betting_test --log_level=message
|
||||||
- ./build/tests/chain_test --log_level=message
|
- ./build/tests/chain_test --log_level=message
|
||||||
- ./build/tests/cli_test --log_level=message
|
- ./build/tests/cli_test --log_level=message
|
||||||
tags:
|
tags:
|
||||||
- builder
|
- builder
|
||||||
|
|
||||||
|
dockerize-mainnet:
|
||||||
|
stage: dockerize
|
||||||
|
variables:
|
||||||
|
IMAGE: $CI_REGISTRY_IMAGE/mainnet/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA
|
||||||
|
before_script:
|
||||||
|
- docker info
|
||||||
|
- docker builder prune -a -f
|
||||||
|
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
|
||||||
|
script:
|
||||||
|
- docker build --no-cache -t $IMAGE .
|
||||||
|
- docker push $IMAGE
|
||||||
|
after_script:
|
||||||
|
- docker rmi $IMAGE
|
||||||
|
tags:
|
||||||
|
- builder
|
||||||
|
timeout:
|
||||||
|
3h
|
||||||
|
|
||||||
|
build-testnet:
|
||||||
|
stage: build
|
||||||
|
script:
|
||||||
|
- rm -rf .git/modules/docs .git/modules/libraries/fc ./docs ./libraries/fc
|
||||||
|
- git submodule sync
|
||||||
|
- git submodule update --init --recursive
|
||||||
|
- rm -rf build
|
||||||
|
- mkdir build
|
||||||
|
- cd build
|
||||||
|
- cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_PEERPLAYS_TESTNET=1 ..
|
||||||
|
- make -j$(nproc)
|
||||||
|
artifacts:
|
||||||
|
untracked: true
|
||||||
|
paths:
|
||||||
|
- build/libraries/
|
||||||
|
- build/programs/
|
||||||
|
- build/tests/
|
||||||
|
when: manual
|
||||||
|
tags:
|
||||||
|
- builder
|
||||||
|
|
||||||
|
deploy-testnet:
|
||||||
|
stage: deploy
|
||||||
|
dependencies:
|
||||||
|
- build-testnet
|
||||||
|
script:
|
||||||
|
- sudo systemctl stop witness
|
||||||
|
- rm $WORK_DIR/peerplays/witness_node || true
|
||||||
|
- cp build/programs/witness_node/witness_node $WORK_DIR/peerplays/
|
||||||
|
- sudo systemctl restart witness
|
||||||
|
rules:
|
||||||
|
- if: $CI_COMMIT_BRANCH == "master"
|
||||||
|
when: always
|
||||||
|
environment:
|
||||||
|
name: devnet
|
||||||
|
url: $DEVNET_URL
|
||||||
|
tags:
|
||||||
|
- devnet
|
||||||
|
|
||||||
|
test-testnet:
|
||||||
|
stage: test
|
||||||
|
dependencies:
|
||||||
|
- build-testnet
|
||||||
|
script:
|
||||||
|
- ./build/libraries/fc/tests/all_tests
|
||||||
|
- ./build/tests/betting_test --log_level=message
|
||||||
|
- ./build/tests/chain_test --log_level=message
|
||||||
|
- ./build/tests/cli_test --log_level=message
|
||||||
|
tags:
|
||||||
|
- builder
|
||||||
|
when:
|
||||||
|
manual
|
||||||
|
timeout:
|
||||||
|
1h
|
||||||
|
|
||||||
|
dockerize-testnet:
|
||||||
|
stage: dockerize
|
||||||
|
variables:
|
||||||
|
IMAGE: $CI_REGISTRY_IMAGE/testnet/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA
|
||||||
|
before_script:
|
||||||
|
- docker info
|
||||||
|
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
|
||||||
|
script:
|
||||||
|
- docker build --no-cache -t $IMAGE .
|
||||||
|
- docker push $IMAGE
|
||||||
|
after_script:
|
||||||
|
- docker rmi $IMAGE
|
||||||
|
tags:
|
||||||
|
- builder
|
||||||
|
when:
|
||||||
|
manual
|
||||||
|
timeout:
|
||||||
|
3h
|
||||||
|
|
||||||
|
test-e2e:
|
||||||
|
stage: python-test
|
||||||
|
variables:
|
||||||
|
IMAGE: $CI_REGISTRY_IMAGE/mainnet/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA
|
||||||
|
before_script:
|
||||||
|
- docker info
|
||||||
|
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
|
||||||
|
script:
|
||||||
|
- git clone https://gitlab.com/PBSA/tools-libs/peerplays-utils.git
|
||||||
|
- cd peerplays-utils/peerplays-qa-environment
|
||||||
|
- git checkout origin/feature/python-e2e-tests-for-CI
|
||||||
|
- cd e2e-tests/
|
||||||
|
- python3 -m venv venv
|
||||||
|
- source venv/bin/activate
|
||||||
|
- pip3 install -r requirements.txt
|
||||||
|
- docker-compose down --remove-orphans
|
||||||
|
- docker ps -a
|
||||||
|
- docker pull $IMAGE
|
||||||
|
- docker tag $IMAGE peerplays-base:latest
|
||||||
|
- docker image ls -a
|
||||||
|
- docker-compose build
|
||||||
|
- python3 main.py --start all
|
||||||
|
- docker ps -a
|
||||||
|
- python3 -m pytest test_btc_init_state.py test_hive_inital_state.py test_pp_inital_state.py
|
||||||
|
- python3 main.py --stop
|
||||||
|
- deactivate
|
||||||
|
- docker ps -a
|
||||||
|
after_script:
|
||||||
|
- docker rmi $(docker images -a | grep -v 'hive-for-peerplays\|ethereum-for-peerplays\|bitcoin-for-peerplays\|ubuntu-for-peerplays' | awk '{print $3}')
|
||||||
|
tags:
|
||||||
|
- python-tests
|
||||||
|
when:
|
||||||
|
manual
|
||||||
|
|
|
||||||
4
.gitmodules
vendored
4
.gitmodules
vendored
|
|
@ -4,6 +4,6 @@
|
||||||
ignore = dirty
|
ignore = dirty
|
||||||
[submodule "libraries/fc"]
|
[submodule "libraries/fc"]
|
||||||
path = libraries/fc
|
path = libraries/fc
|
||||||
url = https://github.com/peerplays-network/peerplays-fc.git
|
url = https://gitlab.com/PBSA/tools-libs/peerplays-fc.git
|
||||||
branch = latest-fc
|
branch = develop
|
||||||
ignore = dirty
|
ignore = dirty
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
sonar.projectKey=peerplays-network_peerplays
|
||||||
|
sonar.organization=peerplays-network
|
||||||
|
|
||||||
|
# This is the name and version displayed in the SonarCloud UI.
|
||||||
|
sonar.projectName=peerplays
|
||||||
|
|
||||||
|
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
|
||||||
|
sonar.sources=.
|
||||||
|
|
||||||
|
sonar.host.url=https://sonarcloud.io
|
||||||
|
|
@ -22,6 +22,37 @@ endif()
|
||||||
|
|
||||||
list( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules" )
|
list( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules" )
|
||||||
|
|
||||||
|
function(get_linux_lsb_release_information)
|
||||||
|
find_program(LSB_RELEASE_EXEC lsb_release)
|
||||||
|
if(NOT LSB_RELEASE_EXEC)
|
||||||
|
message(FATAL_ERROR "Could not detect lsb_release executable, can not gather required information")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
execute_process(COMMAND "${LSB_RELEASE_EXEC}" --short --id OUTPUT_VARIABLE LSB_RELEASE_ID_SHORT OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
execute_process(COMMAND "${LSB_RELEASE_EXEC}" --short --release OUTPUT_VARIABLE LSB_RELEASE_VERSION_SHORT OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
execute_process(COMMAND "${LSB_RELEASE_EXEC}" --short --codename OUTPUT_VARIABLE LSB_RELEASE_CODENAME_SHORT OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
|
||||||
|
set(LSB_RELEASE_ID_SHORT "${LSB_RELEASE_ID_SHORT}" PARENT_SCOPE)
|
||||||
|
set(LSB_RELEASE_VERSION_SHORT "${LSB_RELEASE_VERSION_SHORT}" PARENT_SCOPE)
|
||||||
|
set(LSB_RELEASE_CODENAME_SHORT "${LSB_RELEASE_CODENAME_SHORT}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
|
find_package(cppzmq)
|
||||||
|
target_link_libraries(cppzmq)
|
||||||
|
|
||||||
|
get_linux_lsb_release_information()
|
||||||
|
message(STATUS "Linux ${LSB_RELEASE_ID_SHORT} ${LSB_RELEASE_VERSION_SHORT} ${LSB_RELEASE_CODENAME_SHORT}")
|
||||||
|
string(REGEX MATCHALL "([0-9]+)" arg_list ${LSB_RELEASE_VERSION_SHORT})
|
||||||
|
list( LENGTH arg_list listlen )
|
||||||
|
if (NOT listlen)
|
||||||
|
message(FATAL_ERROR "Could not detect Ubuntu version")
|
||||||
|
endif()
|
||||||
|
list(GET arg_list 0 output)
|
||||||
|
message("Ubuntu version is: ${output}")
|
||||||
|
add_definitions(-DPEERPLAYS_UBUNTU_VERSION=${output})
|
||||||
|
endif()
|
||||||
|
|
||||||
# function to help with cUrl
|
# function to help with cUrl
|
||||||
macro(FIND_CURL)
|
macro(FIND_CURL)
|
||||||
if (NOT WIN32 AND NOT APPLE AND CURL_STATICLIB)
|
if (NOT WIN32 AND NOT APPLE AND CURL_STATICLIB)
|
||||||
|
|
@ -51,7 +82,16 @@ macro(FIND_CURL)
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS "ON")
|
set(CMAKE_EXPORT_COMPILE_COMMANDS "ON")
|
||||||
set(GRAPHENE_EGENESIS_JSON "${CMAKE_CURRENT_SOURCE_DIR}/genesis.json" CACHE PATH "location of the genesis.json to embed in the executable" )
|
|
||||||
|
if (BUILD_PEERPLAYS_TESTNET)
|
||||||
|
set(GRAPHENE_EGENESIS_JSON "${CMAKE_CURRENT_SOURCE_DIR}/genesis-testnet.json" CACHE PATH "location of the genesis.json to embed in the executable" )
|
||||||
|
#add_compile_definitions(BUILD_PEERPLAYS_TESTNET=1)
|
||||||
|
add_definitions(-DBUILD_PEERPLAYS_TESTNET=1)
|
||||||
|
message ("\n====================\nBuilding for Testnet\n====================\n")
|
||||||
|
else (BUILD_PEERPLAYS_TESTNET)
|
||||||
|
set(GRAPHENE_EGENESIS_JSON "${CMAKE_CURRENT_SOURCE_DIR}/genesis-mainnet.json" CACHE PATH "location of the genesis.json to embed in the executable" )
|
||||||
|
message ("\n====================\nBuilding for Mainnet\n====================\n")
|
||||||
|
endif (BUILD_PEERPLAYS_TESTNET)
|
||||||
|
|
||||||
#set (ENABLE_INSTALLER 1)
|
#set (ENABLE_INSTALLER 1)
|
||||||
#set (USE_PCH 1)
|
#set (USE_PCH 1)
|
||||||
|
|
@ -74,7 +114,6 @@ LIST(APPEND BOOST_COMPONENTS thread
|
||||||
system
|
system
|
||||||
filesystem
|
filesystem
|
||||||
program_options
|
program_options
|
||||||
signals
|
|
||||||
serialization
|
serialization
|
||||||
chrono
|
chrono
|
||||||
unit_test_framework
|
unit_test_framework
|
||||||
|
|
@ -242,3 +281,7 @@ endif(LINUX)
|
||||||
include(CPack)
|
include(CPack)
|
||||||
endif(ENABLE_INSTALLER)
|
endif(ENABLE_INSTALLER)
|
||||||
|
|
||||||
|
unset(GRAPHENE_EGENESIS_JSON)
|
||||||
|
unset(GRAPHENE_EGENESIS_JSON CACHE)
|
||||||
|
unset(BUILD_PEERPLAYS_TESTNET)
|
||||||
|
unset(BUILD_PEERPLAYS_TESTNET CACHE)
|
||||||
|
|
|
||||||
250
Dockerfile
250
Dockerfile
|
|
@ -1,96 +1,218 @@
|
||||||
FROM ubuntu:18.04
|
FROM ubuntu:20.04
|
||||||
MAINTAINER PeerPlays Blockchain Standards Association
|
|
||||||
|
|
||||||
ENV LANG en_US.UTF-8
|
#===============================================================================
|
||||||
ENV LANGUAGE en_US.UTF-8
|
# Ubuntu setup
|
||||||
ENV LC_ALL en_US.UTF-8
|
#===============================================================================
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
apt-get update -y && \
|
apt-get update -y && \
|
||||||
DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
||||||
|
apt-utils \
|
||||||
autoconf \
|
autoconf \
|
||||||
bash \
|
bash \
|
||||||
|
bison \
|
||||||
build-essential \
|
build-essential \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
cmake \
|
|
||||||
dnsutils \
|
dnsutils \
|
||||||
doxygen \
|
expect \
|
||||||
|
flex \
|
||||||
git \
|
git \
|
||||||
graphviz \
|
graphviz \
|
||||||
libbz2-dev \
|
libbz2-dev \
|
||||||
libcurl4-openssl-dev \
|
libcurl4-openssl-dev \
|
||||||
libncurses-dev \
|
libncurses-dev \
|
||||||
libreadline-dev \
|
libsnappy-dev \
|
||||||
libssl-dev \
|
libssl-dev \
|
||||||
libtool \
|
libtool \
|
||||||
libzmq3-dev \
|
libzip-dev \
|
||||||
locales \
|
locales \
|
||||||
|
lsb-release \
|
||||||
|
mc \
|
||||||
|
nano \
|
||||||
|
net-tools \
|
||||||
ntp \
|
ntp \
|
||||||
|
openssh-server \
|
||||||
pkg-config \
|
pkg-config \
|
||||||
wget \
|
python3 \
|
||||||
&& \
|
python3-jinja2 \
|
||||||
apt-get clean && \
|
sudo \
|
||||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
systemd-coredump \
|
||||||
|
wget
|
||||||
|
|
||||||
|
ENV HOME /home/peerplays
|
||||||
|
RUN useradd -rm -d /home/peerplays -s /bin/bash -g root -G sudo -u 1000 peerplays
|
||||||
|
RUN echo "peerplays ALL=(ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/peerplays
|
||||||
|
RUN chmod 440 /etc/sudoers.d/peerplays
|
||||||
|
|
||||||
|
RUN service ssh start
|
||||||
|
RUN echo 'peerplays:peerplays' | chpasswd
|
||||||
|
|
||||||
|
# SSH
|
||||||
|
EXPOSE 22
|
||||||
|
|
||||||
|
WORKDIR /home/peerplays/src
|
||||||
|
|
||||||
|
#===============================================================================
|
||||||
|
# Boost setup
|
||||||
|
#===============================================================================
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
|
wget https://boostorg.jfrog.io/artifactory/main/release/1.72.0/source/boost_1_72_0.tar.gz && \
|
||||||
locale-gen
|
tar -xzf boost_1_72_0.tar.gz && \
|
||||||
|
cd boost_1_72_0 && \
|
||||||
# Compile Boost
|
./bootstrap.sh && \
|
||||||
RUN \
|
|
||||||
BOOST_ROOT=$HOME/boost_1_67_0 && \
|
|
||||||
wget -c 'http://sourceforge.net/projects/boost/files/boost/1.67.0/boost_1_67_0.tar.gz/download' -O boost_1_67_0.tar.gz &&\
|
|
||||||
tar -zxvf boost_1_67_0.tar.gz && \
|
|
||||||
cd boost_1_67_0/ && \
|
|
||||||
./bootstrap.sh "--prefix=$BOOST_ROOT" && \
|
|
||||||
./b2 install && \
|
./b2 install && \
|
||||||
cd ..
|
ldconfig && \
|
||||||
|
rm -rf /home/peerplays/src/*
|
||||||
|
|
||||||
ADD . /peerplays-core
|
#===============================================================================
|
||||||
WORKDIR /peerplays-core
|
# cmake setup
|
||||||
|
#===============================================================================
|
||||||
|
|
||||||
# Compile Peerplays
|
|
||||||
RUN \
|
RUN \
|
||||||
BOOST_ROOT=$HOME/boost_1_67_0 && \
|
wget https://github.com/Kitware/CMake/releases/download/v3.24.2/cmake-3.24.2-linux-x86_64.sh && \
|
||||||
git submodule sync --recursive && \
|
chmod 755 ./cmake-3.24.2-linux-x86_64.sh && \
|
||||||
git submodule update --init --recursive && \
|
./cmake-3.24.2-linux-x86_64.sh --prefix=/usr --skip-license && \
|
||||||
|
cmake --version && \
|
||||||
|
rm -rf /home/peerplays/src/*
|
||||||
|
|
||||||
|
#===============================================================================
|
||||||
|
# libzmq setup
|
||||||
|
#===============================================================================
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
wget https://github.com/zeromq/libzmq/archive/refs/tags/v4.3.4.tar.gz && \
|
||||||
|
tar -xzvf v4.3.4.tar.gz && \
|
||||||
|
cd libzmq-4.3.4 && \
|
||||||
mkdir build && \
|
mkdir build && \
|
||||||
mkdir build/release && \
|
cd build && \
|
||||||
cd build/release && \
|
cmake .. && \
|
||||||
cmake \
|
make -j$(nproc) && \
|
||||||
-DBOOST_ROOT="$BOOST_ROOT" \
|
make install && \
|
||||||
-DCMAKE_BUILD_TYPE=Debug \
|
ldconfig && \
|
||||||
../.. && \
|
rm -rf /home/peerplays/src/*
|
||||||
make witness_node cli_wallet && \
|
|
||||||
install -s programs/witness_node/witness_node programs/cli_wallet/cli_wallet /usr/local/bin && \
|
|
||||||
#
|
|
||||||
# Obtain version
|
|
||||||
mkdir /etc/peerplays && \
|
|
||||||
git rev-parse --short HEAD > /etc/peerplays/version && \
|
|
||||||
cd / && \
|
|
||||||
rm -rf /peerplays-core
|
|
||||||
|
|
||||||
# Home directory $HOME
|
#===============================================================================
|
||||||
WORKDIR /
|
# cppzmq setup
|
||||||
RUN useradd -s /bin/bash -m -d /var/lib/peerplays peerplays
|
#===============================================================================
|
||||||
ENV HOME /var/lib/peerplays
|
|
||||||
RUN chown peerplays:peerplays -R /var/lib/peerplays
|
|
||||||
|
|
||||||
# Volume
|
RUN \
|
||||||
VOLUME ["/var/lib/peerplays", "/etc/peerplays"]
|
wget https://github.com/zeromq/cppzmq/archive/refs/tags/v4.9.0.tar.gz && \
|
||||||
|
tar -xzvf v4.9.0.tar.gz && \
|
||||||
|
cd cppzmq-4.9.0 && \
|
||||||
|
mkdir build && \
|
||||||
|
cd build && \
|
||||||
|
cmake .. && \
|
||||||
|
make -j$(nproc) && \
|
||||||
|
make install && \
|
||||||
|
ldconfig && \
|
||||||
|
rm -rf /home/peerplays/src/*
|
||||||
|
|
||||||
# rpc service:
|
#===============================================================================
|
||||||
|
# gsl setup
|
||||||
|
#===============================================================================
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
||||||
|
libpcre3-dev
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
wget https://github.com/imatix/gsl/archive/refs/tags/v4.1.4.tar.gz && \
|
||||||
|
tar -xzvf v4.1.4.tar.gz && \
|
||||||
|
cd gsl-4.1.4 && \
|
||||||
|
make -j$(nproc) && \
|
||||||
|
make install && \
|
||||||
|
rm -rf /home/peerplays/src/*
|
||||||
|
|
||||||
|
#===============================================================================
|
||||||
|
# libbitcoin-build setup
|
||||||
|
# libbitcoin-explorer setup
|
||||||
|
#===============================================================================
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
||||||
|
libsodium-dev
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
git clone --branch version3.8.0 --depth 1 https://gitlab.com/PBSA/peerplays-1.0/libbitcoin-explorer.git && \
|
||||||
|
cd libbitcoin-explorer && \
|
||||||
|
./install.sh && \
|
||||||
|
ldconfig && \
|
||||||
|
rm -rf /home/peerplays/src/*
|
||||||
|
|
||||||
|
#===============================================================================
|
||||||
|
# Doxygen setup
|
||||||
|
#===============================================================================
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
sudo apt install -y bison flex && \
|
||||||
|
wget https://github.com/doxygen/doxygen/archive/refs/tags/Release_1_8_17.tar.gz && \
|
||||||
|
tar -xvf Release_1_8_17.tar.gz && \
|
||||||
|
cd doxygen-Release_1_8_17 && \
|
||||||
|
mkdir build && \
|
||||||
|
cd build && \
|
||||||
|
cmake .. && \
|
||||||
|
make -j$(nproc) install && \
|
||||||
|
ldconfig
|
||||||
|
|
||||||
|
#===============================================================================
|
||||||
|
# Perl setup
|
||||||
|
#===============================================================================
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
wget https://github.com/Perl/perl5/archive/refs/tags/v5.30.0.tar.gz && \
|
||||||
|
tar -xvf v5.30.0.tar.gz && \
|
||||||
|
cd perl5-5.30.0 && \
|
||||||
|
./Configure -des && \
|
||||||
|
make -j$(nproc) install && \
|
||||||
|
ldconfig
|
||||||
|
|
||||||
|
#===============================================================================
|
||||||
|
# Peerplays setup
|
||||||
|
#===============================================================================
|
||||||
|
|
||||||
|
## Clone Peerplays
|
||||||
|
#RUN \
|
||||||
|
# git clone https://gitlab.com/PBSA/peerplays.git && \
|
||||||
|
# cd peerplays && \
|
||||||
|
# git checkout develop && \
|
||||||
|
# git submodule update --init --recursive && \
|
||||||
|
# git branch --show-current && \
|
||||||
|
# git log --oneline -n 5
|
||||||
|
|
||||||
|
# Add local source
|
||||||
|
ADD . peerplays
|
||||||
|
|
||||||
|
# Configure Peerplays
|
||||||
|
RUN \
|
||||||
|
cd peerplays && \
|
||||||
|
git submodule update --init --recursive && \
|
||||||
|
git log --oneline -n 5 && \
|
||||||
|
mkdir build && \
|
||||||
|
cd build && \
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||||
|
|
||||||
|
# Build Peerplays
|
||||||
|
RUN \
|
||||||
|
cd peerplays/build && \
|
||||||
|
make -j$(nproc) cli_wallet witness_node
|
||||||
|
|
||||||
|
WORKDIR /home/peerplays/peerplays-network
|
||||||
|
|
||||||
|
# Setup Peerplays runimage
|
||||||
|
RUN \
|
||||||
|
ln -s /home/peerplays/src/peerplays/build/programs/cli_wallet/cli_wallet ./ && \
|
||||||
|
ln -s /home/peerplays/src/peerplays/build/programs/witness_node/witness_node ./
|
||||||
|
|
||||||
|
RUN ./witness_node --create-genesis-json genesis.json && \
|
||||||
|
rm genesis.json
|
||||||
|
|
||||||
|
RUN chown peerplays:root -R /home/peerplays/peerplays-network
|
||||||
|
|
||||||
|
# Peerplays RPC
|
||||||
EXPOSE 8090
|
EXPOSE 8090
|
||||||
# p2p service:
|
# Peerplays P2P:
|
||||||
EXPOSE 1776
|
EXPOSE 9777
|
||||||
|
|
||||||
# default exec/config files
|
# Peerplays
|
||||||
ADD docker/default_config.ini /etc/peerplays/config.ini
|
CMD ["./witness_node", "-d", "./witness_node_data_dir"]
|
||||||
ADD docker/peerplaysentry.sh /usr/local/bin/peerplaysentry.sh
|
|
||||||
RUN chmod a+x /usr/local/bin/peerplaysentry.sh
|
|
||||||
|
|
||||||
# Make Docker send SIGINT instead of SIGTERM to the daemon
|
|
||||||
STOPSIGNAL SIGINT
|
|
||||||
|
|
||||||
# default execute entry
|
|
||||||
CMD ["/usr/local/bin/peerplaysentry.sh"]
|
|
||||||
|
|
|
||||||
219
Dockerfile.18.04
Normal file
219
Dockerfile.18.04
Normal file
|
|
@ -0,0 +1,219 @@
|
||||||
|
FROM ubuntu:18.04
|
||||||
|
|
||||||
|
#===============================================================================
|
||||||
|
# Ubuntu setup
|
||||||
|
#===============================================================================
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
apt-get update -y && \
|
||||||
|
DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
||||||
|
apt-utils \
|
||||||
|
autoconf \
|
||||||
|
bash \
|
||||||
|
bison \
|
||||||
|
build-essential \
|
||||||
|
ca-certificates \
|
||||||
|
dnsutils \
|
||||||
|
expect \
|
||||||
|
flex \
|
||||||
|
git \
|
||||||
|
graphviz \
|
||||||
|
libbz2-dev \
|
||||||
|
libcurl4-openssl-dev \
|
||||||
|
libncurses-dev \
|
||||||
|
libsnappy-dev \
|
||||||
|
libssl-dev \
|
||||||
|
libtool \
|
||||||
|
libzip-dev \
|
||||||
|
locales \
|
||||||
|
lsb-release \
|
||||||
|
mc \
|
||||||
|
nano \
|
||||||
|
net-tools \
|
||||||
|
ntp \
|
||||||
|
openssh-server \
|
||||||
|
pkg-config \
|
||||||
|
python3 \
|
||||||
|
python3-jinja2 \
|
||||||
|
sudo \
|
||||||
|
systemd-coredump \
|
||||||
|
wget
|
||||||
|
|
||||||
|
ENV HOME /home/peerplays
|
||||||
|
RUN useradd -rm -d /home/peerplays -s /bin/bash -g root -G sudo -u 1000 peerplays
|
||||||
|
RUN echo "peerplays ALL=(ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/peerplays
|
||||||
|
RUN chmod 440 /etc/sudoers.d/peerplays
|
||||||
|
|
||||||
|
RUN service ssh start
|
||||||
|
RUN echo 'peerplays:peerplays' | chpasswd
|
||||||
|
|
||||||
|
# SSH
|
||||||
|
EXPOSE 22
|
||||||
|
|
||||||
|
WORKDIR /home/peerplays/src
|
||||||
|
|
||||||
|
#===============================================================================
|
||||||
|
# Boost setup
|
||||||
|
#===============================================================================
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
wget https://boostorg.jfrog.io/artifactory/main/release/1.72.0/source/boost_1_72_0.tar.gz && \
|
||||||
|
tar -xzf boost_1_72_0.tar.gz && \
|
||||||
|
cd boost_1_72_0 && \
|
||||||
|
./bootstrap.sh && \
|
||||||
|
./b2 install && \
|
||||||
|
ldconfig && \
|
||||||
|
rm -rf /home/peerplays/src/*
|
||||||
|
|
||||||
|
#===============================================================================
|
||||||
|
# cmake setup
|
||||||
|
#===============================================================================
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
wget https://github.com/Kitware/CMake/releases/download/v3.24.2/cmake-3.24.2-linux-x86_64.sh && \
|
||||||
|
chmod 755 ./cmake-3.24.2-linux-x86_64.sh && \
|
||||||
|
./cmake-3.24.2-linux-x86_64.sh --prefix=/usr --skip-license && \
|
||||||
|
cmake --version && \
|
||||||
|
rm -rf /home/peerplays/src/*
|
||||||
|
|
||||||
|
#===============================================================================
|
||||||
|
# libzmq setup
|
||||||
|
#===============================================================================
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
wget https://github.com/zeromq/libzmq/archive/refs/tags/v4.3.4.tar.gz && \
|
||||||
|
tar -xzvf v4.3.4.tar.gz && \
|
||||||
|
cd libzmq-4.3.4 && \
|
||||||
|
mkdir build && \
|
||||||
|
cd build && \
|
||||||
|
cmake .. && \
|
||||||
|
make -j$(nproc) && \
|
||||||
|
make install && \
|
||||||
|
ldconfig && \
|
||||||
|
rm -rf /home/peerplays/src/*
|
||||||
|
|
||||||
|
#===============================================================================
|
||||||
|
# cppzmq setup
|
||||||
|
#===============================================================================
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
wget https://github.com/zeromq/cppzmq/archive/refs/tags/v4.9.0.tar.gz && \
|
||||||
|
tar -xzvf v4.9.0.tar.gz && \
|
||||||
|
cd cppzmq-4.9.0 && \
|
||||||
|
mkdir build && \
|
||||||
|
cd build && \
|
||||||
|
cmake .. && \
|
||||||
|
make -j$(nproc) && \
|
||||||
|
make install && \
|
||||||
|
ldconfig && \
|
||||||
|
rm -rf /home/peerplays/src/*
|
||||||
|
|
||||||
|
#===============================================================================
|
||||||
|
# gsl setup
|
||||||
|
#===============================================================================
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
||||||
|
libpcre3-dev
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
wget https://github.com/imatix/gsl/archive/refs/tags/v4.1.4.tar.gz && \
|
||||||
|
tar -xzvf v4.1.4.tar.gz && \
|
||||||
|
cd gsl-4.1.4 && \
|
||||||
|
make -j$(nproc) && \
|
||||||
|
make install && \
|
||||||
|
rm -rf /home/peerplays/src/*
|
||||||
|
|
||||||
|
#===============================================================================
|
||||||
|
# libbitcoin-build setup
|
||||||
|
# libbitcoin-explorer setup
|
||||||
|
#===============================================================================
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
||||||
|
libsodium-dev
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
git clone --branch version3.8.0 --depth 1 https://gitlab.com/PBSA/peerplays-1.0/libbitcoin-explorer.git && \
|
||||||
|
cd libbitcoin-explorer && \
|
||||||
|
./install.sh && \
|
||||||
|
ldconfig && \
|
||||||
|
rm -rf /home/peerplays/src/*
|
||||||
|
|
||||||
|
#===============================================================================
|
||||||
|
# Doxygen setup
|
||||||
|
#===============================================================================
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
sudo apt install -y bison flex && \
|
||||||
|
wget https://github.com/doxygen/doxygen/archive/refs/tags/Release_1_8_17.tar.gz && \
|
||||||
|
tar -xvf Release_1_8_17.tar.gz && \
|
||||||
|
cd doxygen-Release_1_8_17 && \
|
||||||
|
mkdir build && \
|
||||||
|
cd build && \
|
||||||
|
cmake .. && \
|
||||||
|
make -j$(nproc) install && \
|
||||||
|
ldconfig
|
||||||
|
|
||||||
|
#===============================================================================
|
||||||
|
# Perl setup
|
||||||
|
#===============================================================================
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
wget https://github.com/Perl/perl5/archive/refs/tags/v5.30.0.tar.gz && \
|
||||||
|
tar -xvf v5.30.0.tar.gz && \
|
||||||
|
cd perl5-5.30.0 && \
|
||||||
|
./Configure -des && \
|
||||||
|
make -j$(nproc) install && \
|
||||||
|
ldconfig
|
||||||
|
|
||||||
|
#===============================================================================
|
||||||
|
# Peerplays setup
|
||||||
|
#===============================================================================
|
||||||
|
|
||||||
|
## Clone Peerplays
|
||||||
|
#RUN \
|
||||||
|
# git clone https://gitlab.com/PBSA/peerplays.git && \
|
||||||
|
# cd peerplays && \
|
||||||
|
# git checkout develop && \
|
||||||
|
# git submodule update --init --recursive && \
|
||||||
|
# git branch --show-current && \
|
||||||
|
# git log --oneline -n 5
|
||||||
|
|
||||||
|
# Add local source
|
||||||
|
ADD . peerplays
|
||||||
|
|
||||||
|
# Configure Peerplays
|
||||||
|
RUN \
|
||||||
|
cd peerplays && \
|
||||||
|
git submodule update --init --recursive && \
|
||||||
|
git symbolic-ref --short HEAD && \
|
||||||
|
git log --oneline -n 5 && \
|
||||||
|
mkdir build && \
|
||||||
|
cd build && \
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||||
|
|
||||||
|
# Build Peerplays
|
||||||
|
RUN \
|
||||||
|
cd peerplays/build && \
|
||||||
|
make -j$(nproc) cli_wallet witness_node
|
||||||
|
|
||||||
|
WORKDIR /home/peerplays/peerplays-network
|
||||||
|
|
||||||
|
# Setup Peerplays runimage
|
||||||
|
RUN \
|
||||||
|
ln -s /home/peerplays/src/peerplays/build/programs/cli_wallet/cli_wallet ./ && \
|
||||||
|
ln -s /home/peerplays/src/peerplays/build/programs/witness_node/witness_node ./
|
||||||
|
|
||||||
|
RUN ./witness_node --create-genesis-json genesis.json && \
|
||||||
|
rm genesis.json
|
||||||
|
|
||||||
|
RUN chown peerplays:root -R /home/peerplays/peerplays-network
|
||||||
|
|
||||||
|
# Peerplays RPC
|
||||||
|
EXPOSE 8090
|
||||||
|
# Peerplays P2P:
|
||||||
|
EXPOSE 9777
|
||||||
|
|
||||||
|
# Peerplays
|
||||||
|
CMD ["./witness_node", "-d", "./witness_node_data_dir"]
|
||||||
221
README.md
221
README.md
|
|
@ -2,93 +2,186 @@ Intro for new developers and witnesses
|
||||||
------------------------
|
------------------------
|
||||||
|
|
||||||
This is a quick introduction to get new developers and witnesses up to speed on Peerplays blockchain. It is intended for witnesses plannig to join a live, already deployed blockchain.
|
This is a quick introduction to get new developers and witnesses up to speed on Peerplays blockchain. It is intended for witnesses plannig to join a live, already deployed blockchain.
|
||||||
# Building on Ubuntu 18.04 LTS and Installation Instructions
|
|
||||||
|
|
||||||
The following dependencies were necessary for a clean install of Ubuntu 18.04 LTS:
|
|
||||||
|
|
||||||
```
|
# Building and Installation Instructions
|
||||||
sudo apt-get install autoconf bash build-essential ca-certificates cmake \
|
|
||||||
doxygen git graphviz libbz2-dev libcurl4-openssl-dev libncurses-dev \
|
Officially supported OS are Ubuntu 20.04 and Ubuntu 18.04.
|
||||||
libreadline-dev libssl-dev libtool libzmq3-dev locales ntp pkg-config \
|
|
||||||
wget
|
## Ubuntu 20.04 and 18.04
|
||||||
|
|
||||||
|
Following dependencies are needed for a clean install of Ubuntu 20.04 and Ubuntu 18.04:
|
||||||
```
|
```
|
||||||
## Build Boost 1.67.0
|
sudo apt-get install \
|
||||||
|
autoconf bash bison build-essential ca-certificates dnsutils expect flex git \
|
||||||
|
graphviz libbz2-dev libcurl4-openssl-dev libncurses-dev libpcre3-dev \
|
||||||
```
|
libsnappy-dev libsodium-dev libssl-dev libtool libzip-dev locales lsb-release \
|
||||||
mkdir $HOME/src
|
mc nano net-tools ntp openssh-server pkg-config python3 python3-jinja2 sudo \
|
||||||
cd $HOME/src
|
systemd-coredump wget
|
||||||
export BOOST_ROOT=$HOME/src/boost_1_67_0
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y autotools-dev build-essential libbz2-dev libicu-dev python-dev
|
|
||||||
wget -c 'http://sourceforge.net/projects/boost/files/boost/1.67.0/boost_1_67_0.tar.bz2/download'\
|
|
||||||
-O boost_1_67_0.tar.bz2
|
|
||||||
tar xjf boost_1_67_0.tar.bz2
|
|
||||||
cd boost_1_67_0/
|
|
||||||
./bootstrap.sh "--prefix=$BOOST_ROOT"
|
|
||||||
./b2 install
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Boost libraries setup:
|
||||||
## Building Peerplays
|
|
||||||
|
|
||||||
```
|
```
|
||||||
cd $HOME/src
|
wget https://boostorg.jfrog.io/artifactory/main/release/1.72.0/source/boost_1_72_0.tar.gz
|
||||||
export BOOST_ROOT=$HOME/src/boost_1_67_0
|
tar -xzf boost_1_72_0.tar.gz boost_1_72_0
|
||||||
git clone https://github.com/peerplays-network/peerplays.git
|
cd boost_1_72_0
|
||||||
|
./bootstrap.sh
|
||||||
|
./b2
|
||||||
|
sudo ./b2 install
|
||||||
|
sudo ldconfig
|
||||||
|
```
|
||||||
|
|
||||||
|
cmake setup:
|
||||||
|
```
|
||||||
|
wget https://github.com/Kitware/CMake/releases/download/v3.24.2/cmake-3.24.2-linux-x86_64.sh
|
||||||
|
chmod 755 ./cmake-3.24.2-linux-x86_64.sh
|
||||||
|
sudo ./cmake-3.24.2-linux-x86_64.sh --prefix=/usr --skip-license
|
||||||
|
cmake --version
|
||||||
|
```
|
||||||
|
|
||||||
|
libzmq setup:
|
||||||
|
```
|
||||||
|
wget https://github.com/zeromq/libzmq/archive/refs/tags/v4.3.4.tar.gz
|
||||||
|
tar -xzvf v4.3.4.tar.gz
|
||||||
|
cd libzmq-4.3.4
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake ..
|
||||||
|
make -j$(nproc)
|
||||||
|
sudo make install
|
||||||
|
sudo ldconfig
|
||||||
|
```
|
||||||
|
|
||||||
|
cppzmq setup:
|
||||||
|
```
|
||||||
|
wget https://github.com/zeromq/cppzmq/archive/refs/tags/v4.9.0.tar.gz
|
||||||
|
tar -xzvf v4.9.0.tar.gz
|
||||||
|
cd cppzmq-4.9.0
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake ..
|
||||||
|
make -j$(nproc)
|
||||||
|
sudo make install
|
||||||
|
sudo ldconfig
|
||||||
|
```
|
||||||
|
|
||||||
|
gsl setup:
|
||||||
|
```
|
||||||
|
wget https://github.com/imatix/gsl/archive/refs/tags/v4.1.4.tar.gz
|
||||||
|
tar -xzvf v4.1.4.tar.gz
|
||||||
|
cd gsl-4.1.4
|
||||||
|
make -j$(nproc)
|
||||||
|
sudo make install
|
||||||
|
sudo ldconfig
|
||||||
|
```
|
||||||
|
|
||||||
|
libbitcoin-explorer setup:
|
||||||
|
```
|
||||||
|
git clone --branch version3.8.0 --depth 1 https://gitlab.com/PBSA/peerplays-1.0/libbitcoin-explorer.git
|
||||||
|
cd libbitcoin-explorer
|
||||||
|
sudo ./install.sh
|
||||||
|
sudo ldconfig
|
||||||
|
```
|
||||||
|
|
||||||
|
Doxygen setup:
|
||||||
|
```
|
||||||
|
wget https://github.com/doxygen/doxygen/archive/refs/tags/Release_1_8_17.tar.gz
|
||||||
|
tar -xvf Release_1_8_17.tar.gz
|
||||||
|
cd doxygen-Release_1_8_17
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake ..
|
||||||
|
make -j$(nproc)
|
||||||
|
sudo make install
|
||||||
|
sudo ldconfig
|
||||||
|
```
|
||||||
|
|
||||||
|
Perl setup:
|
||||||
|
```
|
||||||
|
wget https://github.com/Perl/perl5/archive/refs/tags/v5.30.0.tar.gz
|
||||||
|
tar -xvf v5.30.0.tar.gz
|
||||||
|
cd perl5-5.30.0
|
||||||
|
./Configure -des
|
||||||
|
make -j$(nproc)
|
||||||
|
sudo make install
|
||||||
|
sudo ldconfig
|
||||||
|
```
|
||||||
|
|
||||||
|
Building Peerplays
|
||||||
|
```
|
||||||
|
git clone https://gitlab.com/PBSA/peerplays.git
|
||||||
cd peerplays
|
cd peerplays
|
||||||
git submodule update --init --recursive
|
git submodule update --init --recursive
|
||||||
cmake -DBOOST_ROOT="$BOOST_ROOT" -DCMAKE_BUILD_TYPE=Release
|
|
||||||
|
# If you want to build Mainnet node
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=Release
|
||||||
|
|
||||||
|
# If you want to build Testnet node
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_PEERPLAYS_TESTNET=1
|
||||||
|
|
||||||
|
# Update -j flag depending on your current system specs;
|
||||||
|
# Recommended 4GB of RAM per 1 CPU core
|
||||||
|
# make -j2 for 8GB RAM
|
||||||
|
# make -j4 for 16GB RAM
|
||||||
|
# make -j8 for 32GB RAM
|
||||||
make -j$(nproc)
|
make -j$(nproc)
|
||||||
|
|
||||||
make install # this can install the executable files under /usr/local
|
sudo make install # this can install the executable files under /usr/local
|
||||||
```
|
```
|
||||||
|
|
||||||
docker build -t peerplays .
|
## Docker images
|
||||||
|
|
||||||
## Docker image
|
|
||||||
|
|
||||||
|
Install docker, and add current user to docker group.
|
||||||
```
|
```
|
||||||
# Install docker
|
|
||||||
sudo apt install docker.io
|
sudo apt install docker.io
|
||||||
|
|
||||||
|
|
||||||
# Add current user to docker group
|
|
||||||
sudo usermod -a -G docker $USER
|
sudo usermod -a -G docker $USER
|
||||||
|
|
||||||
# You need to restart your shell session, to apply group membership
|
# You need to restart your shell session, to apply group membership
|
||||||
# Type 'groups' to verify that you are a member of a docker group
|
# Type 'groups' to verify that you are a member of a docker group
|
||||||
|
|
||||||
|
|
||||||
# Build docker image (from the project root, must be a docker group member)
|
|
||||||
docker build -t peerplays .
|
|
||||||
|
|
||||||
|
|
||||||
# Start docker image
|
|
||||||
docker start peerplays
|
|
||||||
|
|
||||||
# Exposed ports
|
|
||||||
# # rpc service:
|
|
||||||
# EXPOSE 8090
|
|
||||||
# # p2p service:
|
|
||||||
# EXPOSE 1776
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Rest of the instructions on starting the chain remains same.
|
### Official docker image for Peerplas Mainnet
|
||||||
|
|
||||||
|
```
|
||||||
|
docker pull datasecuritynode/peerplays:latest
|
||||||
|
```
|
||||||
|
|
||||||
|
### Building docker images manually
|
||||||
|
```
|
||||||
|
# Checkout the code
|
||||||
|
git clone https://gitlab.com/PBSA/peerplays.git
|
||||||
|
cd peerplays
|
||||||
|
|
||||||
|
# Checkout the branch you want
|
||||||
|
# E.g.
|
||||||
|
# git checkout beatrice
|
||||||
|
# git checkout develop
|
||||||
|
git checkout master
|
||||||
|
|
||||||
|
git submodule update --init --recursive
|
||||||
|
|
||||||
|
# Execute from the project root, must be a docker group member
|
||||||
|
|
||||||
|
# Build docker image, using Ubuntu 20.04 base
|
||||||
|
docker build --no-cache -f Dockerfile -t peerplays .
|
||||||
|
|
||||||
|
# Build docker image, using Ubuntu 18.04 base
|
||||||
|
docker build --no-cache -f Dockerfile.18.04 -t peerplays-18-04 .
|
||||||
|
```
|
||||||
|
|
||||||
|
### Start docker image
|
||||||
|
```
|
||||||
|
# Start docker image, using Ubuntu 20.04 base
|
||||||
|
docker run peerplays:latest
|
||||||
|
|
||||||
|
# Start docker image, using Ubuntu 18.04 base
|
||||||
|
docker run peerplays-18-04:latest
|
||||||
|
```
|
||||||
|
|
||||||
|
Rest of the instructions on starting the chain remains same.
|
||||||
|
|
||||||
Starting A Peerplays Node
|
Starting A Peerplays Node
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
For Ubuntu 14.04 LTS and up users, see
|
|
||||||
[this](https://github.com/cryptonomex/graphene/wiki/build-ubuntu) and
|
|
||||||
then proceed with:
|
|
||||||
|
|
||||||
git clone https://github.com/peerplays-network/peerplays.git
|
|
||||||
cd peerplays
|
|
||||||
git submodule update --init --recursive
|
|
||||||
cmake -DBOOST_ROOT="$BOOST_ROOT" -DCMAKE_BUILD_TYPE=Release .
|
|
||||||
make
|
|
||||||
./programs/witness_node/witness_node
|
|
||||||
|
|
||||||
Launching the witness creates required directories. Next, **stop the witness** and continue.
|
Launching the witness creates required directories. Next, **stop the witness** and continue.
|
||||||
|
|
||||||
$ vi witness_node_data_dir/config.ini
|
$ vi witness_node_data_dir/config.ini
|
||||||
|
|
|
||||||
|
|
@ -1,794 +0,0 @@
|
||||||
# This is the CMakeCache file.
|
|
||||||
# For build in directory: /home/pbattu/git/18.04/peerplays
|
|
||||||
# It was generated by CMake: /usr/bin/cmake
|
|
||||||
# You can edit this file to change values found and used by cmake.
|
|
||||||
# If you do not want to change any of the values, simply exit the editor.
|
|
||||||
# If you do want to change a value, simply edit, save, and exit the editor.
|
|
||||||
# The syntax for the file is as follows:
|
|
||||||
# KEY:TYPE=VALUE
|
|
||||||
# KEY is the name of a variable in the cache.
|
|
||||||
# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!.
|
|
||||||
# VALUE is the current value for the KEY.
|
|
||||||
|
|
||||||
########################
|
|
||||||
# EXTERNAL cache entries
|
|
||||||
########################
|
|
||||||
|
|
||||||
//No help, variable specified on the command line.
|
|
||||||
BOOST_ROOT:PATH=/home/pbattu/git/18.04/boost_1_67_0
|
|
||||||
|
|
||||||
//The threading library used by boost-thread
|
|
||||||
BOOST_THREAD_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libpthread.so
|
|
||||||
|
|
||||||
//Build bitshares executables (witness node, cli wallet, etc)
|
|
||||||
BUILD_BITSHARES_PROGRAMS:BOOL=TRUE
|
|
||||||
|
|
||||||
//Build bitshares unit tests
|
|
||||||
BUILD_BITSHARES_TESTS:BOOL=TRUE
|
|
||||||
|
|
||||||
//Build websocketpp examples.
|
|
||||||
BUILD_EXAMPLES:BOOL=OFF
|
|
||||||
|
|
||||||
//Build websocketpp tests.
|
|
||||||
BUILD_TESTS:BOOL=OFF
|
|
||||||
|
|
||||||
//Value Computed by CMake
|
|
||||||
BitShares_BINARY_DIR:STATIC=/home/pbattu/git/18.04/peerplays
|
|
||||||
|
|
||||||
//Value Computed by CMake
|
|
||||||
BitShares_SOURCE_DIR:STATIC=/home/pbattu/git/18.04/peerplays
|
|
||||||
|
|
||||||
//Boost chrono library (debug)
|
|
||||||
Boost_CHRONO_LIBRARY_DEBUG:FILEPATH=/home/pbattu/git/18.04/boost_1_67_0/lib/libboost_chrono.a
|
|
||||||
|
|
||||||
//Boost chrono library (release)
|
|
||||||
Boost_CHRONO_LIBRARY_RELEASE:FILEPATH=/home/pbattu/git/18.04/boost_1_67_0/lib/libboost_chrono.a
|
|
||||||
|
|
||||||
//Boost context library (debug)
|
|
||||||
Boost_CONTEXT_LIBRARY_DEBUG:FILEPATH=/home/pbattu/git/18.04/boost_1_67_0/lib/libboost_context.a
|
|
||||||
|
|
||||||
//Boost context library (release)
|
|
||||||
Boost_CONTEXT_LIBRARY_RELEASE:FILEPATH=/home/pbattu/git/18.04/boost_1_67_0/lib/libboost_context.a
|
|
||||||
|
|
||||||
//Boost coroutine library (debug)
|
|
||||||
Boost_COROUTINE_LIBRARY_DEBUG:FILEPATH=/home/pbattu/git/18.04/boost_1_67_0/lib/libboost_coroutine.a
|
|
||||||
|
|
||||||
//Boost coroutine library (release)
|
|
||||||
Boost_COROUTINE_LIBRARY_RELEASE:FILEPATH=/home/pbattu/git/18.04/boost_1_67_0/lib/libboost_coroutine.a
|
|
||||||
|
|
||||||
//Boost date_time library (debug)
|
|
||||||
Boost_DATE_TIME_LIBRARY_DEBUG:FILEPATH=/home/pbattu/git/18.04/boost_1_67_0/lib/libboost_date_time.a
|
|
||||||
|
|
||||||
//Boost date_time library (release)
|
|
||||||
Boost_DATE_TIME_LIBRARY_RELEASE:FILEPATH=/home/pbattu/git/18.04/boost_1_67_0/lib/libboost_date_time.a
|
|
||||||
|
|
||||||
//The directory containing a CMake configuration file for Boost.
|
|
||||||
Boost_DIR:PATH=Boost_DIR-NOTFOUND
|
|
||||||
|
|
||||||
//Boost filesystem library (debug)
|
|
||||||
Boost_FILESYSTEM_LIBRARY_DEBUG:FILEPATH=/home/pbattu/git/18.04/boost_1_67_0/lib/libboost_filesystem.a
|
|
||||||
|
|
||||||
//Boost filesystem library (release)
|
|
||||||
Boost_FILESYSTEM_LIBRARY_RELEASE:FILEPATH=/home/pbattu/git/18.04/boost_1_67_0/lib/libboost_filesystem.a
|
|
||||||
|
|
||||||
//Path to a file.
|
|
||||||
Boost_INCLUDE_DIR:PATH=/home/pbattu/git/18.04/boost_1_67_0/include
|
|
||||||
|
|
||||||
//Boost iostreams library (debug)
|
|
||||||
Boost_IOSTREAMS_LIBRARY_DEBUG:FILEPATH=/home/pbattu/git/18.04/boost_1_67_0/lib/libboost_iostreams.a
|
|
||||||
|
|
||||||
//Boost iostreams library (release)
|
|
||||||
Boost_IOSTREAMS_LIBRARY_RELEASE:FILEPATH=/home/pbattu/git/18.04/boost_1_67_0/lib/libboost_iostreams.a
|
|
||||||
|
|
||||||
//Boost library directory
|
|
||||||
Boost_LIBRARY_DIR:PATH=/home/pbattu/git/18.04/boost_1_67_0/lib
|
|
||||||
|
|
||||||
//Boost library directory DEBUG
|
|
||||||
Boost_LIBRARY_DIR_DEBUG:PATH=/home/pbattu/git/18.04/boost_1_67_0/lib
|
|
||||||
|
|
||||||
//Boost library directory RELEASE
|
|
||||||
Boost_LIBRARY_DIR_RELEASE:PATH=/home/pbattu/git/18.04/boost_1_67_0/lib
|
|
||||||
|
|
||||||
//Boost locale library (debug)
|
|
||||||
Boost_LOCALE_LIBRARY_DEBUG:FILEPATH=/home/pbattu/git/18.04/boost_1_67_0/lib/libboost_locale.a
|
|
||||||
|
|
||||||
//Boost locale library (release)
|
|
||||||
Boost_LOCALE_LIBRARY_RELEASE:FILEPATH=/home/pbattu/git/18.04/boost_1_67_0/lib/libboost_locale.a
|
|
||||||
|
|
||||||
//Boost program_options library (debug)
|
|
||||||
Boost_PROGRAM_OPTIONS_LIBRARY_DEBUG:FILEPATH=/home/pbattu/git/18.04/boost_1_67_0/lib/libboost_program_options.a
|
|
||||||
|
|
||||||
//Boost program_options library (release)
|
|
||||||
Boost_PROGRAM_OPTIONS_LIBRARY_RELEASE:FILEPATH=/home/pbattu/git/18.04/boost_1_67_0/lib/libboost_program_options.a
|
|
||||||
|
|
||||||
//Boost serialization library (debug)
|
|
||||||
Boost_SERIALIZATION_LIBRARY_DEBUG:FILEPATH=/home/pbattu/git/18.04/boost_1_67_0/lib/libboost_serialization.a
|
|
||||||
|
|
||||||
//Boost serialization library (release)
|
|
||||||
Boost_SERIALIZATION_LIBRARY_RELEASE:FILEPATH=/home/pbattu/git/18.04/boost_1_67_0/lib/libboost_serialization.a
|
|
||||||
|
|
||||||
//Boost signals library (debug)
|
|
||||||
Boost_SIGNALS_LIBRARY_DEBUG:FILEPATH=/home/pbattu/git/18.04/boost_1_67_0/lib/libboost_signals.a
|
|
||||||
|
|
||||||
//Boost signals library (release)
|
|
||||||
Boost_SIGNALS_LIBRARY_RELEASE:FILEPATH=/home/pbattu/git/18.04/boost_1_67_0/lib/libboost_signals.a
|
|
||||||
|
|
||||||
//Boost system library (debug)
|
|
||||||
Boost_SYSTEM_LIBRARY_DEBUG:FILEPATH=/home/pbattu/git/18.04/boost_1_67_0/lib/libboost_system.a
|
|
||||||
|
|
||||||
//Boost system library (release)
|
|
||||||
Boost_SYSTEM_LIBRARY_RELEASE:FILEPATH=/home/pbattu/git/18.04/boost_1_67_0/lib/libboost_system.a
|
|
||||||
|
|
||||||
//Boost thread library (debug)
|
|
||||||
Boost_THREAD_LIBRARY_DEBUG:FILEPATH=/home/pbattu/git/18.04/boost_1_67_0/lib/libboost_thread.a
|
|
||||||
|
|
||||||
//Boost thread library (release)
|
|
||||||
Boost_THREAD_LIBRARY_RELEASE:FILEPATH=/home/pbattu/git/18.04/boost_1_67_0/lib/libboost_thread.a
|
|
||||||
|
|
||||||
//Boost unit_test_framework library (debug)
|
|
||||||
Boost_UNIT_TEST_FRAMEWORK_LIBRARY_DEBUG:FILEPATH=/home/pbattu/git/18.04/boost_1_67_0/lib/libboost_unit_test_framework.a
|
|
||||||
|
|
||||||
//Boost unit_test_framework library (release)
|
|
||||||
Boost_UNIT_TEST_FRAMEWORK_LIBRARY_RELEASE:FILEPATH=/home/pbattu/git/18.04/boost_1_67_0/lib/libboost_unit_test_framework.a
|
|
||||||
|
|
||||||
//ON or OFF
|
|
||||||
Boost_USE_STATIC_LIBS:STRING=ON
|
|
||||||
|
|
||||||
//Path to a program.
|
|
||||||
CMAKE_AR:FILEPATH=/usr/bin/ar
|
|
||||||
|
|
||||||
//Choose the type of build, options are: None(CMAKE_CXX_FLAGS or
|
|
||||||
// CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.
|
|
||||||
CMAKE_BUILD_TYPE:STRING=Debug
|
|
||||||
|
|
||||||
//Enable/Disable color output during build.
|
|
||||||
CMAKE_COLOR_MAKEFILE:BOOL=ON
|
|
||||||
|
|
||||||
//Configurations
|
|
||||||
CMAKE_CONFIGURATION_TYPES:STRING=Release;RelWithDebInfo;Debug
|
|
||||||
|
|
||||||
//CXX compiler
|
|
||||||
CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/g++-5
|
|
||||||
|
|
||||||
//A wrapper around 'ar' adding the appropriate '--plugin' option
|
|
||||||
// for the GCC compiler
|
|
||||||
CMAKE_CXX_COMPILER_AR:FILEPATH=/usr/bin/gcc-ar-5
|
|
||||||
|
|
||||||
//A wrapper around 'ranlib' adding the appropriate '--plugin' option
|
|
||||||
// for the GCC compiler
|
|
||||||
CMAKE_CXX_COMPILER_RANLIB:FILEPATH=/usr/bin/gcc-ranlib-5
|
|
||||||
|
|
||||||
//Flags used by the compiler during all build types.
|
|
||||||
CMAKE_CXX_FLAGS:STRING=
|
|
||||||
|
|
||||||
//Flags used by the compiler during debug builds.
|
|
||||||
CMAKE_CXX_FLAGS_DEBUG:STRING=-g
|
|
||||||
|
|
||||||
//Flags used by the compiler during release builds for minimum
|
|
||||||
// size.
|
|
||||||
CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG
|
|
||||||
|
|
||||||
//Flags used by the compiler during release builds.
|
|
||||||
CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG
|
|
||||||
|
|
||||||
//Flags used by the compiler during release builds with debug info.
|
|
||||||
CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG
|
|
||||||
|
|
||||||
//C compiler
|
|
||||||
CMAKE_C_COMPILER:FILEPATH=/usr/bin/gcc-5
|
|
||||||
|
|
||||||
//A wrapper around 'ar' adding the appropriate '--plugin' option
|
|
||||||
// for the GCC compiler
|
|
||||||
CMAKE_C_COMPILER_AR:FILEPATH=/usr/bin/gcc-ar-5
|
|
||||||
|
|
||||||
//A wrapper around 'ranlib' adding the appropriate '--plugin' option
|
|
||||||
// for the GCC compiler
|
|
||||||
CMAKE_C_COMPILER_RANLIB:FILEPATH=/usr/bin/gcc-ranlib-5
|
|
||||||
|
|
||||||
//Flags used by the compiler during all build types.
|
|
||||||
CMAKE_C_FLAGS:STRING=
|
|
||||||
|
|
||||||
//Flags used by the compiler during debug builds.
|
|
||||||
CMAKE_C_FLAGS_DEBUG:STRING=-g
|
|
||||||
|
|
||||||
//Flags used by the compiler during release builds for minimum
|
|
||||||
// size.
|
|
||||||
CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG
|
|
||||||
|
|
||||||
//Flags used by the compiler during release builds.
|
|
||||||
CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG
|
|
||||||
|
|
||||||
//Flags used by the compiler during release builds with debug info.
|
|
||||||
CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG
|
|
||||||
|
|
||||||
//Flags used by the linker.
|
|
||||||
CMAKE_EXE_LINKER_FLAGS:STRING=
|
|
||||||
|
|
||||||
//Flags used by the linker during debug builds.
|
|
||||||
CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=
|
|
||||||
|
|
||||||
//Flags used by the linker during release minsize builds.
|
|
||||||
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=
|
|
||||||
|
|
||||||
//Flags used by the linker during release builds.
|
|
||||||
CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=
|
|
||||||
|
|
||||||
//Flags used by the linker during Release with Debug Info builds.
|
|
||||||
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
|
|
||||||
|
|
||||||
//Enable/Disable output of compile commands during generation.
|
|
||||||
CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF
|
|
||||||
|
|
||||||
//Install path prefix, prepended onto install directories.
|
|
||||||
CMAKE_INSTALL_PREFIX:PATH=/usr/local
|
|
||||||
|
|
||||||
//Path to a program.
|
|
||||||
CMAKE_LINKER:FILEPATH=/usr/bin/ld
|
|
||||||
|
|
||||||
//Path to a program.
|
|
||||||
CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make
|
|
||||||
|
|
||||||
//Flags used by the linker during the creation of modules.
|
|
||||||
CMAKE_MODULE_LINKER_FLAGS:STRING=
|
|
||||||
|
|
||||||
//Flags used by the linker during debug builds.
|
|
||||||
CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=
|
|
||||||
|
|
||||||
//Flags used by the linker during release minsize builds.
|
|
||||||
CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=
|
|
||||||
|
|
||||||
//Flags used by the linker during release builds.
|
|
||||||
CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=
|
|
||||||
|
|
||||||
//Flags used by the linker during Release with Debug Info builds.
|
|
||||||
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
|
|
||||||
|
|
||||||
//Path to a program.
|
|
||||||
CMAKE_NM:FILEPATH=/usr/bin/nm
|
|
||||||
|
|
||||||
//Path to a program.
|
|
||||||
CMAKE_OBJCOPY:FILEPATH=/usr/bin/objcopy
|
|
||||||
|
|
||||||
//Path to a program.
|
|
||||||
CMAKE_OBJDUMP:FILEPATH=/usr/bin/objdump
|
|
||||||
|
|
||||||
//Value Computed by CMake
|
|
||||||
CMAKE_PROJECT_NAME:STATIC=BitShares
|
|
||||||
|
|
||||||
//Path to a program.
|
|
||||||
CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib
|
|
||||||
|
|
||||||
//Flags used by the linker during the creation of dll's.
|
|
||||||
CMAKE_SHARED_LINKER_FLAGS:STRING=
|
|
||||||
|
|
||||||
//Flags used by the linker during debug builds.
|
|
||||||
CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=
|
|
||||||
|
|
||||||
//Flags used by the linker during release minsize builds.
|
|
||||||
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=
|
|
||||||
|
|
||||||
//Flags used by the linker during release builds.
|
|
||||||
CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=
|
|
||||||
|
|
||||||
//Flags used by the linker during Release with Debug Info builds.
|
|
||||||
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=
|
|
||||||
|
|
||||||
//If set, runtime paths are not added when installing shared libraries,
|
|
||||||
// but are added when building.
|
|
||||||
CMAKE_SKIP_INSTALL_RPATH:BOOL=NO
|
|
||||||
|
|
||||||
//If set, runtime paths are not added when using shared libraries.
|
|
||||||
CMAKE_SKIP_RPATH:BOOL=NO
|
|
||||||
|
|
||||||
//Flags used by the linker during the creation of static libraries.
|
|
||||||
CMAKE_STATIC_LINKER_FLAGS:STRING=
|
|
||||||
|
|
||||||
//Flags used by the linker during debug builds.
|
|
||||||
CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING=
|
|
||||||
|
|
||||||
//Flags used by the linker during release minsize builds.
|
|
||||||
CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING=
|
|
||||||
|
|
||||||
//Flags used by the linker during release builds.
|
|
||||||
CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING=
|
|
||||||
|
|
||||||
//Flags used by the linker during Release with Debug Info builds.
|
|
||||||
CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING=
|
|
||||||
|
|
||||||
//Path to a program.
|
|
||||||
CMAKE_STRIP:FILEPATH=/usr/bin/strip
|
|
||||||
|
|
||||||
//If this value is on, makefiles will be generated without the
|
|
||||||
// .SILENT directive, and all commands will be echoed to the console
|
|
||||||
// during the make. This is useful for debugging only. With Visual
|
|
||||||
// Studio IDE projects all commands are done without /nologo.
|
|
||||||
CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE
|
|
||||||
|
|
||||||
//Path to a library.
|
|
||||||
CURSES_CURSES_LIBRARY:FILEPATH=CURSES_CURSES_LIBRARY-NOTFOUND
|
|
||||||
|
|
||||||
//Path to a library.
|
|
||||||
CURSES_FORM_LIBRARY:FILEPATH=CURSES_FORM_LIBRARY-NOTFOUND
|
|
||||||
|
|
||||||
//Path to a file.
|
|
||||||
CURSES_INCLUDE_PATH:PATH=CURSES_INCLUDE_PATH-NOTFOUND
|
|
||||||
|
|
||||||
//Path to a library.
|
|
||||||
CURSES_NCURSES_LIBRARY:FILEPATH=CURSES_NCURSES_LIBRARY-NOTFOUND
|
|
||||||
|
|
||||||
//Dot tool for use with Doxygen
|
|
||||||
DOXYGEN_DOT_EXECUTABLE:FILEPATH=DOXYGEN_DOT_EXECUTABLE-NOTFOUND
|
|
||||||
|
|
||||||
//Doxygen documentation generation tool (http://www.doxygen.org)
|
|
||||||
DOXYGEN_EXECUTABLE:FILEPATH=DOXYGEN_EXECUTABLE-NOTFOUND
|
|
||||||
|
|
||||||
//secp256k1 or openssl or mixed
|
|
||||||
ECC_IMPL:STRING=secp256k1
|
|
||||||
|
|
||||||
//Build BitShares for code coverage analysis
|
|
||||||
ENABLE_COVERAGE_TESTING:BOOL=FALSE
|
|
||||||
|
|
||||||
//Build websocketpp with CPP11 features enabled.
|
|
||||||
ENABLE_CPP11:BOOL=ON
|
|
||||||
|
|
||||||
//TRUE to try to use full zlib for compression, FALSE to use miniz.c
|
|
||||||
FC_USE_FULL_ZLIB:BOOL=FALSE
|
|
||||||
|
|
||||||
//Git command line client
|
|
||||||
GIT_EXECUTABLE:FILEPATH=/usr/bin/git
|
|
||||||
|
|
||||||
//location of the genesis.json to embed in the executable
|
|
||||||
GRAPHENE_EGENESIS_JSON:PATH=/home/pbattu/git/18.04/peerplays/genesis.json
|
|
||||||
|
|
||||||
//The directory containing a CMake configuration file for Gperftools.
|
|
||||||
Gperftools_DIR:PATH=Gperftools_DIR-NOTFOUND
|
|
||||||
|
|
||||||
//Installation directory for CMake files
|
|
||||||
INSTALL_CMAKE_DIR:PATH=lib/cmake/websocketpp
|
|
||||||
|
|
||||||
//Installation directory for header files
|
|
||||||
INSTALL_INCLUDE_DIR:PATH=include
|
|
||||||
|
|
||||||
//Log long API calls over websocket (ON OR OFF)
|
|
||||||
LOG_LONG_API:BOOL=ON
|
|
||||||
|
|
||||||
//Max API execution time in ms
|
|
||||||
LOG_LONG_API_MAX_MS:STRING=1000
|
|
||||||
|
|
||||||
//API execution time in ms at which to warn
|
|
||||||
LOG_LONG_API_WARN_MS:STRING=750
|
|
||||||
|
|
||||||
//Path to a library.
|
|
||||||
OPENSSL_CRYPTO_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libcrypto.a
|
|
||||||
|
|
||||||
//Path to a file.
|
|
||||||
OPENSSL_INCLUDE_DIR:PATH=/usr/include
|
|
||||||
|
|
||||||
//Path to a library.
|
|
||||||
OPENSSL_SSL_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libssl.a
|
|
||||||
|
|
||||||
//Path to a program.
|
|
||||||
PERL_EXECUTABLE:FILEPATH=/usr/bin/perl
|
|
||||||
|
|
||||||
//pkg-config executable
|
|
||||||
PKG_CONFIG_EXECUTABLE:FILEPATH=/usr/bin/pkg-config
|
|
||||||
|
|
||||||
//Path to a file.
|
|
||||||
READLINE_INCLUDE_DIR:PATH=/usr/include
|
|
||||||
|
|
||||||
//Path to a library.
|
|
||||||
READLINE_LIBRARIES:FILEPATH=/usr/lib/x86_64-linux-gnu/libreadline.so
|
|
||||||
|
|
||||||
//Path to a file.
|
|
||||||
Readline_INCLUDE_DIR:PATH=/usr/include
|
|
||||||
|
|
||||||
//Path to a library.
|
|
||||||
Readline_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libreadline.so
|
|
||||||
|
|
||||||
//Path to a file.
|
|
||||||
Readline_ROOT_DIR:PATH=/usr
|
|
||||||
|
|
||||||
//OFF
|
|
||||||
UNITY_BUILD:BOOL=OFF
|
|
||||||
|
|
||||||
//Path to a file.
|
|
||||||
ZLIB_INCLUDE_DIR:PATH=/usr/include
|
|
||||||
|
|
||||||
//Path to a library.
|
|
||||||
ZLIB_LIBRARY_DEBUG:FILEPATH=ZLIB_LIBRARY_DEBUG-NOTFOUND
|
|
||||||
|
|
||||||
//Path to a library.
|
|
||||||
ZLIB_LIBRARY_RELEASE:FILEPATH=/usr/lib/x86_64-linux-gnu/libz.so
|
|
||||||
|
|
||||||
//Value Computed by CMake
|
|
||||||
fc_BINARY_DIR:STATIC=/home/pbattu/git/18.04/peerplays/libraries/fc
|
|
||||||
|
|
||||||
//Dependencies for the target
|
|
||||||
fc_LIB_DEPENDS:STATIC=general;-L/usr/local/lib;general;/home/pbattu/git/18.04/boost_1_67_0/lib/libboost_thread.a;general;/home/pbattu/git/18.04/boost_1_67_0/lib/libboost_date_time.a;general;/home/pbattu/git/18.04/boost_1_67_0/lib/libboost_filesystem.a;general;/home/pbattu/git/18.04/boost_1_67_0/lib/libboost_system.a;general;/home/pbattu/git/18.04/boost_1_67_0/lib/libboost_program_options.a;general;/home/pbattu/git/18.04/boost_1_67_0/lib/libboost_signals.a;general;/home/pbattu/git/18.04/boost_1_67_0/lib/libboost_serialization.a;general;/home/pbattu/git/18.04/boost_1_67_0/lib/libboost_chrono.a;general;/home/pbattu/git/18.04/boost_1_67_0/lib/libboost_unit_test_framework.a;general;/home/pbattu/git/18.04/boost_1_67_0/lib/libboost_context.a;general;/home/pbattu/git/18.04/boost_1_67_0/lib/libboost_locale.a;general;/home/pbattu/git/18.04/boost_1_67_0/lib/libboost_iostreams.a;general;/home/pbattu/git/18.04/boost_1_67_0/lib/libboost_coroutine.a;general;/usr/lib/x86_64-linux-gnu/libpthread.so;general;/usr/lib/x86_64-linux-gnu/libssl.a;general;/usr/lib/x86_64-linux-gnu/libcrypto.a;general;/usr/lib/x86_64-linux-gnu/libz.so;general;dl;general;rt;general;/usr/lib/x86_64-linux-gnu/libreadline.so;general;secp256k1;
|
|
||||||
|
|
||||||
//Value Computed by CMake
|
|
||||||
fc_SOURCE_DIR:STATIC=/home/pbattu/git/18.04/peerplays/libraries/fc
|
|
||||||
|
|
||||||
//Dependencies for the target
|
|
||||||
graphene_account_history_LIB_DEPENDS:STATIC=general;graphene_chain;general;graphene_app;
|
|
||||||
|
|
||||||
//Dependencies for the target
|
|
||||||
graphene_accounts_list_LIB_DEPENDS:STATIC=general;graphene_chain;general;graphene_app;
|
|
||||||
|
|
||||||
//Dependencies for the target
|
|
||||||
graphene_affiliate_stats_LIB_DEPENDS:STATIC=general;graphene_chain;general;graphene_app;
|
|
||||||
|
|
||||||
//Dependencies for the target
|
|
||||||
graphene_app_LIB_DEPENDS:STATIC=general;graphene_market_history;general;graphene_account_history;general;graphene_accounts_list;general;graphene_affiliate_stats;general;graphene_chain;general;fc;general;graphene_db;general;graphene_net;general;graphene_time;general;graphene_utilities;general;graphene_debug_witness;general;graphene_bookie;
|
|
||||||
|
|
||||||
//Dependencies for the target
|
|
||||||
graphene_bookie_LIB_DEPENDS:STATIC=general;graphene_chain;general;graphene_app;
|
|
||||||
|
|
||||||
//Dependencies for the target
|
|
||||||
graphene_chain_LIB_DEPENDS:STATIC=general;fc;general;graphene_db;
|
|
||||||
|
|
||||||
//Dependencies for the target
|
|
||||||
graphene_db_LIB_DEPENDS:STATIC=general;fc;
|
|
||||||
|
|
||||||
//Dependencies for the target
|
|
||||||
graphene_debug_witness_LIB_DEPENDS:STATIC=general;graphene_chain;general;graphene_app;
|
|
||||||
|
|
||||||
//Dependencies for the target
|
|
||||||
graphene_delayed_node_LIB_DEPENDS:STATIC=general;graphene_chain;general;graphene_app;
|
|
||||||
|
|
||||||
//Dependencies for the target
|
|
||||||
graphene_egenesis_brief_LIB_DEPENDS:STATIC=general;graphene_chain;general;fc;
|
|
||||||
|
|
||||||
//Dependencies for the target
|
|
||||||
graphene_egenesis_full_LIB_DEPENDS:STATIC=general;graphene_chain;general;fc;
|
|
||||||
|
|
||||||
//Dependencies for the target
|
|
||||||
graphene_egenesis_none_LIB_DEPENDS:STATIC=general;graphene_chain;general;fc;
|
|
||||||
|
|
||||||
//Dependencies for the target
|
|
||||||
graphene_generate_genesis_LIB_DEPENDS:STATIC=general;graphene_chain;general;graphene_app;general;graphene_time;
|
|
||||||
|
|
||||||
//Dependencies for the target
|
|
||||||
graphene_generate_uia_sharedrop_genesis_LIB_DEPENDS:STATIC=general;graphene_chain;general;graphene_app;general;graphene_time;
|
|
||||||
|
|
||||||
//Dependencies for the target
|
|
||||||
graphene_market_history_LIB_DEPENDS:STATIC=general;graphene_chain;general;graphene_app;
|
|
||||||
|
|
||||||
//Dependencies for the target
|
|
||||||
graphene_net_LIB_DEPENDS:STATIC=general;fc;general;graphene_db;
|
|
||||||
|
|
||||||
//Dependencies for the target
|
|
||||||
graphene_snapshot_LIB_DEPENDS:STATIC=general;graphene_chain;general;graphene_app;
|
|
||||||
|
|
||||||
//Dependencies for the target
|
|
||||||
graphene_time_LIB_DEPENDS:STATIC=general;fc;
|
|
||||||
|
|
||||||
//Dependencies for the target
|
|
||||||
graphene_utilities_LIB_DEPENDS:STATIC=general;fc;
|
|
||||||
|
|
||||||
//Dependencies for the target
|
|
||||||
graphene_wallet_LIB_DEPENDS:STATIC=general;graphene_app;general;graphene_net;general;graphene_chain;general;graphene_utilities;general;fc;general;dl;
|
|
||||||
|
|
||||||
//Dependencies for the target
|
|
||||||
graphene_witness_LIB_DEPENDS:STATIC=general;graphene_chain;general;graphene_app;
|
|
||||||
|
|
||||||
//Value Computed by CMake
|
|
||||||
websocketpp_BINARY_DIR:STATIC=/home/pbattu/git/18.04/peerplays/libraries/fc/vendor/websocketpp
|
|
||||||
|
|
||||||
//Value Computed by CMake
|
|
||||||
websocketpp_SOURCE_DIR:STATIC=/home/pbattu/git/18.04/peerplays/libraries/fc/vendor/websocketpp
|
|
||||||
|
|
||||||
|
|
||||||
########################
|
|
||||||
# INTERNAL cache entries
|
|
||||||
########################
|
|
||||||
|
|
||||||
//ADVANCED property for variable: BOOST_ROOT
|
|
||||||
BOOST_ROOT-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: Boost_CHRONO_LIBRARY_DEBUG
|
|
||||||
Boost_CHRONO_LIBRARY_DEBUG-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: Boost_CHRONO_LIBRARY_RELEASE
|
|
||||||
Boost_CHRONO_LIBRARY_RELEASE-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: Boost_CONTEXT_LIBRARY_DEBUG
|
|
||||||
Boost_CONTEXT_LIBRARY_DEBUG-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: Boost_CONTEXT_LIBRARY_RELEASE
|
|
||||||
Boost_CONTEXT_LIBRARY_RELEASE-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: Boost_COROUTINE_LIBRARY_DEBUG
|
|
||||||
Boost_COROUTINE_LIBRARY_DEBUG-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: Boost_COROUTINE_LIBRARY_RELEASE
|
|
||||||
Boost_COROUTINE_LIBRARY_RELEASE-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: Boost_DATE_TIME_LIBRARY_DEBUG
|
|
||||||
Boost_DATE_TIME_LIBRARY_DEBUG-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: Boost_DATE_TIME_LIBRARY_RELEASE
|
|
||||||
Boost_DATE_TIME_LIBRARY_RELEASE-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: Boost_DIR
|
|
||||||
Boost_DIR-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: Boost_FILESYSTEM_LIBRARY_DEBUG
|
|
||||||
Boost_FILESYSTEM_LIBRARY_DEBUG-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: Boost_FILESYSTEM_LIBRARY_RELEASE
|
|
||||||
Boost_FILESYSTEM_LIBRARY_RELEASE-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: Boost_INCLUDE_DIR
|
|
||||||
Boost_INCLUDE_DIR-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: Boost_IOSTREAMS_LIBRARY_DEBUG
|
|
||||||
Boost_IOSTREAMS_LIBRARY_DEBUG-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: Boost_IOSTREAMS_LIBRARY_RELEASE
|
|
||||||
Boost_IOSTREAMS_LIBRARY_RELEASE-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: Boost_LIBRARY_DIR
|
|
||||||
Boost_LIBRARY_DIR-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: Boost_LIBRARY_DIR_DEBUG
|
|
||||||
Boost_LIBRARY_DIR_DEBUG-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: Boost_LIBRARY_DIR_RELEASE
|
|
||||||
Boost_LIBRARY_DIR_RELEASE-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: Boost_LOCALE_LIBRARY_DEBUG
|
|
||||||
Boost_LOCALE_LIBRARY_DEBUG-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: Boost_LOCALE_LIBRARY_RELEASE
|
|
||||||
Boost_LOCALE_LIBRARY_RELEASE-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: Boost_PROGRAM_OPTIONS_LIBRARY_DEBUG
|
|
||||||
Boost_PROGRAM_OPTIONS_LIBRARY_DEBUG-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: Boost_PROGRAM_OPTIONS_LIBRARY_RELEASE
|
|
||||||
Boost_PROGRAM_OPTIONS_LIBRARY_RELEASE-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: Boost_SERIALIZATION_LIBRARY_DEBUG
|
|
||||||
Boost_SERIALIZATION_LIBRARY_DEBUG-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: Boost_SERIALIZATION_LIBRARY_RELEASE
|
|
||||||
Boost_SERIALIZATION_LIBRARY_RELEASE-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: Boost_SIGNALS_LIBRARY_DEBUG
|
|
||||||
Boost_SIGNALS_LIBRARY_DEBUG-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: Boost_SIGNALS_LIBRARY_RELEASE
|
|
||||||
Boost_SIGNALS_LIBRARY_RELEASE-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: Boost_SYSTEM_LIBRARY_DEBUG
|
|
||||||
Boost_SYSTEM_LIBRARY_DEBUG-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: Boost_SYSTEM_LIBRARY_RELEASE
|
|
||||||
Boost_SYSTEM_LIBRARY_RELEASE-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: Boost_THREAD_LIBRARY_DEBUG
|
|
||||||
Boost_THREAD_LIBRARY_DEBUG-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: Boost_THREAD_LIBRARY_RELEASE
|
|
||||||
Boost_THREAD_LIBRARY_RELEASE-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: Boost_UNIT_TEST_FRAMEWORK_LIBRARY_DEBUG
|
|
||||||
Boost_UNIT_TEST_FRAMEWORK_LIBRARY_DEBUG-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: Boost_UNIT_TEST_FRAMEWORK_LIBRARY_RELEASE
|
|
||||||
Boost_UNIT_TEST_FRAMEWORK_LIBRARY_RELEASE-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_AR
|
|
||||||
CMAKE_AR-ADVANCED:INTERNAL=1
|
|
||||||
//This is the directory where this CMakeCache.txt was created
|
|
||||||
CMAKE_CACHEFILE_DIR:INTERNAL=/home/pbattu/git/18.04/peerplays
|
|
||||||
//Major version of cmake used to create the current loaded cache
|
|
||||||
CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3
|
|
||||||
//Minor version of cmake used to create the current loaded cache
|
|
||||||
CMAKE_CACHE_MINOR_VERSION:INTERNAL=10
|
|
||||||
//Patch version of cmake used to create the current loaded cache
|
|
||||||
CMAKE_CACHE_PATCH_VERSION:INTERNAL=2
|
|
||||||
//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE
|
|
||||||
CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1
|
|
||||||
//Path to CMake executable.
|
|
||||||
CMAKE_COMMAND:INTERNAL=/usr/bin/cmake
|
|
||||||
//Path to cpack program executable.
|
|
||||||
CMAKE_CPACK_COMMAND:INTERNAL=/usr/bin/cpack
|
|
||||||
//Path to ctest program executable.
|
|
||||||
CMAKE_CTEST_COMMAND:INTERNAL=/usr/bin/ctest
|
|
||||||
//ADVANCED property for variable: CMAKE_CXX_COMPILER
|
|
||||||
CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_CXX_COMPILER_AR
|
|
||||||
CMAKE_CXX_COMPILER_AR-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_CXX_COMPILER_RANLIB
|
|
||||||
CMAKE_CXX_COMPILER_RANLIB-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_CXX_FLAGS
|
|
||||||
CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG
|
|
||||||
CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL
|
|
||||||
CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE
|
|
||||||
CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO
|
|
||||||
CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_C_COMPILER
|
|
||||||
CMAKE_C_COMPILER-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_C_COMPILER_AR
|
|
||||||
CMAKE_C_COMPILER_AR-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_C_COMPILER_RANLIB
|
|
||||||
CMAKE_C_COMPILER_RANLIB-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_C_FLAGS
|
|
||||||
CMAKE_C_FLAGS-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG
|
|
||||||
CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL
|
|
||||||
CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE
|
|
||||||
CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO
|
|
||||||
CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
|
|
||||||
//Executable file format
|
|
||||||
CMAKE_EXECUTABLE_FORMAT:INTERNAL=ELF
|
|
||||||
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS
|
|
||||||
CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG
|
|
||||||
CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL
|
|
||||||
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE
|
|
||||||
CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
|
|
||||||
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS
|
|
||||||
CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1
|
|
||||||
//Name of external makefile project generator.
|
|
||||||
CMAKE_EXTRA_GENERATOR:INTERNAL=
|
|
||||||
//Name of generator.
|
|
||||||
CMAKE_GENERATOR:INTERNAL=Unix Makefiles
|
|
||||||
//Name of generator platform.
|
|
||||||
CMAKE_GENERATOR_PLATFORM:INTERNAL=
|
|
||||||
//Name of generator toolset.
|
|
||||||
CMAKE_GENERATOR_TOOLSET:INTERNAL=
|
|
||||||
//Have symbol pthread_create
|
|
||||||
CMAKE_HAVE_LIBC_CREATE:INTERNAL=
|
|
||||||
//Have library pthreads
|
|
||||||
CMAKE_HAVE_PTHREADS_CREATE:INTERNAL=
|
|
||||||
//Have library pthread
|
|
||||||
CMAKE_HAVE_PTHREAD_CREATE:INTERNAL=1
|
|
||||||
//Have include pthread.h
|
|
||||||
CMAKE_HAVE_PTHREAD_H:INTERNAL=1
|
|
||||||
//Source directory with the top level CMakeLists.txt file for this
|
|
||||||
// project
|
|
||||||
CMAKE_HOME_DIRECTORY:INTERNAL=/home/pbattu/git/18.04/peerplays
|
|
||||||
//Install .so files without execute permission.
|
|
||||||
CMAKE_INSTALL_SO_NO_EXE:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_LINKER
|
|
||||||
CMAKE_LINKER-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_MAKE_PROGRAM
|
|
||||||
CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS
|
|
||||||
CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG
|
|
||||||
CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL
|
|
||||||
CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE
|
|
||||||
CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
|
|
||||||
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_NM
|
|
||||||
CMAKE_NM-ADVANCED:INTERNAL=1
|
|
||||||
//number of local generators
|
|
||||||
CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=37
|
|
||||||
//ADVANCED property for variable: CMAKE_OBJCOPY
|
|
||||||
CMAKE_OBJCOPY-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_OBJDUMP
|
|
||||||
CMAKE_OBJDUMP-ADVANCED:INTERNAL=1
|
|
||||||
//Platform information initialized
|
|
||||||
CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_RANLIB
|
|
||||||
CMAKE_RANLIB-ADVANCED:INTERNAL=1
|
|
||||||
//Path to CMake installation.
|
|
||||||
CMAKE_ROOT:INTERNAL=/usr/share/cmake-3.10
|
|
||||||
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS
|
|
||||||
CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG
|
|
||||||
CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL
|
|
||||||
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE
|
|
||||||
CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
|
|
||||||
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH
|
|
||||||
CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_SKIP_RPATH
|
|
||||||
CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS
|
|
||||||
CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG
|
|
||||||
CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL
|
|
||||||
CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE
|
|
||||||
CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO
|
|
||||||
CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CMAKE_STRIP
|
|
||||||
CMAKE_STRIP-ADVANCED:INTERNAL=1
|
|
||||||
//uname command
|
|
||||||
CMAKE_UNAME:INTERNAL=/bin/uname
|
|
||||||
//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE
|
|
||||||
CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CURSES_CURSES_LIBRARY
|
|
||||||
CURSES_CURSES_LIBRARY-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CURSES_FORM_LIBRARY
|
|
||||||
CURSES_FORM_LIBRARY-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CURSES_INCLUDE_PATH
|
|
||||||
CURSES_INCLUDE_PATH-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: CURSES_NCURSES_LIBRARY
|
|
||||||
CURSES_NCURSES_LIBRARY-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: DOXYGEN_DOT_EXECUTABLE
|
|
||||||
DOXYGEN_DOT_EXECUTABLE-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: DOXYGEN_EXECUTABLE
|
|
||||||
DOXYGEN_EXECUTABLE-ADVANCED:INTERNAL=1
|
|
||||||
//Details about finding OpenSSL
|
|
||||||
FIND_PACKAGE_MESSAGE_DETAILS_OpenSSL:INTERNAL=[/usr/lib/x86_64-linux-gnu/libcrypto.a][/usr/include][v1.1.0g()]
|
|
||||||
//Details about finding Perl
|
|
||||||
FIND_PACKAGE_MESSAGE_DETAILS_Perl:INTERNAL=[/usr/bin/perl][v5.26.1()]
|
|
||||||
//Details about finding Readline
|
|
||||||
FIND_PACKAGE_MESSAGE_DETAILS_Readline:INTERNAL=[/usr/include][/usr/lib/x86_64-linux-gnu/libreadline.so][v()]
|
|
||||||
//Details about finding Threads
|
|
||||||
FIND_PACKAGE_MESSAGE_DETAILS_Threads:INTERNAL=[TRUE][v()]
|
|
||||||
//Details about finding ZLIB
|
|
||||||
FIND_PACKAGE_MESSAGE_DETAILS_ZLIB:INTERNAL=[/usr/lib/x86_64-linux-gnu/libz.so][/usr/include][v1.2.11()]
|
|
||||||
//ADVANCED property for variable: GIT_EXECUTABLE
|
|
||||||
GIT_EXECUTABLE-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: OPENSSL_CRYPTO_LIBRARY
|
|
||||||
OPENSSL_CRYPTO_LIBRARY-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: OPENSSL_INCLUDE_DIR
|
|
||||||
OPENSSL_INCLUDE_DIR-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: OPENSSL_SSL_LIBRARY
|
|
||||||
OPENSSL_SSL_LIBRARY-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: PERL_EXECUTABLE
|
|
||||||
PERL_EXECUTABLE-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: PKG_CONFIG_EXECUTABLE
|
|
||||||
PKG_CONFIG_EXECUTABLE-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: Readline_INCLUDE_DIR
|
|
||||||
Readline_INCLUDE_DIR-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: Readline_LIBRARY
|
|
||||||
Readline_LIBRARY-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: Readline_ROOT_DIR
|
|
||||||
Readline_ROOT_DIR-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: ZLIB_INCLUDE_DIR
|
|
||||||
ZLIB_INCLUDE_DIR-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: ZLIB_LIBRARY_DEBUG
|
|
||||||
ZLIB_LIBRARY_DEBUG-ADVANCED:INTERNAL=1
|
|
||||||
//ADVANCED property for variable: ZLIB_LIBRARY_RELEASE
|
|
||||||
ZLIB_LIBRARY_RELEASE-ADVANCED:INTERNAL=1
|
|
||||||
//Last used BOOST_ROOT value.
|
|
||||||
_BOOST_ROOT_LAST:INTERNAL=/home/pbattu/git/18.04/boost_1_67_0
|
|
||||||
//Components requested for this build tree.
|
|
||||||
_Boost_COMPONENTS_SEARCHED:INTERNAL=chrono;context;coroutine;date_time;filesystem;iostreams;locale;program_options;serialization;signals;system;thread;unit_test_framework
|
|
||||||
//Last used Boost_INCLUDE_DIR value.
|
|
||||||
_Boost_INCLUDE_DIR_LAST:INTERNAL=/home/pbattu/git/18.04/boost_1_67_0/include
|
|
||||||
//Last used Boost_LIBRARY_DIR_DEBUG value.
|
|
||||||
_Boost_LIBRARY_DIR_DEBUG_LAST:INTERNAL=/home/pbattu/git/18.04/boost_1_67_0/lib
|
|
||||||
//Last used Boost_LIBRARY_DIR value.
|
|
||||||
_Boost_LIBRARY_DIR_LAST:INTERNAL=/home/pbattu/git/18.04/boost_1_67_0/lib
|
|
||||||
//Last used Boost_LIBRARY_DIR_RELEASE value.
|
|
||||||
_Boost_LIBRARY_DIR_RELEASE_LAST:INTERNAL=/home/pbattu/git/18.04/boost_1_67_0/lib
|
|
||||||
//Last used Boost_NAMESPACE value.
|
|
||||||
_Boost_NAMESPACE_LAST:INTERNAL=boost
|
|
||||||
//Last used Boost_USE_MULTITHREADED value.
|
|
||||||
_Boost_USE_MULTITHREADED_LAST:INTERNAL=TRUE
|
|
||||||
//Last used Boost_USE_STATIC_LIBS value.
|
|
||||||
_Boost_USE_STATIC_LIBS_LAST:INTERNAL=ON
|
|
||||||
_OPENSSL_CFLAGS:INTERNAL=
|
|
||||||
_OPENSSL_CFLAGS_I:INTERNAL=
|
|
||||||
_OPENSSL_CFLAGS_OTHER:INTERNAL=
|
|
||||||
_OPENSSL_FOUND:INTERNAL=1
|
|
||||||
_OPENSSL_INCLUDEDIR:INTERNAL=/usr/include
|
|
||||||
_OPENSSL_INCLUDE_DIRS:INTERNAL=
|
|
||||||
_OPENSSL_LDFLAGS:INTERNAL=-lssl;-lcrypto
|
|
||||||
_OPENSSL_LDFLAGS_OTHER:INTERNAL=
|
|
||||||
_OPENSSL_LIBDIR:INTERNAL=/usr/lib/x86_64-linux-gnu
|
|
||||||
_OPENSSL_LIBRARIES:INTERNAL=ssl;crypto
|
|
||||||
_OPENSSL_LIBRARY_DIRS:INTERNAL=
|
|
||||||
_OPENSSL_LIBS:INTERNAL=
|
|
||||||
_OPENSSL_LIBS_L:INTERNAL=
|
|
||||||
_OPENSSL_LIBS_OTHER:INTERNAL=
|
|
||||||
_OPENSSL_LIBS_PATHS:INTERNAL=
|
|
||||||
_OPENSSL_PREFIX:INTERNAL=/usr
|
|
||||||
_OPENSSL_STATIC_CFLAGS:INTERNAL=
|
|
||||||
_OPENSSL_STATIC_CFLAGS_I:INTERNAL=
|
|
||||||
_OPENSSL_STATIC_CFLAGS_OTHER:INTERNAL=
|
|
||||||
_OPENSSL_STATIC_INCLUDE_DIRS:INTERNAL=
|
|
||||||
_OPENSSL_STATIC_LDFLAGS:INTERNAL=-lssl;-ldl;-lcrypto;-ldl
|
|
||||||
_OPENSSL_STATIC_LDFLAGS_OTHER:INTERNAL=
|
|
||||||
_OPENSSL_STATIC_LIBDIR:INTERNAL=
|
|
||||||
_OPENSSL_STATIC_LIBRARIES:INTERNAL=ssl;dl;crypto;dl
|
|
||||||
_OPENSSL_STATIC_LIBRARY_DIRS:INTERNAL=
|
|
||||||
_OPENSSL_STATIC_LIBS:INTERNAL=
|
|
||||||
_OPENSSL_STATIC_LIBS_L:INTERNAL=
|
|
||||||
_OPENSSL_STATIC_LIBS_OTHER:INTERNAL=
|
|
||||||
_OPENSSL_STATIC_LIBS_PATHS:INTERNAL=
|
|
||||||
_OPENSSL_VERSION:INTERNAL=1.1.0g
|
|
||||||
_OPENSSL_openssl_INCLUDEDIR:INTERNAL=
|
|
||||||
_OPENSSL_openssl_LIBDIR:INTERNAL=
|
|
||||||
_OPENSSL_openssl_PREFIX:INTERNAL=
|
|
||||||
_OPENSSL_openssl_VERSION:INTERNAL=
|
|
||||||
__pkg_config_arguments__OPENSSL:INTERNAL=QUIET;openssl
|
|
||||||
__pkg_config_checked__OPENSSL:INTERNAL=1
|
|
||||||
prefix_result:INTERNAL=/usr/lib/x86_64-linux-gnu
|
|
||||||
|
|
||||||
6
clang-format.sh
Executable file
6
clang-format.sh
Executable file
|
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
find ./libraries/app -regex ".*[c|h]pp" | xargs clang-format -i
|
||||||
|
find ./libraries/chain/hardfork.d -regex ".*hf" | xargs clang-format -i
|
||||||
|
find ./libraries/plugins/peerplays_sidechain -regex ".*[c|h]pp" | xargs clang-format -i
|
||||||
|
find ./programs/cli_wallet -regex ".*[c|h]pp" | xargs clang-format -i
|
||||||
|
|
@ -1,61 +0,0 @@
|
||||||
# Endpoint for P2P node to listen on
|
|
||||||
p2p-endpoint = 0.0.0.0:9090
|
|
||||||
|
|
||||||
# P2P nodes to connect to on startup (may specify multiple times)
|
|
||||||
# seed-node =
|
|
||||||
|
|
||||||
# JSON array of P2P nodes to connect to on startup
|
|
||||||
# seed-nodes =
|
|
||||||
|
|
||||||
# Pairs of [BLOCK_NUM,BLOCK_ID] that should be enforced as checkpoints.
|
|
||||||
# checkpoint =
|
|
||||||
|
|
||||||
# Endpoint for websocket RPC to listen on
|
|
||||||
rpc-endpoint = 0.0.0.0:8090
|
|
||||||
|
|
||||||
# Endpoint for TLS websocket RPC to listen on
|
|
||||||
# rpc-tls-endpoint =
|
|
||||||
|
|
||||||
# The TLS certificate file for this server
|
|
||||||
# server-pem =
|
|
||||||
|
|
||||||
# Password for this certificate
|
|
||||||
# server-pem-password =
|
|
||||||
|
|
||||||
# File to read Genesis State from
|
|
||||||
# genesis-json =
|
|
||||||
|
|
||||||
# Block signing key to use for init witnesses, overrides genesis file
|
|
||||||
# dbg-init-key =
|
|
||||||
|
|
||||||
# JSON file specifying API permissions
|
|
||||||
# api-access =
|
|
||||||
|
|
||||||
# Enable block production, even if the chain is stale.
|
|
||||||
enable-stale-production = false
|
|
||||||
|
|
||||||
# Percent of witnesses (0-99) that must be participating in order to produce blocks
|
|
||||||
required-participation = false
|
|
||||||
|
|
||||||
# ID of witness controlled by this node (e.g. "1.6.5", quotes are required, may specify multiple times)
|
|
||||||
# witness-id =
|
|
||||||
|
|
||||||
# Tuple of [PublicKey, WIF private key] (may specify multiple times)
|
|
||||||
# private-key = ["BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"]
|
|
||||||
|
|
||||||
# Account ID to track history for (may specify multiple times)
|
|
||||||
# track-account =
|
|
||||||
|
|
||||||
# Track market history by grouping orders into buckets of equal size measured in seconds specified as a JSON array of numbers
|
|
||||||
# bucket-size = [15,60,300,3600,86400]
|
|
||||||
bucket-size = [60,300,900,1800,3600,14400,86400]
|
|
||||||
# for 1 min, 5 mins, 30 mins, 1h, 4 hs and 1 day. i think this should be the default.
|
|
||||||
|
|
||||||
# How far back in time to track history for each bucket size, measured in the number of buckets (default: 1000)
|
|
||||||
history-per-size = 1000
|
|
||||||
|
|
||||||
# Max amount of operations to store in the database, per account (drastically reduces RAM requirements)
|
|
||||||
max-ops-per-account = 1000
|
|
||||||
|
|
||||||
# Remove old operation history # objects from RAM
|
|
||||||
partial-operations = true
|
|
||||||
|
|
@ -1,87 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
PEERPLAYSD="/usr/local/bin/witness_node"
|
|
||||||
|
|
||||||
# For blockchain download
|
|
||||||
VERSION=`cat /etc/peerplays/version`
|
|
||||||
|
|
||||||
## Supported Environmental Variables
|
|
||||||
#
|
|
||||||
# * $PEERPLAYSD_SEED_NODES
|
|
||||||
# * $PEERPLAYSD_RPC_ENDPOINT
|
|
||||||
# * $PEERPLAYSD_PLUGINS
|
|
||||||
# * $PEERPLAYSD_REPLAY
|
|
||||||
# * $PEERPLAYSD_RESYNC
|
|
||||||
# * $PEERPLAYSD_P2P_ENDPOINT
|
|
||||||
# * $PEERPLAYSD_WITNESS_ID
|
|
||||||
# * $PEERPLAYSD_PRIVATE_KEY
|
|
||||||
# * $PEERPLAYSD_DEBUG_PRIVATE_KEY
|
|
||||||
# * $PEERPLAYSD_TRACK_ACCOUNTS
|
|
||||||
# * $PEERPLAYSD_PARTIAL_OPERATIONS
|
|
||||||
# * $PEERPLAYSD_MAX_OPS_PER_ACCOUNT
|
|
||||||
# * $PEERPLAYSD_TRUSTED_NODE
|
|
||||||
#
|
|
||||||
|
|
||||||
ARGS=""
|
|
||||||
# Translate environmental variables
|
|
||||||
if [[ ! -z "$PEERPLAYSD_SEED_NODES" ]]; then
|
|
||||||
for NODE in $PEERPLAYSD_SEED_NODES ; do
|
|
||||||
ARGS+=" --seed-node=$NODE"
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
if [[ ! -z "$PEERPLAYSD_RPC_ENDPOINT" ]]; then
|
|
||||||
ARGS+=" --rpc-endpoint=${PEERPLAYSD_RPC_ENDPOINT}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ! -z "$PEERPLAYSD_REPLAY" ]]; then
|
|
||||||
ARGS+=" --replay-blockchain"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ! -z "$PEERPLAYSD_RESYNC" ]]; then
|
|
||||||
ARGS+=" --resync-blockchain"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ! -z "$PEERPLAYSD_P2P_ENDPOINT" ]]; then
|
|
||||||
ARGS+=" --p2p-endpoint=${PEERPLAYSD_P2P_ENDPOINT}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ! -z "$PEERPLAYSD_WITNESS_ID" ]]; then
|
|
||||||
ARGS+=" --witness-id=$PEERPLAYSD_WITNESS_ID"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ! -z "$PEERPLAYSD_PRIVATE_KEY" ]]; then
|
|
||||||
ARGS+=" --private-key=$PEERPLAYSD_PRIVATE_KEY"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ! -z "$PEERPLAYSD_DEBUG_PRIVATE_KEY" ]]; then
|
|
||||||
ARGS+=" --debug-private-key=$PEERPLAYSD_DEBUG_PRIVATE_KEY"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ! -z "$PEERPLAYSD_TRACK_ACCOUNTS" ]]; then
|
|
||||||
for ACCOUNT in $PEERPLAYSD_TRACK_ACCOUNTS ; do
|
|
||||||
ARGS+=" --track-account=$ACCOUNT"
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ! -z "$PEERPLAYSD_PARTIAL_OPERATIONS" ]]; then
|
|
||||||
ARGS+=" --partial-operations=${PEERPLAYSD_PARTIAL_OPERATIONS}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ! -z "$PEERPLAYSD_MAX_OPS_PER_ACCOUNT" ]]; then
|
|
||||||
ARGS+=" --max-ops-per-account=${PEERPLAYSD_MAX_OPS_PER_ACCOUNT}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ! -z "$PEERPLAYSD_TRUSTED_NODE" ]]; then
|
|
||||||
ARGS+=" --trusted-node=${PEERPLAYSD_TRUSTED_NODE}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
## Link the peerplays config file into home
|
|
||||||
## This link has been created in Dockerfile, already
|
|
||||||
ln -f -s /etc/peerplays/config.ini /var/lib/peerplays
|
|
||||||
|
|
||||||
# Plugins need to be provided in a space-separated list, which
|
|
||||||
# makes it necessary to write it like this
|
|
||||||
if [[ ! -z "$PEERPLAYSD_PLUGINS" ]]; then
|
|
||||||
$PEERPLAYSD --data-dir ${HOME} ${ARGS} ${PEERPLAYSD_ARGS} --plugins "${PEERPLAYSD_PLUGINS}"
|
|
||||||
else
|
|
||||||
$PEERPLAYSD --data-dir ${HOME} ${ARGS} ${PEERPLAYSD_ARGS}
|
|
||||||
fi
|
|
||||||
2
docs
2
docs
|
|
@ -1 +1 @@
|
||||||
Subproject commit 8df8f66389853df73ab8f6dd73981be2a6957df8
|
Subproject commit 1e924950c2f92b166c34ceb294e8b8c4997a6c4e
|
||||||
216158
genesis-mainnet.json
Normal file
216158
genesis-mainnet.json
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -5,6 +5,7 @@ add_subdirectory( egenesis )
|
||||||
add_subdirectory( fc )
|
add_subdirectory( fc )
|
||||||
add_subdirectory( net )
|
add_subdirectory( net )
|
||||||
add_subdirectory( plugins )
|
add_subdirectory( plugins )
|
||||||
|
add_subdirectory( sha3 )
|
||||||
add_subdirectory( time )
|
add_subdirectory( time )
|
||||||
add_subdirectory( utilities )
|
add_subdirectory( utilities )
|
||||||
add_subdirectory( wallet )
|
add_subdirectory( wallet )
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ add_library( graphene_app
|
||||||
#target_link_libraries( graphene_app graphene_market_history graphene_account_history graphene_chain fc graphene_db graphene_net graphene_utilities graphene_debug_witness )
|
#target_link_libraries( graphene_app graphene_market_history graphene_account_history graphene_chain fc graphene_db graphene_net graphene_utilities graphene_debug_witness )
|
||||||
target_link_libraries( graphene_app
|
target_link_libraries( graphene_app
|
||||||
PUBLIC graphene_net graphene_utilities
|
PUBLIC graphene_net graphene_utilities
|
||||||
graphene_account_history graphene_accounts_list graphene_affiliate_stats graphene_bookie graphene_debug_witness graphene_elasticsearch graphene_es_objects graphene_generate_genesis graphene_market_history )
|
graphene_account_history graphene_accounts_list graphene_affiliate_stats graphene_bookie graphene_debug_witness graphene_elasticsearch graphene_es_objects graphene_generate_genesis graphene_market_history peerplays_sidechain )
|
||||||
|
|
||||||
target_include_directories( graphene_app
|
target_include_directories( graphene_app
|
||||||
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include"
|
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include"
|
||||||
|
|
@ -55,4 +55,3 @@ INSTALL( TARGETS
|
||||||
LIBRARY DESTINATION lib
|
LIBRARY DESTINATION lib
|
||||||
ARCHIVE DESTINATION lib
|
ARCHIVE DESTINATION lib
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -25,36 +25,36 @@
|
||||||
#include <graphene/app/config_util.hpp>
|
#include <graphene/app/config_util.hpp>
|
||||||
#include <graphene/chain/config.hpp>
|
#include <graphene/chain/config.hpp>
|
||||||
|
|
||||||
#include <fc/reflect/variant.hpp>
|
|
||||||
#include <fc/string.hpp>
|
|
||||||
#include <fc/exception/exception.hpp>
|
#include <fc/exception/exception.hpp>
|
||||||
#include <fc/log/console_appender.hpp>
|
#include <fc/log/console_appender.hpp>
|
||||||
#include <fc/log/file_appender.hpp>
|
#include <fc/log/file_appender.hpp>
|
||||||
#include <fc/log/logger_config.hpp>
|
#include <fc/log/logger_config.hpp>
|
||||||
|
#include <fc/reflect/variant.hpp>
|
||||||
|
#include <fc/string.hpp>
|
||||||
|
|
||||||
#include <boost/property_tree/ptree.hpp>
|
#include <boost/algorithm/string.hpp>
|
||||||
#include <boost/property_tree/ini_parser.hpp>
|
|
||||||
#include <boost/algorithm/string/predicate.hpp>
|
#include <boost/algorithm/string/predicate.hpp>
|
||||||
#include <boost/algorithm/string/split.hpp>
|
#include <boost/algorithm/string/split.hpp>
|
||||||
#include <boost/algorithm/string/split.hpp>
|
#include <boost/property_tree/ini_parser.hpp>
|
||||||
#include <boost/algorithm/string.hpp>
|
#include <boost/property_tree/ptree.hpp>
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
||||||
namespace bpo = boost::program_options;
|
namespace bpo = boost::program_options;
|
||||||
|
|
||||||
class deduplicator
|
class deduplicator {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
deduplicator() : modifier(nullptr) {}
|
deduplicator() :
|
||||||
|
modifier(nullptr) {
|
||||||
|
}
|
||||||
|
|
||||||
deduplicator(const boost::shared_ptr<bpo::option_description> (*mod_fn)(const boost::shared_ptr<bpo::option_description>&))
|
deduplicator(const boost::shared_ptr<bpo::option_description> (*mod_fn)(const boost::shared_ptr<bpo::option_description> &)) :
|
||||||
: modifier(mod_fn) {}
|
modifier(mod_fn) {
|
||||||
|
}
|
||||||
|
|
||||||
const boost::shared_ptr<bpo::option_description> next(const boost::shared_ptr<bpo::option_description>& o)
|
const boost::shared_ptr<bpo::option_description> next(const boost::shared_ptr<bpo::option_description> &o) {
|
||||||
{
|
|
||||||
const std::string name = o->long_name();
|
const std::string name = o->long_name();
|
||||||
if( seen.find( name ) != seen.end() )
|
if (seen.find(name) != seen.end())
|
||||||
return nullptr;
|
return nullptr;
|
||||||
seen.insert(name);
|
seen.insert(name);
|
||||||
return modifier ? modifier(o) : o;
|
return modifier ? modifier(o) : o;
|
||||||
|
|
@ -62,15 +62,14 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
boost::container::flat_set<std::string> seen;
|
boost::container::flat_set<std::string> seen;
|
||||||
const boost::shared_ptr<bpo::option_description> (*modifier)(const boost::shared_ptr<bpo::option_description>&);
|
const boost::shared_ptr<bpo::option_description> (*modifier)(const boost::shared_ptr<bpo::option_description> &);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Currently, you can only specify the filenames and logging levels, which
|
// Currently, you can only specify the filenames and logging levels, which
|
||||||
// are all most users would want to change. At a later time, options can
|
// are all most users would want to change. At a later time, options can
|
||||||
// be added to control rotation intervals, compression, and other seldom-
|
// be added to control rotation intervals, compression, and other seldom-
|
||||||
// used features
|
// used features
|
||||||
static void write_default_logging_config_to_stream(std::ostream& out)
|
static void write_default_logging_config_to_stream(std::ostream &out) {
|
||||||
{
|
|
||||||
out << "# declare an appender named \"stderr\" that writes messages to the console\n"
|
out << "# declare an appender named \"stderr\" that writes messages to the console\n"
|
||||||
"[log.console_appender.stderr]\n"
|
"[log.console_appender.stderr]\n"
|
||||||
"stream=std_error\n\n"
|
"stream=std_error\n\n"
|
||||||
|
|
@ -115,26 +114,22 @@ static void write_default_logging_config_to_stream(std::ostream& out)
|
||||||
|
|
||||||
// logging config is too complicated to be parsed by boost::program_options,
|
// logging config is too complicated to be parsed by boost::program_options,
|
||||||
// so we do it by hand
|
// so we do it by hand
|
||||||
static fc::optional<fc::logging_config> load_logging_config_from_ini_file(const fc::path& config_ini_filename)
|
static fc::optional<fc::logging_config> load_logging_config_from_ini_file(const fc::path &config_ini_filename) {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
fc::logging_config logging_config;
|
fc::logging_config logging_config;
|
||||||
bool found_logging_config = false;
|
bool found_logging_config = false;
|
||||||
|
|
||||||
boost::property_tree::ptree config_ini_tree;
|
boost::property_tree::ptree config_ini_tree;
|
||||||
boost::property_tree::ini_parser::read_ini(config_ini_filename.preferred_string().c_str(), config_ini_tree);
|
boost::property_tree::ini_parser::read_ini(config_ini_filename.preferred_string().c_str(), config_ini_tree);
|
||||||
for (const auto& section : config_ini_tree)
|
for (const auto §ion : config_ini_tree) {
|
||||||
{
|
const std::string §ion_name = section.first;
|
||||||
const std::string& section_name = section.first;
|
const boost::property_tree::ptree §ion_tree = section.second;
|
||||||
const boost::property_tree::ptree& section_tree = section.second;
|
|
||||||
|
|
||||||
const std::string console_appender_section_prefix = "log.console_appender.";
|
const std::string console_appender_section_prefix = "log.console_appender.";
|
||||||
const std::string file_appender_section_prefix = "log.file_appender.";
|
const std::string file_appender_section_prefix = "log.file_appender.";
|
||||||
const std::string logger_section_prefix = "logger.";
|
const std::string logger_section_prefix = "logger.";
|
||||||
|
|
||||||
if (boost::starts_with(section_name, console_appender_section_prefix))
|
if (boost::starts_with(section_name, console_appender_section_prefix)) {
|
||||||
{
|
|
||||||
std::string console_appender_name = section_name.substr(console_appender_section_prefix.length());
|
std::string console_appender_name = section_name.substr(console_appender_section_prefix.length());
|
||||||
std::string stream_name = section_tree.get<std::string>("stream");
|
std::string stream_name = section_tree.get<std::string>("stream");
|
||||||
|
|
||||||
|
|
@ -153,9 +148,7 @@ static fc::optional<fc::logging_config> load_logging_config_from_ini_file(const
|
||||||
console_appender_config.stream = fc::variant(stream_name).as<fc::console_appender::stream::type>(GRAPHENE_MAX_NESTED_OBJECTS);
|
console_appender_config.stream = fc::variant(stream_name).as<fc::console_appender::stream::type>(GRAPHENE_MAX_NESTED_OBJECTS);
|
||||||
logging_config.appenders.push_back(fc::appender_config(console_appender_name, "console", fc::variant(console_appender_config, GRAPHENE_MAX_NESTED_OBJECTS)));
|
logging_config.appenders.push_back(fc::appender_config(console_appender_name, "console", fc::variant(console_appender_config, GRAPHENE_MAX_NESTED_OBJECTS)));
|
||||||
found_logging_config = true;
|
found_logging_config = true;
|
||||||
}
|
} else if (boost::starts_with(section_name, file_appender_section_prefix)) {
|
||||||
else if (boost::starts_with(section_name, file_appender_section_prefix))
|
|
||||||
{
|
|
||||||
std::string file_appender_name = section_name.substr(file_appender_section_prefix.length());
|
std::string file_appender_name = section_name.substr(file_appender_section_prefix.length());
|
||||||
fc::path file_name = section_tree.get<std::string>("filename");
|
fc::path file_name = section_tree.get<std::string>("filename");
|
||||||
if (file_name.is_relative())
|
if (file_name.is_relative())
|
||||||
|
|
@ -174,9 +167,7 @@ static fc::optional<fc::logging_config> load_logging_config_from_ini_file(const
|
||||||
file_appender_config.rotation_limit = fc::days(limit);
|
file_appender_config.rotation_limit = fc::days(limit);
|
||||||
logging_config.appenders.push_back(fc::appender_config(file_appender_name, "file", fc::variant(file_appender_config, GRAPHENE_MAX_NESTED_OBJECTS)));
|
logging_config.appenders.push_back(fc::appender_config(file_appender_name, "file", fc::variant(file_appender_config, GRAPHENE_MAX_NESTED_OBJECTS)));
|
||||||
found_logging_config = true;
|
found_logging_config = true;
|
||||||
}
|
} else if (boost::starts_with(section_name, logger_section_prefix)) {
|
||||||
else if (boost::starts_with(section_name, logger_section_prefix))
|
|
||||||
{
|
|
||||||
std::string logger_name = section_name.substr(logger_section_prefix.length());
|
std::string logger_name = section_name.substr(logger_section_prefix.length());
|
||||||
std::string level_string = section_tree.get<std::string>("level");
|
std::string level_string = section_tree.get<std::string>("level");
|
||||||
std::string appenders_string = section_tree.get<std::string>("appenders");
|
std::string appenders_string = section_tree.get<std::string>("appenders");
|
||||||
|
|
@ -197,74 +188,66 @@ static fc::optional<fc::logging_config> load_logging_config_from_ini_file(const
|
||||||
FC_RETHROW_EXCEPTIONS(warn, "")
|
FC_RETHROW_EXCEPTIONS(warn, "")
|
||||||
}
|
}
|
||||||
|
|
||||||
static const boost::shared_ptr<bpo::option_description> new_option_description( const std::string& name, const bpo::value_semantic* value, const std::string& description )
|
static const boost::shared_ptr<bpo::option_description> new_option_description(const std::string &name, const bpo::value_semantic *value, const std::string &description) {
|
||||||
{
|
|
||||||
bpo::options_description helper("");
|
bpo::options_description helper("");
|
||||||
helper.add_options()( name.c_str(), value, description.c_str() );
|
helper.add_options()(name.c_str(), value, description.c_str());
|
||||||
return helper.options()[0];
|
return helper.options()[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void load_config_file(const fc::path &config_ini_path, const bpo::options_description &cfg_options,
|
||||||
static void load_config_file(const fc::path& config_ini_path, const bpo::options_description& cfg_options,
|
bpo::variables_map &options) {
|
||||||
bpo::variables_map& options )
|
|
||||||
{
|
|
||||||
deduplicator dedup;
|
deduplicator dedup;
|
||||||
bpo::options_description unique_options("Graphene Witness Node");
|
bpo::options_description unique_options("Graphene Witness Node");
|
||||||
for( const boost::shared_ptr<bpo::option_description> opt : cfg_options.options() )
|
for (const boost::shared_ptr<bpo::option_description> opt : cfg_options.options()) {
|
||||||
{
|
|
||||||
const boost::shared_ptr<bpo::option_description> od = dedup.next(opt);
|
const boost::shared_ptr<bpo::option_description> od = dedup.next(opt);
|
||||||
if( !od ) continue;
|
if (!od)
|
||||||
unique_options.add( od );
|
continue;
|
||||||
|
unique_options.add(od);
|
||||||
}
|
}
|
||||||
|
|
||||||
// get the basic options
|
// get the basic options
|
||||||
bpo::store(bpo::parse_config_file<char>(config_ini_path.preferred_string().c_str(),
|
bpo::store(bpo::parse_config_file<char>(config_ini_path.preferred_string().c_str(),
|
||||||
unique_options, true), options);
|
unique_options, true),
|
||||||
|
options);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool load_logging_config_file(const fc::path& config_ini_path)
|
static bool load_logging_config_file(const fc::path &config_ini_path) {
|
||||||
{
|
|
||||||
// try to get logging options from the config file.
|
// try to get logging options from the config file.
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
fc::optional<fc::logging_config> logging_config = load_logging_config_from_ini_file(config_ini_path);
|
fc::optional<fc::logging_config> logging_config = load_logging_config_from_ini_file(config_ini_path);
|
||||||
if (logging_config)
|
if (logging_config) {
|
||||||
{
|
|
||||||
fc::configure_logging(*logging_config);
|
fc::configure_logging(*logging_config);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
} catch (const fc::exception &ex) {
|
||||||
catch (const fc::exception& ex)
|
|
||||||
{
|
|
||||||
wlog("Error parsing logging config from logging config file ${config}, using default config", ("config", config_ini_path.preferred_string()));
|
wlog("Error parsing logging config from logging config file ${config}, using default config", ("config", config_ini_path.preferred_string()));
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void create_new_config_file(const fc::path& config_ini_path, const fc::path& data_dir,
|
static void create_new_config_file(const fc::path &config_ini_path, const fc::path &data_dir,
|
||||||
const bpo::options_description& cfg_options )
|
const bpo::options_description &cfg_options) {
|
||||||
{
|
|
||||||
ilog("Writing new config file at ${path}", ("path", config_ini_path));
|
ilog("Writing new config file at ${path}", ("path", config_ini_path));
|
||||||
if( !fc::exists(data_dir) )
|
if (!fc::exists(data_dir))
|
||||||
fc::create_directories(data_dir);
|
fc::create_directories(data_dir);
|
||||||
|
|
||||||
auto modify_option_defaults = [](const boost::shared_ptr<bpo::option_description>& o) -> const boost::shared_ptr<bpo::option_description> {
|
auto modify_option_defaults = [](const boost::shared_ptr<bpo::option_description> &o) -> const boost::shared_ptr<bpo::option_description> {
|
||||||
const std::string& name = o->long_name();
|
const std::string &name = o->long_name();
|
||||||
if( name == "partial-operations" )
|
if (name == "partial-operations")
|
||||||
return new_option_description(name, bpo::value<bool>()->default_value(true), o->description() );
|
return new_option_description(name, bpo::value<bool>()->default_value(true), o->description());
|
||||||
if( name == "max-ops-per-account" )
|
if (name == "max-ops-per-account")
|
||||||
return new_option_description(name, bpo::value<int>()->default_value(100), o->description() );
|
return new_option_description(name, bpo::value<int>()->default_value(100), o->description());
|
||||||
return o;
|
return o;
|
||||||
};
|
};
|
||||||
deduplicator dedup(modify_option_defaults);
|
deduplicator dedup(modify_option_defaults);
|
||||||
std::ofstream out_cfg(config_ini_path.preferred_string());
|
std::ofstream out_cfg(config_ini_path.preferred_string());
|
||||||
std::string plugin_header_surrounding( 78, '=' );
|
std::string plugin_header_surrounding(78, '=');
|
||||||
for( const boost::shared_ptr<bpo::option_description> opt : cfg_options.options() )
|
for (const boost::shared_ptr<bpo::option_description> opt : cfg_options.options()) {
|
||||||
{
|
|
||||||
const boost::shared_ptr<bpo::option_description> od = dedup.next(opt);
|
const boost::shared_ptr<bpo::option_description> od = dedup.next(opt);
|
||||||
if( !od ) continue;
|
if (!od)
|
||||||
|
continue;
|
||||||
|
|
||||||
if( od->long_name().find("plugin-cfg-header-") == 0 ) // it's a plugin header
|
if (od->long_name().find("plugin-cfg-header-") == 0) // it's a plugin header
|
||||||
{
|
{
|
||||||
out_cfg << "\n";
|
out_cfg << "\n";
|
||||||
out_cfg << "# " << plugin_header_surrounding << "\n";
|
out_cfg << "# " << plugin_header_surrounding << "\n";
|
||||||
|
|
@ -274,20 +257,21 @@ static void create_new_config_file(const fc::path& config_ini_path, const fc::pa
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !od->description().empty() )
|
if (!od->description().empty())
|
||||||
out_cfg << "# " << od->description() << "\n";
|
out_cfg << "# " << od->description() << "\n";
|
||||||
boost::any store;
|
boost::any store;
|
||||||
if( !od->semantic()->apply_default(store) )
|
if (!od->semantic()->apply_default(store))
|
||||||
out_cfg << "# " << od->long_name() << " = \n";
|
out_cfg << "# " << od->long_name() << " = \n";
|
||||||
else {
|
else {
|
||||||
auto example = od->format_parameter();
|
auto example = od->format_parameter();
|
||||||
if( example.empty() )
|
if (example.empty())
|
||||||
// This is a boolean switch
|
// This is a boolean switch
|
||||||
out_cfg << od->long_name() << " = " << "false\n";
|
out_cfg << od->long_name() << " = "
|
||||||
|
<< "false\n";
|
||||||
else {
|
else {
|
||||||
// The string is formatted "arg (=<interesting part>)"
|
// The string is formatted "arg (=<interesting part>)"
|
||||||
example.erase(0, 6);
|
example.erase(0, 6);
|
||||||
example.erase(example.length()-1);
|
example.erase(example.length() - 1);
|
||||||
out_cfg << od->long_name() << " = " << example << "\n";
|
out_cfg << od->long_name() << " = " << example << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -304,11 +288,9 @@ static void create_new_config_file(const fc::path& config_ini_path, const fc::pa
|
||||||
out_cfg.close();
|
out_cfg.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void create_logging_config_file(const fc::path& config_ini_path, const fc::path& data_dir)
|
static void create_logging_config_file(const fc::path &config_ini_path, const fc::path &data_dir) {
|
||||||
{
|
|
||||||
ilog("Writing new config file at ${path}", ("path", config_ini_path));
|
ilog("Writing new config file at ${path}", ("path", config_ini_path));
|
||||||
if (!exists(data_dir))
|
if (!exists(data_dir)) {
|
||||||
{
|
|
||||||
create_directories(data_dir);
|
create_directories(data_dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -319,18 +301,14 @@ static void create_logging_config_file(const fc::path& config_ini_path, const fc
|
||||||
|
|
||||||
namespace graphene { namespace app {
|
namespace graphene { namespace app {
|
||||||
|
|
||||||
void load_configuration_options(const fc::path& data_dir, const bpo::options_description& cfg_options, bpo::variables_map& options)
|
void load_configuration_options(const fc::path &data_dir, const bpo::options_description &cfg_options, bpo::variables_map &options) {
|
||||||
{
|
|
||||||
const auto config_ini_path = data_dir / "config.ini";
|
const auto config_ini_path = data_dir / "config.ini";
|
||||||
const auto logging_ini_path = data_dir / "logging.ini";
|
const auto logging_ini_path = data_dir / "logging.ini";
|
||||||
|
|
||||||
if(!exists(config_ini_path) && fc::exists(logging_ini_path))
|
if (!exists(config_ini_path) && fc::exists(logging_ini_path)) {
|
||||||
{
|
|
||||||
// this is an uncommon case
|
// this is an uncommon case
|
||||||
create_new_config_file(config_ini_path, data_dir, cfg_options);
|
create_new_config_file(config_ini_path, data_dir, cfg_options);
|
||||||
}
|
} else if (!exists(config_ini_path)) {
|
||||||
else if(!exists(config_ini_path))
|
|
||||||
{
|
|
||||||
// create default config.ini and logging.ini
|
// create default config.ini and logging.ini
|
||||||
create_new_config_file(config_ini_path, data_dir, cfg_options);
|
create_new_config_file(config_ini_path, data_dir, cfg_options);
|
||||||
create_logging_config_file(logging_ini_path, data_dir);
|
create_logging_config_file(logging_ini_path, data_dir);
|
||||||
|
|
@ -340,15 +318,12 @@ namespace graphene { namespace app {
|
||||||
load_config_file(config_ini_path, cfg_options, options);
|
load_config_file(config_ini_path, cfg_options, options);
|
||||||
|
|
||||||
// load logging configuration
|
// load logging configuration
|
||||||
if (fc::exists(logging_ini_path))
|
if (fc::exists(logging_ini_path)) {
|
||||||
{
|
|
||||||
load_logging_config_file(logging_ini_path);
|
load_logging_config_file(logging_ini_path);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
// this is the legacy config.ini case
|
// this is the legacy config.ini case
|
||||||
load_logging_config_file(config_ini_path);
|
load_logging_config_file(config_ini_path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} } // graphene::app
|
}} // namespace graphene::app
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -25,24 +25,23 @@
|
||||||
|
|
||||||
#include <graphene/app/database_api.hpp>
|
#include <graphene/app/database_api.hpp>
|
||||||
|
|
||||||
#include <graphene/chain/protocol/types.hpp>
|
|
||||||
#include <graphene/chain/protocol/confidential.hpp>
|
#include <graphene/chain/protocol/confidential.hpp>
|
||||||
|
#include <graphene/chain/protocol/types.hpp>
|
||||||
#include <graphene/market_history/market_history_plugin.hpp>
|
|
||||||
#include <graphene/accounts_list/accounts_list_plugin.hpp>
|
|
||||||
|
|
||||||
#include <graphene/elasticsearch/elasticsearch_plugin.hpp>
|
|
||||||
|
|
||||||
#include <graphene/debug_witness/debug_api.hpp>
|
|
||||||
#include <graphene/affiliate_stats/affiliate_stats_api.hpp>
|
|
||||||
#include <graphene/bookie/bookie_api.hpp>
|
|
||||||
|
|
||||||
#include <graphene/net/node.hpp>
|
#include <graphene/net/node.hpp>
|
||||||
|
|
||||||
|
#include <graphene/accounts_list/accounts_list_plugin.hpp>
|
||||||
|
#include <graphene/affiliate_stats/affiliate_stats_api.hpp>
|
||||||
|
#include <graphene/bookie/bookie_api.hpp>
|
||||||
|
#include <graphene/debug_witness/debug_api.hpp>
|
||||||
|
#include <graphene/elasticsearch/elasticsearch_plugin.hpp>
|
||||||
|
#include <graphene/market_history/market_history_plugin.hpp>
|
||||||
|
#include <graphene/peerplays_sidechain/sidechain_api.hpp>
|
||||||
|
|
||||||
#include <fc/api.hpp>
|
#include <fc/api.hpp>
|
||||||
#include <fc/optional.hpp>
|
|
||||||
#include <fc/crypto/elliptic.hpp>
|
#include <fc/crypto/elliptic.hpp>
|
||||||
#include <fc/network/ip.hpp>
|
#include <fc/network/ip.hpp>
|
||||||
|
#include <fc/optional.hpp>
|
||||||
|
|
||||||
#include <boost/container/flat_set.hpp>
|
#include <boost/container/flat_set.hpp>
|
||||||
|
|
||||||
|
|
@ -52,53 +51,50 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace graphene { namespace app {
|
namespace graphene { namespace app {
|
||||||
using namespace graphene::chain;
|
using namespace graphene::chain;
|
||||||
using namespace graphene::market_history;
|
using namespace graphene::market_history;
|
||||||
using namespace graphene::accounts_list;
|
using namespace graphene::accounts_list;
|
||||||
using namespace fc::ecc;
|
using namespace fc::ecc;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
class application;
|
class application;
|
||||||
|
|
||||||
struct verify_range_result
|
struct verify_range_result {
|
||||||
{
|
|
||||||
bool success;
|
bool success;
|
||||||
uint64_t min_val;
|
uint64_t min_val;
|
||||||
uint64_t max_val;
|
uint64_t max_val;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct verify_range_proof_rewind_result
|
struct verify_range_proof_rewind_result {
|
||||||
{
|
|
||||||
bool success;
|
bool success;
|
||||||
uint64_t min_val;
|
uint64_t min_val;
|
||||||
uint64_t max_val;
|
uint64_t max_val;
|
||||||
uint64_t value_out;
|
uint64_t value_out;
|
||||||
fc::ecc::blind_factor_type blind_out;
|
fc::ecc::blind_factor_type blind_out;
|
||||||
string message_out;
|
string message_out;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct account_asset_balance
|
struct account_asset_balance {
|
||||||
{
|
|
||||||
string name;
|
string name;
|
||||||
account_id_type account_id;
|
account_id_type account_id;
|
||||||
share_type amount;
|
share_type amount;
|
||||||
};
|
};
|
||||||
struct asset_holders
|
struct asset_holders {
|
||||||
{
|
|
||||||
asset_id_type asset_id;
|
asset_id_type asset_id;
|
||||||
int count;
|
int count;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The history_api class implements the RPC API for account history
|
* @brief The history_api class implements the RPC API for account history
|
||||||
*
|
*
|
||||||
* This API contains methods to access account histories
|
* This API contains methods to access account histories
|
||||||
*/
|
*/
|
||||||
class history_api
|
class history_api {
|
||||||
{
|
public:
|
||||||
public:
|
history_api(application &app) :
|
||||||
history_api(application& app)
|
_app(app),
|
||||||
:_app(app), database_api( std::ref(*app.chain_database())) {}
|
database_api(std::ref(*app.chain_database())) {
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get operations relevant to the specificed account
|
* @brief Get operations relevant to the specificed account
|
||||||
|
|
@ -111,7 +107,7 @@ namespace graphene { namespace app {
|
||||||
vector<operation_history_object> get_account_history(const std::string account_id_or_name,
|
vector<operation_history_object> get_account_history(const std::string account_id_or_name,
|
||||||
operation_history_id_type stop = operation_history_id_type(),
|
operation_history_id_type stop = operation_history_id_type(),
|
||||||
unsigned limit = 100,
|
unsigned limit = 100,
|
||||||
operation_history_id_type start = operation_history_id_type())const;
|
operation_history_id_type start = operation_history_id_type()) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get only asked operations relevant to the specified account
|
* @brief Get only asked operations relevant to the specified account
|
||||||
|
|
@ -126,7 +122,7 @@ namespace graphene { namespace app {
|
||||||
int operation_id,
|
int operation_id,
|
||||||
operation_history_id_type start = operation_history_id_type(),
|
operation_history_id_type start = operation_history_id_type(),
|
||||||
operation_history_id_type stop = operation_history_id_type(),
|
operation_history_id_type stop = operation_history_id_type(),
|
||||||
unsigned limit = 100)const;
|
unsigned limit = 100) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @breif Get operations relevant to the specified account referenced
|
* @breif Get operations relevant to the specified account referenced
|
||||||
|
|
@ -140,57 +136,54 @@ namespace graphene { namespace app {
|
||||||
* 0 is default, which will start querying from the most recent operation.
|
* 0 is default, which will start querying from the most recent operation.
|
||||||
* @return A list of operations performed by account, ordered from most recent to oldest.
|
* @return A list of operations performed by account, ordered from most recent to oldest.
|
||||||
*/
|
*/
|
||||||
vector<operation_history_object> get_relative_account_history( const std::string account_id_or_name,
|
vector<operation_history_object> get_relative_account_history(const std::string account_id_or_name,
|
||||||
uint32_t stop = 0,
|
uint32_t stop = 0,
|
||||||
unsigned limit = 100,
|
unsigned limit = 100,
|
||||||
uint32_t start = 0) const;
|
uint32_t start = 0) const;
|
||||||
|
|
||||||
vector<order_history_object> get_fill_order_history( std::string asset_a, std::string asset_b, uint32_t limit )const;
|
vector<order_history_object> get_fill_order_history(std::string asset_a, std::string asset_b, uint32_t limit) const;
|
||||||
vector<bucket_object> get_market_history( std::string asset_a, std::string asset_b, uint32_t bucket_seconds,
|
vector<bucket_object> get_market_history(std::string asset_a, std::string asset_b, uint32_t bucket_seconds,
|
||||||
fc::time_point_sec start, fc::time_point_sec end )const;
|
fc::time_point_sec start, fc::time_point_sec end) const;
|
||||||
vector<account_balance_object> list_core_accounts()const;
|
vector<account_balance_object> list_core_accounts() const;
|
||||||
flat_set<uint32_t> get_market_history_buckets()const;
|
flat_set<uint32_t> get_market_history_buckets() const;
|
||||||
uint32_t api_limit_get_account_history_operations = 100;
|
uint32_t api_limit_get_account_history_operations = 100;
|
||||||
uint32_t api_limit_get_account_history = 100;
|
uint32_t api_limit_get_account_history = 100;
|
||||||
uint32_t api_limit_get_relative_account_history = 100;
|
uint32_t api_limit_get_relative_account_history = 100;
|
||||||
private:
|
|
||||||
application& _app;
|
|
||||||
graphene::app::database_api database_api;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
private:
|
||||||
|
application &_app;
|
||||||
|
graphene::app::database_api database_api;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
* @brief Block api
|
* @brief Block api
|
||||||
*/
|
*/
|
||||||
class block_api
|
class block_api {
|
||||||
{
|
public:
|
||||||
public:
|
block_api(graphene::chain::database &db);
|
||||||
block_api(graphene::chain::database& db);
|
|
||||||
~block_api();
|
~block_api();
|
||||||
|
|
||||||
vector<optional<signed_block>> get_blocks(uint32_t block_num_from, uint32_t block_num_to)const;
|
vector<optional<signed_block>> get_blocks(uint32_t block_num_from, uint32_t block_num_to) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
graphene::chain::database& _db;
|
graphene::chain::database &_db;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
/**
|
|
||||||
* @brief The network_broadcast_api class allows broadcasting of transactions.
|
* @brief The network_broadcast_api class allows broadcasting of transactions.
|
||||||
*/
|
*/
|
||||||
class network_broadcast_api : public std::enable_shared_from_this<network_broadcast_api>
|
class network_broadcast_api : public std::enable_shared_from_this<network_broadcast_api> {
|
||||||
{
|
public:
|
||||||
public:
|
network_broadcast_api(application &a);
|
||||||
network_broadcast_api(application& a);
|
|
||||||
|
|
||||||
struct transaction_confirmation
|
struct transaction_confirmation {
|
||||||
{
|
|
||||||
transaction_id_type id;
|
transaction_id_type id;
|
||||||
uint32_t block_num;
|
uint32_t block_num;
|
||||||
uint32_t trx_num;
|
uint32_t trx_num;
|
||||||
processed_transaction trx;
|
processed_transaction trx;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::function<void(variant/*transaction_confirmation*/)> confirmation_callback;
|
typedef std::function<void(variant /*transaction_confirmation*/)> confirmation_callback;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Broadcast a transaction to the network
|
* @brief Broadcast a transaction to the network
|
||||||
|
|
@ -199,21 +192,21 @@ namespace graphene { namespace app {
|
||||||
* The transaction will be checked for validity in the local database prior to broadcasting. If it fails to
|
* The transaction will be checked for validity in the local database prior to broadcasting. If it fails to
|
||||||
* apply locally, an error will be thrown and the transaction will not be broadcast.
|
* apply locally, an error will be thrown and the transaction will not be broadcast.
|
||||||
*/
|
*/
|
||||||
void broadcast_transaction(const signed_transaction& trx);
|
void broadcast_transaction(const signed_transaction &trx);
|
||||||
|
|
||||||
/** this version of broadcast transaction registers a callback method that will be called when the transaction is
|
/** this version of broadcast transaction registers a callback method that will be called when the transaction is
|
||||||
* included into a block. The callback method includes the transaction id, block number, and transaction number in the
|
* included into a block. The callback method includes the transaction id, block number, and transaction number in the
|
||||||
* block.
|
* block.
|
||||||
*/
|
*/
|
||||||
void broadcast_transaction_with_callback( confirmation_callback cb, const signed_transaction& trx);
|
void broadcast_transaction_with_callback(confirmation_callback cb, const signed_transaction &trx);
|
||||||
|
|
||||||
/** this version of broadcast transaction registers a callback method that will be called when the transaction is
|
/** this version of broadcast transaction registers a callback method that will be called when the transaction is
|
||||||
* included into a block. The callback method includes the transaction id, block number, and transaction number in the
|
* included into a block. The callback method includes the transaction id, block number, and transaction number in the
|
||||||
* block.
|
* block.
|
||||||
*/
|
*/
|
||||||
fc::variant broadcast_transaction_synchronous(const signed_transaction& trx);
|
fc::variant broadcast_transaction_synchronous(const signed_transaction &trx);
|
||||||
|
|
||||||
void broadcast_block( const signed_block& block );
|
void broadcast_block(const signed_block &block);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Not reflected, thus not accessible to API clients.
|
* @brief Not reflected, thus not accessible to API clients.
|
||||||
|
|
@ -223,20 +216,20 @@ namespace graphene { namespace app {
|
||||||
* It then dispatches callbacks to clients who have requested
|
* It then dispatches callbacks to clients who have requested
|
||||||
* to be notified when a particular txid is included in a block.
|
* to be notified when a particular txid is included in a block.
|
||||||
*/
|
*/
|
||||||
void on_applied_block( const signed_block& b );
|
void on_applied_block(const signed_block &b);
|
||||||
private:
|
|
||||||
boost::signals2::scoped_connection _applied_block_connection;
|
|
||||||
map<transaction_id_type,confirmation_callback> _callbacks;
|
|
||||||
application& _app;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
private:
|
||||||
|
boost::signals2::scoped_connection _applied_block_connection;
|
||||||
|
map<transaction_id_type, confirmation_callback> _callbacks;
|
||||||
|
application &_app;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
* @brief The network_node_api class allows maintenance of p2p connections.
|
* @brief The network_node_api class allows maintenance of p2p connections.
|
||||||
*/
|
*/
|
||||||
class network_node_api
|
class network_node_api {
|
||||||
{
|
public:
|
||||||
public:
|
network_node_api(application &a);
|
||||||
network_node_api(application& a);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Return general network information, such as p2p port
|
* @brief Return general network information, such as p2p port
|
||||||
|
|
@ -247,7 +240,7 @@ namespace graphene { namespace app {
|
||||||
* @brief add_node Connect to a new peer
|
* @brief add_node Connect to a new peer
|
||||||
* @param ep The IP/Port of the peer to connect to
|
* @param ep The IP/Port of the peer to connect to
|
||||||
*/
|
*/
|
||||||
void add_node(const fc::ip::endpoint& ep);
|
void add_node(const fc::ip::endpoint &ep);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get status of all current connections to peers
|
* @brief Get status of all current connections to peers
|
||||||
|
|
@ -265,7 +258,7 @@ namespace graphene { namespace app {
|
||||||
* number of connections
|
* number of connections
|
||||||
* @param params a JSON object containing the name/value pairs for the parameters to set
|
* @param params a JSON object containing the name/value pairs for the parameters to set
|
||||||
*/
|
*/
|
||||||
void set_advanced_node_parameters(const fc::variant_object& params);
|
void set_advanced_node_parameters(const fc::variant_object ¶ms);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Return list of potential peers
|
* @brief Return list of potential peers
|
||||||
|
|
@ -281,58 +274,27 @@ namespace graphene { namespace app {
|
||||||
* @brief Subscribes caller for notifications about pending transactions.
|
* @brief Subscribes caller for notifications about pending transactions.
|
||||||
* @param callback a functional object which will be called when new transaction is created.
|
* @param callback a functional object which will be called when new transaction is created.
|
||||||
*/
|
*/
|
||||||
void subscribe_to_pending_transactions(std::function<void(const variant&)> callback);
|
void subscribe_to_pending_transactions(std::function<void(const variant &)> callback);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Unsubscribes caller from notifications about pending transactions.
|
* @brief Unsubscribes caller from notifications about pending transactions.
|
||||||
*/
|
*/
|
||||||
void unsubscribe_from_pending_transactions();
|
void unsubscribe_from_pending_transactions();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
application& _app;
|
application &_app;
|
||||||
map<transaction_id_type, signed_transaction> _pending_transactions;
|
map<transaction_id_type, signed_transaction> _pending_transactions;
|
||||||
boost::signals2::scoped_connection _pending_trx_connection;
|
boost::signals2::scoped_connection _pending_trx_connection;
|
||||||
boost::signals2::scoped_connection _applied_block_connection;
|
boost::signals2::scoped_connection _applied_block_connection;
|
||||||
std::function<void(const variant&)> _on_pending_transaction;
|
std::function<void(const variant &)> _on_pending_transaction;
|
||||||
};
|
};
|
||||||
|
|
||||||
class crypto_api
|
/**
|
||||||
{
|
|
||||||
public:
|
|
||||||
crypto_api();
|
|
||||||
|
|
||||||
fc::ecc::commitment_type blind( const fc::ecc::blind_factor_type& blind, uint64_t value );
|
|
||||||
|
|
||||||
fc::ecc::blind_factor_type blind_sum( const std::vector<blind_factor_type>& blinds_in, uint32_t non_neg );
|
|
||||||
|
|
||||||
bool verify_sum( const std::vector<commitment_type>& commits_in, const std::vector<commitment_type>& neg_commits_in, int64_t excess );
|
|
||||||
|
|
||||||
verify_range_result verify_range( const fc::ecc::commitment_type& commit, const std::vector<char>& proof );
|
|
||||||
|
|
||||||
std::vector<char> range_proof_sign( uint64_t min_value,
|
|
||||||
const commitment_type& commit,
|
|
||||||
const blind_factor_type& commit_blind,
|
|
||||||
const blind_factor_type& nonce,
|
|
||||||
int8_t base10_exp,
|
|
||||||
uint8_t min_bits,
|
|
||||||
uint64_t actual_value );
|
|
||||||
|
|
||||||
|
|
||||||
verify_range_proof_rewind_result verify_range_proof_rewind( const blind_factor_type& nonce,
|
|
||||||
const fc::ecc::commitment_type& commit,
|
|
||||||
const std::vector<char>& proof );
|
|
||||||
|
|
||||||
|
|
||||||
range_proof_info range_get_info( const std::vector<char>& proof );
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief
|
* @brief
|
||||||
*/
|
*/
|
||||||
class asset_api
|
class asset_api {
|
||||||
{
|
public:
|
||||||
public:
|
asset_api(graphene::app::application &app);
|
||||||
asset_api(graphene::app::application& app);
|
|
||||||
~asset_api();
|
~asset_api();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -342,14 +304,14 @@ namespace graphene { namespace app {
|
||||||
* @param limit Maximum limit must not exceed 100
|
* @param limit Maximum limit must not exceed 100
|
||||||
* @return A list of asset holders for the specified asset
|
* @return A list of asset holders for the specified asset
|
||||||
*/
|
*/
|
||||||
vector<account_asset_balance> get_asset_holders( std::string asset, uint32_t start, uint32_t limit )const;
|
vector<account_asset_balance> get_asset_holders(std::string asset, uint32_t start, uint32_t limit) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get asset holders count for a specific asset
|
* @brief Get asset holders count for a specific asset
|
||||||
* @param asset The specific asset id or symbol
|
* @param asset The specific asset id or symbol
|
||||||
* @return Holders count for the specified asset
|
* @return Holders count for the specified asset
|
||||||
*/
|
*/
|
||||||
int get_asset_holders_count( std::string asset )const;
|
int get_asset_holders_count(std::string asset) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get all asset holders
|
* @brief Get all asset holders
|
||||||
|
|
@ -358,31 +320,30 @@ namespace graphene { namespace app {
|
||||||
vector<asset_holders> get_all_asset_holders() const;
|
vector<asset_holders> get_all_asset_holders() const;
|
||||||
|
|
||||||
uint32_t api_limit_get_asset_holders = 100;
|
uint32_t api_limit_get_asset_holders = 100;
|
||||||
private:
|
|
||||||
graphene::app::application& _app;
|
private:
|
||||||
graphene::chain::database& _db;
|
graphene::app::application &_app;
|
||||||
|
graphene::chain::database &_db;
|
||||||
graphene::app::database_api database_api;
|
graphene::app::database_api database_api;
|
||||||
};
|
};
|
||||||
} } // graphene::app
|
}} // namespace graphene::app
|
||||||
|
|
||||||
extern template class fc::api<graphene::app::block_api>;
|
extern template class fc::api<graphene::app::block_api>;
|
||||||
extern template class fc::api<graphene::app::network_broadcast_api>;
|
extern template class fc::api<graphene::app::network_broadcast_api>;
|
||||||
extern template class fc::api<graphene::app::network_node_api>;
|
extern template class fc::api<graphene::app::network_node_api>;
|
||||||
extern template class fc::api<graphene::app::history_api>;
|
extern template class fc::api<graphene::app::history_api>;
|
||||||
extern template class fc::api<graphene::app::crypto_api>;
|
|
||||||
extern template class fc::api<graphene::app::asset_api>;
|
extern template class fc::api<graphene::app::asset_api>;
|
||||||
extern template class fc::api<graphene::debug_witness::debug_api>;
|
extern template class fc::api<graphene::debug_witness::debug_api>;
|
||||||
|
|
||||||
namespace graphene { namespace app {
|
namespace graphene { namespace app {
|
||||||
/**
|
/**
|
||||||
* @brief The login_api class implements the bottom layer of the RPC API
|
* @brief The login_api class implements the bottom layer of the RPC API
|
||||||
*
|
*
|
||||||
* All other APIs must be requested from this API.
|
* All other APIs must be requested from this API.
|
||||||
*/
|
*/
|
||||||
class login_api
|
class login_api {
|
||||||
{
|
public:
|
||||||
public:
|
login_api(application &a);
|
||||||
login_api(application& a);
|
|
||||||
~login_api();
|
~login_api();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -394,60 +355,65 @@ namespace graphene { namespace app {
|
||||||
* @note This must be called prior to requesting other APIs. Other APIs may not be accessible until the client
|
* @note This must be called prior to requesting other APIs. Other APIs may not be accessible until the client
|
||||||
* has sucessfully authenticated.
|
* has sucessfully authenticated.
|
||||||
*/
|
*/
|
||||||
bool login(const string& user, const string& password);
|
bool login(const string &user, const string &password);
|
||||||
/// @brief Retrieve the network block API
|
/// @brief Retrieve the network block API
|
||||||
fc::api<block_api> block()const;
|
fc::api<block_api> block() const;
|
||||||
/// @brief Retrieve the network broadcast API
|
/// @brief Retrieve the network broadcast API
|
||||||
fc::api<network_broadcast_api> network_broadcast()const;
|
fc::api<network_broadcast_api> network_broadcast() const;
|
||||||
/// @brief Retrieve the database API
|
/// @brief Retrieve the database API
|
||||||
fc::api<database_api> database()const;
|
fc::api<database_api> database() const;
|
||||||
/// @brief Retrieve the history API
|
/// @brief Retrieve the history API
|
||||||
fc::api<history_api> history()const;
|
fc::api<history_api> history() const;
|
||||||
/// @brief Retrieve the network node API
|
/// @brief Retrieve the network node API
|
||||||
fc::api<network_node_api> network_node()const;
|
fc::api<network_node_api> network_node() const;
|
||||||
/// @brief Retrieve the cryptography API
|
|
||||||
fc::api<crypto_api> crypto()const;
|
|
||||||
/// @brief Retrieve the asset API
|
/// @brief Retrieve the asset API
|
||||||
fc::api<asset_api> asset()const;
|
fc::api<asset_api> asset() const;
|
||||||
/// @brief Retrieve the debug API (if available)
|
/// @brief Retrieve the debug API (if available)
|
||||||
fc::api<graphene::debug_witness::debug_api> debug()const;
|
fc::api<graphene::debug_witness::debug_api> debug() const;
|
||||||
/// @brief Retrieve the bookie API (if available)
|
/// @brief Retrieve the bookie API (if available)
|
||||||
fc::api<graphene::bookie::bookie_api> bookie()const;
|
fc::api<graphene::bookie::bookie_api> bookie() const;
|
||||||
/// @brief Retrieve the affiliate_stats API (if available)
|
/// @brief Retrieve the affiliate_stats API (if available)
|
||||||
fc::api<graphene::affiliate_stats::affiliate_stats_api> affiliate_stats()const;
|
fc::api<graphene::affiliate_stats::affiliate_stats_api> affiliate_stats() const;
|
||||||
|
/// @brief Retrieve the sidechain_api API (if available)
|
||||||
|
fc::api<graphene::peerplays_sidechain::sidechain_api> sidechain() const;
|
||||||
|
|
||||||
/// @brief Called to enable an API, not reflected.
|
/// @brief Called to enable an API, not reflected.
|
||||||
void enable_api( const string& api_name );
|
void enable_api(const string &api_name);
|
||||||
private:
|
|
||||||
|
|
||||||
application& _app;
|
private:
|
||||||
optional< fc::api<block_api> > _block_api;
|
application &_app;
|
||||||
optional< fc::api<database_api> > _database_api;
|
optional<fc::api<block_api>> _block_api;
|
||||||
optional< fc::api<network_broadcast_api> > _network_broadcast_api;
|
optional<fc::api<database_api>> _database_api;
|
||||||
optional< fc::api<network_node_api> > _network_node_api;
|
optional<fc::api<network_broadcast_api>> _network_broadcast_api;
|
||||||
optional< fc::api<history_api> > _history_api;
|
optional<fc::api<network_node_api>> _network_node_api;
|
||||||
optional< fc::api<crypto_api> > _crypto_api;
|
optional<fc::api<history_api>> _history_api;
|
||||||
optional< fc::api<asset_api> > _asset_api;
|
optional<fc::api<asset_api>> _asset_api;
|
||||||
optional< fc::api<graphene::debug_witness::debug_api> > _debug_api;
|
optional<fc::api<graphene::debug_witness::debug_api>> _debug_api;
|
||||||
optional< fc::api<graphene::bookie::bookie_api> > _bookie_api;
|
optional<fc::api<graphene::bookie::bookie_api>> _bookie_api;
|
||||||
optional< fc::api<graphene::affiliate_stats::affiliate_stats_api> > _affiliate_stats_api;
|
optional<fc::api<graphene::affiliate_stats::affiliate_stats_api>> _affiliate_stats_api;
|
||||||
};
|
optional<fc::api<graphene::peerplays_sidechain::sidechain_api>> _sidechain_api;
|
||||||
|
};
|
||||||
|
|
||||||
}} // graphene::app
|
}} // namespace graphene::app
|
||||||
|
|
||||||
extern template class fc::api<graphene::app::login_api>;
|
extern template class fc::api<graphene::app::login_api>;
|
||||||
|
|
||||||
FC_REFLECT( graphene::app::network_broadcast_api::transaction_confirmation,
|
// clang-format off
|
||||||
(id)(block_num)(trx_num)(trx) )
|
|
||||||
FC_REFLECT( graphene::app::verify_range_result,
|
|
||||||
(success)(min_val)(max_val) )
|
|
||||||
FC_REFLECT( graphene::app::verify_range_proof_rewind_result,
|
|
||||||
(success)(min_val)(max_val)(value_out)(blind_out)(message_out) )
|
|
||||||
//FC_REFLECT_TYPENAME( fc::ecc::compact_signature );
|
|
||||||
//FC_REFLECT_TYPENAME( fc::ecc::commitment_type );
|
|
||||||
|
|
||||||
FC_REFLECT( graphene::app::account_asset_balance, (name)(account_id)(amount) );
|
FC_REFLECT(graphene::app::network_broadcast_api::transaction_confirmation,
|
||||||
FC_REFLECT( graphene::app::asset_holders, (asset_id)(count) );
|
(id)(block_num)(trx_num)(trx))
|
||||||
|
|
||||||
|
FC_REFLECT(graphene::app::verify_range_result,
|
||||||
|
(success)(min_val)(max_val))
|
||||||
|
|
||||||
|
FC_REFLECT(graphene::app::verify_range_proof_rewind_result,
|
||||||
|
(success)(min_val)(max_val)(value_out)(blind_out)(message_out))
|
||||||
|
|
||||||
|
FC_REFLECT(graphene::app::account_asset_balance,
|
||||||
|
(name)(account_id)(amount));
|
||||||
|
|
||||||
|
FC_REFLECT(graphene::app::asset_holders,
|
||||||
|
(asset_id)(count));
|
||||||
|
|
||||||
FC_API(graphene::app::history_api,
|
FC_API(graphene::app::history_api,
|
||||||
(get_account_history)
|
(get_account_history)
|
||||||
|
|
@ -456,17 +422,17 @@ FC_API(graphene::app::history_api,
|
||||||
(get_fill_order_history)
|
(get_fill_order_history)
|
||||||
(get_market_history)
|
(get_market_history)
|
||||||
(get_market_history_buckets)
|
(get_market_history_buckets)
|
||||||
(list_core_accounts)
|
(list_core_accounts))
|
||||||
)
|
|
||||||
FC_API(graphene::app::block_api,
|
FC_API(graphene::app::block_api,
|
||||||
(get_blocks)
|
(get_blocks))
|
||||||
)
|
|
||||||
FC_API(graphene::app::network_broadcast_api,
|
FC_API(graphene::app::network_broadcast_api,
|
||||||
(broadcast_transaction)
|
(broadcast_transaction)
|
||||||
(broadcast_transaction_with_callback)
|
(broadcast_transaction_with_callback)
|
||||||
(broadcast_transaction_synchronous)
|
(broadcast_transaction_synchronous)
|
||||||
(broadcast_block)
|
(broadcast_block))
|
||||||
)
|
|
||||||
FC_API(graphene::app::network_node_api,
|
FC_API(graphene::app::network_node_api,
|
||||||
(get_info)
|
(get_info)
|
||||||
(add_node)
|
(add_node)
|
||||||
|
|
@ -476,22 +442,13 @@ FC_API(graphene::app::network_node_api,
|
||||||
(set_advanced_node_parameters)
|
(set_advanced_node_parameters)
|
||||||
(list_pending_transactions)
|
(list_pending_transactions)
|
||||||
(subscribe_to_pending_transactions)
|
(subscribe_to_pending_transactions)
|
||||||
(unsubscribe_from_pending_transactions)
|
(unsubscribe_from_pending_transactions))
|
||||||
)
|
|
||||||
FC_API(graphene::app::crypto_api,
|
|
||||||
(blind)
|
|
||||||
(blind_sum)
|
|
||||||
(verify_sum)
|
|
||||||
(verify_range)
|
|
||||||
(range_proof_sign)
|
|
||||||
(verify_range_proof_rewind)
|
|
||||||
(range_get_info)
|
|
||||||
)
|
|
||||||
FC_API(graphene::app::asset_api,
|
FC_API(graphene::app::asset_api,
|
||||||
(get_asset_holders)
|
(get_asset_holders)
|
||||||
(get_asset_holders_count)
|
(get_asset_holders_count)
|
||||||
(get_all_asset_holders)
|
(get_all_asset_holders))
|
||||||
)
|
|
||||||
FC_API(graphene::app::login_api,
|
FC_API(graphene::app::login_api,
|
||||||
(login)
|
(login)
|
||||||
(block)
|
(block)
|
||||||
|
|
@ -499,9 +456,10 @@ FC_API(graphene::app::login_api,
|
||||||
(database)
|
(database)
|
||||||
(history)
|
(history)
|
||||||
(network_node)
|
(network_node)
|
||||||
(crypto)
|
|
||||||
(asset)
|
(asset)
|
||||||
(debug)
|
(debug)
|
||||||
(bookie)
|
(bookie)
|
||||||
(affiliate_stats)
|
(affiliate_stats)
|
||||||
)
|
(sidechain))
|
||||||
|
|
||||||
|
// clang-format on
|
||||||
|
|
|
||||||
|
|
@ -31,26 +31,26 @@
|
||||||
|
|
||||||
namespace graphene { namespace app {
|
namespace graphene { namespace app {
|
||||||
|
|
||||||
struct api_access_info
|
struct api_access_info {
|
||||||
{
|
|
||||||
std::string password_hash_b64;
|
std::string password_hash_b64;
|
||||||
std::string password_salt_b64;
|
std::string password_salt_b64;
|
||||||
std::vector< std::string > allowed_apis;
|
std::vector<std::string> allowed_apis;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct api_access
|
struct api_access {
|
||||||
{
|
std::map<std::string, api_access_info> permission_map;
|
||||||
std::map< std::string, api_access_info > permission_map;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} } // graphene::app
|
}} // namespace graphene::app
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
|
|
||||||
FC_REFLECT( graphene::app::api_access_info,
|
FC_REFLECT( graphene::app::api_access_info,
|
||||||
(password_hash_b64)
|
(password_hash_b64)
|
||||||
(password_salt_b64)
|
(password_salt_b64)
|
||||||
(allowed_apis)
|
(allowed_apis))
|
||||||
)
|
|
||||||
|
|
||||||
FC_REFLECT( graphene::app::api_access,
|
FC_REFLECT( graphene::app::api_access,
|
||||||
(permission_map)
|
(permission_map))
|
||||||
)
|
|
||||||
|
// clang-format on
|
||||||
|
|
|
||||||
|
|
@ -24,89 +24,86 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <graphene/app/api_access.hpp>
|
#include <graphene/app/api_access.hpp>
|
||||||
#include <graphene/net/node.hpp>
|
|
||||||
#include <graphene/chain/database.hpp>
|
#include <graphene/chain/database.hpp>
|
||||||
|
#include <graphene/net/node.hpp>
|
||||||
|
|
||||||
#include <boost/program_options.hpp>
|
#include <boost/program_options.hpp>
|
||||||
|
|
||||||
namespace graphene { namespace app {
|
namespace graphene { namespace app {
|
||||||
namespace detail { class application_impl; }
|
namespace detail {
|
||||||
using std::string;
|
class application_impl;
|
||||||
|
}
|
||||||
|
using std::string;
|
||||||
|
|
||||||
class abstract_plugin;
|
class abstract_plugin;
|
||||||
|
|
||||||
class application
|
class application {
|
||||||
{
|
public:
|
||||||
public:
|
|
||||||
application();
|
application();
|
||||||
~application();
|
~application();
|
||||||
|
|
||||||
void set_program_options( boost::program_options::options_description& command_line_options,
|
void set_program_options(boost::program_options::options_description &cli,
|
||||||
boost::program_options::options_description& configuration_file_options )const;
|
boost::program_options::options_description &cfg) const;
|
||||||
void initialize(const fc::path& data_dir, const boost::program_options::variables_map&options);
|
void initialize(const fc::path &data_dir, const boost::program_options::variables_map &options);
|
||||||
void initialize_plugins( const boost::program_options::variables_map& options );
|
void initialize_plugins(const boost::program_options::variables_map &options);
|
||||||
void startup();
|
void startup();
|
||||||
void shutdown();
|
void shutdown();
|
||||||
void startup_plugins();
|
void startup_plugins();
|
||||||
void shutdown_plugins();
|
void shutdown_plugins();
|
||||||
|
|
||||||
template<typename PluginType>
|
template <typename PluginType>
|
||||||
std::shared_ptr<PluginType> register_plugin()
|
std::shared_ptr<PluginType> register_plugin() {
|
||||||
{
|
|
||||||
auto plug = std::make_shared<PluginType>();
|
auto plug = std::make_shared<PluginType>();
|
||||||
plug->plugin_set_app(this);
|
plug->plugin_set_app(this);
|
||||||
|
|
||||||
boost::program_options::options_description plugin_cli_options(plug->plugin_name() + " plugin. " + plug->plugin_description() + "\nOptions"), plugin_cfg_options;
|
boost::program_options::options_description plugin_cli_options(plug->plugin_name() + " plugin. " + plug->plugin_description() + "\nOptions"), plugin_cfg_options;
|
||||||
//boost::program_options::options_description plugin_cli_options("Options for plugin " + plug->plugin_name()), plugin_cfg_options;
|
|
||||||
plug->plugin_set_program_options(plugin_cli_options, plugin_cfg_options);
|
plug->plugin_set_program_options(plugin_cli_options, plugin_cfg_options);
|
||||||
if( !plugin_cli_options.options().empty() )
|
if (!plugin_cli_options.options().empty())
|
||||||
_cli_options.add(plugin_cli_options);
|
_cli_options.add(plugin_cli_options);
|
||||||
|
|
||||||
if( !plugin_cfg_options.options().empty() )
|
if (!plugin_cfg_options.options().empty()) {
|
||||||
{
|
|
||||||
std::string header_name = "plugin-cfg-header-" + plug->plugin_name();
|
std::string header_name = "plugin-cfg-header-" + plug->plugin_name();
|
||||||
std::string header_desc = plug->plugin_name() + " plugin options";
|
std::string header_desc = plug->plugin_name() + " plugin options";
|
||||||
_cfg_options.add_options()(header_name.c_str(), header_desc.c_str());
|
_cfg_options.add_options()(header_name.c_str(), header_desc.c_str());
|
||||||
_cfg_options.add(plugin_cfg_options);
|
_cfg_options.add(plugin_cfg_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
add_available_plugin( plug );
|
add_available_plugin(plug);
|
||||||
return plug;
|
return plug;
|
||||||
}
|
}
|
||||||
std::shared_ptr<abstract_plugin> get_plugin( const string& name )const;
|
std::shared_ptr<abstract_plugin> get_plugin(const string &name) const;
|
||||||
|
|
||||||
template<typename PluginType>
|
template <typename PluginType>
|
||||||
std::shared_ptr<PluginType> get_plugin( const string& name ) const
|
std::shared_ptr<PluginType> get_plugin(const string &name) const {
|
||||||
{
|
std::shared_ptr<abstract_plugin> abs_plugin = get_plugin(name);
|
||||||
std::shared_ptr<abstract_plugin> abs_plugin = get_plugin( name );
|
std::shared_ptr<PluginType> result = std::dynamic_pointer_cast<PluginType>(abs_plugin);
|
||||||
std::shared_ptr<PluginType> result = std::dynamic_pointer_cast<PluginType>( abs_plugin );
|
FC_ASSERT(result != std::shared_ptr<PluginType>());
|
||||||
FC_ASSERT( result != std::shared_ptr<PluginType>() );
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
net::node_ptr p2p_node();
|
net::node_ptr p2p_node();
|
||||||
std::shared_ptr<chain::database> chain_database()const;
|
std::shared_ptr<chain::database> chain_database() const;
|
||||||
|
|
||||||
void set_block_production(bool producing_blocks);
|
void set_block_production(bool producing_blocks);
|
||||||
fc::optional< api_access_info > get_api_access_info( const string& username )const;
|
fc::optional<api_access_info> get_api_access_info(const string &username) const;
|
||||||
void set_api_access_info(const string& username, api_access_info&& permissions);
|
void set_api_access_info(const string &username, api_access_info &&permissions);
|
||||||
|
|
||||||
bool is_finished_syncing()const;
|
bool is_finished_syncing() const;
|
||||||
/// Emitted when syncing finishes (is_finished_syncing will return true)
|
/// Emitted when syncing finishes (is_finished_syncing will return true)
|
||||||
boost::signals2::signal<void()> syncing_finished;
|
boost::signals2::signal<void()> syncing_finished;
|
||||||
|
|
||||||
void enable_plugin( const string& name );
|
void enable_plugin(const string &name);
|
||||||
|
|
||||||
bool is_plugin_enabled(const string& name) const;
|
bool is_plugin_enabled(const string &name) const;
|
||||||
|
|
||||||
std::shared_ptr<fc::thread> elasticsearch_thread;
|
std::shared_ptr<fc::thread> elasticsearch_thread;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void add_available_plugin( std::shared_ptr<abstract_plugin> p );
|
void add_available_plugin(std::shared_ptr<abstract_plugin> p);
|
||||||
std::shared_ptr<detail::application_impl> my;
|
std::shared_ptr<detail::application_impl> my;
|
||||||
|
|
||||||
boost::program_options::options_description _cli_options;
|
boost::program_options::options_description _cli_options;
|
||||||
boost::program_options::options_description _cfg_options;
|
boost::program_options::options_description _cfg_options;
|
||||||
};
|
};
|
||||||
|
|
||||||
} }
|
}} // namespace graphene::app
|
||||||
|
|
|
||||||
|
|
@ -23,12 +23,12 @@
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <fc/filesystem.hpp>
|
|
||||||
#include <boost/program_options.hpp>
|
#include <boost/program_options.hpp>
|
||||||
|
#include <fc/filesystem.hpp>
|
||||||
|
|
||||||
namespace graphene { namespace app {
|
namespace graphene { namespace app {
|
||||||
|
|
||||||
void load_configuration_options(const fc::path &data_dir, const boost::program_options::options_description &cfg_options,
|
void load_configuration_options(const fc::path &data_dir, const boost::program_options::options_description &cfg_options,
|
||||||
boost::program_options::variables_map &options);
|
boost::program_options::variables_map &options);
|
||||||
|
|
||||||
} } // graphene::app
|
}} // namespace graphene::app
|
||||||
|
|
|
||||||
|
|
@ -32,30 +32,32 @@
|
||||||
#include <graphene/chain/account_object.hpp>
|
#include <graphene/chain/account_object.hpp>
|
||||||
#include <graphene/chain/asset_object.hpp>
|
#include <graphene/chain/asset_object.hpp>
|
||||||
#include <graphene/chain/balance_object.hpp>
|
#include <graphene/chain/balance_object.hpp>
|
||||||
|
#include <graphene/chain/betting_market_object.hpp>
|
||||||
#include <graphene/chain/chain_property_object.hpp>
|
#include <graphene/chain/chain_property_object.hpp>
|
||||||
#include <graphene/chain/committee_member_object.hpp>
|
#include <graphene/chain/committee_member_object.hpp>
|
||||||
#include <graphene/chain/confidential_object.hpp>
|
#include <graphene/chain/confidential_object.hpp>
|
||||||
|
#include <graphene/chain/event_group_object.hpp>
|
||||||
|
#include <graphene/chain/event_object.hpp>
|
||||||
|
#include <graphene/chain/global_betting_statistics_object.hpp>
|
||||||
#include <graphene/chain/market_object.hpp>
|
#include <graphene/chain/market_object.hpp>
|
||||||
#include <graphene/chain/operation_history_object.hpp>
|
#include <graphene/chain/operation_history_object.hpp>
|
||||||
#include <graphene/chain/proposal_object.hpp>
|
#include <graphene/chain/proposal_object.hpp>
|
||||||
#include <graphene/chain/sport_object.hpp>
|
#include <graphene/chain/sidechain_address_object.hpp>
|
||||||
#include <graphene/chain/event_group_object.hpp>
|
|
||||||
#include <graphene/chain/event_object.hpp>
|
|
||||||
#include <graphene/chain/betting_market_object.hpp>
|
|
||||||
#include <graphene/chain/global_betting_statistics_object.hpp>
|
|
||||||
#include <graphene/chain/son_object.hpp>
|
#include <graphene/chain/son_object.hpp>
|
||||||
#include <graphene/chain/son_wallet_object.hpp>
|
#include <graphene/chain/son_wallet_object.hpp>
|
||||||
#include <graphene/chain/sidechain_address_object.hpp>
|
#include <graphene/chain/sport_object.hpp>
|
||||||
|
|
||||||
#include <graphene/chain/worker_object.hpp>
|
|
||||||
#include <graphene/chain/witness_object.hpp>
|
|
||||||
#include <graphene/chain/tournament_object.hpp>
|
#include <graphene/chain/tournament_object.hpp>
|
||||||
|
#include <graphene/chain/witness_object.hpp>
|
||||||
|
#include <graphene/chain/worker_object.hpp>
|
||||||
|
|
||||||
#include <graphene/chain/custom_permission_object.hpp>
|
#include <graphene/chain/account_role_object.hpp>
|
||||||
#include <graphene/chain/custom_account_authority_object.hpp>
|
#include <graphene/chain/custom_account_authority_object.hpp>
|
||||||
|
#include <graphene/chain/custom_permission_object.hpp>
|
||||||
#include <graphene/chain/nft_object.hpp>
|
#include <graphene/chain/nft_object.hpp>
|
||||||
#include <graphene/chain/offer_object.hpp>
|
#include <graphene/chain/offer_object.hpp>
|
||||||
#include <graphene/chain/account_role_object.hpp>
|
#include <graphene/chain/voters_info.hpp>
|
||||||
|
#include <graphene/chain/votes_info.hpp>
|
||||||
|
|
||||||
#include <graphene/market_history/market_history_plugin.hpp>
|
#include <graphene/market_history/market_history_plugin.hpp>
|
||||||
|
|
||||||
|
|
@ -80,23 +82,29 @@ using namespace std;
|
||||||
|
|
||||||
class database_api_impl;
|
class database_api_impl;
|
||||||
|
|
||||||
struct order
|
struct signed_block_with_info : public signed_block {
|
||||||
{
|
signed_block_with_info();
|
||||||
|
signed_block_with_info(const signed_block &block);
|
||||||
|
signed_block_with_info(const signed_block_with_info &block) = default;
|
||||||
|
block_id_type block_id;
|
||||||
|
public_key_type signing_key;
|
||||||
|
vector<transaction_id_type> transaction_ids;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct order {
|
||||||
double price;
|
double price;
|
||||||
double quote;
|
double quote;
|
||||||
double base;
|
double base;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct order_book
|
struct order_book {
|
||||||
{
|
|
||||||
string base;
|
string base;
|
||||||
string quote;
|
string quote;
|
||||||
vector< order > bids;
|
vector<order> bids;
|
||||||
vector< order > asks;
|
vector<order> asks;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct market_ticker
|
struct market_ticker {
|
||||||
{
|
|
||||||
string base;
|
string base;
|
||||||
string quote;
|
string quote;
|
||||||
double latest;
|
double latest;
|
||||||
|
|
@ -107,16 +115,14 @@ struct market_ticker
|
||||||
double quote_volume;
|
double quote_volume;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct market_volume
|
struct market_volume {
|
||||||
{
|
|
||||||
string base;
|
string base;
|
||||||
string quote;
|
string quote;
|
||||||
double base_volume;
|
double base_volume;
|
||||||
double quote_volume;
|
double quote_volume;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct market_trade
|
struct market_trade {
|
||||||
{
|
|
||||||
fc::time_point_sec date;
|
fc::time_point_sec date;
|
||||||
double price;
|
double price;
|
||||||
double amount;
|
double amount;
|
||||||
|
|
@ -133,6 +139,14 @@ struct gpos_info {
|
||||||
share_type account_vested_balance;
|
share_type account_vested_balance;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct version_info {
|
||||||
|
string version;
|
||||||
|
string git_revision;
|
||||||
|
string built;
|
||||||
|
string openssl;
|
||||||
|
string boost;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The database_api class implements the RPC API for the chain database.
|
* @brief The database_api class implements the RPC API for the chain database.
|
||||||
*
|
*
|
||||||
|
|
@ -140,10 +154,9 @@ struct gpos_info {
|
||||||
* read-only; all modifications to the database must be performed via transactions. Transactions are broadcast via
|
* read-only; all modifications to the database must be performed via transactions. Transactions are broadcast via
|
||||||
* the @ref network_broadcast_api.
|
* the @ref network_broadcast_api.
|
||||||
*/
|
*/
|
||||||
class database_api
|
class database_api {
|
||||||
{
|
public:
|
||||||
public:
|
database_api(graphene::chain::database &db);
|
||||||
database_api(graphene::chain::database& db);
|
|
||||||
~database_api();
|
~database_api();
|
||||||
|
|
||||||
/////////////
|
/////////////
|
||||||
|
|
@ -157,15 +170,15 @@ class database_api
|
||||||
*
|
*
|
||||||
* If any of the provided IDs does not map to an object, a null variant is returned in its position.
|
* If any of the provided IDs does not map to an object, a null variant is returned in its position.
|
||||||
*/
|
*/
|
||||||
fc::variants get_objects(const vector<object_id_type>& ids)const;
|
fc::variants get_objects(const vector<object_id_type> &ids) const;
|
||||||
|
|
||||||
///////////////////
|
///////////////////
|
||||||
// Subscriptions //
|
// Subscriptions //
|
||||||
///////////////////
|
///////////////////
|
||||||
|
|
||||||
void set_subscribe_callback( std::function<void(const variant&)> cb, bool clear_filter );
|
void set_subscribe_callback(std::function<void(const variant &)> cb, bool clear_filter);
|
||||||
void set_pending_transaction_callback( std::function<void(const variant&)> cb );
|
void set_pending_transaction_callback(std::function<void(const variant &)> cb);
|
||||||
void set_block_applied_callback( std::function<void(const variant& block_id)> cb );
|
void set_block_applied_callback(std::function<void(const variant &block_id)> cb);
|
||||||
/**
|
/**
|
||||||
* @brief Stop receiving any notifications
|
* @brief Stop receiving any notifications
|
||||||
*
|
*
|
||||||
|
|
@ -182,69 +195,88 @@ class database_api
|
||||||
* @param block_num Height of the block whose header should be returned
|
* @param block_num Height of the block whose header should be returned
|
||||||
* @return header of the referenced block, or null if no matching block was found
|
* @return header of the referenced block, or null if no matching block was found
|
||||||
*/
|
*/
|
||||||
optional<block_header> get_block_header(uint32_t block_num)const;
|
optional<block_header> get_block_header(uint32_t block_num) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Retrieve multiple block header by block numbers
|
* @brief Retrieve multiple block header by block numbers
|
||||||
* @param block_num vector containing heights of the block whose header should be returned
|
* @param block_num vector containing heights of the block whose header should be returned
|
||||||
* @return array of headers of the referenced blocks, or null if no matching block was found
|
* @return array of headers of the referenced blocks, or null if no matching block was found
|
||||||
*/
|
*/
|
||||||
map<uint32_t, optional<block_header>> get_block_header_batch(const vector<uint32_t> block_nums)const;
|
map<uint32_t, optional<block_header>> get_block_header_batch(const vector<uint32_t> block_nums) const;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Retrieve a full, signed block
|
* @brief Retrieve a full, signed block
|
||||||
* @param block_num Height of the block to be returned
|
* @param block_num Height of the block to be returned
|
||||||
* @return the referenced block, or null if no matching block was found
|
* @return the referenced block, or null if no matching block was found
|
||||||
*/
|
*/
|
||||||
optional<signed_block> get_block(uint32_t block_num)const;
|
optional<signed_block> get_block(uint32_t block_num) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Retrieve a full, signed block, with some extra info
|
||||||
|
* @param block_num Height of the block to be returned
|
||||||
|
* @return the referenced block, or null if no matching block was found
|
||||||
|
*/
|
||||||
|
optional<signed_block_with_info> get_block2(uint32_t block_num) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Retrieve a list of signed blocks
|
||||||
|
* @param block_num_from start
|
||||||
|
* @param block_num_to end
|
||||||
|
* @return list of referenced blocks
|
||||||
|
*/
|
||||||
|
vector<optional<signed_block>> get_blocks(uint32_t block_num_from, uint32_t block_num_to) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief used to fetch an individual transaction.
|
* @brief used to fetch an individual transaction.
|
||||||
*/
|
*/
|
||||||
processed_transaction get_transaction( uint32_t block_num, uint32_t trx_in_block )const;
|
processed_transaction get_transaction(uint32_t block_num, uint32_t trx_in_block) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If the transaction has not expired, this method will return the transaction for the given ID or
|
* If the transaction has not expired, this method will return the transaction for the given ID or
|
||||||
* it will return NULL if it is not known. Just because it is not known does not mean it wasn't
|
* it will return NULL if it is not known. Just because it is not known does not mean it wasn't
|
||||||
* included in the blockchain.
|
* included in the blockchain.
|
||||||
*/
|
*/
|
||||||
optional<signed_transaction> get_recent_transaction_by_id( const transaction_id_type& id )const;
|
optional<signed_transaction> get_recent_transaction_by_id(const transaction_id_type &id) const;
|
||||||
|
|
||||||
/////////////
|
/////////////
|
||||||
// Globals //
|
// Globals //
|
||||||
/////////////
|
/////////////
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Retrieve the @ref version_info associated with the witness node
|
||||||
|
*/
|
||||||
|
version_info get_version_info() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Retrieve the @ref chain_property_object associated with the chain
|
* @brief Retrieve the @ref chain_property_object associated with the chain
|
||||||
*/
|
*/
|
||||||
chain_property_object get_chain_properties()const;
|
chain_property_object get_chain_properties() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Retrieve the current @ref global_property_object
|
* @brief Retrieve the current @ref global_property_object
|
||||||
*/
|
*/
|
||||||
global_property_object get_global_properties()const;
|
global_property_object get_global_properties() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Retrieve compile-time constants
|
* @brief Retrieve compile-time constants
|
||||||
*/
|
*/
|
||||||
fc::variant_object get_config()const;
|
fc::variant_object get_config() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the chain ID
|
* @brief Get the chain ID
|
||||||
*/
|
*/
|
||||||
chain_id_type get_chain_id()const;
|
chain_id_type get_chain_id() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Retrieve the current @ref dynamic_global_property_object
|
* @brief Retrieve the current @ref dynamic_global_property_object
|
||||||
*/
|
*/
|
||||||
dynamic_global_property_object get_dynamic_global_properties()const;
|
dynamic_global_property_object get_dynamic_global_properties() const;
|
||||||
|
|
||||||
//////////
|
//////////
|
||||||
// Keys //
|
// Keys //
|
||||||
//////////
|
//////////
|
||||||
|
|
||||||
vector<vector<account_id_type>> get_key_references( vector<public_key_type> key )const;
|
vector<vector<account_id_type>> get_key_references(vector<public_key_type> key) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine whether a textual representation of a public key
|
* Determine whether a textual representation of a public key
|
||||||
|
|
@ -265,7 +297,7 @@ class database_api
|
||||||
* @return Account ID
|
* @return Account ID
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
account_id_type get_account_id_from_string(const std::string& name_or_id)const;
|
account_id_type get_account_id_from_string(const std::string &name_or_id) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get a list of accounts by ID or Name
|
* @brief Get a list of accounts by ID or Name
|
||||||
|
|
@ -274,7 +306,7 @@ class database_api
|
||||||
*
|
*
|
||||||
* This function has semantics identical to @ref get_objects
|
* This function has semantics identical to @ref get_objects
|
||||||
*/
|
*/
|
||||||
vector<optional<account_object>> get_accounts(const vector<std::string>& account_names_or_ids)const;
|
vector<optional<account_object>> get_accounts(const vector<std::string> &account_names_or_ids) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Fetch all objects relevant to the specified accounts and subscribe to updates
|
* @brief Fetch all objects relevant to the specified accounts and subscribe to updates
|
||||||
|
|
@ -287,14 +319,14 @@ class database_api
|
||||||
* ignored. All other accounts will be retrieved and subscribed.
|
* ignored. All other accounts will be retrieved and subscribed.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
std::map<string,full_account> get_full_accounts( const vector<string>& names_or_ids, bool subscribe );
|
std::map<string, full_account> get_full_accounts(const vector<string> &names_or_ids, bool subscribe);
|
||||||
|
|
||||||
optional<account_object> get_account_by_name( string name )const;
|
optional<account_object> get_account_by_name(string name) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return all accounts that referr to the key or account id in their owner or active authorities.
|
* @return all accounts that referr to the key or account id in their owner or active authorities.
|
||||||
*/
|
*/
|
||||||
vector<account_id_type> get_account_references( const std::string account_name_or_id )const;
|
vector<account_id_type> get_account_references(const std::string account_name_or_id) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get a list of accounts by name
|
* @brief Get a list of accounts by name
|
||||||
|
|
@ -303,7 +335,7 @@ class database_api
|
||||||
*
|
*
|
||||||
* This function has semantics identical to @ref get_objects
|
* This function has semantics identical to @ref get_objects
|
||||||
*/
|
*/
|
||||||
vector<optional<account_object>> lookup_account_names(const vector<string>& account_names)const;
|
vector<optional<account_object>> lookup_account_names(const vector<string> &account_names) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get names and IDs for registered accounts
|
* @brief Get names and IDs for registered accounts
|
||||||
|
|
@ -311,7 +343,7 @@ class database_api
|
||||||
* @param limit Maximum number of results to return -- must not exceed 1000
|
* @param limit Maximum number of results to return -- must not exceed 1000
|
||||||
* @return Map of account names to corresponding IDs
|
* @return Map of account names to corresponding IDs
|
||||||
*/
|
*/
|
||||||
map<string,account_id_type> lookup_accounts(const string& lower_bound_name, uint32_t limit)const;
|
map<string, account_id_type> lookup_accounts(const string &lower_bound_name, uint32_t limit) const;
|
||||||
|
|
||||||
//////////////
|
//////////////
|
||||||
// Balances //
|
// Balances //
|
||||||
|
|
@ -323,23 +355,23 @@ class database_api
|
||||||
* @param assets IDs of the assets to get balances of; if empty, get all assets account has a balance in
|
* @param assets IDs of the assets to get balances of; if empty, get all assets account has a balance in
|
||||||
* @return Balances of the account
|
* @return Balances of the account
|
||||||
*/
|
*/
|
||||||
vector<asset> get_account_balances( const std::string& account_name_or_id,
|
vector<asset> get_account_balances(const std::string &account_name_or_id,
|
||||||
const flat_set<asset_id_type>& assets )const;
|
const flat_set<asset_id_type> &assets) const;
|
||||||
|
|
||||||
/// Semantically equivalent to @ref get_account_balances, but takes a name instead of an ID.
|
/// Semantically equivalent to @ref get_account_balances, but takes a name instead of an ID.
|
||||||
vector<asset> get_named_account_balances(const std::string& name, const flat_set<asset_id_type>& assets)const;
|
vector<asset> get_named_account_balances(const std::string &name, const flat_set<asset_id_type> &assets) const;
|
||||||
|
|
||||||
/** @return all unclaimed balance objects for a set of addresses */
|
/** @return all unclaimed balance objects for a set of addresses */
|
||||||
vector<balance_object> get_balance_objects( const vector<address>& addrs )const;
|
vector<balance_object> get_balance_objects(const vector<address> &addrs) const;
|
||||||
|
|
||||||
vector<asset> get_vested_balances( const vector<balance_id_type>& objs )const;
|
vector<asset> get_vested_balances(const vector<balance_id_type> &objs) const;
|
||||||
|
|
||||||
vector<vesting_balance_object> get_vesting_balances( const std::string account_id_or_name )const;
|
vector<vesting_balance_object> get_vesting_balances(const std::string account_id_or_name) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the total number of accounts registered with the blockchain
|
* @brief Get the total number of accounts registered with the blockchain
|
||||||
*/
|
*/
|
||||||
uint64_t get_account_count()const;
|
uint64_t get_account_count() const;
|
||||||
|
|
||||||
////////////
|
////////////
|
||||||
// Assets //
|
// Assets //
|
||||||
|
|
@ -350,7 +382,7 @@ class database_api
|
||||||
* @param symbol_or_id symbol name or ID of the asset
|
* @param symbol_or_id symbol name or ID of the asset
|
||||||
* @return asset ID
|
* @return asset ID
|
||||||
*/
|
*/
|
||||||
asset_id_type get_asset_id_from_string(const std::string& symbol_or_id) const;
|
asset_id_type get_asset_id_from_string(const std::string &symbol_or_id) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get a list of assets by ID
|
* @brief Get a list of assets by ID
|
||||||
|
|
@ -359,7 +391,7 @@ class database_api
|
||||||
*
|
*
|
||||||
* This function has semantics identical to @ref get_objects
|
* This function has semantics identical to @ref get_objects
|
||||||
*/
|
*/
|
||||||
vector<optional<asset_object>> get_assets(const vector<std::string>& asset_symbols_or_ids)const;
|
vector<optional<asset_object>> get_assets(const vector<std::string> &asset_symbols_or_ids) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get assets alphabetically by symbol name
|
* @brief Get assets alphabetically by symbol name
|
||||||
|
|
@ -367,7 +399,7 @@ class database_api
|
||||||
* @param limit Maximum number of assets to fetch (must not exceed 100)
|
* @param limit Maximum number of assets to fetch (must not exceed 100)
|
||||||
* @return The assets found
|
* @return The assets found
|
||||||
*/
|
*/
|
||||||
vector<asset_object> list_assets(const string& lower_bound_symbol, uint32_t limit)const;
|
vector<asset_object> list_assets(const string &lower_bound_symbol, uint32_t limit) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get a list of assets by symbol
|
* @brief Get a list of assets by symbol
|
||||||
|
|
@ -376,13 +408,13 @@ class database_api
|
||||||
*
|
*
|
||||||
* This function has semantics identical to @ref get_objects
|
* This function has semantics identical to @ref get_objects
|
||||||
*/
|
*/
|
||||||
vector<optional<asset_object>> lookup_asset_symbols(const vector<string>& symbols_or_ids)const;
|
vector<optional<asset_object>> lookup_asset_symbols(const vector<string> &symbols_or_ids) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get assets count
|
* @brief Get assets count
|
||||||
* @return The assets count
|
* @return The assets count
|
||||||
*/
|
*/
|
||||||
uint64_t get_asset_count()const;
|
uint64_t get_asset_count() const;
|
||||||
|
|
||||||
////////////////////
|
////////////////////
|
||||||
// Lottery Assets //
|
// Lottery Assets //
|
||||||
|
|
@ -391,20 +423,19 @@ class database_api
|
||||||
* @brief Get a list of lottery assets
|
* @brief Get a list of lottery assets
|
||||||
* @return The lottery assets between start and stop ids
|
* @return The lottery assets between start and stop ids
|
||||||
*/
|
*/
|
||||||
vector<asset_object> get_lotteries( asset_id_type stop = asset_id_type(),
|
vector<asset_object> get_lotteries(asset_id_type stop = asset_id_type(),
|
||||||
unsigned limit = 100,
|
unsigned limit = 100,
|
||||||
asset_id_type start = asset_id_type() )const;
|
asset_id_type start = asset_id_type()) const;
|
||||||
vector<asset_object> get_account_lotteries( account_id_type issuer,
|
vector<asset_object> get_account_lotteries(account_id_type issuer,
|
||||||
asset_id_type stop,
|
asset_id_type stop,
|
||||||
unsigned limit,
|
unsigned limit,
|
||||||
asset_id_type start )const;
|
asset_id_type start) const;
|
||||||
sweeps_vesting_balance_object get_sweeps_vesting_balance_object( account_id_type account )const;
|
sweeps_vesting_balance_object get_sweeps_vesting_balance_object(account_id_type account) const;
|
||||||
asset get_sweeps_vesting_balance_available_for_claim( account_id_type account )const;
|
asset get_sweeps_vesting_balance_available_for_claim(account_id_type account) const;
|
||||||
/**
|
/**
|
||||||
* @brief Get balance of lottery assets
|
* @brief Get balance of lottery assets
|
||||||
*/
|
*/
|
||||||
asset get_lottery_balance( asset_id_type lottery_id ) const;
|
asset get_lottery_balance(asset_id_type lottery_id) const;
|
||||||
|
|
||||||
|
|
||||||
/////////////////////
|
/////////////////////
|
||||||
// Peerplays //
|
// Peerplays //
|
||||||
|
|
@ -461,7 +492,7 @@ class database_api
|
||||||
* @param limit Maximum number of orders to retrieve
|
* @param limit Maximum number of orders to retrieve
|
||||||
* @return The limit orders, ordered from least price to greatest
|
* @return The limit orders, ordered from least price to greatest
|
||||||
*/
|
*/
|
||||||
vector<limit_order_object> get_limit_orders(const std::string& a, const std::string& b, uint32_t limit)const;
|
vector<limit_order_object> get_limit_orders(const std::string &a, const std::string &b, uint32_t limit) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get call orders in a given asset
|
* @brief Get call orders in a given asset
|
||||||
|
|
@ -469,7 +500,7 @@ class database_api
|
||||||
* @param limit Maximum number of orders to retrieve
|
* @param limit Maximum number of orders to retrieve
|
||||||
* @return The call orders, ordered from earliest to be called to latest
|
* @return The call orders, ordered from earliest to be called to latest
|
||||||
*/
|
*/
|
||||||
vector<call_order_object> get_call_orders(const std::string& a, uint32_t limit)const;
|
vector<call_order_object> get_call_orders(const std::string &a, uint32_t limit) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get forced settlement orders in a given asset
|
* @brief Get forced settlement orders in a given asset
|
||||||
|
|
@ -477,12 +508,12 @@ class database_api
|
||||||
* @param limit Maximum number of orders to retrieve
|
* @param limit Maximum number of orders to retrieve
|
||||||
* @return The settle orders, ordered from earliest settlement date to latest
|
* @return The settle orders, ordered from earliest settlement date to latest
|
||||||
*/
|
*/
|
||||||
vector<force_settlement_object> get_settle_orders(const std::string& a, uint32_t limit)const;
|
vector<force_settlement_object> get_settle_orders(const std::string &a, uint32_t limit) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return all open margin positions for a given account id.
|
* @return all open margin positions for a given account id.
|
||||||
*/
|
*/
|
||||||
vector<call_order_object> get_margin_positions( const std::string account_id_or_name )const;
|
vector<call_order_object> get_margin_positions(const std::string account_id_or_name) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Request notification when the active orders in the market between two assets changes
|
* @brief Request notification when the active orders in the market between two assets changes
|
||||||
|
|
@ -493,15 +524,15 @@ class database_api
|
||||||
* Callback will be passed a variant containing a vector<pair<operation, operation_result>>. The vector will
|
* Callback will be passed a variant containing a vector<pair<operation, operation_result>>. The vector will
|
||||||
* contain, in order, the operations which changed the market, and their results.
|
* contain, in order, the operations which changed the market, and their results.
|
||||||
*/
|
*/
|
||||||
void subscribe_to_market(std::function<void(const variant&)> callback,
|
void subscribe_to_market(std::function<void(const variant &)> callback,
|
||||||
const std::string& a, const std::string& b);
|
const std::string &a, const std::string &b);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Unsubscribe from updates to a given market
|
* @brief Unsubscribe from updates to a given market
|
||||||
* @param a First asset ID or name
|
* @param a First asset ID or name
|
||||||
* @param b Second asset ID or name
|
* @param b Second asset ID or name
|
||||||
*/
|
*/
|
||||||
void unsubscribe_from_market( const std::string& a, const std::string& b );
|
void unsubscribe_from_market(const std::string &a, const std::string &b);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Returns the ticker for the market assetA:assetB
|
* @brief Returns the ticker for the market assetA:assetB
|
||||||
|
|
@ -509,7 +540,7 @@ class database_api
|
||||||
* @param b String name of the second asset
|
* @param b String name of the second asset
|
||||||
* @return The market ticker for the past 24 hours.
|
* @return The market ticker for the past 24 hours.
|
||||||
*/
|
*/
|
||||||
market_ticker get_ticker( const string& base, const string& quote )const;
|
market_ticker get_ticker(const string &base, const string "e) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Returns the 24 hour volume for the market assetA:assetB
|
* @brief Returns the 24 hour volume for the market assetA:assetB
|
||||||
|
|
@ -517,7 +548,7 @@ class database_api
|
||||||
* @param b String name of the second asset
|
* @param b String name of the second asset
|
||||||
* @return The market volume over the past 24 hours
|
* @return The market volume over the past 24 hours
|
||||||
*/
|
*/
|
||||||
market_volume get_24_volume( const string& base, const string& quote )const;
|
market_volume get_24_volume(const string &base, const string "e) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Returns the order book for the market base:quote
|
* @brief Returns the order book for the market base:quote
|
||||||
|
|
@ -526,7 +557,7 @@ class database_api
|
||||||
* @param depth of the order book. Up to depth of each asks and bids, capped at 50. Prioritizes most moderate of each
|
* @param depth of the order book. Up to depth of each asks and bids, capped at 50. Prioritizes most moderate of each
|
||||||
* @return Order book of the market
|
* @return Order book of the market
|
||||||
*/
|
*/
|
||||||
order_book get_order_book( const string& base, const string& quote, unsigned limit = 50 )const;
|
order_book get_order_book(const string &base, const string "e, unsigned limit = 50) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Returns recent trades for the market assetA:assetB
|
* @brief Returns recent trades for the market assetA:assetB
|
||||||
|
|
@ -538,9 +569,7 @@ class database_api
|
||||||
* @param start Start time as a UNIX timestamp
|
* @param start Start time as a UNIX timestamp
|
||||||
* @return Recent transactions in the market
|
* @return Recent transactions in the market
|
||||||
*/
|
*/
|
||||||
vector<market_trade> get_trade_history( const string& base, const string& quote, fc::time_point_sec start, fc::time_point_sec stop, unsigned limit = 100 )const;
|
vector<market_trade> get_trade_history(const string &base, const string "e, fc::time_point_sec start, fc::time_point_sec stop, unsigned limit = 100) const;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
///////////////
|
///////////////
|
||||||
// Witnesses //
|
// Witnesses //
|
||||||
|
|
@ -553,14 +582,21 @@ class database_api
|
||||||
*
|
*
|
||||||
* This function has semantics identical to @ref get_objects
|
* This function has semantics identical to @ref get_objects
|
||||||
*/
|
*/
|
||||||
vector<optional<witness_object>> get_witnesses(const vector<witness_id_type>& witness_ids)const;
|
vector<optional<witness_object>> get_witnesses(const vector<witness_id_type> &witness_ids) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the witness owned by a given account
|
* @brief Get the witness owned by a given account
|
||||||
* @param account The ID of the account whose witness should be retrieved
|
* @param account The ID of the account whose witness should be retrieved
|
||||||
* @return The witness object, or null if the account does not have a witness
|
* @return The witness object, or null if the account does not have a witness
|
||||||
*/
|
*/
|
||||||
fc::optional<witness_object> get_witness_by_account(const std::string account_name_or_id)const;
|
fc::optional<witness_object> get_witness_by_account_id(account_id_type account) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get the witness owned by a given account
|
||||||
|
* @param account_id_or_name The ID or name of the account whose witness should be retrieved
|
||||||
|
* @return The witness object, or null if the account does not have a witness
|
||||||
|
*/
|
||||||
|
fc::optional<witness_object> get_witness_by_account(const std::string account_name_or_id) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get names and IDs for registered witnesses
|
* @brief Get names and IDs for registered witnesses
|
||||||
|
|
@ -568,12 +604,12 @@ class database_api
|
||||||
* @param limit Maximum number of results to return -- must not exceed 1000
|
* @param limit Maximum number of results to return -- must not exceed 1000
|
||||||
* @return Map of witness names to corresponding IDs
|
* @return Map of witness names to corresponding IDs
|
||||||
*/
|
*/
|
||||||
map<string, witness_id_type> lookup_witness_accounts(const string& lower_bound_name, uint32_t limit)const;
|
map<string, witness_id_type> lookup_witness_accounts(const string &lower_bound_name, uint32_t limit) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the total number of witnesses registered with the blockchain
|
* @brief Get the total number of witnesses registered with the blockchain
|
||||||
*/
|
*/
|
||||||
uint64_t get_witness_count()const;
|
uint64_t get_witness_count() const;
|
||||||
|
|
||||||
///////////////////////
|
///////////////////////
|
||||||
// Committee members //
|
// Committee members //
|
||||||
|
|
@ -586,14 +622,21 @@ class database_api
|
||||||
*
|
*
|
||||||
* This function has semantics identical to @ref get_objects
|
* This function has semantics identical to @ref get_objects
|
||||||
*/
|
*/
|
||||||
vector<optional<committee_member_object>> get_committee_members(const vector<committee_member_id_type>& committee_member_ids)const;
|
vector<optional<committee_member_object>> get_committee_members(const vector<committee_member_id_type> &committee_member_ids) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get the committee_member owned by a given account
|
||||||
|
* @param account The ID of the account whose committee_member should be retrieved
|
||||||
|
* @return The committee_member object, or null if the account does not have a committee_member
|
||||||
|
*/
|
||||||
|
fc::optional<committee_member_object> get_committee_member_by_account_id(account_id_type account) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the committee_member owned by a given account
|
* @brief Get the committee_member owned by a given account
|
||||||
* @param account_id_or_name The ID or name of the account whose committee_member should be retrieved
|
* @param account_id_or_name The ID or name of the account whose committee_member should be retrieved
|
||||||
* @return The committee_member object, or null if the account does not have a committee_member
|
* @return The committee_member object, or null if the account does not have a committee_member
|
||||||
*/
|
*/
|
||||||
fc::optional<committee_member_object> get_committee_member_by_account(const std::string account_id_or_name)const;
|
fc::optional<committee_member_object> get_committee_member_by_account(const std::string account_id_or_name) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get names and IDs for registered committee_members
|
* @brief Get names and IDs for registered committee_members
|
||||||
|
|
@ -601,7 +644,12 @@ class database_api
|
||||||
* @param limit Maximum number of results to return -- must not exceed 1000
|
* @param limit Maximum number of results to return -- must not exceed 1000
|
||||||
* @return Map of committee_member names to corresponding IDs
|
* @return Map of committee_member names to corresponding IDs
|
||||||
*/
|
*/
|
||||||
map<string, committee_member_id_type> lookup_committee_member_accounts(const string& lower_bound_name, uint32_t limit)const;
|
map<string, committee_member_id_type> lookup_committee_member_accounts(const string &lower_bound_name, uint32_t limit) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get the total number of committee_members registered with the blockchain
|
||||||
|
*/
|
||||||
|
uint64_t get_committee_member_count() const;
|
||||||
|
|
||||||
/////////////////
|
/////////////////
|
||||||
// SON members //
|
// SON members //
|
||||||
|
|
@ -614,14 +662,21 @@ class database_api
|
||||||
*
|
*
|
||||||
* This function has semantics identical to @ref get_objects
|
* This function has semantics identical to @ref get_objects
|
||||||
*/
|
*/
|
||||||
vector<optional<son_object>> get_sons(const vector<son_id_type>& son_ids)const;
|
vector<optional<son_object>> get_sons(const vector<son_id_type> &son_ids) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the SON owned by a given account
|
* @brief Get the SON owned by a given account
|
||||||
* @param account The ID of the account whose SON should be retrieved
|
* @param account The ID of the account whose SON should be retrieved
|
||||||
* @return The SON object, or null if the account does not have a SON
|
* @return The SON object, or null if the account does not have a SON
|
||||||
*/
|
*/
|
||||||
fc::optional<son_object> get_son_by_account(account_id_type account)const;
|
fc::optional<son_object> get_son_by_account_id(account_id_type account) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get the SON owned by a given account
|
||||||
|
* @param account_id_or_name The ID of the account whose SON should be retrieved
|
||||||
|
* @return The SON object, or null if the account does not have a SON
|
||||||
|
*/
|
||||||
|
fc::optional<son_object> get_son_by_account(const std::string account_id_or_name) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get names and IDs for registered SONs
|
* @brief Get names and IDs for registered SONs
|
||||||
|
|
@ -629,12 +684,38 @@ class database_api
|
||||||
* @param limit Maximum number of results to return -- must not exceed 1000
|
* @param limit Maximum number of results to return -- must not exceed 1000
|
||||||
* @return Map of SON names to corresponding IDs
|
* @return Map of SON names to corresponding IDs
|
||||||
*/
|
*/
|
||||||
map<string, son_id_type> lookup_son_accounts(const string& lower_bound_name, uint32_t limit)const;
|
map<string, son_id_type> lookup_son_accounts(const string &lower_bound_name, uint32_t limit) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the total number of SONs registered with the blockchain
|
* @brief Get the total number of SONs registered with the blockchain
|
||||||
*/
|
*/
|
||||||
uint64_t get_son_count()const;
|
uint64_t get_son_count() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get list of active sons
|
||||||
|
* @return List of active SONs
|
||||||
|
*/
|
||||||
|
flat_map<sidechain_type, vector<son_sidechain_info>> get_active_sons();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get list of active sons
|
||||||
|
* @param sidechain Sidechain type [bitcoin|ethereum|hive]
|
||||||
|
* @return List of active SONs
|
||||||
|
*/
|
||||||
|
vector<son_sidechain_info> get_active_sons_by_sidechain(sidechain_type sidechain);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get SON network status
|
||||||
|
* @return SON network status description for a given sidechain type
|
||||||
|
*/
|
||||||
|
map<sidechain_type, map<son_id_type, string>> get_son_network_status();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get SON network status
|
||||||
|
* @param sidechain Sidechain type [bitcoin|ethereum|hive]
|
||||||
|
* @return SON network status description for a given sidechain type
|
||||||
|
*/
|
||||||
|
map<son_id_type, string> get_son_network_status_by_sidechain(sidechain_type sidechain);
|
||||||
|
|
||||||
/////////////////////////
|
/////////////////////////
|
||||||
// SON Wallets //
|
// SON Wallets //
|
||||||
|
|
@ -671,21 +752,21 @@ class database_api
|
||||||
*
|
*
|
||||||
* This function has semantics identical to @ref get_objects
|
* This function has semantics identical to @ref get_objects
|
||||||
*/
|
*/
|
||||||
vector<optional<sidechain_address_object>> get_sidechain_addresses(const vector<sidechain_address_id_type>& sidechain_address_ids)const;
|
vector<optional<sidechain_address_object>> get_sidechain_addresses(const vector<sidechain_address_id_type> &sidechain_address_ids) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the sidechain addresses for a given account
|
* @brief Get the sidechain addresses for a given account
|
||||||
* @param account The ID of the account whose sidechain addresses should be retrieved
|
* @param account The ID of the account whose sidechain addresses should be retrieved
|
||||||
* @return The sidechain addresses objects, or null if the account does not have a sidechain addresses
|
* @return The sidechain addresses objects, or null if the account does not have a sidechain addresses
|
||||||
*/
|
*/
|
||||||
vector<optional<sidechain_address_object>> get_sidechain_addresses_by_account(account_id_type account)const;
|
vector<optional<sidechain_address_object>> get_sidechain_addresses_by_account(account_id_type account) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the sidechain addresses for a given sidechain
|
* @brief Get the sidechain addresses for a given sidechain
|
||||||
* @param sidechain Sidechain for which addresses should be retrieved
|
* @param sidechain Sidechain for which addresses should be retrieved
|
||||||
* @return The sidechain addresses objects, or null if the sidechain does not have any addresses
|
* @return The sidechain addresses objects, or null if the sidechain does not have any addresses
|
||||||
*/
|
*/
|
||||||
vector<optional<sidechain_address_object>> get_sidechain_addresses_by_sidechain(sidechain_type sidechain)const;
|
vector<optional<sidechain_address_object>> get_sidechain_addresses_by_sidechain(sidechain_type sidechain) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the sidechain addresses for a given account and sidechain
|
* @brief Get the sidechain addresses for a given account and sidechain
|
||||||
|
|
@ -693,22 +774,52 @@ class database_api
|
||||||
* @param sidechain Sidechain for which address should be retrieved
|
* @param sidechain Sidechain for which address should be retrieved
|
||||||
* @return The sidechain addresses objects, or null if the account does not have a sidechain addresses for a given sidechain
|
* @return The sidechain addresses objects, or null if the account does not have a sidechain addresses for a given sidechain
|
||||||
*/
|
*/
|
||||||
fc::optional<sidechain_address_object> get_sidechain_address_by_account_and_sidechain(account_id_type account, sidechain_type sidechain)const;
|
fc::optional<sidechain_address_object> get_sidechain_address_by_account_and_sidechain(account_id_type account, sidechain_type sidechain) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the total number of sidechain addresses registered with the blockchain
|
* @brief Get the total number of sidechain addresses registered with the blockchain
|
||||||
*/
|
*/
|
||||||
uint64_t get_sidechain_addresses_count()const;
|
uint64_t get_sidechain_addresses_count() const;
|
||||||
|
|
||||||
/// WORKERS
|
/////////////
|
||||||
|
// Workers //
|
||||||
|
/////////////
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get a list of workers by ID
|
||||||
|
* @param worker_ids IDs of the workers to retrieve
|
||||||
|
* @return The workers corresponding to the provided IDs
|
||||||
|
*
|
||||||
|
* This function has semantics identical to @ref get_objects
|
||||||
|
*/
|
||||||
|
vector<optional<worker_object>> get_workers(const vector<worker_id_type> &worker_ids) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Return the worker objects associated with this account.
|
* @brief Return the worker objects associated with this account.
|
||||||
* @param account_id_or_name The ID or name of the account whose worker should be retrieved
|
* @param account The ID of the account whose workers should be retrieved
|
||||||
* @return The worker object or null if the account does not have a worker
|
* @return The worker object or null if the account does not have a worker
|
||||||
*/
|
*/
|
||||||
vector<worker_object> get_workers_by_account(const std::string account_id_or_name)const;
|
vector<worker_object> get_workers_by_account_id(account_id_type account) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Return the worker objects associated with this account.
|
||||||
|
* @param account_id_or_name The ID or name of the account whose workers should be retrieved
|
||||||
|
* @return The worker object or null if the account does not have a worker
|
||||||
|
*/
|
||||||
|
vector<worker_object> get_workers_by_account(const std::string account_id_or_name) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get names and IDs for registered workers
|
||||||
|
* @param lower_bound_name Lower bound of the first name to return
|
||||||
|
* @param limit Maximum number of results to return -- must not exceed 1000
|
||||||
|
* @return Map of worker names to corresponding IDs
|
||||||
|
*/
|
||||||
|
map<string, worker_id_type> lookup_worker_accounts(const string &lower_bound_name, uint32_t limit) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get the total number of workers registered with the blockchain
|
||||||
|
*/
|
||||||
|
uint64_t get_worker_count() const;
|
||||||
|
|
||||||
///////////
|
///////////
|
||||||
// Votes //
|
// Votes //
|
||||||
|
|
@ -722,49 +833,82 @@ class database_api
|
||||||
* The results will be in the same order as the votes. Null will be returned for
|
* The results will be in the same order as the votes. Null will be returned for
|
||||||
* any vote ids that are not found.
|
* any vote ids that are not found.
|
||||||
*/
|
*/
|
||||||
vector<variant> lookup_vote_ids( const vector<vote_id_type>& votes )const;
|
vector<variant> lookup_vote_ids(const vector<vote_id_type> &votes) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get a list of vote_id_type that ID votes for
|
||||||
|
* @param account_name_or_id ID or name of the account to get votes for
|
||||||
|
* @return The list of vote_id_type ID votes for
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
vector<vote_id_type> get_votes_ids(const string &account_name_or_id) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Return the objects account_name_or_id votes for
|
||||||
|
* @param account_name_or_id ID or name of the account to get votes for
|
||||||
|
* @return The votes_info account_name_or_id votes for
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
votes_info get_votes(const string &account_name_or_id) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @brief Get a list of accounts that votes for vote_id
|
||||||
|
* @param vote_id We search accounts that vote for this ID
|
||||||
|
* @return The accounts that votes for provided ID
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
vector<account_object> get_voters_by_id(const vote_id_type &vote_id) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Return the accounts that votes for account_name_or_id
|
||||||
|
* @param account_name_or_id ID or name of the account to get voters for
|
||||||
|
* @return The voters_info for account_name_or_id
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
voters_info get_voters(const string &account_name_or_id) const;
|
||||||
|
|
||||||
////////////////////////////
|
////////////////////////////
|
||||||
// Authority / validation //
|
// Authority / validation //
|
||||||
////////////////////////////
|
////////////////////////////
|
||||||
|
|
||||||
/// @brief Get a hexdump of the serialized binary form of a transaction
|
/// @brief Get a hexdump of the serialized binary form of a transaction
|
||||||
std::string get_transaction_hex(const signed_transaction& trx)const;
|
std::string get_transaction_hex(const signed_transaction &trx) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This API will take a partially signed transaction and a set of public keys that the owner has the ability to sign for
|
* This API will take a partially signed transaction and a set of public keys that the owner has the ability to sign for
|
||||||
* and return the minimal subset of public keys that should add signatures to the transaction.
|
* and return the minimal subset of public keys that should add signatures to the transaction.
|
||||||
*/
|
*/
|
||||||
set<public_key_type> get_required_signatures( const signed_transaction& trx, const flat_set<public_key_type>& available_keys )const;
|
set<public_key_type> get_required_signatures(const signed_transaction &trx, const flat_set<public_key_type> &available_keys) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method will return the set of all public keys that could possibly sign for a given transaction. This call can
|
* This method will return the set of all public keys that could possibly sign for a given transaction. This call can
|
||||||
* be used by wallets to filter their set of public keys to just the relevant subset prior to calling @ref get_required_signatures
|
* be used by wallets to filter their set of public keys to just the relevant subset prior to calling @ref get_required_signatures
|
||||||
* to get the minimum subset.
|
* to get the minimum subset.
|
||||||
*/
|
*/
|
||||||
set<public_key_type> get_potential_signatures( const signed_transaction& trx )const;
|
set<public_key_type> get_potential_signatures(const signed_transaction &trx) const;
|
||||||
set<address> get_potential_address_signatures( const signed_transaction& trx )const;
|
set<address> get_potential_address_signatures(const signed_transaction &trx) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return true of the @ref trx has all of the required signatures, otherwise throws an exception
|
* @return true of the @ref trx has all of the required signatures, otherwise throws an exception
|
||||||
*/
|
*/
|
||||||
bool verify_authority( const signed_transaction& trx )const;
|
bool verify_authority(const signed_transaction &trx) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return true if the signers have enough authority to authorize an account
|
* @return true if the signers have enough authority to authorize an account
|
||||||
*/
|
*/
|
||||||
bool verify_account_authority( const string& name_or_id, const flat_set<public_key_type>& signers )const;
|
bool verify_account_authority(const string &name_or_id, const flat_set<public_key_type> &signers) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validates a transaction against the current state without broadcasting it on the network.
|
* Validates a transaction against the current state without broadcasting it on the network.
|
||||||
*/
|
*/
|
||||||
processed_transaction validate_transaction( const signed_transaction& trx )const;
|
processed_transaction validate_transaction(const signed_transaction &trx) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* For each operation calculate the required fee in the specified asset type. If the asset type does
|
* For each operation calculate the required fee in the specified asset type. If the asset type does
|
||||||
* not have a valid core_exchange_rate
|
* not have a valid core_exchange_rate
|
||||||
*/
|
*/
|
||||||
vector< fc::variant > get_required_fees( const vector<operation>& ops, const std::string& asset_id_or_symbol )const;
|
vector<fc::variant> get_required_fees(const vector<operation> &ops, const std::string &asset_id_or_symbol) const;
|
||||||
|
|
||||||
///////////////////////////
|
///////////////////////////
|
||||||
// Proposed transactions //
|
// Proposed transactions //
|
||||||
|
|
@ -773,16 +917,7 @@ class database_api
|
||||||
/**
|
/**
|
||||||
* @return the set of proposed transactions relevant to the specified account id.
|
* @return the set of proposed transactions relevant to the specified account id.
|
||||||
*/
|
*/
|
||||||
vector<proposal_object> get_proposed_transactions( const std::string account_id_or_name )const;
|
vector<proposal_object> get_proposed_transactions(const std::string account_id_or_name) const;
|
||||||
|
|
||||||
//////////////////////
|
|
||||||
// Blinded balances //
|
|
||||||
//////////////////////
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the set of blinded balance objects by commitment ID
|
|
||||||
*/
|
|
||||||
vector<blinded_balance_object> get_blinded_balances( const flat_set<commitment_type>& commitments )const;
|
|
||||||
|
|
||||||
/////////////////
|
/////////////////
|
||||||
// Tournaments //
|
// Tournaments //
|
||||||
|
|
@ -821,10 +956,10 @@ class database_api
|
||||||
* @return account and custom permissions/account-authorities info
|
* @return account and custom permissions/account-authorities info
|
||||||
*/
|
*/
|
||||||
vector<custom_permission_object> get_custom_permissions(const account_id_type account) const;
|
vector<custom_permission_object> get_custom_permissions(const account_id_type account) const;
|
||||||
fc::optional<custom_permission_object> get_custom_permission_by_name(const account_id_type account, const string& permission_name) const;
|
fc::optional<custom_permission_object> get_custom_permission_by_name(const account_id_type account, const string &permission_name) const;
|
||||||
vector<custom_account_authority_object> get_custom_account_authorities(const account_id_type account) const;
|
vector<custom_account_authority_object> get_custom_account_authorities(const account_id_type account) const;
|
||||||
vector<custom_account_authority_object> get_custom_account_authorities_by_permission_id(const custom_permission_id_type permission_id) const;
|
vector<custom_account_authority_object> get_custom_account_authorities_by_permission_id(const custom_permission_id_type permission_id) const;
|
||||||
vector<custom_account_authority_object> get_custom_account_authorities_by_permission_name(const account_id_type account, const string& permission_name) const;
|
vector<custom_account_authority_object> get_custom_account_authorities_by_permission_name(const account_id_type account, const string &permission_name) const;
|
||||||
vector<authority> get_active_custom_account_authorities_by_operation(const account_id_type account, int operation_type) const;
|
vector<authority> get_active_custom_account_authorities_by_operation(const account_id_type account, int operation_type) const;
|
||||||
|
|
||||||
/////////
|
/////////
|
||||||
|
|
@ -908,14 +1043,25 @@ class database_api
|
||||||
* @brief Returns list of all available NTF's
|
* @brief Returns list of all available NTF's
|
||||||
* @return List of all available NFT's
|
* @return List of all available NFT's
|
||||||
*/
|
*/
|
||||||
vector<nft_object> nft_get_all_tokens() const;
|
vector<nft_object> nft_get_all_tokens(const nft_id_type lower_id, uint32_t limit) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Returns NFT's owned by owner
|
* @brief Returns NFT's owned by owner
|
||||||
* @param owner NFT owner
|
* @param owner NFT owner
|
||||||
|
* @param lower_id ID of the first NFT to return
|
||||||
|
* @param limit Maximum number of results to return
|
||||||
* @return List of NFT owned by owner
|
* @return List of NFT owned by owner
|
||||||
*/
|
*/
|
||||||
vector<nft_object> nft_get_tokens_by_owner(const account_id_type owner) const;
|
vector<nft_object> nft_get_tokens_by_owner(const account_id_type owner, const nft_id_type lower_id, uint32_t limit) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Returns NFT metadata owned by owner
|
||||||
|
* @param owner NFT owner
|
||||||
|
* @param lower_id ID of the first NFT metadata to return
|
||||||
|
* @param limit Maximum number of results to return
|
||||||
|
* @return List of NFT owned by owner
|
||||||
|
*/
|
||||||
|
vector<nft_metadata_object> nft_get_metadata_by_owner(const account_id_type owner, const nft_metadata_id_type lower_id, uint32_t limit) const;
|
||||||
|
|
||||||
//////////////////
|
//////////////////
|
||||||
// MARKET PLACE //
|
// MARKET PLACE //
|
||||||
|
|
@ -935,41 +1081,25 @@ class database_api
|
||||||
//////////////////
|
//////////////////
|
||||||
vector<account_role_object> get_account_roles_by_owner(account_id_type owner) const;
|
vector<account_role_object> get_account_roles_by_owner(account_id_type owner) const;
|
||||||
|
|
||||||
/////////////////////////////
|
private:
|
||||||
// Random number generator //
|
std::shared_ptr<database_api_impl> my;
|
||||||
/////////////////////////////
|
|
||||||
/**
|
|
||||||
* @brief Returns the random number
|
|
||||||
* @param minimum Lower bound of segment containing random number
|
|
||||||
* @param maximum Upper bound of segment containing random number
|
|
||||||
* @param selections Number of random numbers to return
|
|
||||||
* @param duplicates Allow duplicated numbers
|
|
||||||
* @return Vector containing random numbers from segment [minimum, maximum)
|
|
||||||
*/
|
|
||||||
vector<uint64_t> get_random_number_ex(uint64_t minimum, uint64_t maximum, uint64_t selections, bool duplicates) const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Returns the random number
|
|
||||||
* @param bound Upper bound of segment containing random number
|
|
||||||
* @return Random number from segment [0, bound)
|
|
||||||
*/
|
|
||||||
uint64_t get_random_number(uint64_t bound) const;
|
|
||||||
|
|
||||||
private:
|
|
||||||
std::shared_ptr< database_api_impl > my;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} }
|
}} // namespace graphene::app
|
||||||
|
|
||||||
extern template class fc::api<graphene::app::database_api>;
|
extern template class fc::api<graphene::app::database_api>;
|
||||||
|
|
||||||
FC_REFLECT( graphene::app::order, (price)(quote)(base) );
|
// clang-format off
|
||||||
FC_REFLECT( graphene::app::order_book, (base)(quote)(bids)(asks) );
|
|
||||||
FC_REFLECT( graphene::app::market_ticker, (base)(quote)(latest)(lowest_ask)(highest_bid)(percent_change)(base_volume)(quote_volume) );
|
|
||||||
FC_REFLECT( graphene::app::market_volume, (base)(quote)(base_volume)(quote_volume) );
|
|
||||||
FC_REFLECT( graphene::app::market_trade, (date)(price)(amount)(value) );
|
|
||||||
FC_REFLECT( graphene::app::gpos_info, (vesting_factor)(award)(total_amount)(current_subperiod)(last_voted_time)(allowed_withdraw_amount)(account_vested_balance) );
|
|
||||||
|
|
||||||
|
FC_REFLECT_DERIVED(graphene::app::signed_block_with_info, (graphene::chain::signed_block), (block_id)(signing_key)(transaction_ids));
|
||||||
|
|
||||||
|
FC_REFLECT(graphene::app::order, (price)(quote)(base));
|
||||||
|
FC_REFLECT(graphene::app::order_book, (base)(quote)(bids)(asks));
|
||||||
|
FC_REFLECT(graphene::app::market_ticker, (base)(quote)(latest)(lowest_ask)(highest_bid)(percent_change)(base_volume)(quote_volume));
|
||||||
|
FC_REFLECT(graphene::app::market_volume, (base)(quote)(base_volume)(quote_volume));
|
||||||
|
FC_REFLECT(graphene::app::market_trade, (date)(price)(amount)(value));
|
||||||
|
FC_REFLECT(graphene::app::gpos_info, (vesting_factor)(award)(total_amount)(current_subperiod)(last_voted_time)(allowed_withdraw_amount)(account_vested_balance));
|
||||||
|
FC_REFLECT(graphene::app::version_info, (version)(git_revision)(built)(openssl)(boost));
|
||||||
|
|
||||||
FC_API(graphene::app::database_api,
|
FC_API(graphene::app::database_api,
|
||||||
// Objects
|
// Objects
|
||||||
|
|
@ -985,10 +1115,13 @@ FC_API(graphene::app::database_api,
|
||||||
(get_block_header)
|
(get_block_header)
|
||||||
(get_block_header_batch)
|
(get_block_header_batch)
|
||||||
(get_block)
|
(get_block)
|
||||||
|
(get_block2)
|
||||||
|
(get_blocks)
|
||||||
(get_transaction)
|
(get_transaction)
|
||||||
(get_recent_transaction_by_id)
|
(get_recent_transaction_by_id)
|
||||||
|
|
||||||
// Globals
|
// Globals
|
||||||
|
(get_version_info)
|
||||||
(get_chain_properties)
|
(get_chain_properties)
|
||||||
(get_global_properties)
|
(get_global_properties)
|
||||||
(get_config)
|
(get_config)
|
||||||
|
|
@ -1054,20 +1187,28 @@ FC_API(graphene::app::database_api,
|
||||||
|
|
||||||
// Witnesses
|
// Witnesses
|
||||||
(get_witnesses)
|
(get_witnesses)
|
||||||
|
(get_witness_by_account_id)
|
||||||
(get_witness_by_account)
|
(get_witness_by_account)
|
||||||
(lookup_witness_accounts)
|
(lookup_witness_accounts)
|
||||||
(get_witness_count)
|
(get_witness_count)
|
||||||
|
|
||||||
// Committee members
|
// Committee members
|
||||||
(get_committee_members)
|
(get_committee_members)
|
||||||
|
(get_committee_member_by_account_id)
|
||||||
(get_committee_member_by_account)
|
(get_committee_member_by_account)
|
||||||
(lookup_committee_member_accounts)
|
(lookup_committee_member_accounts)
|
||||||
|
(get_committee_member_count)
|
||||||
|
|
||||||
// SON members
|
// SON members
|
||||||
(get_sons)
|
(get_sons)
|
||||||
|
(get_son_by_account_id)
|
||||||
(get_son_by_account)
|
(get_son_by_account)
|
||||||
(lookup_son_accounts)
|
(lookup_son_accounts)
|
||||||
(get_son_count)
|
(get_son_count)
|
||||||
|
(get_active_sons)
|
||||||
|
(get_active_sons_by_sidechain)
|
||||||
|
(get_son_network_status)
|
||||||
|
(get_son_network_status_by_sidechain)
|
||||||
|
|
||||||
// SON wallets
|
// SON wallets
|
||||||
(get_active_son_wallet)
|
(get_active_son_wallet)
|
||||||
|
|
@ -1081,10 +1222,19 @@ FC_API(graphene::app::database_api,
|
||||||
(get_sidechain_address_by_account_and_sidechain)
|
(get_sidechain_address_by_account_and_sidechain)
|
||||||
(get_sidechain_addresses_count)
|
(get_sidechain_addresses_count)
|
||||||
|
|
||||||
// workers
|
// Workers
|
||||||
|
(get_workers)
|
||||||
|
(get_workers_by_account_id)
|
||||||
(get_workers_by_account)
|
(get_workers_by_account)
|
||||||
|
(lookup_worker_accounts)
|
||||||
|
(get_worker_count)
|
||||||
|
|
||||||
// Votes
|
// Votes
|
||||||
(lookup_vote_ids)
|
(lookup_vote_ids)
|
||||||
|
(get_votes_ids)
|
||||||
|
(get_votes)
|
||||||
|
(get_voters_by_id)
|
||||||
|
(get_voters)
|
||||||
|
|
||||||
// Authority / validation
|
// Authority / validation
|
||||||
(get_transaction_hex)
|
(get_transaction_hex)
|
||||||
|
|
@ -1099,9 +1249,6 @@ FC_API(graphene::app::database_api,
|
||||||
// Proposed transactions
|
// Proposed transactions
|
||||||
(get_proposed_transactions)
|
(get_proposed_transactions)
|
||||||
|
|
||||||
// Blinded balances
|
|
||||||
(get_blinded_balances)
|
|
||||||
|
|
||||||
// Tournaments
|
// Tournaments
|
||||||
(get_tournaments_in_state)
|
(get_tournaments_in_state)
|
||||||
(get_tournaments_by_state)
|
(get_tournaments_by_state)
|
||||||
|
|
@ -1132,6 +1279,7 @@ FC_API(graphene::app::database_api,
|
||||||
(nft_token_of_owner_by_index)
|
(nft_token_of_owner_by_index)
|
||||||
(nft_get_all_tokens)
|
(nft_get_all_tokens)
|
||||||
(nft_get_tokens_by_owner)
|
(nft_get_tokens_by_owner)
|
||||||
|
(nft_get_metadata_by_owner)
|
||||||
|
|
||||||
// Marketplace
|
// Marketplace
|
||||||
(list_offers)
|
(list_offers)
|
||||||
|
|
@ -1146,7 +1294,6 @@ FC_API(graphene::app::database_api,
|
||||||
|
|
||||||
// Account Roles
|
// Account Roles
|
||||||
(get_account_roles_by_owner)
|
(get_account_roles_by_owner)
|
||||||
// rngs
|
|
||||||
(get_random_number_ex)
|
|
||||||
(get_random_number)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// clang-format on
|
||||||
|
|
|
||||||
|
|
@ -24,15 +24,14 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <graphene/chain/account_object.hpp>
|
#include <graphene/chain/account_object.hpp>
|
||||||
#include <graphene/chain/vesting_balance_object.hpp>
|
|
||||||
#include <graphene/chain/market_evaluator.hpp>
|
#include <graphene/chain/market_evaluator.hpp>
|
||||||
|
#include <graphene/chain/vesting_balance_object.hpp>
|
||||||
#include <graphene/chain/withdraw_permission_object.hpp>
|
#include <graphene/chain/withdraw_permission_object.hpp>
|
||||||
|
|
||||||
namespace graphene { namespace app {
|
namespace graphene { namespace app {
|
||||||
using namespace graphene::chain;
|
using namespace graphene::chain;
|
||||||
|
|
||||||
struct full_account
|
struct full_account {
|
||||||
{
|
|
||||||
account_object account;
|
account_object account;
|
||||||
account_statistics_object statistics;
|
account_statistics_object statistics;
|
||||||
string registrar_name;
|
string registrar_name;
|
||||||
|
|
@ -48,13 +47,15 @@ namespace graphene { namespace app {
|
||||||
vector<proposal_object> proposals;
|
vector<proposal_object> proposals;
|
||||||
vector<asset_id_type> assets;
|
vector<asset_id_type> assets;
|
||||||
vector<withdraw_permission_object> withdraws;
|
vector<withdraw_permission_object> withdraws;
|
||||||
// vector<pending_dividend_payout_balance_object> pending_dividend_payments;
|
// vector<pending_dividend_payout_balance_object> pending_dividend_payments;
|
||||||
vector<pending_dividend_payout_balance_for_holder_object> pending_dividend_payments;
|
vector<pending_dividend_payout_balance_for_holder_object> pending_dividend_payments;
|
||||||
};
|
};
|
||||||
|
|
||||||
} }
|
}} // namespace graphene::app
|
||||||
|
|
||||||
FC_REFLECT( graphene::app::full_account,
|
// clang-format off
|
||||||
|
|
||||||
|
FC_REFLECT(graphene::app::full_account,
|
||||||
(account)
|
(account)
|
||||||
(statistics)
|
(statistics)
|
||||||
(registrar_name)
|
(registrar_name)
|
||||||
|
|
@ -70,5 +71,6 @@ FC_REFLECT( graphene::app::full_account,
|
||||||
(proposals)
|
(proposals)
|
||||||
(assets)
|
(assets)
|
||||||
(withdraws)
|
(withdraws)
|
||||||
(pending_dividend_payments)
|
(pending_dividend_payments))
|
||||||
)
|
|
||||||
|
// clang-format on
|
||||||
|
|
|
||||||
|
|
@ -30,12 +30,12 @@
|
||||||
|
|
||||||
namespace graphene { namespace app {
|
namespace graphene { namespace app {
|
||||||
|
|
||||||
class abstract_plugin
|
class abstract_plugin {
|
||||||
{
|
public:
|
||||||
public:
|
virtual ~abstract_plugin() {
|
||||||
virtual ~abstract_plugin(){}
|
}
|
||||||
virtual std::string plugin_name()const = 0;
|
virtual std::string plugin_name() const = 0;
|
||||||
virtual std::string plugin_description()const = 0;
|
virtual std::string plugin_description() const = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Perform early startup routines and register plugin indexes, callbacks, etc.
|
* @brief Perform early startup routines and register plugin indexes, callbacks, etc.
|
||||||
|
|
@ -49,7 +49,7 @@ class abstract_plugin
|
||||||
*
|
*
|
||||||
* @param options The options passed to the application, via configuration files or command line
|
* @param options The options passed to the application, via configuration files or command line
|
||||||
*/
|
*/
|
||||||
virtual void plugin_initialize( const boost::program_options::variables_map& options ) = 0;
|
virtual void plugin_initialize(const boost::program_options::variables_map &options) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Begin normal runtime operations
|
* @brief Begin normal runtime operations
|
||||||
|
|
@ -71,7 +71,7 @@ class abstract_plugin
|
||||||
*
|
*
|
||||||
* This is called by the framework to set the application.
|
* This is called by the framework to set the application.
|
||||||
*/
|
*/
|
||||||
virtual void plugin_set_app( application* a ) = 0;
|
virtual void plugin_set_app(application *a) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Fill in command line parameters used by the plugin.
|
* @brief Fill in command line parameters used by the plugin.
|
||||||
|
|
@ -84,64 +84,65 @@ class abstract_plugin
|
||||||
* If a plugin does not need these options, it
|
* If a plugin does not need these options, it
|
||||||
* may simply provide an empty implementation of this method.
|
* may simply provide an empty implementation of this method.
|
||||||
*/
|
*/
|
||||||
virtual void plugin_set_program_options(
|
virtual void plugin_set_program_options(boost::program_options::options_description &command_line_options,
|
||||||
boost::program_options::options_description& command_line_options,
|
boost::program_options::options_description &config_file_options) = 0;
|
||||||
boost::program_options::options_description& config_file_options
|
|
||||||
) = 0;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides basic default implementations of abstract_plugin functions.
|
* Provides basic default implementations of abstract_plugin functions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class plugin : public abstract_plugin
|
class plugin : public abstract_plugin {
|
||||||
{
|
public:
|
||||||
public:
|
|
||||||
plugin();
|
plugin();
|
||||||
virtual ~plugin() override;
|
virtual ~plugin() override;
|
||||||
|
|
||||||
virtual std::string plugin_name()const override;
|
virtual std::string plugin_name() const override;
|
||||||
virtual std::string plugin_description()const override;
|
virtual std::string plugin_description() const override;
|
||||||
virtual void plugin_initialize( const boost::program_options::variables_map& options ) override;
|
virtual void plugin_initialize(const boost::program_options::variables_map &options) override;
|
||||||
virtual void plugin_startup() override;
|
virtual void plugin_startup() override;
|
||||||
virtual void plugin_shutdown() override;
|
virtual void plugin_shutdown() override;
|
||||||
virtual void plugin_set_app( application* app ) override;
|
virtual void plugin_set_app(application *app) override;
|
||||||
virtual void plugin_set_program_options(
|
virtual void plugin_set_program_options(boost::program_options::options_description &command_line_options,
|
||||||
boost::program_options::options_description& command_line_options,
|
boost::program_options::options_description &config_file_options) override;
|
||||||
boost::program_options::options_description& config_file_options
|
|
||||||
) override;
|
|
||||||
|
|
||||||
chain::database& database() { return *app().chain_database(); }
|
chain::database &database() {
|
||||||
application& app()const { assert(_app); return *_app; }
|
return *app().chain_database();
|
||||||
protected:
|
}
|
||||||
net::node& p2p_node() { return *app().p2p_node(); }
|
application &app() const {
|
||||||
|
assert(_app);
|
||||||
|
return *_app;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
protected:
|
||||||
application* _app = nullptr;
|
net::node &p2p_node() {
|
||||||
|
return *app().p2p_node();
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
application *_app = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// @group Some useful tools for boost::program_options arguments using vectors of JSON strings
|
/// @group Some useful tools for boost::program_options arguments using vectors of JSON strings
|
||||||
/// @{
|
/// @{
|
||||||
template<typename T>
|
template <typename T>
|
||||||
T dejsonify(const string& s, uint32_t max_depth)
|
T dejsonify(const string &s, uint32_t max_depth) {
|
||||||
{
|
|
||||||
return fc::json::from_string(s).as<T>(max_depth);
|
return fc::json::from_string(s).as<T>(max_depth);
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace impl {
|
namespace impl {
|
||||||
template<typename T>
|
template <typename T>
|
||||||
T dejsonify( const string& s )
|
T dejsonify(const string &s) {
|
||||||
{
|
return graphene::app::dejsonify<T>(s, GRAPHENE_MAX_NESTED_OBJECTS);
|
||||||
return graphene::app::dejsonify<T>( s, GRAPHENE_MAX_NESTED_OBJECTS );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
} // namespace impl
|
||||||
|
|
||||||
#define DEFAULT_VALUE_VECTOR(value) default_value({fc::json::to_string(value)}, fc::json::to_string(value))
|
#define DEFAULT_VALUE_VECTOR(value) default_value({fc::json::to_string(value)}, fc::json::to_string(value))
|
||||||
#define LOAD_VALUE_SET(options, name, container, type) \
|
#define LOAD_VALUE_SET(options, name, container, type) \
|
||||||
if( options.count(name) ) { \
|
if (options.count(name)) { \
|
||||||
const std::vector<std::string>& ops = options[name].as<std::vector<std::string>>(); \
|
const std::vector<std::string> &ops = options[name].as<std::vector<std::string>>(); \
|
||||||
std::transform(ops.begin(), ops.end(), std::inserter(container, container.end()), &graphene::app::impl::dejsonify<type>); \
|
std::transform(ops.begin(), ops.end(), std::inserter(container, container.end()), &graphene::app::impl::dejsonify<type>); \
|
||||||
}
|
}
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
} } //graphene::app
|
}} // namespace graphene::app
|
||||||
|
|
|
||||||
|
|
@ -27,54 +27,44 @@
|
||||||
|
|
||||||
namespace graphene { namespace app {
|
namespace graphene { namespace app {
|
||||||
|
|
||||||
plugin::plugin()
|
plugin::plugin() {
|
||||||
{
|
|
||||||
_app = nullptr;
|
_app = nullptr;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
plugin::~plugin()
|
plugin::~plugin() {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string plugin::plugin_name()const
|
std::string plugin::plugin_name() const {
|
||||||
{
|
|
||||||
return "<unknown plugin>";
|
return "<unknown plugin>";
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string plugin::plugin_description()const
|
std::string plugin::plugin_description() const {
|
||||||
{
|
|
||||||
return "<no description>";
|
return "<no description>";
|
||||||
}
|
}
|
||||||
|
|
||||||
void plugin::plugin_initialize( const boost::program_options::variables_map& options )
|
void plugin::plugin_initialize(const boost::program_options::variables_map &options) {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void plugin::plugin_startup()
|
void plugin::plugin_startup() {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void plugin::plugin_shutdown()
|
void plugin::plugin_shutdown() {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void plugin::plugin_set_app( application* app )
|
void plugin::plugin_set_app(application *app) {
|
||||||
{
|
|
||||||
_app = app;
|
_app = app;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void plugin::plugin_set_program_options(
|
void plugin::plugin_set_program_options(
|
||||||
boost::program_options::options_description& command_line_options,
|
boost::program_options::options_description &cli,
|
||||||
boost::program_options::options_description& config_file_options
|
boost::program_options::options_description &cfg) {
|
||||||
)
|
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
} } // graphene::app
|
}} // namespace graphene::app
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,54 @@ void verify_authority_accounts( const database& db, const authority& a )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void verify_account_votes( const database& db, const account_options& options )
|
// Overwrites the num_son values from the origin to the destination for those sidechains which are found in the origin.
|
||||||
|
// Keeps the values of num_son for the sidechains which are found in the destination, but not in the origin.
|
||||||
|
// Returns false if an error is detected.
|
||||||
|
bool merge_num_sons( flat_map<sidechain_type, uint16_t>& destination,
|
||||||
|
const flat_map<sidechain_type, uint16_t>& origin,
|
||||||
|
fc::optional<time_point_sec> head_block_time = {})
|
||||||
|
{
|
||||||
|
const auto active_sidechains = head_block_time.valid() ? active_sidechain_types(*head_block_time) : all_sidechain_types;
|
||||||
|
bool success = true;
|
||||||
|
|
||||||
|
for (const auto &ns : origin)
|
||||||
|
{
|
||||||
|
destination[ns.first] = ns.second;
|
||||||
|
if (active_sidechains.find(ns.first) == active_sidechains.end())
|
||||||
|
{
|
||||||
|
success = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
|
flat_map<sidechain_type, uint16_t> count_SON_votes_per_sidechain( const flat_set<vote_id_type>& votes )
|
||||||
|
{
|
||||||
|
flat_map<sidechain_type, uint16_t> SON_votes_per_sidechain = account_options::ext::empty_num_son();
|
||||||
|
|
||||||
|
for (const auto &vote : votes)
|
||||||
|
{
|
||||||
|
switch (vote.type())
|
||||||
|
{
|
||||||
|
case vote_id_type::son_bitcoin:
|
||||||
|
SON_votes_per_sidechain[sidechain_type::bitcoin]++;
|
||||||
|
break;
|
||||||
|
case vote_id_type::son_hive:
|
||||||
|
SON_votes_per_sidechain[sidechain_type::hive]++;
|
||||||
|
break;
|
||||||
|
case vote_id_type::son_ethereum:
|
||||||
|
SON_votes_per_sidechain[sidechain_type::ethereum]++;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return SON_votes_per_sidechain;
|
||||||
|
}
|
||||||
|
|
||||||
|
void verify_account_votes( const database& db, const account_options& options, fc::optional<account_object> account = {} )
|
||||||
{
|
{
|
||||||
// ensure account's votes satisfy requirements
|
// ensure account's votes satisfy requirements
|
||||||
// NB only the part of vote checking that requires chain state is here,
|
// NB only the part of vote checking that requires chain state is here,
|
||||||
|
|
@ -62,10 +109,47 @@ void verify_account_votes( const database& db, const account_options& options )
|
||||||
const auto& gpo = db.get_global_properties();
|
const auto& gpo = db.get_global_properties();
|
||||||
const auto& chain_params = gpo.parameters;
|
const auto& chain_params = gpo.parameters;
|
||||||
|
|
||||||
|
FC_ASSERT( db.find_object(options.voting_account), "Invalid proxy account specified." );
|
||||||
|
|
||||||
FC_ASSERT( options.num_witness <= chain_params.maximum_witness_count,
|
FC_ASSERT( options.num_witness <= chain_params.maximum_witness_count,
|
||||||
"Voted for more witnesses than currently allowed (${c})", ("c", chain_params.maximum_witness_count) );
|
"Voted for more witnesses than currently allowed (${c})", ("c", chain_params.maximum_witness_count) );
|
||||||
FC_ASSERT( options.num_committee <= chain_params.maximum_committee_count,
|
FC_ASSERT( options.num_committee <= chain_params.maximum_committee_count,
|
||||||
"Voted for more committee members than currently allowed (${c})", ("c", chain_params.maximum_committee_count) );
|
"Voted for more committee members than currently allowed (${c})", ("c", chain_params.maximum_committee_count) );
|
||||||
|
FC_ASSERT( chain_params.extensions.value.maximum_son_count.valid() , "Invalid maximum son count" );
|
||||||
|
|
||||||
|
flat_map<sidechain_type, uint16_t> merged_num_sons = account_options::ext::empty_num_son();
|
||||||
|
|
||||||
|
// Merge with existing account if exists
|
||||||
|
if ( account.valid() && account->options.extensions.value.num_son.valid())
|
||||||
|
{
|
||||||
|
merge_num_sons( merged_num_sons, *account->options.extensions.value.num_son, db.head_block_time() );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Apply update operation on top
|
||||||
|
if ( options.extensions.value.num_son.valid() )
|
||||||
|
{
|
||||||
|
merge_num_sons( merged_num_sons, *options.extensions.value.num_son, db.head_block_time() );
|
||||||
|
}
|
||||||
|
|
||||||
|
for(const auto& num_sons : merged_num_sons)
|
||||||
|
{
|
||||||
|
FC_ASSERT( num_sons.second <= *chain_params.extensions.value.maximum_son_count,
|
||||||
|
"Voted for more sons than currently allowed (${c})", ("c", *chain_params.extensions.value.maximum_son_count) );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Count the votes for SONs and confirm that the account did not vote for less SONs than num_son
|
||||||
|
flat_map<sidechain_type, uint16_t> SON_votes_per_sidechain = count_SON_votes_per_sidechain(options.votes);
|
||||||
|
|
||||||
|
for (const auto& number_of_votes : SON_votes_per_sidechain)
|
||||||
|
{
|
||||||
|
// Number of votes of account_options are also checked in account_options::do_evaluate,
|
||||||
|
// but there we are checking the value before merging num_sons, so the values should be checked again
|
||||||
|
const auto sidechain = number_of_votes.first;
|
||||||
|
FC_ASSERT( number_of_votes.second >= merged_num_sons[sidechain],
|
||||||
|
"Voted for less sons than specified in num_son (votes ${v} < num_son ${ns}) for sidechain ${s}",
|
||||||
|
("v", number_of_votes.second) ("ns", merged_num_sons[sidechain]) ("s", sidechain) );
|
||||||
|
}
|
||||||
|
|
||||||
FC_ASSERT( db.find_object(options.voting_account), "Invalid proxy account specified." );
|
FC_ASSERT( db.find_object(options.voting_account), "Invalid proxy account specified." );
|
||||||
|
|
||||||
uint32_t max_vote_id = gpo.next_available_vote_id;
|
uint32_t max_vote_id = gpo.next_available_vote_id;
|
||||||
|
|
@ -179,6 +263,13 @@ object_id_type account_create_evaluator::do_apply( const account_create_operatio
|
||||||
obj.owner = o.owner;
|
obj.owner = o.owner;
|
||||||
obj.active = o.active;
|
obj.active = o.active;
|
||||||
obj.options = o.options;
|
obj.options = o.options;
|
||||||
|
|
||||||
|
obj.options.extensions.value.num_son = account_options::ext::empty_num_son();
|
||||||
|
if ( o.options.extensions.value.num_son.valid() )
|
||||||
|
{
|
||||||
|
merge_num_sons( *obj.options.extensions.value.num_son, *o.options.extensions.value.num_son );
|
||||||
|
}
|
||||||
|
|
||||||
obj.statistics = d.create<account_statistics_object>([&obj](account_statistics_object& s){
|
obj.statistics = d.create<account_statistics_object>([&obj](account_statistics_object& s){
|
||||||
s.owner = obj.id;
|
s.owner = obj.id;
|
||||||
s.name = obj.name;
|
s.name = obj.name;
|
||||||
|
|
@ -278,7 +369,7 @@ void_result account_update_evaluator::do_evaluate( const account_update_operatio
|
||||||
acnt = &o.account(d);
|
acnt = &o.account(d);
|
||||||
|
|
||||||
if( o.new_options.valid() )
|
if( o.new_options.valid() )
|
||||||
verify_account_votes( d, *o.new_options );
|
verify_account_votes( d, *o.new_options, *acnt );
|
||||||
|
|
||||||
return void_result();
|
return void_result();
|
||||||
} FC_CAPTURE_AND_RETHROW( (o) ) }
|
} FC_CAPTURE_AND_RETHROW( (o) ) }
|
||||||
|
|
@ -317,7 +408,31 @@ void_result account_update_evaluator::do_apply( const account_update_operation&
|
||||||
a.active = *o.active;
|
a.active = *o.active;
|
||||||
a.top_n_control_flags = 0;
|
a.top_n_control_flags = 0;
|
||||||
}
|
}
|
||||||
if( o.new_options ) a.options = *o.new_options;
|
|
||||||
|
// New num_son structure initialized to 0
|
||||||
|
flat_map<sidechain_type, uint16_t> new_num_son = account_options::ext::empty_num_son();
|
||||||
|
|
||||||
|
// If num_son of existing object is valid, we should merge the existing data
|
||||||
|
if ( a.options.extensions.value.num_son.valid() )
|
||||||
|
{
|
||||||
|
merge_num_sons( new_num_son, *a.options.extensions.value.num_son );
|
||||||
|
}
|
||||||
|
|
||||||
|
// If num_son of the operation are valid, they should merge the existing data
|
||||||
|
if ( o.new_options )
|
||||||
|
{
|
||||||
|
const auto new_options = *o.new_options;
|
||||||
|
|
||||||
|
if ( new_options.extensions.value.num_son.valid() )
|
||||||
|
{
|
||||||
|
merge_num_sons( new_num_son, *new_options.extensions.value.num_son );
|
||||||
|
}
|
||||||
|
|
||||||
|
a.options = *o.new_options;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.options.extensions.value.num_son = new_num_son;
|
||||||
|
|
||||||
if( o.extensions.value.owner_special_authority.valid() )
|
if( o.extensions.value.owner_special_authority.valid() )
|
||||||
{
|
{
|
||||||
a.owner_special_authority = *(o.extensions.value.owner_special_authority);
|
a.owner_special_authority = *(o.extensions.value.owner_special_authority);
|
||||||
|
|
|
||||||
|
|
@ -42,8 +42,7 @@ void_result asset_create_evaluator::do_evaluate( const asset_create_operation& o
|
||||||
|
|
||||||
database& d = db();
|
database& d = db();
|
||||||
|
|
||||||
if (d.head_block_time() < HARDFORK_SON_TIME)
|
FC_ASSERT(d.is_asset_creation_allowed(op.symbol), "Asset creation not allowed at current time");
|
||||||
FC_ASSERT(op.symbol != "BTC", "BTC asset creation before SON hardfork");
|
|
||||||
|
|
||||||
const auto& chain_parameters = d.get_global_properties().parameters;
|
const auto& chain_parameters = d.get_global_properties().parameters;
|
||||||
FC_ASSERT( op.common_options.whitelist_authorities.size() <= chain_parameters.maximum_asset_whitelist_authorities );
|
FC_ASSERT( op.common_options.whitelist_authorities.size() <= chain_parameters.maximum_asset_whitelist_authorities );
|
||||||
|
|
@ -191,6 +190,8 @@ void_result lottery_asset_create_evaluator::do_evaluate( const lottery_asset_cre
|
||||||
|
|
||||||
database& d = db();
|
database& d = db();
|
||||||
|
|
||||||
|
FC_ASSERT(d.is_asset_creation_allowed(op.symbol), "Lottery asset creation not allowed at current time");
|
||||||
|
|
||||||
const auto& chain_parameters = d.get_global_properties().parameters;
|
const auto& chain_parameters = d.get_global_properties().parameters;
|
||||||
FC_ASSERT( op.common_options.whitelist_authorities.size() <= chain_parameters.maximum_asset_whitelist_authorities );
|
FC_ASSERT( op.common_options.whitelist_authorities.size() <= chain_parameters.maximum_asset_whitelist_authorities );
|
||||||
FC_ASSERT( op.common_options.blacklist_authorities.size() <= chain_parameters.maximum_asset_whitelist_authorities );
|
FC_ASSERT( op.common_options.blacklist_authorities.size() <= chain_parameters.maximum_asset_whitelist_authorities );
|
||||||
|
|
|
||||||
|
|
@ -493,4 +493,3 @@ namespace fc {
|
||||||
const_cast<int*>(event_obj.my->state_machine.current_state())[0] = (int)status;
|
const_cast<int*>(event_obj.my->state_machine.current_state())[0] = (int)status;
|
||||||
}
|
}
|
||||||
} //end namespace fc
|
} //end namespace fc
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,10 @@ void block_database::flush()
|
||||||
|
|
||||||
void block_database::store( const block_id_type& _id, const signed_block& b )
|
void block_database::store( const block_id_type& _id, const signed_block& b )
|
||||||
{
|
{
|
||||||
|
if (true == replay_mode){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
block_id_type id = _id;
|
block_id_type id = _id;
|
||||||
if( id == block_id_type() )
|
if( id == block_id_type() )
|
||||||
{
|
{
|
||||||
|
|
@ -99,8 +103,15 @@ void block_database::remove( const block_id_type& id )
|
||||||
index_entry e;
|
index_entry e;
|
||||||
auto index_pos = sizeof(e)*block_header::num_from_id(id);
|
auto index_pos = sizeof(e)*block_header::num_from_id(id);
|
||||||
_block_num_to_pos.seekg( 0, _block_num_to_pos.end );
|
_block_num_to_pos.seekg( 0, _block_num_to_pos.end );
|
||||||
if ( _block_num_to_pos.tellg() <= index_pos )
|
|
||||||
|
std::streampos s_pos = _block_num_to_pos.tellg();
|
||||||
|
if (-1 == s_pos){
|
||||||
|
FC_THROW_EXCEPTION(fc::key_not_found_exception, "Block ${id} not contained in block database, _block_num_to_pos.tellg failed", ("id", id));
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( static_cast<uint32_t>(s_pos) <= index_pos ){
|
||||||
FC_THROW_EXCEPTION(fc::key_not_found_exception, "Block ${id} not contained in block database", ("id", id));
|
FC_THROW_EXCEPTION(fc::key_not_found_exception, "Block ${id} not contained in block database", ("id", id));
|
||||||
|
}
|
||||||
|
|
||||||
_block_num_to_pos.seekg( index_pos );
|
_block_num_to_pos.seekg( index_pos );
|
||||||
_block_num_to_pos.read( (char*)&e, sizeof(e) );
|
_block_num_to_pos.read( (char*)&e, sizeof(e) );
|
||||||
|
|
@ -114,20 +125,27 @@ void block_database::remove( const block_id_type& id )
|
||||||
} FC_CAPTURE_AND_RETHROW( (id) ) }
|
} FC_CAPTURE_AND_RETHROW( (id) ) }
|
||||||
|
|
||||||
bool block_database::contains( const block_id_type& id )const
|
bool block_database::contains( const block_id_type& id )const
|
||||||
{
|
{ try {
|
||||||
if( id == block_id_type() )
|
if( id == block_id_type() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
index_entry e;
|
index_entry e;
|
||||||
auto index_pos = sizeof(e)*block_header::num_from_id(id);
|
auto index_pos = sizeof(e)*block_header::num_from_id(id);
|
||||||
_block_num_to_pos.seekg( 0, _block_num_to_pos.end );
|
_block_num_to_pos.seekg( 0, _block_num_to_pos.end );
|
||||||
if ( _block_num_to_pos.tellg() < index_pos + sizeof(e) )
|
|
||||||
|
std::streampos s_pos = _block_num_to_pos.tellg();
|
||||||
|
if (-1 == s_pos){
|
||||||
|
FC_THROW_EXCEPTION(fc::key_not_found_exception, "Block ${id} not contained in block database, _block_num_to_pos.tellg failed", ("id", id));
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( static_cast<uint32_t>(s_pos) < index_pos + sizeof(e) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
_block_num_to_pos.seekg( index_pos );
|
_block_num_to_pos.seekg( index_pos );
|
||||||
_block_num_to_pos.read( (char*)&e, sizeof(e) );
|
_block_num_to_pos.read( (char*)&e, sizeof(e) );
|
||||||
|
|
||||||
return e.block_id == id && e.block_size > 0;
|
return e.block_id == id && e.block_size > 0;
|
||||||
}
|
} FC_CAPTURE_AND_RETHROW( (id) ) }
|
||||||
|
|
||||||
block_id_type block_database::fetch_block_id( uint32_t block_num )const
|
block_id_type block_database::fetch_block_id( uint32_t block_num )const
|
||||||
{
|
{
|
||||||
|
|
@ -152,7 +170,13 @@ optional<signed_block> block_database::fetch_optional( const block_id_type& id )
|
||||||
index_entry e;
|
index_entry e;
|
||||||
auto index_pos = sizeof(e)*block_header::num_from_id(id);
|
auto index_pos = sizeof(e)*block_header::num_from_id(id);
|
||||||
_block_num_to_pos.seekg( 0, _block_num_to_pos.end );
|
_block_num_to_pos.seekg( 0, _block_num_to_pos.end );
|
||||||
if ( _block_num_to_pos.tellg() <= index_pos )
|
std::streampos s_pos = _block_num_to_pos.tellg();
|
||||||
|
|
||||||
|
if (-1 == s_pos){
|
||||||
|
FC_THROW_EXCEPTION(fc::key_not_found_exception, "Block ${id} not contained in block database, _block_num_to_pos.tellg failed", ("id", id));
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( static_cast<uint32_t>(s_pos) <= index_pos )
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
_block_num_to_pos.seekg( index_pos );
|
_block_num_to_pos.seekg( index_pos );
|
||||||
|
|
@ -184,7 +208,12 @@ optional<signed_block> block_database::fetch_by_number( uint32_t block_num )cons
|
||||||
index_entry e;
|
index_entry e;
|
||||||
auto index_pos = sizeof(e)*block_num;
|
auto index_pos = sizeof(e)*block_num;
|
||||||
_block_num_to_pos.seekg( 0, _block_num_to_pos.end );
|
_block_num_to_pos.seekg( 0, _block_num_to_pos.end );
|
||||||
if ( _block_num_to_pos.tellg() <= index_pos )
|
std::streampos s_pos = _block_num_to_pos.tellg();
|
||||||
|
if (-1 == s_pos){
|
||||||
|
FC_THROW_EXCEPTION(fc::key_not_found_exception, "Block ${block_num} not contained in block database, _block_num_to_pos.tellg failed", ("block_num", block_num));
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( static_cast<uint32_t>(s_pos) <= index_pos )
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
_block_num_to_pos.seekg( index_pos, _block_num_to_pos.beg );
|
_block_num_to_pos.seekg( index_pos, _block_num_to_pos.beg );
|
||||||
|
|
@ -213,7 +242,11 @@ optional<index_entry> block_database::last_index_entry()const {
|
||||||
|
|
||||||
_block_num_to_pos.seekg( 0, _block_num_to_pos.end );
|
_block_num_to_pos.seekg( 0, _block_num_to_pos.end );
|
||||||
std::streampos pos = _block_num_to_pos.tellg();
|
std::streampos pos = _block_num_to_pos.tellg();
|
||||||
if( pos < sizeof(index_entry) )
|
if (-1 == pos){
|
||||||
|
FC_THROW_EXCEPTION(fc::key_not_found_exception, "last_index_entry tellg failed");
|
||||||
|
}
|
||||||
|
|
||||||
|
if( static_cast<size_t>(pos) < sizeof(index_entry) )
|
||||||
return optional<index_entry>();
|
return optional<index_entry>();
|
||||||
|
|
||||||
pos -= pos % sizeof(index_entry);
|
pos -= pos % sizeof(index_entry);
|
||||||
|
|
@ -226,7 +259,7 @@ optional<index_entry> block_database::last_index_entry()const {
|
||||||
_block_num_to_pos.seekg( pos );
|
_block_num_to_pos.seekg( pos );
|
||||||
_block_num_to_pos.read( (char*)&e, sizeof(e) );
|
_block_num_to_pos.read( (char*)&e, sizeof(e) );
|
||||||
if( _block_num_to_pos.gcount() == sizeof(e) && e.block_size > 0
|
if( _block_num_to_pos.gcount() == sizeof(e) && e.block_size > 0
|
||||||
&& e.block_pos + e.block_size <= blocks_size )
|
&& e.block_pos + static_cast<uint64_t>(e.block_size) <= static_cast<uint64_t>(blocks_size) )
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
vector<char> data( e.block_size );
|
vector<char> data( e.block_size );
|
||||||
|
|
@ -271,4 +304,9 @@ optional<block_id_type> block_database::last_id()const
|
||||||
return optional<block_id_type>();
|
return optional<block_id_type>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void block_database::set_replay_mode(bool mode)
|
||||||
|
{
|
||||||
|
replay_mode = mode;
|
||||||
|
}
|
||||||
|
|
||||||
} }
|
} }
|
||||||
|
|
|
||||||
|
|
@ -34,8 +34,9 @@ namespace graphene { namespace chain {
|
||||||
void_result transfer_to_blind_evaluator::do_evaluate( const transfer_to_blind_operation& o )
|
void_result transfer_to_blind_evaluator::do_evaluate( const transfer_to_blind_operation& o )
|
||||||
{ try {
|
{ try {
|
||||||
const auto& d = db();
|
const auto& d = db();
|
||||||
|
if( d.head_block_time() < HARDFORK_SON_FOR_ETHEREUM_TIME )
|
||||||
const auto& atype = o.amount.asset_id(db());
|
{
|
||||||
|
const auto& atype = o.amount.asset_id(d);
|
||||||
FC_ASSERT( atype.allow_confidential() );
|
FC_ASSERT( atype.allow_confidential() );
|
||||||
FC_ASSERT( !atype.is_transfer_restricted() );
|
FC_ASSERT( !atype.is_transfer_restricted() );
|
||||||
FC_ASSERT( !(atype.options.flags & white_list) );
|
FC_ASSERT( !(atype.options.flags & white_list) );
|
||||||
|
|
@ -45,137 +46,150 @@ void_result transfer_to_blind_evaluator::do_evaluate( const transfer_to_blind_op
|
||||||
for( const auto& a : out.owner.account_auths )
|
for( const auto& a : out.owner.account_auths )
|
||||||
a.first(d); // verify all accounts exist and are valid
|
a.first(d); // verify all accounts exist and are valid
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return void_result();
|
return void_result();
|
||||||
} FC_CAPTURE_AND_RETHROW( (o) ) }
|
} FC_CAPTURE_AND_RETHROW( (o) ) }
|
||||||
|
|
||||||
|
|
||||||
void_result transfer_to_blind_evaluator::do_apply( const transfer_to_blind_operation& o )
|
void_result transfer_to_blind_evaluator::do_apply( const transfer_to_blind_operation& o )
|
||||||
{ try {
|
{ try {
|
||||||
db().adjust_balance( o.from, -o.amount );
|
if( db().head_block_time() < HARDFORK_SON_FOR_ETHEREUM_TIME ) {
|
||||||
|
db().adjust_balance(o.from, -o.amount);
|
||||||
|
|
||||||
const auto& add = o.amount.asset_id(db()).dynamic_asset_data_id(db()); // verify fee is a legit asset
|
const auto &add = o.amount.asset_id(db()).dynamic_asset_data_id(db()); // verify fee is a legit asset
|
||||||
db().modify( add, [&]( asset_dynamic_data_object& obj ){
|
db().modify(add, [&](asset_dynamic_data_object &obj) {
|
||||||
obj.confidential_supply += o.amount.amount;
|
obj.confidential_supply += o.amount.amount;
|
||||||
FC_ASSERT( obj.confidential_supply >= 0 );
|
FC_ASSERT(obj.confidential_supply >= 0);
|
||||||
});
|
});
|
||||||
for( const auto& out : o.outputs )
|
for (const auto &out : o.outputs) {
|
||||||
{
|
db().create<blinded_balance_object>([&](blinded_balance_object &obj) {
|
||||||
db().create<blinded_balance_object>( [&]( blinded_balance_object& obj ){
|
|
||||||
obj.asset_id = o.amount.asset_id;
|
obj.asset_id = o.amount.asset_id;
|
||||||
obj.owner = out.owner;
|
obj.owner = out.owner;
|
||||||
obj.commitment = out.commitment;
|
obj.commitment = out.commitment;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return void_result();
|
return void_result();
|
||||||
} FC_CAPTURE_AND_RETHROW( (o) ) }
|
} FC_CAPTURE_AND_RETHROW( (o) ) }
|
||||||
|
|
||||||
void transfer_to_blind_evaluator::pay_fee()
|
void transfer_to_blind_evaluator::pay_fee()
|
||||||
{
|
{
|
||||||
if( db().head_block_time() >= HARDFORK_563_TIME )
|
const auto& d = db();
|
||||||
pay_fba_fee( fba_accumulator_id_transfer_to_blind );
|
if( d.head_block_time() < HARDFORK_SON_FOR_ETHEREUM_TIME ) {
|
||||||
|
if (d.head_block_time() >= HARDFORK_563_TIME)
|
||||||
|
pay_fba_fee(fba_accumulator_id_transfer_to_blind);
|
||||||
else
|
else
|
||||||
generic_evaluator::pay_fee();
|
generic_evaluator::pay_fee();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void_result transfer_from_blind_evaluator::do_evaluate( const transfer_from_blind_operation& o )
|
void_result transfer_from_blind_evaluator::do_evaluate( const transfer_from_blind_operation& o )
|
||||||
{ try {
|
{ try {
|
||||||
const auto& d = db();
|
const auto& d = db();
|
||||||
|
if( d.head_block_time() < HARDFORK_SON_FOR_ETHEREUM_TIME ) {
|
||||||
o.fee.asset_id(d); // verify fee is a legit asset
|
o.fee.asset_id(d); // verify fee is a legit asset
|
||||||
const auto& bbi = d.get_index_type<blinded_balance_index>();
|
const auto &bbi = d.get_index_type<blinded_balance_index>();
|
||||||
const auto& cidx = bbi.indices().get<by_commitment>();
|
const auto &cidx = bbi.indices().get<by_commitment>();
|
||||||
for( const auto& in : o.inputs )
|
for (const auto &in : o.inputs) {
|
||||||
{
|
auto itr = cidx.find(in.commitment);
|
||||||
auto itr = cidx.find( in.commitment );
|
FC_ASSERT(itr != cidx.end());
|
||||||
FC_ASSERT( itr != cidx.end() );
|
FC_ASSERT(itr->asset_id == o.fee.asset_id);
|
||||||
FC_ASSERT( itr->asset_id == o.fee.asset_id );
|
FC_ASSERT(itr->owner == in.owner);
|
||||||
FC_ASSERT( itr->owner == in.owner );
|
}
|
||||||
}
|
}
|
||||||
return void_result();
|
return void_result();
|
||||||
} FC_CAPTURE_AND_RETHROW( (o) ) }
|
} FC_CAPTURE_AND_RETHROW( (o) ) }
|
||||||
|
|
||||||
void_result transfer_from_blind_evaluator::do_apply( const transfer_from_blind_operation& o )
|
void_result transfer_from_blind_evaluator::do_apply( const transfer_from_blind_operation& o )
|
||||||
{ try {
|
{ try {
|
||||||
db().adjust_balance( o.fee_payer(), o.fee );
|
if( db().head_block_time() < HARDFORK_SON_FOR_ETHEREUM_TIME ) {
|
||||||
db().adjust_balance( o.to, o.amount );
|
db().adjust_balance(o.fee_payer(), o.fee);
|
||||||
const auto& bbi = db().get_index_type<blinded_balance_index>();
|
db().adjust_balance(o.to, o.amount);
|
||||||
const auto& cidx = bbi.indices().get<by_commitment>();
|
const auto &bbi = db().get_index_type<blinded_balance_index>();
|
||||||
for( const auto& in : o.inputs )
|
const auto &cidx = bbi.indices().get<by_commitment>();
|
||||||
{
|
for (const auto &in : o.inputs) {
|
||||||
auto itr = cidx.find( in.commitment );
|
auto itr = cidx.find(in.commitment);
|
||||||
FC_ASSERT( itr != cidx.end() );
|
FC_ASSERT(itr != cidx.end());
|
||||||
db().remove( *itr );
|
db().remove(*itr);
|
||||||
}
|
}
|
||||||
const auto& add = o.amount.asset_id(db()).dynamic_asset_data_id(db()); // verify fee is a legit asset
|
const auto &add = o.amount.asset_id(db()).dynamic_asset_data_id(db()); // verify fee is a legit asset
|
||||||
db().modify( add, [&]( asset_dynamic_data_object& obj ){
|
db().modify(add, [&](asset_dynamic_data_object &obj) {
|
||||||
obj.confidential_supply -= o.amount.amount + o.fee.amount;
|
obj.confidential_supply -= o.amount.amount + o.fee.amount;
|
||||||
FC_ASSERT( obj.confidential_supply >= 0 );
|
FC_ASSERT(obj.confidential_supply >= 0);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
return void_result();
|
return void_result();
|
||||||
} FC_CAPTURE_AND_RETHROW( (o) ) }
|
} FC_CAPTURE_AND_RETHROW( (o) ) }
|
||||||
|
|
||||||
void transfer_from_blind_evaluator::pay_fee()
|
void transfer_from_blind_evaluator::pay_fee()
|
||||||
{
|
{
|
||||||
if( db().head_block_time() >= HARDFORK_563_TIME )
|
const auto& d = db();
|
||||||
pay_fba_fee( fba_accumulator_id_transfer_from_blind );
|
if( d.head_block_time() < HARDFORK_SON_FOR_ETHEREUM_TIME ) {
|
||||||
|
if (d.head_block_time() >= HARDFORK_563_TIME)
|
||||||
|
pay_fba_fee(fba_accumulator_id_transfer_from_blind);
|
||||||
else
|
else
|
||||||
generic_evaluator::pay_fee();
|
generic_evaluator::pay_fee();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void_result blind_transfer_evaluator::do_evaluate( const blind_transfer_operation& o )
|
void_result blind_transfer_evaluator::do_evaluate( const blind_transfer_operation& o )
|
||||||
{ try {
|
{ try {
|
||||||
const auto& d = db();
|
const auto& d = db();
|
||||||
o.fee.asset_id(db()); // verify fee is a legit asset
|
if( d.head_block_time() < HARDFORK_SON_FOR_ETHEREUM_TIME ) {
|
||||||
const auto& bbi = db().get_index_type<blinded_balance_index>();
|
o.fee.asset_id(d); // verify fee is a legit asset
|
||||||
const auto& cidx = bbi.indices().get<by_commitment>();
|
const auto &bbi = d.get_index_type<blinded_balance_index>();
|
||||||
for( const auto& out : o.outputs )
|
const auto &cidx = bbi.indices().get<by_commitment>();
|
||||||
{
|
for (const auto &out : o.outputs) {
|
||||||
for( const auto& a : out.owner.account_auths )
|
for (const auto &a : out.owner.account_auths)
|
||||||
a.first(d); // verify all accounts exist and are valid
|
a.first(d); // verify all accounts exist and are valid
|
||||||
}
|
}
|
||||||
for( const auto& in : o.inputs )
|
for (const auto &in : o.inputs) {
|
||||||
{
|
auto itr = cidx.find(in.commitment);
|
||||||
auto itr = cidx.find( in.commitment );
|
GRAPHENE_ASSERT(itr != cidx.end(), blind_transfer_unknown_commitment, "", ("commitment", in.commitment));
|
||||||
GRAPHENE_ASSERT( itr != cidx.end(), blind_transfer_unknown_commitment, "", ("commitment",in.commitment) );
|
FC_ASSERT(itr->asset_id == o.fee.asset_id);
|
||||||
FC_ASSERT( itr->asset_id == o.fee.asset_id );
|
FC_ASSERT(itr->owner == in.owner);
|
||||||
FC_ASSERT( itr->owner == in.owner );
|
}
|
||||||
}
|
}
|
||||||
return void_result();
|
return void_result();
|
||||||
} FC_CAPTURE_AND_RETHROW( (o) ) }
|
} FC_CAPTURE_AND_RETHROW( (o) ) }
|
||||||
|
|
||||||
void_result blind_transfer_evaluator::do_apply( const blind_transfer_operation& o )
|
void_result blind_transfer_evaluator::do_apply( const blind_transfer_operation& o )
|
||||||
{ try {
|
{ try {
|
||||||
db().adjust_balance( o.fee_payer(), o.fee ); // deposit the fee to the temp account
|
if( db().head_block_time() < HARDFORK_SON_FOR_ETHEREUM_TIME ) {
|
||||||
const auto& bbi = db().get_index_type<blinded_balance_index>();
|
db().adjust_balance(o.fee_payer(), o.fee); // deposit the fee to the temp account
|
||||||
const auto& cidx = bbi.indices().get<by_commitment>();
|
const auto &bbi = db().get_index_type<blinded_balance_index>();
|
||||||
for( const auto& in : o.inputs )
|
const auto &cidx = bbi.indices().get<by_commitment>();
|
||||||
{
|
for (const auto &in : o.inputs) {
|
||||||
auto itr = cidx.find( in.commitment );
|
auto itr = cidx.find(in.commitment);
|
||||||
GRAPHENE_ASSERT( itr != cidx.end(), blind_transfer_unknown_commitment, "", ("commitment",in.commitment) );
|
GRAPHENE_ASSERT(itr != cidx.end(), blind_transfer_unknown_commitment, "", ("commitment", in.commitment));
|
||||||
db().remove( *itr );
|
db().remove(*itr);
|
||||||
}
|
}
|
||||||
for( const auto& out : o.outputs )
|
for (const auto &out : o.outputs) {
|
||||||
{
|
db().create<blinded_balance_object>([&](blinded_balance_object &obj) {
|
||||||
db().create<blinded_balance_object>( [&]( blinded_balance_object& obj ){
|
|
||||||
obj.asset_id = o.fee.asset_id;
|
obj.asset_id = o.fee.asset_id;
|
||||||
obj.owner = out.owner;
|
obj.owner = out.owner;
|
||||||
obj.commitment = out.commitment;
|
obj.commitment = out.commitment;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
const auto& add = o.fee.asset_id(db()).dynamic_asset_data_id(db());
|
const auto &add = o.fee.asset_id(db()).dynamic_asset_data_id(db());
|
||||||
db().modify( add, [&]( asset_dynamic_data_object& obj ){
|
db().modify(add, [&](asset_dynamic_data_object &obj) {
|
||||||
obj.confidential_supply -= o.fee.amount;
|
obj.confidential_supply -= o.fee.amount;
|
||||||
FC_ASSERT( obj.confidential_supply >= 0 );
|
FC_ASSERT(obj.confidential_supply >= 0);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
return void_result();
|
return void_result();
|
||||||
} FC_CAPTURE_AND_RETHROW( (o) ) }
|
} FC_CAPTURE_AND_RETHROW( (o) ) }
|
||||||
|
|
||||||
void blind_transfer_evaluator::pay_fee()
|
void blind_transfer_evaluator::pay_fee()
|
||||||
{
|
{
|
||||||
if( db().head_block_time() >= HARDFORK_563_TIME )
|
const auto& d = db();
|
||||||
pay_fba_fee( fba_accumulator_id_blind_transfer );
|
if( d.head_block_time() < HARDFORK_SON_FOR_ETHEREUM_TIME ) {
|
||||||
|
if (d.head_block_time() >= HARDFORK_563_TIME)
|
||||||
|
pay_fba_fee(fba_accumulator_id_blind_transfer);
|
||||||
else
|
else
|
||||||
generic_evaluator::pay_fee();
|
generic_evaluator::pay_fee();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} } // graphene::chain
|
} } // graphene::chain
|
||||||
|
|
|
||||||
|
|
@ -40,8 +40,10 @@
|
||||||
#include <graphene/chain/exceptions.hpp>
|
#include <graphene/chain/exceptions.hpp>
|
||||||
#include <graphene/chain/evaluator.hpp>
|
#include <graphene/chain/evaluator.hpp>
|
||||||
#include <graphene/chain/witness_schedule_object.hpp>
|
#include <graphene/chain/witness_schedule_object.hpp>
|
||||||
|
#include <graphene/db/object_database.hpp>
|
||||||
#include <fc/crypto/digest.hpp>
|
#include <fc/crypto/digest.hpp>
|
||||||
|
|
||||||
|
#include <boost/filesystem.hpp>
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
|
@ -160,11 +162,14 @@ void database::check_transaction_for_duplicated_operations(const signed_transact
|
||||||
existed_operations_digests.insert( proposed_operations_digests.begin(), proposed_operations_digests.end() );
|
existed_operations_digests.insert( proposed_operations_digests.begin(), proposed_operations_digests.end() );
|
||||||
});
|
});
|
||||||
|
|
||||||
for (auto& pending_transaction: _pending_tx)
|
{
|
||||||
|
const std::lock_guard<std::mutex> pending_tx_lock{_pending_tx_mutex};
|
||||||
|
for (auto &pending_transaction : _pending_tx)
|
||||||
{
|
{
|
||||||
auto proposed_operations_digests = gather_proposed_operations_digests(pending_transaction);
|
auto proposed_operations_digests = gather_proposed_operations_digests(pending_transaction);
|
||||||
existed_operations_digests.insert(proposed_operations_digests.begin(), proposed_operations_digests.end());
|
existed_operations_digests.insert(proposed_operations_digests.begin(), proposed_operations_digests.end());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
auto proposed_operations_digests = gather_proposed_operations_digests(trx);
|
auto proposed_operations_digests = gather_proposed_operations_digests(trx);
|
||||||
for (auto& digest: proposed_operations_digests)
|
for (auto& digest: proposed_operations_digests)
|
||||||
|
|
@ -185,7 +190,12 @@ bool database::push_block(const signed_block& new_block, uint32_t skip)
|
||||||
bool result;
|
bool result;
|
||||||
detail::with_skip_flags( *this, skip, [&]()
|
detail::with_skip_flags( *this, skip, [&]()
|
||||||
{
|
{
|
||||||
detail::without_pending_transactions( *this, std::move(_pending_tx),
|
std::vector<processed_transaction> pending_tx = [this] {
|
||||||
|
const std::lock_guard<std::mutex> pending_tx_lock{_pending_tx_mutex};
|
||||||
|
return std::move(_pending_tx);
|
||||||
|
}();
|
||||||
|
|
||||||
|
detail::without_pending_transactions( *this, std::move(pending_tx),
|
||||||
[&]()
|
[&]()
|
||||||
{
|
{
|
||||||
result = _push_block(new_block);
|
result = _push_block(new_block);
|
||||||
|
|
@ -196,6 +206,9 @@ bool database::push_block(const signed_block& new_block, uint32_t skip)
|
||||||
|
|
||||||
bool database::_push_block(const signed_block& new_block)
|
bool database::_push_block(const signed_block& new_block)
|
||||||
{ try {
|
{ try {
|
||||||
|
boost::filesystem::space_info si = boost::filesystem::space(get_data_dir());
|
||||||
|
FC_ASSERT((si.available) > 104857600, "Rejecting block due to low disk space"); // 104857600 bytes = 100 MB
|
||||||
|
|
||||||
uint32_t skip = get_node_properties().skip_flags;
|
uint32_t skip = get_node_properties().skip_flags;
|
||||||
const auto now = fc::time_point::now().sec_since_epoch();
|
const auto now = fc::time_point::now().sec_since_epoch();
|
||||||
|
|
||||||
|
|
@ -382,17 +395,26 @@ processed_transaction database::_push_transaction( const signed_transaction& trx
|
||||||
{
|
{
|
||||||
// If this is the first transaction pushed after applying a block, start a new undo session.
|
// If this is the first transaction pushed after applying a block, start a new undo session.
|
||||||
// This allows us to quickly rewind to the clean state of the head block, in case a new block arrives.
|
// This allows us to quickly rewind to the clean state of the head block, in case a new block arrives.
|
||||||
if( !_pending_tx_session.valid() )
|
{
|
||||||
|
const std::lock_guard<std::mutex> pending_tx_session_lock{_pending_tx_session_mutex};
|
||||||
|
if (!_pending_tx_session.valid()) {
|
||||||
|
const std::lock_guard<std::mutex> undo_db_lock{_undo_db_mutex};
|
||||||
_pending_tx_session = _undo_db.start_undo_session();
|
_pending_tx_session = _undo_db.start_undo_session();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Create a temporary undo session as a child of _pending_tx_session.
|
// Create a temporary undo session as a child of _pending_tx_session.
|
||||||
// The temporary session will be discarded by the destructor if
|
// The temporary session will be discarded by the destructor if
|
||||||
// _apply_transaction fails. If we make it to merge(), we
|
// _apply_transaction fails. If we make it to merge(), we
|
||||||
// apply the changes.
|
// apply the changes.
|
||||||
|
|
||||||
|
const std::lock_guard<std::mutex> undo_db_lock{_undo_db_mutex};
|
||||||
auto temp_session = _undo_db.start_undo_session();
|
auto temp_session = _undo_db.start_undo_session();
|
||||||
auto processed_trx = _apply_transaction( trx );
|
auto processed_trx = _apply_transaction(trx);
|
||||||
|
{
|
||||||
|
const std::lock_guard<std::mutex> pending_tx_lock{_pending_tx_mutex};
|
||||||
_pending_tx.push_back(processed_trx);
|
_pending_tx.push_back(processed_trx);
|
||||||
|
}
|
||||||
|
|
||||||
// notify_changed_objects();
|
// notify_changed_objects();
|
||||||
// The transaction applied successfully. Merge its changes into the pending block session.
|
// The transaction applied successfully. Merge its changes into the pending block session.
|
||||||
|
|
@ -405,6 +427,7 @@ processed_transaction database::_push_transaction( const signed_transaction& trx
|
||||||
|
|
||||||
processed_transaction database::validate_transaction( const signed_transaction& trx )
|
processed_transaction database::validate_transaction( const signed_transaction& trx )
|
||||||
{
|
{
|
||||||
|
const std::lock_guard<std::mutex> undo_db_lock{_undo_db_mutex};
|
||||||
auto session = _undo_db.start_undo_session();
|
auto session = _undo_db.start_undo_session();
|
||||||
return _apply_transaction( trx );
|
return _apply_transaction( trx );
|
||||||
}
|
}
|
||||||
|
|
@ -433,7 +456,12 @@ processed_transaction database::push_proposal(const proposal_object& proposal)
|
||||||
{
|
{
|
||||||
for( size_t i=old_applied_ops_size,n=_applied_ops.size(); i<n; i++ )
|
for( size_t i=old_applied_ops_size,n=_applied_ops.size(); i<n; i++ )
|
||||||
{
|
{
|
||||||
ilog( "removing failed operation from applied_ops: ${op}", ("op", *(_applied_ops[i])) );
|
if(_applied_ops[i].valid()) {
|
||||||
|
ilog("removing failed operation from applied_ops: ${op}", ("op", *(_applied_ops[i])));
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
ilog("Can't remove failed operation from applied_ops (operation is not valid), op_id : ${op_id}", ("op_id", i));
|
||||||
|
}
|
||||||
_applied_ops[i].reset();
|
_applied_ops[i].reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -499,47 +527,52 @@ signed_block database::_generate_block(
|
||||||
// the value of the "when" variable is known, which means we need to
|
// the value of the "when" variable is known, which means we need to
|
||||||
// re-apply pending transactions in this method.
|
// re-apply pending transactions in this method.
|
||||||
//
|
//
|
||||||
|
{
|
||||||
|
const std::lock_guard<std::mutex> pending_tx_session_lock{_pending_tx_session_mutex};
|
||||||
_pending_tx_session.reset();
|
_pending_tx_session.reset();
|
||||||
_pending_tx_session = _undo_db.start_undo_session();
|
_pending_tx_session = _undo_db.start_undo_session();
|
||||||
|
}
|
||||||
|
|
||||||
uint64_t postponed_tx_count = 0;
|
uint64_t postponed_tx_count = 0;
|
||||||
// pop pending state (reset to head block state)
|
// pop pending state (reset to head block state)
|
||||||
for( const processed_transaction& tx : _pending_tx )
|
|
||||||
{
|
{
|
||||||
size_t new_total_size = total_block_size + fc::raw::pack_size( tx );
|
const std::lock_guard<std::mutex> pending_tx_lock{_pending_tx_mutex};
|
||||||
|
for (const processed_transaction &tx : _pending_tx) {
|
||||||
|
size_t new_total_size = total_block_size + fc::raw::pack_size(tx);
|
||||||
|
|
||||||
// postpone transaction if it would make block too big
|
// postpone transaction if it would make block too big
|
||||||
if( new_total_size >= maximum_block_size )
|
if (new_total_size >= maximum_block_size) {
|
||||||
{
|
|
||||||
postponed_tx_count++;
|
postponed_tx_count++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
auto temp_session = _undo_db.start_undo_session();
|
auto temp_session = _undo_db.start_undo_session();
|
||||||
processed_transaction ptx = _apply_transaction( tx );
|
processed_transaction ptx = _apply_transaction(tx);
|
||||||
temp_session.merge();
|
temp_session.merge();
|
||||||
|
|
||||||
// We have to recompute pack_size(ptx) because it may be different
|
// We have to recompute pack_size(ptx) because it may be different
|
||||||
// than pack_size(tx) (i.e. if one or more results increased
|
// than pack_size(tx) (i.e. if one or more results increased
|
||||||
// their size)
|
// their size)
|
||||||
total_block_size += fc::raw::pack_size( ptx );
|
total_block_size += fc::raw::pack_size(ptx);
|
||||||
pending_block.transactions.push_back( ptx );
|
pending_block.transactions.push_back(ptx);
|
||||||
}
|
} catch (const fc::exception &e) {
|
||||||
catch ( const fc::exception& e )
|
|
||||||
{
|
|
||||||
// Do nothing, transaction will not be re-applied
|
// Do nothing, transaction will not be re-applied
|
||||||
wlog( "Transaction was not processed while generating block due to ${e}", ("e", e) );
|
wlog("Transaction was not processed while generating block due to ${e}", ("e", e));
|
||||||
wlog( "The transaction was ${t}", ("t", tx) );
|
wlog("The transaction was ${t}", ("t", tx));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if( postponed_tx_count > 0 )
|
if( postponed_tx_count > 0 )
|
||||||
{
|
{
|
||||||
wlog( "Postponed ${n} transactions due to block size limit", ("n", postponed_tx_count) );
|
wlog( "Postponed ${n} transactions due to block size limit", ("n", postponed_tx_count) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
const std::lock_guard<std::mutex> pending_tx_session_lock{_pending_tx_session_mutex};
|
||||||
_pending_tx_session.reset();
|
_pending_tx_session.reset();
|
||||||
|
}
|
||||||
|
|
||||||
// We have temporarily broken the invariant that
|
// We have temporarily broken the invariant that
|
||||||
// _pending_tx_session is the result of applying _pending_tx, as
|
// _pending_tx_session is the result of applying _pending_tx, as
|
||||||
|
|
@ -587,7 +620,11 @@ signed_block database::_generate_block(
|
||||||
*/
|
*/
|
||||||
void database::pop_block()
|
void database::pop_block()
|
||||||
{ try {
|
{ try {
|
||||||
|
{
|
||||||
|
const std::lock_guard<std::mutex> pending_tx_session_lock{_pending_tx_session_mutex};
|
||||||
_pending_tx_session.reset();
|
_pending_tx_session.reset();
|
||||||
|
}
|
||||||
|
|
||||||
auto head_id = head_block_id();
|
auto head_id = head_block_id();
|
||||||
optional<signed_block> head_block = fetch_block_by_id( head_id );
|
optional<signed_block> head_block = fetch_block_by_id( head_id );
|
||||||
GRAPHENE_ASSERT( head_block.valid(), pop_empty_chain, "there are no blocks to pop" );
|
GRAPHENE_ASSERT( head_block.valid(), pop_empty_chain, "there are no blocks to pop" );
|
||||||
|
|
@ -601,6 +638,8 @@ void database::pop_block()
|
||||||
|
|
||||||
void database::clear_pending()
|
void database::clear_pending()
|
||||||
{ try {
|
{ try {
|
||||||
|
const std::lock_guard<std::mutex> pending_tx_lock{_pending_tx_mutex};
|
||||||
|
const std::lock_guard<std::mutex> pending_tx_session_lock{_pending_tx_session_mutex};
|
||||||
assert( (_pending_tx.size() == 0) || _pending_tx_session.valid() );
|
assert( (_pending_tx.size() == 0) || _pending_tx_session.valid() );
|
||||||
_pending_tx.clear();
|
_pending_tx.clear();
|
||||||
_pending_tx_session.reset();
|
_pending_tx_session.reset();
|
||||||
|
|
@ -619,7 +658,7 @@ uint32_t database::push_applied_operation( const operation& op )
|
||||||
void database::set_applied_operation_result( uint32_t op_id, const operation_result& result )
|
void database::set_applied_operation_result( uint32_t op_id, const operation_result& result )
|
||||||
{
|
{
|
||||||
assert( op_id < _applied_ops.size() );
|
assert( op_id < _applied_ops.size() );
|
||||||
if( _applied_ops[op_id] )
|
if( _applied_ops[op_id].valid() )
|
||||||
_applied_ops[op_id]->result = result;
|
_applied_ops[op_id]->result = result;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -700,8 +739,11 @@ void database::_apply_block( const signed_block& next_block )
|
||||||
|
|
||||||
if (global_props.parameters.witness_schedule_algorithm == GRAPHENE_WITNESS_SCHEDULED_ALGORITHM) {
|
if (global_props.parameters.witness_schedule_algorithm == GRAPHENE_WITNESS_SCHEDULED_ALGORITHM) {
|
||||||
update_witness_schedule(next_block);
|
update_witness_schedule(next_block);
|
||||||
if(global_props.active_sons.size() > 0) {
|
|
||||||
update_son_schedule(next_block);
|
for(const auto& active_sons : global_props.active_sons) {
|
||||||
|
if(!active_sons.second.empty()) {
|
||||||
|
update_son_schedule(active_sons.first, next_block);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -734,11 +776,15 @@ void database::_apply_block( const signed_block& next_block )
|
||||||
// TODO: figure out if we could collapse this function into
|
// TODO: figure out if we could collapse this function into
|
||||||
// update_global_dynamic_data() as perhaps these methods only need
|
// update_global_dynamic_data() as perhaps these methods only need
|
||||||
// to be called for header validation?
|
// to be called for header validation?
|
||||||
|
|
||||||
update_maintenance_flag( maint_needed );
|
update_maintenance_flag( maint_needed );
|
||||||
if (global_props.parameters.witness_schedule_algorithm == GRAPHENE_WITNESS_SHUFFLED_ALGORITHM) {
|
if (global_props.parameters.witness_schedule_algorithm == GRAPHENE_WITNESS_SHUFFLED_ALGORITHM) {
|
||||||
update_witness_schedule();
|
update_witness_schedule();
|
||||||
if(global_props.active_sons.size() > 0) {
|
|
||||||
update_son_schedule();
|
for(const auto& active_sidechain_type : active_sidechain_types(dynamic_global_props.time)) {
|
||||||
|
if(global_props.active_sons.at(active_sidechain_type).size() > 0) {
|
||||||
|
update_son_schedule(active_sidechain_type);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -806,7 +852,7 @@ processed_transaction database::_apply_transaction(const signed_transaction& trx
|
||||||
return get_account_custom_authorities(id, op);
|
return get_account_custom_authorities(id, op);
|
||||||
};
|
};
|
||||||
trx.verify_authority( chain_id, get_active, get_owner, get_custom,
|
trx.verify_authority( chain_id, get_active, get_owner, get_custom,
|
||||||
MUST_IGNORE_CUSTOM_OP_REQD_AUTHS(head_block_time()),
|
true,
|
||||||
get_global_properties().parameters.max_authority_depth );
|
get_global_properties().parameters.max_authority_depth );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -222,18 +222,33 @@ std::set<son_id_type> database::get_sons_to_be_deregistered()
|
||||||
|
|
||||||
for( auto& son : son_idx )
|
for( auto& son : son_idx )
|
||||||
{
|
{
|
||||||
if(son.status == son_status::in_maintenance)
|
bool need_to_be_deregistered = true;
|
||||||
|
for(const auto& status : son.statuses)
|
||||||
|
{
|
||||||
|
const auto& sidechain = status.first;
|
||||||
|
if(status.second != son_status::in_maintenance)
|
||||||
|
need_to_be_deregistered = false;
|
||||||
|
|
||||||
|
if(need_to_be_deregistered)
|
||||||
{
|
{
|
||||||
auto stats = son.statistics(*this);
|
auto stats = son.statistics(*this);
|
||||||
|
|
||||||
// TODO : We need to add a function that returns if we can deregister SON
|
// TODO : We need to add a function that returns if we can deregister SON
|
||||||
// i.e. with introduction of PW code, we have to make a decision if the SON
|
// i.e. with introduction of PW code, we have to make a decision if the SON
|
||||||
// is needed for release of funds from the PW
|
// is needed for release of funds from the PW
|
||||||
if(head_block_time() - stats.last_down_timestamp >= fc::seconds(get_global_properties().parameters.son_deregister_time()))
|
if(stats.last_active_timestamp.contains(sidechain)) {
|
||||||
|
if (head_block_time() - stats.last_active_timestamp.at(sidechain) < fc::seconds(get_global_properties().parameters.son_deregister_time())) {
|
||||||
|
need_to_be_deregistered = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(need_to_be_deregistered)
|
||||||
{
|
{
|
||||||
ret.insert(son.id);
|
ret.insert(son.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -289,28 +304,50 @@ bool database::is_son_dereg_valid( son_id_type son_id )
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (son->status == son_status::in_maintenance &&
|
bool status_son_dereg_valid = true;
|
||||||
(head_block_time() - son->statistics(*this).last_down_timestamp >= fc::seconds(get_global_properties().parameters.son_deregister_time())));
|
for (const auto &active_sidechain_type : active_sidechain_types(head_block_time())) {
|
||||||
|
if(son->statuses.at(active_sidechain_type) != son_status::in_maintenance)
|
||||||
|
status_son_dereg_valid = false;
|
||||||
|
|
||||||
|
if(status_son_dereg_valid)
|
||||||
|
{
|
||||||
|
if(son->statistics(*this).last_active_timestamp.contains(active_sidechain_type)) {
|
||||||
|
if (head_block_time() - son->statistics(*this).last_active_timestamp.at(active_sidechain_type) < fc::seconds(get_global_properties().parameters.son_deregister_time())) {
|
||||||
|
status_son_dereg_valid = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return status_son_dereg_valid;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool database::is_son_active( son_id_type son_id )
|
bool database::is_son_active( sidechain_type type, son_id_type son_id )
|
||||||
{
|
{
|
||||||
const auto& son_idx = get_index_type<son_index>().indices().get< by_id >();
|
const auto& son_idx = get_index_type<son_index>().indices().get< by_id >();
|
||||||
auto son = son_idx.find( son_id );
|
auto son = son_idx.find( son_id );
|
||||||
if(son == son_idx.end())
|
if(son == son_idx.end()) {
|
||||||
{
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const global_property_object& gpo = get_global_properties();
|
const global_property_object& gpo = get_global_properties();
|
||||||
|
if(!gpo.active_sons.contains(type)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const auto& gpo_as = gpo.active_sons.at(type);
|
||||||
vector<son_id_type> active_son_ids;
|
vector<son_id_type> active_son_ids;
|
||||||
active_son_ids.reserve(gpo.active_sons.size());
|
active_son_ids.reserve(gpo_as.size());
|
||||||
std::transform(gpo.active_sons.begin(), gpo.active_sons.end(),
|
std::transform(gpo_as.cbegin(), gpo_as.cend(),
|
||||||
std::inserter(active_son_ids, active_son_ids.end()),
|
std::inserter(active_son_ids, active_son_ids.end()),
|
||||||
[](const son_info& swi) {
|
[](const son_sidechain_info& swi) {
|
||||||
return swi.son_id;
|
return swi.son_id;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if(active_son_ids.empty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
auto it_son = std::find(active_son_ids.begin(), active_son_ids.end(), son_id);
|
auto it_son = std::find(active_son_ids.begin(), active_son_ids.end(), son_id);
|
||||||
return (it_son != active_son_ids.end());
|
return (it_son != active_son_ids.end());
|
||||||
}
|
}
|
||||||
|
|
@ -347,4 +384,16 @@ vector<uint64_t> database::get_random_numbers(uint64_t minimum, uint64_t maximum
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
} }
|
bool database::is_asset_creation_allowed(const string &symbol)
|
||||||
|
{
|
||||||
|
if (symbol == "BTC")
|
||||||
|
{
|
||||||
|
if (head_block_time() < HARDFORK_SON_TIME)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -329,10 +329,54 @@ void database::initialize_evaluators()
|
||||||
register_evaluator<random_number_store_evaluator>();
|
register_evaluator<random_number_store_evaluator>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void database::initialize_hardforks()
|
||||||
|
{
|
||||||
|
_hardfork_times.emplace_back(HARDFORK_357_TIME);
|
||||||
|
_hardfork_times.emplace_back(HARDFORK_359_TIME);
|
||||||
|
_hardfork_times.emplace_back(HARDFORK_385_TIME);
|
||||||
|
_hardfork_times.emplace_back(HARDFORK_409_TIME);
|
||||||
|
_hardfork_times.emplace_back(HARDFORK_413_TIME);
|
||||||
|
_hardfork_times.emplace_back(HARDFORK_415_TIME);
|
||||||
|
_hardfork_times.emplace_back(HARDFORK_416_TIME);
|
||||||
|
_hardfork_times.emplace_back(HARDFORK_419_TIME);
|
||||||
|
_hardfork_times.emplace_back(HARDFORK_436_TIME);
|
||||||
|
_hardfork_times.emplace_back(HARDFORK_445_TIME);
|
||||||
|
_hardfork_times.emplace_back(HARDFORK_453_TIME);
|
||||||
|
_hardfork_times.emplace_back(HARDFORK_480_TIME);
|
||||||
|
_hardfork_times.emplace_back(HARDFORK_483_TIME);
|
||||||
|
_hardfork_times.emplace_back(HARDFORK_516_TIME);
|
||||||
|
_hardfork_times.emplace_back(HARDFORK_533_TIME);
|
||||||
|
_hardfork_times.emplace_back(HARDFORK_538_TIME);
|
||||||
|
_hardfork_times.emplace_back(HARDFORK_555_TIME);
|
||||||
|
_hardfork_times.emplace_back(HARDFORK_563_TIME);
|
||||||
|
_hardfork_times.emplace_back(HARDFORK_572_TIME);
|
||||||
|
_hardfork_times.emplace_back(HARDFORK_599_TIME);
|
||||||
|
_hardfork_times.emplace_back(HARDFORK_607_TIME);
|
||||||
|
_hardfork_times.emplace_back(HARDFORK_613_TIME);
|
||||||
|
_hardfork_times.emplace_back(HARDFORK_615_TIME);
|
||||||
|
_hardfork_times.emplace_back(HARDFORK_999_TIME);
|
||||||
|
_hardfork_times.emplace_back(HARDFORK_1000_TIME);
|
||||||
|
_hardfork_times.emplace_back(HARDFORK_1001_TIME);
|
||||||
|
_hardfork_times.emplace_back(HARDFORK_5050_1_TIME);
|
||||||
|
_hardfork_times.emplace_back(HARDFORK_CORE_429_TIME);
|
||||||
|
_hardfork_times.emplace_back(HARDFORK_GPOS_TIME);
|
||||||
|
_hardfork_times.emplace_back(HARDFORK_NFT_TIME);
|
||||||
|
_hardfork_times.emplace_back(HARDFORK_SON_FOR_HIVE_TIME);
|
||||||
|
_hardfork_times.emplace_back(HARDFORK_SON_TIME);
|
||||||
|
_hardfork_times.emplace_back(HARDFORK_SON2_TIME);
|
||||||
|
_hardfork_times.emplace_back(HARDFORK_SON_FOR_ETHEREUM_TIME);
|
||||||
|
_hardfork_times.emplace_back(HARDFORK_SWEEPS_TIME);
|
||||||
|
|
||||||
|
std::sort(_hardfork_times.begin(), _hardfork_times.end());
|
||||||
|
}
|
||||||
|
|
||||||
void database::initialize_indexes()
|
void database::initialize_indexes()
|
||||||
{
|
{
|
||||||
reset_indexes();
|
reset_indexes();
|
||||||
_undo_db.set_max_size( GRAPHENE_MIN_UNDO_HISTORY );
|
|
||||||
|
const std::lock_guard<std::mutex> undo_db_lock{_undo_db_mutex};
|
||||||
|
_undo_db.set_max_size(GRAPHENE_MIN_UNDO_HISTORY);
|
||||||
|
|
||||||
//Protocol object indexes
|
//Protocol object indexes
|
||||||
add_index< primary_index<asset_index, 13> >(); // 8192 assets per chunk
|
add_index< primary_index<asset_index, 13> >(); // 8192 assets per chunk
|
||||||
|
|
@ -432,7 +476,9 @@ void database::init_genesis(const genesis_state_type& genesis_state)
|
||||||
FC_ASSERT(genesis_state.initial_active_witnesses <= genesis_state.initial_witness_candidates.size(),
|
FC_ASSERT(genesis_state.initial_active_witnesses <= genesis_state.initial_witness_candidates.size(),
|
||||||
"initial_active_witnesses is larger than the number of candidate witnesses.");
|
"initial_active_witnesses is larger than the number of candidate witnesses.");
|
||||||
|
|
||||||
|
const std::lock_guard<std::mutex> undo_db_lock{_undo_db_mutex};
|
||||||
_undo_db.disable();
|
_undo_db.disable();
|
||||||
|
|
||||||
struct auth_inhibitor {
|
struct auth_inhibitor {
|
||||||
auth_inhibitor(database& db) : db(db), old_flags(db.node_properties().skip_flags)
|
auth_inhibitor(database& db) : db(db), old_flags(db.node_properties().skip_flags)
|
||||||
{ db.node_properties().skip_flags |= skip_authority_check; }
|
{ db.node_properties().skip_flags |= skip_authority_check; }
|
||||||
|
|
@ -1058,8 +1104,9 @@ void database::init_genesis(const genesis_state_type& genesis_state)
|
||||||
FC_ASSERT( _p_witness_schedule_obj->id == witness_schedule_id_type() );
|
FC_ASSERT( _p_witness_schedule_obj->id == witness_schedule_id_type() );
|
||||||
|
|
||||||
// Initialize witness schedule
|
// Initialize witness schedule
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
const son_schedule_object& sso =
|
const son_schedule_object& ssobitcoin =
|
||||||
#endif
|
#endif
|
||||||
create<son_schedule_object>([&](son_schedule_object& _sso)
|
create<son_schedule_object>([&](son_schedule_object& _sso)
|
||||||
{
|
{
|
||||||
|
|
@ -1068,24 +1115,64 @@ void database::init_genesis(const genesis_state_type& genesis_state)
|
||||||
|
|
||||||
witness_scheduler_rng rng(_sso.rng_seed.begin(), GRAPHENE_NEAR_SCHEDULE_CTR_IV);
|
witness_scheduler_rng rng(_sso.rng_seed.begin(), GRAPHENE_NEAR_SCHEDULE_CTR_IV);
|
||||||
|
|
||||||
auto init_witnesses = get_global_properties().active_witnesses;
|
auto init_bitcoin_sons = get_global_properties().active_sons.at(sidechain_type::bitcoin);
|
||||||
|
|
||||||
_sso.scheduler = son_scheduler();
|
_sso.scheduler = son_scheduler();
|
||||||
_sso.scheduler._min_token_count = std::max(int(init_witnesses.size()) / 2, 1);
|
_sso.scheduler._min_token_count = std::max(int(init_bitcoin_sons.size()) / 2, 1);
|
||||||
|
|
||||||
|
|
||||||
_sso.last_scheduling_block = 0;
|
_sso.last_scheduling_block = 0;
|
||||||
|
|
||||||
_sso.recent_slots_filled = fc::uint128::max_value();
|
_sso.recent_slots_filled = fc::uint128::max_value();
|
||||||
});
|
});
|
||||||
assert( sso.id == son_schedule_id_type() );
|
assert( ssobitcoin.id == son_schedule_id_type(get_son_schedule_id(sidechain_type::bitcoin)) );
|
||||||
|
|
||||||
|
#ifndef NDEBUG
|
||||||
|
const son_schedule_object& ssoethereum =
|
||||||
|
#endif
|
||||||
|
create<son_schedule_object>([&](son_schedule_object& _sso)
|
||||||
|
{
|
||||||
|
// for scheduled
|
||||||
|
memset(_sso.rng_seed.begin(), 0, _sso.rng_seed.size());
|
||||||
|
|
||||||
|
witness_scheduler_rng rng(_sso.rng_seed.begin(), GRAPHENE_NEAR_SCHEDULE_CTR_IV);
|
||||||
|
|
||||||
|
auto init_ethereum_sons = get_global_properties().active_sons.at(sidechain_type::ethereum);
|
||||||
|
|
||||||
|
_sso.scheduler = son_scheduler();
|
||||||
|
_sso.scheduler._min_token_count = std::max(int(init_ethereum_sons.size()) / 2, 1);
|
||||||
|
|
||||||
|
_sso.last_scheduling_block = 0;
|
||||||
|
|
||||||
|
_sso.recent_slots_filled = fc::uint128::max_value();
|
||||||
|
});
|
||||||
|
assert( ssoethereum.id == son_schedule_id_type(get_son_schedule_id(sidechain_type::ethereum)) );
|
||||||
|
|
||||||
|
#ifndef NDEBUG
|
||||||
|
const son_schedule_object& ssohive =
|
||||||
|
#endif
|
||||||
|
create<son_schedule_object>([&](son_schedule_object& _sso)
|
||||||
|
{
|
||||||
|
// for scheduled
|
||||||
|
memset(_sso.rng_seed.begin(), 0, _sso.rng_seed.size());
|
||||||
|
|
||||||
|
witness_scheduler_rng rng(_sso.rng_seed.begin(), GRAPHENE_NEAR_SCHEDULE_CTR_IV);
|
||||||
|
|
||||||
|
auto init_hive_sons = get_global_properties().active_sons.at(sidechain_type::hive);
|
||||||
|
|
||||||
|
_sso.scheduler = son_scheduler();
|
||||||
|
_sso.scheduler._min_token_count = std::max(int(init_hive_sons.size()) / 2, 1);
|
||||||
|
|
||||||
|
_sso.last_scheduling_block = 0;
|
||||||
|
|
||||||
|
_sso.recent_slots_filled = fc::uint128::max_value();
|
||||||
|
});
|
||||||
|
assert( ssohive.id == son_schedule_id_type(get_son_schedule_id(sidechain_type::hive)) );
|
||||||
|
|
||||||
// Enable fees
|
// Enable fees
|
||||||
modify(get_global_properties(), [&genesis_state](global_property_object& p) {
|
modify(get_global_properties(), [&genesis_state](global_property_object& p) {
|
||||||
p.parameters.current_fees = genesis_state.initial_parameters.current_fees;
|
p.parameters.current_fees = genesis_state.initial_parameters.current_fees;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// Create FBA counters
|
// Create FBA counters
|
||||||
create<fba_accumulator_object>([&]( fba_accumulator_object& acc )
|
create<fba_accumulator_object>([&]( fba_accumulator_object& acc )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -44,6 +44,7 @@ database::database() :
|
||||||
{
|
{
|
||||||
initialize_indexes();
|
initialize_indexes();
|
||||||
initialize_evaluators();
|
initialize_evaluators();
|
||||||
|
initialize_hardforks();
|
||||||
}
|
}
|
||||||
|
|
||||||
database::~database()
|
database::~database()
|
||||||
|
|
@ -123,7 +124,7 @@ void database::reindex( fc::path data_dir )
|
||||||
}
|
}
|
||||||
for( uint32_t i = head_block_num() + 1; i <= last_block_num; ++i )
|
for( uint32_t i = head_block_num() + 1; i <= last_block_num; ++i )
|
||||||
{
|
{
|
||||||
if( i % 10000 == 0 )
|
if( i % 1000000 == 0 )
|
||||||
{
|
{
|
||||||
ilog( "Writing database to disk at block ${i}", ("i",i) );
|
ilog( "Writing database to disk at block ${i}", ("i",i) );
|
||||||
flush();
|
flush();
|
||||||
|
|
@ -232,7 +233,12 @@ void database::open(
|
||||||
FC_ASSERT( *last_block >= head_block_id(),
|
FC_ASSERT( *last_block >= head_block_id(),
|
||||||
"last block ID does not match current chain state",
|
"last block ID does not match current chain state",
|
||||||
("last_block->id", last_block)("head_block_id",head_block_num()) );
|
("last_block->id", last_block)("head_block_id",head_block_num()) );
|
||||||
|
|
||||||
|
_block_id_to_block.set_replay_mode(true);
|
||||||
|
|
||||||
reindex( data_dir );
|
reindex( data_dir );
|
||||||
|
|
||||||
|
_block_id_to_block.set_replay_mode(false);
|
||||||
}
|
}
|
||||||
_opened = true;
|
_opened = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -203,27 +203,10 @@ struct get_impacted_account_visitor
|
||||||
_impacted.insert( op.issuer );
|
_impacted.insert( op.issuer );
|
||||||
}
|
}
|
||||||
|
|
||||||
void operator()( const transfer_to_blind_operation& op )
|
//! We don't use this operations
|
||||||
{
|
void operator()( const transfer_to_blind_operation& op ){}
|
||||||
_impacted.insert( op.from );
|
void operator()( const blind_transfer_operation& op ){}
|
||||||
for( const auto& out : op.outputs )
|
void operator()( const transfer_from_blind_operation& op ){}
|
||||||
add_authority_accounts( _impacted, out.owner );
|
|
||||||
}
|
|
||||||
|
|
||||||
void operator()( const blind_transfer_operation& op )
|
|
||||||
{
|
|
||||||
for( const auto& in : op.inputs )
|
|
||||||
add_authority_accounts( _impacted, in.owner );
|
|
||||||
for( const auto& out : op.outputs )
|
|
||||||
add_authority_accounts( _impacted, out.owner );
|
|
||||||
}
|
|
||||||
|
|
||||||
void operator()( const transfer_from_blind_operation& op )
|
|
||||||
{
|
|
||||||
_impacted.insert( op.to );
|
|
||||||
for( const auto& in : op.inputs )
|
|
||||||
add_authority_accounts( _impacted, in.owner );
|
|
||||||
}
|
|
||||||
|
|
||||||
void operator()( const asset_settle_cancel_operation& op )
|
void operator()( const asset_settle_cancel_operation& op )
|
||||||
{
|
{
|
||||||
|
|
@ -625,7 +608,6 @@ void database::notify_changed_objects()
|
||||||
if( _undo_db.enabled() )
|
if( _undo_db.enabled() )
|
||||||
{
|
{
|
||||||
const auto& head_undo = _undo_db.head();
|
const auto& head_undo = _undo_db.head();
|
||||||
auto chain_time = head_block_time();
|
|
||||||
|
|
||||||
// New
|
// New
|
||||||
if( !new_objects.empty() )
|
if( !new_objects.empty() )
|
||||||
|
|
@ -637,8 +619,7 @@ void database::notify_changed_objects()
|
||||||
new_ids.push_back(item);
|
new_ids.push_back(item);
|
||||||
auto obj = find_object(item);
|
auto obj = find_object(item);
|
||||||
if(obj != nullptr)
|
if(obj != nullptr)
|
||||||
get_relevant_accounts(obj, new_accounts_impacted,
|
get_relevant_accounts(obj, new_accounts_impacted, true);
|
||||||
MUST_IGNORE_CUSTOM_OP_REQD_AUTHS(chain_time));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GRAPHENE_TRY_NOTIFY( new_objects, new_ids, new_accounts_impacted)
|
GRAPHENE_TRY_NOTIFY( new_objects, new_ids, new_accounts_impacted)
|
||||||
|
|
@ -652,8 +633,7 @@ void database::notify_changed_objects()
|
||||||
for( const auto& item : head_undo.old_values )
|
for( const auto& item : head_undo.old_values )
|
||||||
{
|
{
|
||||||
changed_ids.push_back(item.first);
|
changed_ids.push_back(item.first);
|
||||||
get_relevant_accounts(item.second.get(), changed_accounts_impacted,
|
get_relevant_accounts(item.second.get(), changed_accounts_impacted, true);
|
||||||
MUST_IGNORE_CUSTOM_OP_REQD_AUTHS(chain_time));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GRAPHENE_TRY_NOTIFY( changed_objects, changed_ids, changed_accounts_impacted)
|
GRAPHENE_TRY_NOTIFY( changed_objects, changed_ids, changed_accounts_impacted)
|
||||||
|
|
@ -670,8 +650,7 @@ void database::notify_changed_objects()
|
||||||
removed_ids.emplace_back( item.first );
|
removed_ids.emplace_back( item.first );
|
||||||
auto obj = item.second.get();
|
auto obj = item.second.get();
|
||||||
removed.emplace_back( obj );
|
removed.emplace_back( obj );
|
||||||
get_relevant_accounts(obj, removed_accounts_impacted,
|
get_relevant_accounts(obj, removed_accounts_impacted, true);
|
||||||
MUST_IGNORE_CUSTOM_OP_REQD_AUTHS(chain_time));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GRAPHENE_TRY_NOTIFY( removed_objects, removed_ids, removed, removed_accounts_impacted)
|
GRAPHENE_TRY_NOTIFY( removed_objects, removed_ids, removed, removed_accounts_impacted)
|
||||||
|
|
|
||||||
|
|
@ -74,21 +74,32 @@ witness_id_type database::get_scheduled_witness( uint32_t slot_num )const
|
||||||
return wid;
|
return wid;
|
||||||
}
|
}
|
||||||
|
|
||||||
son_id_type database::get_scheduled_son( uint32_t slot_num )const
|
unsigned_int database::get_son_schedule_id( sidechain_type type )const
|
||||||
|
{
|
||||||
|
static const map<sidechain_type, unsigned_int> schedule_map = {
|
||||||
|
{ sidechain_type::bitcoin, 0 },
|
||||||
|
{ sidechain_type::ethereum, 1 },
|
||||||
|
{ sidechain_type::hive, 2 }
|
||||||
|
};
|
||||||
|
|
||||||
|
return schedule_map.at(type);
|
||||||
|
}
|
||||||
|
|
||||||
|
son_id_type database::get_scheduled_son( sidechain_type type, uint32_t slot_num )const
|
||||||
{
|
{
|
||||||
son_id_type sid;
|
son_id_type sid;
|
||||||
const global_property_object& gpo = get_global_properties();
|
const global_property_object& gpo = get_global_properties();
|
||||||
if (gpo.parameters.witness_schedule_algorithm == GRAPHENE_WITNESS_SHUFFLED_ALGORITHM)
|
if (gpo.parameters.witness_schedule_algorithm == GRAPHENE_WITNESS_SHUFFLED_ALGORITHM)
|
||||||
{
|
{
|
||||||
const dynamic_global_property_object& dpo = get_dynamic_global_properties();
|
const dynamic_global_property_object& dpo = get_dynamic_global_properties();
|
||||||
const son_schedule_object& sso = son_schedule_id_type()(*this);
|
const son_schedule_object& sso = son_schedule_id_type(get_son_schedule_id(type))(*this);
|
||||||
uint64_t current_aslot = dpo.current_aslot + slot_num;
|
uint64_t current_aslot = dpo.current_aslot + slot_num;
|
||||||
return sso.current_shuffled_sons[ current_aslot % sso.current_shuffled_sons.size() ];
|
return sso.current_shuffled_sons[ current_aslot % sso.current_shuffled_sons.size() ];
|
||||||
}
|
}
|
||||||
if (gpo.parameters.witness_schedule_algorithm == GRAPHENE_WITNESS_SCHEDULED_ALGORITHM &&
|
if (gpo.parameters.witness_schedule_algorithm == GRAPHENE_WITNESS_SCHEDULED_ALGORITHM &&
|
||||||
slot_num != 0 )
|
slot_num != 0 )
|
||||||
{
|
{
|
||||||
const son_schedule_object& sso = son_schedule_id_type()(*this);
|
const son_schedule_object& sso = son_schedule_id_type(get_son_schedule_id(type))(*this);
|
||||||
// ask the near scheduler who goes in the given slot
|
// ask the near scheduler who goes in the given slot
|
||||||
bool slot_is_near = sso.scheduler.get_slot(slot_num-1, sid);
|
bool slot_is_near = sso.scheduler.get_slot(slot_num-1, sid);
|
||||||
if(! slot_is_near)
|
if(! slot_is_near)
|
||||||
|
|
@ -189,36 +200,39 @@ void database::update_witness_schedule()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void database::update_son_schedule()
|
void database::update_son_schedule(sidechain_type type)
|
||||||
{
|
{
|
||||||
const son_schedule_object& sso = son_schedule_id_type()(*this);
|
|
||||||
const global_property_object& gpo = get_global_properties();
|
const global_property_object& gpo = get_global_properties();
|
||||||
|
|
||||||
if( head_block_num() % gpo.active_sons.size() == 0 )
|
const son_schedule_object& sidechain_sso = get(son_schedule_id_type(get_son_schedule_id(type)));
|
||||||
|
if( gpo.active_sons.at(type).size() != 0 &&
|
||||||
|
head_block_num() % gpo.active_sons.at(type).size() == 0)
|
||||||
{
|
{
|
||||||
modify( sso, [&]( son_schedule_object& _sso )
|
modify( sidechain_sso, [&]( son_schedule_object& _sso )
|
||||||
{
|
{
|
||||||
_sso.current_shuffled_sons.clear();
|
_sso.current_shuffled_sons.clear();
|
||||||
_sso.current_shuffled_sons.reserve( gpo.active_sons.size() );
|
_sso.current_shuffled_sons.reserve( gpo.active_sons.at(type).size() );
|
||||||
|
|
||||||
for( const son_info& w : gpo.active_sons )
|
for ( const auto &w : gpo.active_sons.at(type) ) {
|
||||||
_sso.current_shuffled_sons.push_back( w.son_id );
|
_sso.current_shuffled_sons.push_back(w.son_id);
|
||||||
|
}
|
||||||
|
|
||||||
auto now_hi = uint64_t(head_block_time().sec_since_epoch()) << 32;
|
auto now_hi = uint64_t(head_block_time().sec_since_epoch()) << 32;
|
||||||
for( uint32_t i = 0; i < _sso.current_shuffled_sons.size(); ++i )
|
|
||||||
|
for (uint32_t i = 0; i < _sso.current_shuffled_sons.size(); ++i)
|
||||||
{
|
{
|
||||||
/// High performance random generator
|
/// High performance random generator
|
||||||
/// http://xorshift.di.unimi.it/
|
/// http://xorshift.di.unimi.it/
|
||||||
uint64_t k = now_hi + uint64_t(i)*2685821657736338717ULL;
|
uint64_t k = now_hi + uint64_t(i) * 2685821657736338717ULL;
|
||||||
k ^= (k >> 12);
|
k ^= (k >> 12);
|
||||||
k ^= (k << 25);
|
k ^= (k << 25);
|
||||||
k ^= (k >> 27);
|
k ^= (k >> 27);
|
||||||
k *= 2685821657736338717ULL;
|
k *= 2685821657736338717ULL;
|
||||||
|
|
||||||
uint32_t jmax = _sso.current_shuffled_sons.size() - i;
|
uint32_t jmax = _sso.current_shuffled_sons.size() - i;
|
||||||
uint32_t j = i + k%jmax;
|
uint32_t j = i + k % jmax;
|
||||||
std::swap( _sso.current_shuffled_sons[i],
|
std::swap(_sso.current_shuffled_sons[i],
|
||||||
_sso.current_shuffled_sons[j] );
|
_sso.current_shuffled_sons[j]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -304,13 +318,15 @@ void database::update_witness_schedule(const signed_block& next_block)
|
||||||
idump( ( double(total_time/1000000.0)/calls) );
|
idump( ( double(total_time/1000000.0)/calls) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void database::update_son_schedule(const signed_block& next_block)
|
void database::update_son_schedule(sidechain_type type, const signed_block& next_block)
|
||||||
{
|
{
|
||||||
auto start = fc::time_point::now();
|
auto start = fc::time_point::now();
|
||||||
const global_property_object& gpo = get_global_properties();
|
#ifndef NDEBUG
|
||||||
const son_schedule_object& sso = get(son_schedule_id_type());
|
const son_schedule_object& sso = get(son_schedule_id_type());
|
||||||
uint32_t schedule_needs_filled = gpo.active_sons.size();
|
#endif
|
||||||
uint32_t schedule_slot = get_slot_at_time(next_block.timestamp);
|
const global_property_object& gpo = get_global_properties();
|
||||||
|
const uint32_t schedule_needs_filled = gpo.active_sons.at(type).size();
|
||||||
|
const uint32_t schedule_slot = get_slot_at_time(next_block.timestamp);
|
||||||
|
|
||||||
// We shouldn't be able to generate _pending_block with timestamp
|
// We shouldn't be able to generate _pending_block with timestamp
|
||||||
// in the past, and incoming blocks from the network with timestamp
|
// in the past, and incoming blocks from the network with timestamp
|
||||||
|
|
@ -319,22 +335,22 @@ void database::update_son_schedule(const signed_block& next_block)
|
||||||
|
|
||||||
assert( schedule_slot > 0 );
|
assert( schedule_slot > 0 );
|
||||||
|
|
||||||
son_id_type first_son;
|
|
||||||
bool slot_is_near = sso.scheduler.get_slot( schedule_slot-1, first_son );
|
|
||||||
|
|
||||||
son_id_type son;
|
|
||||||
|
|
||||||
const dynamic_global_property_object& dpo = get_dynamic_global_properties();
|
const dynamic_global_property_object& dpo = get_dynamic_global_properties();
|
||||||
|
|
||||||
assert( dpo.random.data_size() == witness_scheduler_rng::seed_length );
|
assert( dpo.random.data_size() == witness_scheduler_rng::seed_length );
|
||||||
assert( witness_scheduler_rng::seed_length == sso.rng_seed.size() );
|
assert( witness_scheduler_rng::seed_length == sso.rng_seed.size() );
|
||||||
|
|
||||||
modify(sso, [&](son_schedule_object& _sso)
|
const son_schedule_object& sidechain_sso = get(son_schedule_id_type(get_son_schedule_id(type)));
|
||||||
|
son_id_type first_son;
|
||||||
|
bool slot_is_near = sidechain_sso.scheduler.get_slot( schedule_slot-1, first_son );
|
||||||
|
son_id_type son_id;
|
||||||
|
|
||||||
|
modify(sidechain_sso, [&](son_schedule_object& _sso)
|
||||||
{
|
{
|
||||||
_sso.slots_since_genesis += schedule_slot;
|
_sso.slots_since_genesis += schedule_slot;
|
||||||
witness_scheduler_rng rng(sso.rng_seed.data, _sso.slots_since_genesis);
|
witness_scheduler_rng rng(_sso.rng_seed.data, _sso.slots_since_genesis);
|
||||||
|
|
||||||
_sso.scheduler._min_token_count = std::max(int(gpo.active_sons.size()) / 2, 1);
|
_sso.scheduler._min_token_count = std::max(int(gpo.active_sons.at(type).size()) / 2, 1);
|
||||||
|
|
||||||
if( slot_is_near )
|
if( slot_is_near )
|
||||||
{
|
{
|
||||||
|
|
@ -351,7 +367,7 @@ void database::update_son_schedule(const signed_block& next_block)
|
||||||
{
|
{
|
||||||
_sso.scheduler.reset_schedule( first_son );
|
_sso.scheduler.reset_schedule( first_son );
|
||||||
}
|
}
|
||||||
while( !_sso.scheduler.get_slot(schedule_needs_filled, son) )
|
while( !_sso.scheduler.get_slot(schedule_needs_filled, son_id) )
|
||||||
{
|
{
|
||||||
if( _sso.scheduler.produce_schedule(rng) & emit_turn )
|
if( _sso.scheduler.produce_schedule(rng) & emit_turn )
|
||||||
memcpy(_sso.rng_seed.begin(), dpo.random.data(), dpo.random.data_size());
|
memcpy(_sso.rng_seed.begin(), dpo.random.data(), dpo.random.data_size());
|
||||||
|
|
@ -361,6 +377,7 @@ void database::update_son_schedule(const signed_block& next_block)
|
||||||
(_sso.recent_slots_filled << 1)
|
(_sso.recent_slots_filled << 1)
|
||||||
+ 1) << (schedule_slot - 1);
|
+ 1) << (schedule_slot - 1);
|
||||||
});
|
});
|
||||||
|
|
||||||
auto end = fc::time_point::now();
|
auto end = fc::time_point::now();
|
||||||
static uint64_t total_time = 0;
|
static uint64_t total_time = 0;
|
||||||
static uint64_t calls = 0;
|
static uint64_t calls = 0;
|
||||||
|
|
|
||||||
|
|
@ -344,7 +344,6 @@ namespace graphene { namespace chain {
|
||||||
{
|
{
|
||||||
FC_THROW_EXCEPTION(graphene::chain::no_transition, "No transition");
|
FC_THROW_EXCEPTION(graphene::chain::no_transition, "No transition");
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Fsm>
|
template <class Fsm>
|
||||||
void no_transition(canceled_event const& e, Fsm&, int state)
|
void no_transition(canceled_event const& e, Fsm&, int state)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,7 @@
|
||||||
#ifndef HARDFORK_1000_TIME
|
#ifndef HARDFORK_1000_TIME
|
||||||
#define HARDFORK_1000_TIME (fc::time_point_sec( 1540000000 ))
|
#ifdef BUILD_PEERPLAYS_TESTNET
|
||||||
|
#define HARDFORK_1000_TIME (fc::time_point_sec::from_iso_string("2018-10-20T01:46:40"))
|
||||||
|
#else
|
||||||
|
#define HARDFORK_1000_TIME (fc::time_point_sec::from_iso_string("2019-02-18T12:00:00"))
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
// added delete sport and delete event group operations
|
// added delete sport and delete event group operations
|
||||||
#ifndef HARDFORK_1001_TIME
|
#ifndef HARDFORK_1001_TIME
|
||||||
#define HARDFORK_1001_TIME (fc::time_point_sec( 1540000000 ))
|
#ifdef BUILD_PEERPLAYS_TESTNET
|
||||||
|
#define HARDFORK_1001_TIME (fc::time_point_sec::from_iso_string("2018-10-20T01:46:40"))
|
||||||
|
#else
|
||||||
|
#define HARDFORK_1001_TIME (fc::time_point_sec::from_iso_string("2019-02-18T12:00:00"))
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
// #357 Disallow publishing certain malformed price feeds
|
// #357 Disallow publishing certain malformed price feeds
|
||||||
#ifndef HARDFORK_357_TIME
|
#ifndef HARDFORK_357_TIME
|
||||||
#define HARDFORK_357_TIME (fc::time_point_sec( 1444416300 ))
|
#ifdef BUILD_PEERPLAYS_TESTNET
|
||||||
|
#define HARDFORK_357_TIME (fc::time_point_sec::from_iso_string("2015-10-09T18:45:00"))
|
||||||
|
#else
|
||||||
|
#define HARDFORK_357_TIME (fc::time_point_sec::from_iso_string("2015-10-09T18:45:00"))
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
// #359 Allow digits in asset name
|
// #359 Allow digits in asset name
|
||||||
#ifndef HARDFORK_359_TIME
|
#ifndef HARDFORK_359_TIME
|
||||||
#define HARDFORK_359_TIME (fc::time_point_sec( 1444416300 ))
|
#ifdef BUILD_PEERPLAYS_TESTNET
|
||||||
|
#define HARDFORK_359_TIME (fc::time_point_sec::from_iso_string("2015-10-09T18:45:00"))
|
||||||
|
#else
|
||||||
|
#define HARDFORK_359_TIME (fc::time_point_sec::from_iso_string("2015-10-09T18:45:00"))
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
// #385 October 23 enforce PARENT.CHILD and allow short names
|
// #385 October 23 enforce PARENT.CHILD and allow short names
|
||||||
#ifndef HARDFORK_385_TIME
|
#ifndef HARDFORK_385_TIME
|
||||||
#define HARDFORK_385_TIME (fc::time_point_sec( 1445558400 ))
|
#ifdef BUILD_PEERPLAYS_TESTNET
|
||||||
|
#define HARDFORK_385_TIME (fc::time_point_sec::from_iso_string("2015-10-23T00:00:00"))
|
||||||
|
#else
|
||||||
|
#define HARDFORK_385_TIME (fc::time_point_sec::from_iso_string("2015-10-23T00:00:00"))
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
// #409 Allow creation of sub-assets
|
// #409 Allow creation of sub-assets
|
||||||
#ifndef HARDFORK_409_TIME
|
#ifndef HARDFORK_409_TIME
|
||||||
#define HARDFORK_409_TIME (fc::time_point_sec( 1446652800 ))
|
#ifdef BUILD_PEERPLAYS_TESTNET
|
||||||
|
#define HARDFORK_409_TIME (fc::time_point_sec::from_iso_string("2015-11-04T16:00:00"))
|
||||||
|
#else
|
||||||
|
#define HARDFORK_409_TIME (fc::time_point_sec::from_iso_string("2015-11-04T16:00:00"))
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
// #413 Add operation to claim asset fees
|
// #413 Add operation to claim asset fees
|
||||||
#ifndef HARDFORK_413_TIME
|
#ifndef HARDFORK_413_TIME
|
||||||
#define HARDFORK_413_TIME (fc::time_point_sec( 1446652800 ))
|
#ifdef BUILD_PEERPLAYS_TESTNET
|
||||||
|
#define HARDFORK_413_TIME (fc::time_point_sec::from_iso_string("2015-11-04T16:00:00"))
|
||||||
|
#else
|
||||||
|
#define HARDFORK_413_TIME (fc::time_point_sec::from_iso_string("2015-11-04T16:00:00"))
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
// #415 Default accept policy for asset with no whitelist authorities
|
// #415 Default accept policy for asset with no whitelist authorities
|
||||||
#ifndef HARDFORK_415_TIME
|
#ifndef HARDFORK_415_TIME
|
||||||
#define HARDFORK_415_TIME (fc::time_point_sec( 1446652800 ))
|
#ifdef BUILD_PEERPLAYS_TESTNET
|
||||||
|
#define HARDFORK_415_TIME (fc::time_point_sec::from_iso_string("2015-11-04T16:00:00"))
|
||||||
|
#else
|
||||||
|
#define HARDFORK_415_TIME (fc::time_point_sec::from_iso_string("2015-11-04T16:00:00"))
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
// #416 enforce_white_list is inconsistently applied
|
// #416 enforce_white_list is inconsistently applied
|
||||||
#ifndef HARDFORK_416_TIME
|
#ifndef HARDFORK_416_TIME
|
||||||
#define HARDFORK_416_TIME (fc::time_point_sec( 1446652800 ))
|
#ifdef BUILD_PEERPLAYS_TESTNET
|
||||||
|
#define HARDFORK_416_TIME (fc::time_point_sec::from_iso_string("2015-11-04T16:00:00"))
|
||||||
|
#else
|
||||||
|
#define HARDFORK_416_TIME (fc::time_point_sec::from_iso_string("2015-11-04T16:00:00"))
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
// #419 Account can pay fees in blacklisted asset
|
// #419 Account can pay fees in blacklisted asset
|
||||||
#ifndef HARDFORK_419_TIME
|
#ifndef HARDFORK_419_TIME
|
||||||
#define HARDFORK_419_TIME (fc::time_point_sec( 1446652800 ))
|
#ifdef BUILD_PEERPLAYS_TESTNET
|
||||||
|
#define HARDFORK_419_TIME (fc::time_point_sec::from_iso_string("2015-11-04T16:00:00"))
|
||||||
|
#else
|
||||||
|
#define HARDFORK_419_TIME (fc::time_point_sec::from_iso_string("2015-11-04T16:00:00"))
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
// #436 Prevent margin call from being triggered unless feed < call price
|
// #436 Prevent margin call from being triggered unless feed < call price
|
||||||
#ifndef HARDFORK_436_TIME
|
#ifndef HARDFORK_436_TIME
|
||||||
#define HARDFORK_436_TIME (fc::time_point_sec( 1450288800 ))
|
#ifdef BUILD_PEERPLAYS_TESTNET
|
||||||
|
#define HARDFORK_436_TIME (fc::time_point_sec::from_iso_string("2015-12-16T18:00:00"))
|
||||||
|
#else
|
||||||
|
#define HARDFORK_436_TIME (fc::time_point_sec::from_iso_string("2015-12-16T18:00:00"))
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
// #445 Refund create order fees on cancel
|
// #445 Refund create order fees on cancel
|
||||||
#ifndef HARDFORK_445_TIME
|
#ifndef HARDFORK_445_TIME
|
||||||
#define HARDFORK_445_TIME (fc::time_point_sec( 1450288800 ))
|
#ifdef BUILD_PEERPLAYS_TESTNET
|
||||||
|
#define HARDFORK_445_TIME (fc::time_point_sec::from_iso_string("2015-12-16T18:00:00"))
|
||||||
|
#else
|
||||||
|
#define HARDFORK_445_TIME (fc::time_point_sec::from_iso_string("2015-12-16T18:00:00"))
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
// #453 Hardfork to retroactively correct referral percentages
|
// #453 Hardfork to retroactively correct referral percentages
|
||||||
#ifndef HARDFORK_453_TIME
|
#ifndef HARDFORK_453_TIME
|
||||||
#define HARDFORK_453_TIME (fc::time_point_sec( 1450288800 ))
|
#ifdef BUILD_PEERPLAYS_TESTNET
|
||||||
|
#define HARDFORK_453_TIME (fc::time_point_sec::from_iso_string("2015-12-16T18:00:00"))
|
||||||
|
#else
|
||||||
|
#define HARDFORK_453_TIME (fc::time_point_sec::from_iso_string("2015-12-16T18:00:00"))
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
// #480 Fix non-BTS MIA core_exchange_rate check
|
// #480 Fix non-BTS MIA core_exchange_rate check
|
||||||
#ifndef HARDFORK_480_TIME
|
#ifndef HARDFORK_480_TIME
|
||||||
#define HARDFORK_480_TIME (fc::time_point_sec( 1450378800 ))
|
#ifdef BUILD_PEERPLAYS_TESTNET
|
||||||
|
#define HARDFORK_480_TIME (fc::time_point_sec::from_iso_string("2015-12-17T19:00:00"))
|
||||||
|
#else
|
||||||
|
#define HARDFORK_480_TIME (fc::time_point_sec::from_iso_string("2015-12-17T19:00:00"))
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
// #483 Operation history numbering change
|
// #483 Operation history numbering change
|
||||||
#ifndef HARDFORK_483_TIME
|
#ifndef HARDFORK_483_TIME
|
||||||
#define HARDFORK_483_TIME (fc::time_point_sec( 1450378800 ))
|
#ifdef BUILD_PEERPLAYS_TESTNET
|
||||||
|
#define HARDFORK_483_TIME (fc::time_point_sec::from_iso_string("2015-12-17T19:00:00"))
|
||||||
|
#else
|
||||||
|
#define HARDFORK_483_TIME (fc::time_point_sec::from_iso_string("2015-12-17T19:00:00"))
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,7 @@
|
||||||
// 5050_1 HARDFORK Wednesday, 15 April 2020 20:00:00 GMT
|
|
||||||
#ifndef HARDFORK_5050_1_TIME
|
#ifndef HARDFORK_5050_1_TIME
|
||||||
#define HARDFORK_5050_1_TIME (fc::time_point_sec( 1586980800 ))
|
#ifdef BUILD_PEERPLAYS_TESTNET
|
||||||
|
#define HARDFORK_5050_1_TIME (fc::time_point_sec::from_iso_string("2020-04-15T20:00:00"))
|
||||||
|
#else
|
||||||
|
#define HARDFORK_5050_1_TIME (fc::time_point_sec::from_iso_string("2020-04-22T20:00:00"))
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
// #516 Special authorities
|
// #516 Special authorities
|
||||||
#ifndef HARDFORK_516_TIME
|
#ifndef HARDFORK_516_TIME
|
||||||
#define HARDFORK_516_TIME (fc::time_point_sec( 1456250400 ))
|
#ifdef BUILD_PEERPLAYS_TESTNET
|
||||||
|
#define HARDFORK_516_TIME (fc::time_point_sec::from_iso_string("2016-02-23T18:00:00"))
|
||||||
|
#else
|
||||||
|
#define HARDFORK_516_TIME (fc::time_point_sec::from_iso_string("2016-02-23T18:00:00"))
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
// #533 Improve vote counting implementation
|
// #533 Improve vote counting implementation
|
||||||
#ifndef HARDFORK_533_TIME
|
#ifndef HARDFORK_533_TIME
|
||||||
#define HARDFORK_533_TIME (fc::time_point_sec( 1456250400 ))
|
#ifdef BUILD_PEERPLAYS_TESTNET
|
||||||
|
#define HARDFORK_533_TIME (fc::time_point_sec::from_iso_string("2016-02-23T18:00:00"))
|
||||||
|
#else
|
||||||
|
#define HARDFORK_533_TIME (fc::time_point_sec::from_iso_string("2016-02-23T18:00:00"))
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
// #538 Buyback accounts
|
// #538 Buyback accounts
|
||||||
#ifndef HARDFORK_538_TIME
|
#ifndef HARDFORK_538_TIME
|
||||||
#define HARDFORK_538_TIME (fc::time_point_sec( 1456250400 ))
|
#ifdef BUILD_PEERPLAYS_TESTNET
|
||||||
|
#define HARDFORK_538_TIME (fc::time_point_sec::from_iso_string("2016-02-23T18:00:00"))
|
||||||
|
#else
|
||||||
|
#define HARDFORK_538_TIME (fc::time_point_sec::from_iso_string("2016-02-23T18:00:00"))
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
// #555 Buyback accounts
|
// #555 Buyback accounts
|
||||||
#ifndef HARDFORK_555_TIME
|
#ifndef HARDFORK_555_TIME
|
||||||
#define HARDFORK_555_TIME (fc::time_point_sec( 1456250400 ))
|
#ifdef BUILD_PEERPLAYS_TESTNET
|
||||||
|
#define HARDFORK_555_TIME (fc::time_point_sec::from_iso_string("2016-02-23T18:00:00"))
|
||||||
|
#else
|
||||||
|
#define HARDFORK_555_TIME (fc::time_point_sec::from_iso_string("2016-02-23T18:00:00"))
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
// #563 Stealth fee routing
|
// #563 Stealth fee routing
|
||||||
#ifndef HARDFORK_563_TIME
|
#ifndef HARDFORK_563_TIME
|
||||||
#define HARDFORK_563_TIME (fc::time_point_sec( 1456250400 ))
|
#ifdef BUILD_PEERPLAYS_TESTNET
|
||||||
|
#define HARDFORK_563_TIME (fc::time_point_sec::from_iso_string("2016-02-23T18:00:00"))
|
||||||
|
#else
|
||||||
|
#define HARDFORK_563_TIME (fc::time_point_sec::from_iso_string("2016-02-23T18:00:00"))
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
// #572 Allow asset to update permission flags when no supply exists
|
// #572 Allow asset to update permission flags when no supply exists
|
||||||
#ifndef HARDFORK_572_TIME
|
#ifndef HARDFORK_572_TIME
|
||||||
#define HARDFORK_572_TIME (fc::time_point_sec( 1456250400 ))
|
#ifdef BUILD_PEERPLAYS_TESTNET
|
||||||
|
#define HARDFORK_572_TIME (fc::time_point_sec::from_iso_string("2016-02-23T18:00:00"))
|
||||||
|
#else
|
||||||
|
#define HARDFORK_572_TIME (fc::time_point_sec::from_iso_string("2016-02-23T18:00:00"))
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
// #599 Unpacking of extension is incorrect
|
// #599 Unpacking of extension is incorrect
|
||||||
#ifndef HARDFORK_599_TIME
|
#ifndef HARDFORK_599_TIME
|
||||||
#define HARDFORK_599_TIME (fc::time_point_sec( 1459789200 ))
|
#ifdef BUILD_PEERPLAYS_TESTNET
|
||||||
|
#define HARDFORK_599_TIME (fc::time_point_sec::from_iso_string("2016-04-04T17:00:00"))
|
||||||
|
#else
|
||||||
|
#define HARDFORK_599_TIME (fc::time_point_sec::from_iso_string("2016-04-04T17:00:00"))
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
// #607 Disable negative voting on workers
|
// #607 Disable negative voting on workers
|
||||||
#ifndef HARDFORK_607_TIME
|
#ifndef HARDFORK_607_TIME
|
||||||
#define HARDFORK_607_TIME (fc::time_point_sec( 1458752400 ))
|
#ifdef BUILD_PEERPLAYS_TESTNET
|
||||||
|
#define HARDFORK_607_TIME (fc::time_point_sec::from_iso_string("2016-03-23T17:00:00"))
|
||||||
|
#else
|
||||||
|
#define HARDFORK_607_TIME (fc::time_point_sec::from_iso_string("2016-03-23T17:00:00"))
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
// #613 Deprecate annual membership
|
// #613 Deprecate annual membership
|
||||||
#ifndef HARDFORK_613_TIME
|
#ifndef HARDFORK_613_TIME
|
||||||
#define HARDFORK_613_TIME (fc::time_point_sec( 1458752400 ))
|
#ifdef BUILD_PEERPLAYS_TESTNET
|
||||||
|
#define HARDFORK_613_TIME (fc::time_point_sec::from_iso_string("2016-03-23T17:00:00"))
|
||||||
|
#else
|
||||||
|
#define HARDFORK_613_TIME (fc::time_point_sec::from_iso_string("2016-03-23T17:00:00"))
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
// #615 Fix price feed expiration check, so websocket server will never spam too much data
|
// #615 Fix price feed expiration check, so websocket server will never spam too much data
|
||||||
#ifndef HARDFORK_615_TIME
|
#ifndef HARDFORK_615_TIME
|
||||||
#define HARDFORK_615_TIME (fc::time_point_sec( 1458752400 ))
|
#ifdef BUILD_PEERPLAYS_TESTNET
|
||||||
|
#define HARDFORK_615_TIME (fc::time_point_sec::from_iso_string("2016-03-23T17:00:00"))
|
||||||
|
#else
|
||||||
|
#define HARDFORK_615_TIME (fc::time_point_sec::from_iso_string("2016-03-23T17:00:00"))
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
// Placeholder HF for affiliate reward system
|
// Placeholder HF for affiliate reward system
|
||||||
#ifndef HARDFORK_999_TIME
|
#ifndef HARDFORK_999_TIME
|
||||||
#define HARDFORK_999_TIME (fc::time_point_sec( 1540000000 ))
|
#ifdef BUILD_PEERPLAYS_TESTNET
|
||||||
|
#define HARDFORK_999_TIME (fc::time_point_sec::from_iso_string("2018-10-20T01:46:40"))
|
||||||
|
#else
|
||||||
|
#define HARDFORK_999_TIME (fc::time_point_sec::from_iso_string("2019-02-18T12:00:00"))
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
// bitshares-core #429 rounding issue when creating assets
|
// bitshares-core #429 rounding issue when creating assets
|
||||||
#ifndef HARDFORK_CORE_429_TIME
|
#ifndef HARDFORK_CORE_429_TIME
|
||||||
#define HARDFORK_CORE_429_TIME (fc::time_point_sec( 1566784800 ))
|
#ifdef BUILD_PEERPLAYS_TESTNET
|
||||||
|
#define HARDFORK_CORE_429_TIME (fc::time_point_sec::from_iso_string("2019-08-26T02:00:00"))
|
||||||
|
#else
|
||||||
|
#define HARDFORK_CORE_429_TIME (fc::time_point_sec::from_iso_string("2019-09-13T02:00:00"))
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
// #210 Check authorities on custom_operation
|
|
||||||
#ifndef HARDFORK_CORE_210_TIME
|
|
||||||
#define HARDFORK_CORE_210_TIME (fc::time_point_sec(1893456000)) // Jan 1 00:00:00 2030 (Not yet scheduled)
|
|
||||||
// Bugfix: pre-HF 210, custom_operation's required_auths field was ignored.
|
|
||||||
#define MUST_IGNORE_CUSTOM_OP_REQD_AUTHS(chain_time) (chain_time <= HARDFORK_CORE_210_TIME)
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,4 +1,7 @@
|
||||||
// GPOS HARDFORK Monday, 6 January 2020 01:00:00 GMT
|
|
||||||
#ifndef HARDFORK_GPOS_TIME
|
#ifndef HARDFORK_GPOS_TIME
|
||||||
#define HARDFORK_GPOS_TIME (fc::time_point_sec( 1578272400 ))
|
#ifdef BUILD_PEERPLAYS_TESTNET
|
||||||
|
#define HARDFORK_GPOS_TIME (fc::time_point_sec::from_iso_string("2020-01-06T01:00:00"))
|
||||||
|
#else
|
||||||
|
#define HARDFORK_GPOS_TIME (fc::time_point_sec::from_iso_string("2020-02-17T22:00:00"))
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
7
libraries/chain/hardfork.d/HOTFIX_2024.hf
Normal file
7
libraries/chain/hardfork.d/HOTFIX_2024.hf
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
#ifndef HARDFORK_HOTFIX_2024_TIME
|
||||||
|
#ifdef BUILD_PEERPLAYS_TESTNET
|
||||||
|
#define HARDFORK_HOTFIX_2024_TIME (fc::time_point_sec::from_iso_string("2023-12-20T00:00:00"))
|
||||||
|
#else
|
||||||
|
#define HARDFORK_HOTFIX_2024_TIME (fc::time_point_sec::from_iso_string("2023-12-20T00:00:00"))
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
@ -1,4 +1,7 @@
|
||||||
// NFT HARDFORK Sat, 15-Aug-20 00:00:00 UTC
|
|
||||||
#ifndef HARDFORK_NFT_TIME
|
#ifndef HARDFORK_NFT_TIME
|
||||||
#define HARDFORK_NFT_TIME (fc::time_point_sec( 1597449600 ))
|
#ifdef BUILD_PEERPLAYS_TESTNET
|
||||||
|
#define HARDFORK_NFT_TIME (fc::time_point_sec::from_iso_string("2020-08-15T00:00:00"))
|
||||||
|
#else
|
||||||
|
#define HARDFORK_NFT_TIME (fc::time_point_sec::from_iso_string("2020-12-21T00:00:00"))
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
7
libraries/chain/hardfork.d/SIDECHAIN.hf
Normal file
7
libraries/chain/hardfork.d/SIDECHAIN.hf
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
#ifndef HARDFORK_SIDECHAIN_DELETE_TIME
|
||||||
|
#ifdef BUILD_PEERPLAYS_TESTNET
|
||||||
|
#define HARDFORK_SIDECHAIN_DELETE_TIME (fc::time_point_sec::from_iso_string("2022-11-16T02:00:00"))
|
||||||
|
#else
|
||||||
|
#define HARDFORK_SIDECHAIN_DELETE_TIME (fc::time_point_sec::from_iso_string("2022-11-16T02:00:00"))
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
@ -1,4 +1,7 @@
|
||||||
// SON HARDFORK Wednesday, October 28, 2020 0:00:00 GMT
|
|
||||||
#ifndef HARDFORK_SON_TIME
|
#ifndef HARDFORK_SON_TIME
|
||||||
#define HARDFORK_SON_TIME (fc::time_point_sec( 1603843200 ))
|
#ifdef BUILD_PEERPLAYS_TESTNET
|
||||||
|
#define HARDFORK_SON_TIME (fc::time_point_sec::from_iso_string("2020-10-28T00:00:00"))
|
||||||
|
#else
|
||||||
|
#define HARDFORK_SON_TIME (fc::time_point_sec::from_iso_string("2020-12-21T00:00:00"))
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
7
libraries/chain/hardfork.d/SON2.hf
Normal file
7
libraries/chain/hardfork.d/SON2.hf
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
#ifndef HARDFORK_SON2_TIME
|
||||||
|
#ifdef BUILD_PEERPLAYS_TESTNET
|
||||||
|
#define HARDFORK_SON2_TIME (fc::time_point_sec::from_iso_string("2021-07-31T00:00:00"))
|
||||||
|
#else
|
||||||
|
#define HARDFORK_SON2_TIME (fc::time_point_sec::from_iso_string("2021-07-31T00:00:00"))
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
7
libraries/chain/hardfork.d/SON_FOR_ETHEREUM.hf
Normal file
7
libraries/chain/hardfork.d/SON_FOR_ETHEREUM.hf
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
#ifndef HARDFORK_SON_FOR_ETHEREUM_TIME
|
||||||
|
#ifdef BUILD_PEERPLAYS_TESTNET
|
||||||
|
#define HARDFORK_SON_FOR_ETHEREUM_TIME (fc::time_point_sec::from_iso_string("2023-07-17T12:00:00"))
|
||||||
|
#else
|
||||||
|
#define HARDFORK_SON_FOR_ETHEREUM_TIME (fc::time_point_sec::from_iso_string("2023-10-24T12:00:00"))
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
7
libraries/chain/hardfork.d/SON_FOR_HIVE.hf
Normal file
7
libraries/chain/hardfork.d/SON_FOR_HIVE.hf
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
#ifndef HARDFORK_SON_FOR_HIVE_TIME
|
||||||
|
#ifdef BUILD_PEERPLAYS_TESTNET
|
||||||
|
#define HARDFORK_SON_FOR_HIVE_TIME (fc::time_point_sec::from_iso_string("2021-03-31T00:00:00"))
|
||||||
|
#else
|
||||||
|
#define HARDFORK_SON_FOR_HIVE_TIME (fc::time_point_sec::from_iso_string("2021-12-21T00:00:00"))
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
@ -1,3 +1,7 @@
|
||||||
#ifndef HARDFORK_SWEEPS_TIME
|
#ifndef HARDFORK_SWEEPS_TIME
|
||||||
#define HARDFORK_SWEEPS_TIME (fc::time_point_sec( 1566784800 ))
|
#ifdef BUILD_PEERPLAYS_TESTNET
|
||||||
|
#define HARDFORK_SWEEPS_TIME (fc::time_point_sec::from_iso_string("2019-08-26T02:00:00"))
|
||||||
|
#else
|
||||||
|
#define HARDFORK_SWEEPS_TIME (fc::time_point_sec::from_iso_string("2019-09-13T02:00:00"))
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -164,7 +164,12 @@ namespace graphene { namespace chain {
|
||||||
|
|
||||||
template<class DB>
|
template<class DB>
|
||||||
const asset_bitasset_data_object& bitasset_data(const DB& db)const
|
const asset_bitasset_data_object& bitasset_data(const DB& db)const
|
||||||
{ assert(bitasset_data_id); return db.get(*bitasset_data_id); }
|
{
|
||||||
|
FC_ASSERT( bitasset_data_id.valid(),
|
||||||
|
"Asset ${a} (${id}) is not a market issued asset.",
|
||||||
|
("a",this->symbol)("id",this->id) );
|
||||||
|
return db.get(*bitasset_data_id);
|
||||||
|
}
|
||||||
|
|
||||||
template<class DB>
|
template<class DB>
|
||||||
const asset_dividend_data_object& dividend_data(const DB& db)const
|
const asset_dividend_data_object& dividend_data(const DB& db)const
|
||||||
|
|
|
||||||
|
|
@ -24,12 +24,11 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <graphene/chain/protocol/types.hpp>
|
#include <graphene/chain/protocol/types.hpp>
|
||||||
|
#include <graphene/chain/protocol/betting_market.hpp>
|
||||||
#include <graphene/db/object.hpp>
|
#include <graphene/db/object.hpp>
|
||||||
#include <graphene/db/generic_index.hpp>
|
#include <graphene/db/generic_index.hpp>
|
||||||
#include <graphene/chain/protocol/betting_market.hpp>
|
|
||||||
#include <sstream>
|
|
||||||
|
|
||||||
#include <boost/multi_index/composite_key.hpp>
|
#include <boost/multi_index/composite_key.hpp>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
namespace graphene { namespace chain {
|
||||||
class betting_market_object;
|
class betting_market_object;
|
||||||
|
|
@ -626,7 +625,6 @@ typedef multi_index_container<
|
||||||
|
|
||||||
typedef generic_index<betting_market_position_object, betting_market_position_multi_index_type> betting_market_position_index;
|
typedef generic_index<betting_market_position_object, betting_market_position_multi_index_type> betting_market_position_index;
|
||||||
|
|
||||||
|
|
||||||
template<typename Stream>
|
template<typename Stream>
|
||||||
inline Stream& operator<<( Stream& s, const betting_market_object& betting_market_obj )
|
inline Stream& operator<<( Stream& s, const betting_market_object& betting_market_obj )
|
||||||
{
|
{
|
||||||
|
|
@ -714,12 +712,110 @@ inline Stream& operator>>( Stream& s, betting_market_group_object& betting_marke
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
} } // graphene::chain
|
} } // graphene::chain
|
||||||
|
|
||||||
FC_REFLECT_DERIVED( graphene::chain::betting_market_rules_object, (graphene::db::object), (name)(description) )
|
FC_REFLECT_DERIVED( graphene::chain::betting_market_rules_object, (graphene::db::object), (name)(description) )
|
||||||
FC_REFLECT_DERIVED( graphene::chain::betting_market_group_object, (graphene::db::object), (description)(event_id)(rules_id)(asset_id)(total_matched_bets_amount)(never_in_play)(delay_before_settling)(settling_time) )
|
|
||||||
FC_REFLECT_DERIVED( graphene::chain::betting_market_object, (graphene::db::object), (group_id)(description)(payout_condition)(resolution) )
|
|
||||||
FC_REFLECT_DERIVED( graphene::chain::bet_object, (graphene::db::object), (bettor_id)(betting_market_id)(amount_to_bet)(backer_multiplier)(back_or_lay)(end_of_delay) )
|
FC_REFLECT_DERIVED( graphene::chain::bet_object, (graphene::db::object), (bettor_id)(betting_market_id)(amount_to_bet)(backer_multiplier)(back_or_lay)(end_of_delay) )
|
||||||
|
|
||||||
FC_REFLECT_DERIVED( graphene::chain::betting_market_position_object, (graphene::db::object), (bettor_id)(betting_market_id)(pay_if_payout_condition)(pay_if_not_payout_condition)(pay_if_canceled)(pay_if_not_canceled)(fees_collected) )
|
FC_REFLECT_DERIVED( graphene::chain::betting_market_position_object, (graphene::db::object), (bettor_id)(betting_market_id)(pay_if_payout_condition)(pay_if_not_payout_condition)(pay_if_canceled)(pay_if_not_canceled)(fees_collected) )
|
||||||
|
|
||||||
|
namespace fc {
|
||||||
|
|
||||||
|
template<>
|
||||||
|
template<>
|
||||||
|
inline void if_enum<fc::false_type>::from_variant(const variant &vo, graphene::chain::betting_market_object &v, uint32_t max_depth) {
|
||||||
|
from_variant(vo, v, max_depth);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
template<>
|
||||||
|
inline void if_enum<fc::false_type>::to_variant(const graphene::chain::betting_market_object &v, variant &vo, uint32_t max_depth) {
|
||||||
|
to_variant(v, vo, max_depth);
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace raw { namespace detail {
|
||||||
|
|
||||||
|
template<>
|
||||||
|
template<>
|
||||||
|
inline void if_enum<fc::false_type>::pack(fc::datastream<size_t> &s, const graphene::chain::betting_market_object &v, uint32_t) {
|
||||||
|
s << v;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
template<>
|
||||||
|
inline void if_enum<fc::false_type>::pack(fc::datastream<char*> &s, const graphene::chain::betting_market_object &v, uint32_t) {
|
||||||
|
s << v;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
template<>
|
||||||
|
inline void if_enum<fc::false_type>::unpack(fc::datastream<const char*> &s, graphene::chain::betting_market_object &v, uint32_t) {
|
||||||
|
s >> v;
|
||||||
|
}
|
||||||
|
|
||||||
|
} } // namespace fc::raw::detail
|
||||||
|
|
||||||
|
template <>
|
||||||
|
struct get_typename<graphene::chain::betting_market_object> {
|
||||||
|
static const char *name() {
|
||||||
|
return "graphene::chain::betting_market_object";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
template <>
|
||||||
|
struct reflector<graphene::chain::betting_market_object> {
|
||||||
|
typedef graphene::chain::betting_market_object type;
|
||||||
|
typedef fc::true_type is_defined;
|
||||||
|
typedef fc::false_type is_enum;
|
||||||
|
};
|
||||||
|
} // namespace fc
|
||||||
|
|
||||||
|
namespace fc {
|
||||||
|
|
||||||
|
template<>
|
||||||
|
template<>
|
||||||
|
inline void if_enum<fc::false_type>::from_variant(const variant &vo, graphene::chain::betting_market_group_object &v, uint32_t max_depth) {
|
||||||
|
from_variant(vo, v, max_depth);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
template<>
|
||||||
|
inline void if_enum<fc::false_type>::to_variant(const graphene::chain::betting_market_group_object &v, variant &vo, uint32_t max_depth) {
|
||||||
|
to_variant(v, vo, max_depth);
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace raw { namespace detail {
|
||||||
|
|
||||||
|
template<>
|
||||||
|
template<>
|
||||||
|
inline void if_enum<fc::false_type>::pack(fc::datastream<size_t> &s, const graphene::chain::betting_market_group_object &v, uint32_t) {
|
||||||
|
s << v;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
template<>
|
||||||
|
inline void if_enum<fc::false_type>::pack(fc::datastream<char*> &s, const graphene::chain::betting_market_group_object &v, uint32_t) {
|
||||||
|
s << v;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
template<>
|
||||||
|
inline void if_enum<fc::false_type>::unpack(fc::datastream<const char*> &s, graphene::chain::betting_market_group_object &v, uint32_t) {
|
||||||
|
s >> v;
|
||||||
|
}
|
||||||
|
|
||||||
|
} } // namespace fc::raw:detail
|
||||||
|
|
||||||
|
template <>
|
||||||
|
struct get_typename<graphene::chain::betting_market_group_object> {
|
||||||
|
static const char *name() {
|
||||||
|
return "graphene::chain::betting_market_group_object";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
template <>
|
||||||
|
struct reflector<graphene::chain::betting_market_group_object> {
|
||||||
|
typedef graphene::chain::betting_market_group_object type;
|
||||||
|
typedef fc::true_type is_defined;
|
||||||
|
typedef fc::false_type is_enum;
|
||||||
|
};
|
||||||
|
} // namespace fc
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,11 @@ namespace graphene { namespace chain {
|
||||||
optional<signed_block> fetch_by_number( uint32_t block_num )const;
|
optional<signed_block> fetch_by_number( uint32_t block_num )const;
|
||||||
optional<signed_block> last()const;
|
optional<signed_block> last()const;
|
||||||
optional<block_id_type> last_id()const;
|
optional<block_id_type> last_id()const;
|
||||||
|
|
||||||
|
void set_replay_mode(bool mode);
|
||||||
private:
|
private:
|
||||||
|
bool replay_mode = false;
|
||||||
|
|
||||||
optional<index_entry> last_index_entry()const;
|
optional<index_entry> last_index_entry()const;
|
||||||
fc::path _index_filename;
|
fc::path _index_filename;
|
||||||
mutable std::fstream _blocks;
|
mutable std::fstream _blocks;
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,13 @@
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#ifdef BUILD_PEERPLAYS_TESTNET
|
||||||
#define GRAPHENE_SYMBOL "TEST"
|
#define GRAPHENE_SYMBOL "TEST"
|
||||||
#define GRAPHENE_ADDRESS_PREFIX "TEST"
|
#define GRAPHENE_ADDRESS_PREFIX "TEST"
|
||||||
|
#else
|
||||||
|
#define GRAPHENE_SYMBOL "PPY"
|
||||||
|
#define GRAPHENE_ADDRESS_PREFIX "PPY"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define GRAPHENE_MIN_ACCOUNT_NAME_LENGTH 1
|
#define GRAPHENE_MIN_ACCOUNT_NAME_LENGTH 1
|
||||||
#define GRAPHENE_MAX_ACCOUNT_NAME_LENGTH 63
|
#define GRAPHENE_MAX_ACCOUNT_NAME_LENGTH 63
|
||||||
|
|
@ -153,7 +158,7 @@
|
||||||
#define GRAPHENE_RECENTLY_MISSED_COUNT_INCREMENT 4
|
#define GRAPHENE_RECENTLY_MISSED_COUNT_INCREMENT 4
|
||||||
#define GRAPHENE_RECENTLY_MISSED_COUNT_DECREMENT 3
|
#define GRAPHENE_RECENTLY_MISSED_COUNT_DECREMENT 3
|
||||||
|
|
||||||
#define GRAPHENE_CURRENT_DB_VERSION "PPY2.4"
|
#define GRAPHENE_CURRENT_DB_VERSION "PPY2.5"
|
||||||
|
|
||||||
#define GRAPHENE_IRREVERSIBLE_THRESHOLD (70 * GRAPHENE_1_PERCENT)
|
#define GRAPHENE_IRREVERSIBLE_THRESHOLD (70 * GRAPHENE_1_PERCENT)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,8 @@ namespace graphene { namespace chain {
|
||||||
database();
|
database();
|
||||||
~database();
|
~database();
|
||||||
|
|
||||||
|
std::vector<fc::time_point_sec> _hardfork_times;
|
||||||
|
|
||||||
enum validation_steps
|
enum validation_steps
|
||||||
{
|
{
|
||||||
skip_nothing = 0,
|
skip_nothing = 0,
|
||||||
|
|
@ -243,7 +245,16 @@ namespace graphene { namespace chain {
|
||||||
witness_id_type get_scheduled_witness(uint32_t slot_num)const;
|
witness_id_type get_scheduled_witness(uint32_t slot_num)const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the son scheduled for block production in a slot.
|
* @brief Get son schedule id for the given sidechain_type.
|
||||||
|
*
|
||||||
|
* type sidechain_type we getting schedule.
|
||||||
|
*
|
||||||
|
* returns Id of the schedule object.
|
||||||
|
*/
|
||||||
|
unsigned_int get_son_schedule_id(sidechain_type type)const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get the bitcoin or hive son scheduled for block production in a slot.
|
||||||
*
|
*
|
||||||
* slot_num always corresponds to a time in the future.
|
* slot_num always corresponds to a time in the future.
|
||||||
*
|
*
|
||||||
|
|
@ -256,7 +267,7 @@ namespace graphene { namespace chain {
|
||||||
*
|
*
|
||||||
* Passing slot_num == 0 returns GRAPHENE_NULL_WITNESS
|
* Passing slot_num == 0 returns GRAPHENE_NULL_WITNESS
|
||||||
*/
|
*/
|
||||||
son_id_type get_scheduled_son(uint32_t slot_num)const;
|
son_id_type get_scheduled_son(sidechain_type type, uint32_t slot_num)const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the time at which the given slot occurs.
|
* Get the time at which the given slot occurs.
|
||||||
|
|
@ -281,8 +292,8 @@ namespace graphene { namespace chain {
|
||||||
vector<witness_id_type> get_near_witness_schedule()const;
|
vector<witness_id_type> get_near_witness_schedule()const;
|
||||||
void update_witness_schedule();
|
void update_witness_schedule();
|
||||||
void update_witness_schedule(const signed_block& next_block);
|
void update_witness_schedule(const signed_block& next_block);
|
||||||
void update_son_schedule();
|
void update_son_schedule(sidechain_type type);
|
||||||
void update_son_schedule(const signed_block& next_block);
|
void update_son_schedule(sidechain_type type, const signed_block& next_block);
|
||||||
|
|
||||||
void check_lottery_end_by_participants( asset_id_type asset_id );
|
void check_lottery_end_by_participants( asset_id_type asset_id );
|
||||||
void check_ending_lotteries();
|
void check_ending_lotteries();
|
||||||
|
|
@ -311,7 +322,8 @@ namespace graphene { namespace chain {
|
||||||
fc::optional<operation> create_son_deregister_proposal( son_id_type son_id, account_id_type paying_son );
|
fc::optional<operation> create_son_deregister_proposal( son_id_type son_id, account_id_type paying_son );
|
||||||
signed_transaction create_signed_transaction( const fc::ecc::private_key& signing_private_key, const operation& op );
|
signed_transaction create_signed_transaction( const fc::ecc::private_key& signing_private_key, const operation& op );
|
||||||
bool is_son_dereg_valid( son_id_type son_id );
|
bool is_son_dereg_valid( son_id_type son_id );
|
||||||
bool is_son_active( son_id_type son_id );
|
bool is_son_active( sidechain_type type, son_id_type son_id );
|
||||||
|
bool is_asset_creation_allowed(const string& symbol);
|
||||||
|
|
||||||
time_point_sec head_block_time()const;
|
time_point_sec head_block_time()const;
|
||||||
uint32_t head_block_num()const;
|
uint32_t head_block_num()const;
|
||||||
|
|
@ -331,6 +343,8 @@ namespace graphene { namespace chain {
|
||||||
void initialize_evaluators();
|
void initialize_evaluators();
|
||||||
/// Reset the object graph in-memory
|
/// Reset the object graph in-memory
|
||||||
void initialize_indexes();
|
void initialize_indexes();
|
||||||
|
void initialize_hardforks();
|
||||||
|
|
||||||
void init_genesis(const genesis_state_type& genesis_state = genesis_state_type());
|
void init_genesis(const genesis_state_type& genesis_state = genesis_state_type());
|
||||||
|
|
||||||
template<typename EvaluatorType>
|
template<typename EvaluatorType>
|
||||||
|
|
@ -506,12 +520,16 @@ namespace graphene { namespace chain {
|
||||||
void notify_changed_objects();
|
void notify_changed_objects();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
std::mutex _pending_tx_session_mutex;
|
||||||
optional<undo_database::session> _pending_tx_session;
|
optional<undo_database::session> _pending_tx_session;
|
||||||
vector< unique_ptr<op_evaluator> > _operation_evaluators;
|
vector< unique_ptr<op_evaluator> > _operation_evaluators;
|
||||||
|
|
||||||
template<class Index>
|
template<class Index>
|
||||||
vector<std::reference_wrapper<const typename Index::object_type>> sort_votable_objects(size_t count)const;
|
vector<std::reference_wrapper<const typename Index::object_type>> sort_votable_objects(size_t count)const;
|
||||||
|
|
||||||
|
template<class Index>
|
||||||
|
vector<std::reference_wrapper<const typename Index::object_type>> sort_votable_objects(sidechain_type sidechain, size_t count)const;
|
||||||
|
|
||||||
//////////////////// db_block.cpp ////////////////////
|
//////////////////// db_block.cpp ////////////////////
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
@ -561,19 +579,22 @@ namespace graphene { namespace chain {
|
||||||
void initialize_budget_record( fc::time_point_sec now, budget_record& rec )const;
|
void initialize_budget_record( fc::time_point_sec now, budget_record& rec )const;
|
||||||
void process_budget();
|
void process_budget();
|
||||||
void pay_workers( share_type& budget );
|
void pay_workers( share_type& budget );
|
||||||
void pay_sons();
|
void pay_sons_before_hf_ethereum();
|
||||||
|
void pay_sons_after_hf_ethereum();
|
||||||
void perform_son_tasks();
|
void perform_son_tasks();
|
||||||
void perform_chain_maintenance(const signed_block& next_block, const global_property_object& global_props);
|
void perform_chain_maintenance(const signed_block& next_block, const global_property_object& global_props);
|
||||||
void update_active_witnesses();
|
void update_active_witnesses();
|
||||||
void update_active_committee_members();
|
void update_active_committee_members();
|
||||||
void update_son_metrics( const vector<son_info>& curr_active_sons );
|
void update_son_metrics( const flat_map<sidechain_type, vector<son_sidechain_info> >& curr_active_sons );
|
||||||
void update_active_sons();
|
void update_active_sons();
|
||||||
void remove_son_proposal( const proposal_object& proposal );
|
void remove_son_proposal( const proposal_object& proposal );
|
||||||
void remove_inactive_son_down_proposals( const vector<son_id_type>& son_ids_to_remove );
|
void remove_inactive_son_down_proposals( const vector<son_id_type>& son_ids_to_remove );
|
||||||
void remove_inactive_son_proposals( const vector<son_id_type>& son_ids_to_remove );
|
void remove_inactive_son_proposals( const vector<son_id_type>& son_ids_to_remove );
|
||||||
void update_son_statuses( const vector<son_info>& cur_active_sons, const vector<son_info>& new_active_sons );
|
void update_son_statuses( const flat_map<sidechain_type, vector<son_sidechain_info> >& curr_active_sons,
|
||||||
void update_son_wallet( const vector<son_info>& new_active_sons );
|
const flat_map<sidechain_type, vector<son_sidechain_info> >& new_active_sons );
|
||||||
|
void update_son_wallet( const flat_map<sidechain_type, vector<son_sidechain_info> >& new_active_sons );
|
||||||
void update_worker_votes();
|
void update_worker_votes();
|
||||||
|
void hotfix_2024();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
double calculate_vesting_factor(const account_object& stake_account);
|
double calculate_vesting_factor(const account_object& stake_account);
|
||||||
|
|
@ -584,6 +605,7 @@ namespace graphene { namespace chain {
|
||||||
///@}
|
///@}
|
||||||
///@}
|
///@}
|
||||||
|
|
||||||
|
std::mutex _pending_tx_mutex;
|
||||||
vector< processed_transaction > _pending_tx;
|
vector< processed_transaction > _pending_tx;
|
||||||
fork_database _fork_db;
|
fork_database _fork_db;
|
||||||
|
|
||||||
|
|
@ -614,7 +636,13 @@ namespace graphene { namespace chain {
|
||||||
vector<uint64_t> _vote_tally_buffer;
|
vector<uint64_t> _vote_tally_buffer;
|
||||||
vector<uint64_t> _witness_count_histogram_buffer;
|
vector<uint64_t> _witness_count_histogram_buffer;
|
||||||
vector<uint64_t> _committee_count_histogram_buffer;
|
vector<uint64_t> _committee_count_histogram_buffer;
|
||||||
vector<uint64_t> _son_count_histogram_buffer;
|
flat_map<sidechain_type, vector<uint64_t> > _son_count_histogram_buffer = []{
|
||||||
|
flat_map<sidechain_type, vector<uint64_t> > son_count_histogram_buffer;
|
||||||
|
for(const auto& active_sidechain_type : all_sidechain_types){
|
||||||
|
son_count_histogram_buffer[active_sidechain_type] = vector<uint64_t>{};
|
||||||
|
}
|
||||||
|
return son_count_histogram_buffer;
|
||||||
|
}();
|
||||||
uint64_t _total_voting_stake;
|
uint64_t _total_voting_stake;
|
||||||
|
|
||||||
flat_map<uint32_t,block_id_type> _checkpoints;
|
flat_map<uint32_t,block_id_type> _checkpoints;
|
||||||
|
|
|
||||||
|
|
@ -158,6 +158,53 @@ typedef generic_index<event_object, event_object_multi_index_type> event_object_
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
} } // graphene::chain
|
} } // graphene::chain
|
||||||
FC_REFLECT(graphene::chain::event_object, (name)(season)(start_time)(event_group_id)(at_least_one_betting_market_group_settled)(scores))
|
|
||||||
|
|
||||||
|
namespace fc {
|
||||||
|
|
||||||
|
template<>
|
||||||
|
template<>
|
||||||
|
inline void if_enum<fc::false_type>::from_variant(const variant &vo, graphene::chain::event_object &v, uint32_t max_depth) {
|
||||||
|
from_variant(vo, v, max_depth);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
template<>
|
||||||
|
inline void if_enum<fc::false_type>::to_variant(const graphene::chain::event_object &v, variant &vo, uint32_t max_depth) {
|
||||||
|
to_variant(v, vo, max_depth);
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace raw { namespace detail {
|
||||||
|
|
||||||
|
template<>
|
||||||
|
template<>
|
||||||
|
inline void if_enum<fc::false_type>::pack(fc::datastream<size_t> &s, const graphene::chain::event_object &v, uint32_t) {
|
||||||
|
s << v;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
template<>
|
||||||
|
inline void if_enum<fc::false_type>::pack(fc::datastream<char*> &s, const graphene::chain::event_object &v, uint32_t) {
|
||||||
|
s << v;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
template<>
|
||||||
|
inline void if_enum<fc::false_type>::unpack(fc::datastream<const char*> &s, graphene::chain::event_object &v, uint32_t) {
|
||||||
|
s >> v;
|
||||||
|
}
|
||||||
|
|
||||||
|
} } // namespace fc::raw::detail
|
||||||
|
|
||||||
|
template <>
|
||||||
|
struct get_typename<graphene::chain::event_object> {
|
||||||
|
static const char *name() {
|
||||||
|
return "graphene::chain::event_object";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
template <>
|
||||||
|
struct reflector<graphene::chain::event_object> {
|
||||||
|
typedef graphene::chain::event_object type;
|
||||||
|
typedef fc::true_type is_defined;
|
||||||
|
typedef fc::false_type is_enum;
|
||||||
|
};
|
||||||
|
} // namespace fc
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <boost/exception/diagnostic_information.hpp>
|
||||||
#include <fc/exception/exception.hpp>
|
#include <fc/exception/exception.hpp>
|
||||||
#include <graphene/chain/protocol/protocol.hpp>
|
#include <graphene/chain/protocol/protocol.hpp>
|
||||||
|
|
||||||
|
|
@ -75,6 +76,14 @@
|
||||||
elog( "Caught plugin exception: ${e}", ("e", e.to_detail_string() ) ); \
|
elog( "Caught plugin exception: ${e}", ("e", e.to_detail_string() ) ); \
|
||||||
throw; \
|
throw; \
|
||||||
} \
|
} \
|
||||||
|
catch( const boost::exception& e ) \
|
||||||
|
{ \
|
||||||
|
elog( "Caught plugin boost::exception: ${e}", ("e", boost::diagnostic_information(e) ) ); \
|
||||||
|
} \
|
||||||
|
catch( const std::exception& e ) \
|
||||||
|
{ \
|
||||||
|
elog( "Caught plugin std::exception: ${e}", ("e", e.what() ) ); \
|
||||||
|
} \
|
||||||
catch( ... ) \
|
catch( ... ) \
|
||||||
{ \
|
{ \
|
||||||
wlog( "Caught unexpected exception in plugin" ); \
|
wlog( "Caught unexpected exception in plugin" ); \
|
||||||
|
|
|
||||||
|
|
@ -23,10 +23,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <graphene/chain/match_object.hpp>
|
|
||||||
#include <graphene/chain/rock_paper_scissors.hpp>
|
#include <graphene/chain/rock_paper_scissors.hpp>
|
||||||
#include <boost/multi_index/composite_key.hpp>
|
#include <graphene/db/object.hpp>
|
||||||
#include <graphene/db/flat_index.hpp>
|
|
||||||
#include <graphene/db/generic_index.hpp>
|
#include <graphene/db/generic_index.hpp>
|
||||||
#include <fc/crypto/hex.hpp>
|
#include <fc/crypto/hex.hpp>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
@ -156,7 +154,6 @@ namespace graphene { namespace chain {
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
} }
|
} }
|
||||||
|
|
||||||
FC_REFLECT_ENUM(graphene::chain::game_state,
|
FC_REFLECT_ENUM(graphene::chain::game_state,
|
||||||
|
|
@ -165,7 +162,52 @@ FC_REFLECT_ENUM(graphene::chain::game_state,
|
||||||
(expecting_reveal_moves)
|
(expecting_reveal_moves)
|
||||||
(game_complete))
|
(game_complete))
|
||||||
|
|
||||||
//FC_REFLECT_TYPENAME(graphene::chain::game_object) // manually serialized
|
namespace fc {
|
||||||
FC_REFLECT(graphene::chain::game_object, (players))
|
|
||||||
|
|
||||||
|
template<>
|
||||||
|
template<>
|
||||||
|
inline void if_enum<fc::false_type>::from_variant(const variant &vo, graphene::chain::game_object &v, uint32_t max_depth) {
|
||||||
|
from_variant(vo, v, max_depth);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
template<>
|
||||||
|
inline void if_enum<fc::false_type>::to_variant(const graphene::chain::game_object &v, variant &vo, uint32_t max_depth) {
|
||||||
|
to_variant(v, vo, max_depth);
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace raw { namespace detail {
|
||||||
|
|
||||||
|
template<>
|
||||||
|
template<>
|
||||||
|
inline void if_enum<fc::false_type>::pack(fc::datastream<size_t> &s, const graphene::chain::game_object &v, uint32_t) {
|
||||||
|
s << v;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
template<>
|
||||||
|
inline void if_enum<fc::false_type>::pack(fc::datastream<char*> &s, const graphene::chain::game_object &v, uint32_t) {
|
||||||
|
s << v;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
template<>
|
||||||
|
inline void if_enum<fc::false_type>::unpack(fc::datastream<const char*> &s, graphene::chain::game_object &v, uint32_t) {
|
||||||
|
s >> v;
|
||||||
|
}
|
||||||
|
|
||||||
|
} } // namespace fc::raw::detail
|
||||||
|
|
||||||
|
template <>
|
||||||
|
struct get_typename<graphene::chain::game_object> {
|
||||||
|
static const char *name() {
|
||||||
|
return "graphene::chain::game_object";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
template <>
|
||||||
|
struct reflector<graphene::chain::game_object> {
|
||||||
|
typedef graphene::chain::game_object type;
|
||||||
|
typedef fc::true_type is_defined;
|
||||||
|
typedef fc::false_type is_enum;
|
||||||
|
};
|
||||||
|
} // namespace fc
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
#include <graphene/chain/protocol/chain_parameters.hpp>
|
#include <graphene/chain/protocol/chain_parameters.hpp>
|
||||||
#include <graphene/chain/protocol/types.hpp>
|
#include <graphene/chain/protocol/types.hpp>
|
||||||
#include <graphene/chain/database.hpp>
|
#include <graphene/chain/database.hpp>
|
||||||
#include <graphene/chain/son_info.hpp>
|
#include <graphene/chain/son_sidechain_info.hpp>
|
||||||
#include <graphene/db/object.hpp>
|
#include <graphene/db/object.hpp>
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
namespace graphene { namespace chain {
|
||||||
|
|
@ -52,7 +52,15 @@ namespace graphene { namespace chain {
|
||||||
uint32_t next_available_vote_id = 0;
|
uint32_t next_available_vote_id = 0;
|
||||||
vector<committee_member_id_type> active_committee_members; // updated once per maintenance interval
|
vector<committee_member_id_type> active_committee_members; // updated once per maintenance interval
|
||||||
flat_set<witness_id_type> active_witnesses; // updated once per maintenance interval
|
flat_set<witness_id_type> active_witnesses; // updated once per maintenance interval
|
||||||
vector<son_info> active_sons; // updated once per maintenance interval
|
flat_map<sidechain_type, vector<son_sidechain_info> > active_sons = []() // updated once per maintenance interval
|
||||||
|
{
|
||||||
|
flat_map<sidechain_type, vector<son_sidechain_info> > active_sons;
|
||||||
|
for(const auto& active_sidechain_type : all_sidechain_types)
|
||||||
|
{
|
||||||
|
active_sons[active_sidechain_type] = vector<son_sidechain_info>();
|
||||||
|
}
|
||||||
|
return active_sons;
|
||||||
|
}();
|
||||||
// n.b. witness scheduling is done by witness_schedule object
|
// n.b. witness scheduling is done by witness_schedule object
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -131,6 +139,7 @@ namespace graphene { namespace chain {
|
||||||
}}
|
}}
|
||||||
|
|
||||||
FC_REFLECT_DERIVED( graphene::chain::dynamic_global_property_object, (graphene::db::object),
|
FC_REFLECT_DERIVED( graphene::chain::dynamic_global_property_object, (graphene::db::object),
|
||||||
|
(random)
|
||||||
(head_block_number)
|
(head_block_number)
|
||||||
(head_block_id)
|
(head_block_id)
|
||||||
(time)
|
(time)
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,5 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <graphene/chain/protocol/tournament.hpp>
|
#include <graphene/db/object.hpp>
|
||||||
#include <graphene/chain/rock_paper_scissors.hpp>
|
|
||||||
#include <boost/multi_index/composite_key.hpp>
|
|
||||||
#include <graphene/db/flat_index.hpp>
|
|
||||||
#include <graphene/db/generic_index.hpp>
|
#include <graphene/db/generic_index.hpp>
|
||||||
#include <fc/crypto/hex.hpp>
|
#include <fc/crypto/hex.hpp>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
@ -16,6 +13,7 @@ namespace fc {
|
||||||
void from_variant(const fc::variant& v, graphene::chain::match_object& match_obj, uint32_t max_depth = 1);
|
void from_variant(const fc::variant& v, graphene::chain::match_object& match_obj, uint32_t max_depth = 1);
|
||||||
} //end namespace fc
|
} //end namespace fc
|
||||||
|
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
namespace graphene { namespace chain {
|
||||||
class database;
|
class database;
|
||||||
using namespace graphene::db;
|
using namespace graphene::db;
|
||||||
|
|
@ -89,6 +87,7 @@ namespace graphene { namespace chain {
|
||||||
|
|
||||||
void pack_impl(std::ostream& stream) const;
|
void pack_impl(std::ostream& stream) const;
|
||||||
void unpack_impl(std::istream& stream);
|
void unpack_impl(std::istream& stream);
|
||||||
|
|
||||||
void on_initiate_match(database& db);
|
void on_initiate_match(database& db);
|
||||||
void on_game_complete(database& db, const game_object& game);
|
void on_game_complete(database& db, const game_object& game);
|
||||||
game_id_type start_next_game(database& db, match_id_type match_id);
|
game_id_type start_next_game(database& db, match_id_type match_id);
|
||||||
|
|
@ -154,7 +153,6 @@ namespace graphene { namespace chain {
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
} }
|
} }
|
||||||
|
|
||||||
FC_REFLECT_ENUM(graphene::chain::match_state,
|
FC_REFLECT_ENUM(graphene::chain::match_state,
|
||||||
|
|
@ -162,6 +160,52 @@ FC_REFLECT_ENUM(graphene::chain::match_state,
|
||||||
(match_in_progress)
|
(match_in_progress)
|
||||||
(match_complete))
|
(match_complete))
|
||||||
|
|
||||||
//FC_REFLECT_TYPENAME(graphene::chain::match_object) // manually serialized
|
namespace fc {
|
||||||
FC_REFLECT(graphene::chain::match_object, (players))
|
|
||||||
|
|
||||||
|
template<>
|
||||||
|
template<>
|
||||||
|
inline void if_enum<fc::false_type>::from_variant(const variant &vo, graphene::chain::match_object &v, uint32_t max_depth) {
|
||||||
|
from_variant(vo, v, max_depth);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
template<>
|
||||||
|
inline void if_enum<fc::false_type>::to_variant(const graphene::chain::match_object &v, variant &vo, uint32_t max_depth) {
|
||||||
|
to_variant(v, vo, max_depth);
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace raw { namespace detail {
|
||||||
|
|
||||||
|
template<>
|
||||||
|
template<>
|
||||||
|
inline void if_enum<fc::false_type>::pack(fc::datastream<size_t> &s, const graphene::chain::match_object &v, uint32_t) {
|
||||||
|
s << v;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
template<>
|
||||||
|
inline void if_enum<fc::false_type>::pack(fc::datastream<char*> &s, const graphene::chain::match_object &v, uint32_t) {
|
||||||
|
s << v;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
template<>
|
||||||
|
inline void if_enum<fc::false_type>::unpack(fc::datastream<const char*> &s, graphene::chain::match_object &v, uint32_t) {
|
||||||
|
s >> v;
|
||||||
|
}
|
||||||
|
|
||||||
|
} } // namespace fc::raw::detail
|
||||||
|
|
||||||
|
template <>
|
||||||
|
struct get_typename<graphene::chain::match_object> {
|
||||||
|
static const char *name() {
|
||||||
|
return "graphene::chain::match_object";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
template <>
|
||||||
|
struct reflector<graphene::chain::match_object> {
|
||||||
|
typedef graphene::chain::match_object type;
|
||||||
|
typedef fc::true_type is_defined;
|
||||||
|
typedef fc::false_type is_enum;
|
||||||
|
};
|
||||||
|
} // namespace fc
|
||||||
|
|
|
||||||
|
|
@ -130,6 +130,9 @@ namespace graphene { namespace chain {
|
||||||
std::greater< uint32_t >,
|
std::greater< uint32_t >,
|
||||||
std::greater< object_id_type >
|
std::greater< object_id_type >
|
||||||
>
|
>
|
||||||
|
>,
|
||||||
|
ordered_non_unique< tag<by_owner>,
|
||||||
|
member<nft_metadata_object, account_id_type, &nft_metadata_object::owner>
|
||||||
>
|
>
|
||||||
>
|
>
|
||||||
>;
|
>;
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@
|
||||||
#include <graphene/chain/protocol/special_authority.hpp>
|
#include <graphene/chain/protocol/special_authority.hpp>
|
||||||
#include <graphene/chain/protocol/types.hpp>
|
#include <graphene/chain/protocol/types.hpp>
|
||||||
#include <graphene/chain/protocol/vote.hpp>
|
#include <graphene/chain/protocol/vote.hpp>
|
||||||
|
#include <graphene/chain/sidechain_defs.hpp>
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
namespace graphene { namespace chain {
|
||||||
|
|
||||||
|
|
@ -37,6 +38,26 @@ namespace graphene { namespace chain {
|
||||||
/// These are the fields which can be updated by the active authority.
|
/// These are the fields which can be updated by the active authority.
|
||||||
struct account_options
|
struct account_options
|
||||||
{
|
{
|
||||||
|
struct ext
|
||||||
|
{
|
||||||
|
/// The number of active son members this account votes the blockchain should appoint
|
||||||
|
/// Must not exceed the actual number of son members voted for in @ref votes
|
||||||
|
optional< flat_map<sidechain_type, uint16_t> > num_son;
|
||||||
|
|
||||||
|
/// Returns and empty num_son map with all sidechains
|
||||||
|
static flat_map<sidechain_type, uint16_t> empty_num_son()
|
||||||
|
{
|
||||||
|
flat_map<sidechain_type, uint16_t> num_son;
|
||||||
|
for(const auto& active_sidechain_type : all_sidechain_types)
|
||||||
|
{
|
||||||
|
num_son[active_sidechain_type] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return num_son;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/// The memo key is the key this account will typically use to encrypt/sign transaction memos and other non-
|
/// The memo key is the key this account will typically use to encrypt/sign transaction memos and other non-
|
||||||
/// validated account activities. This field is here to prevent confusion if the active authority has zero or
|
/// validated account activities. This field is here to prevent confusion if the active authority has zero or
|
||||||
/// multiple keys in it.
|
/// multiple keys in it.
|
||||||
|
|
@ -52,13 +73,10 @@ namespace graphene { namespace chain {
|
||||||
/// The number of active committee members this account votes the blockchain should appoint
|
/// The number of active committee members this account votes the blockchain should appoint
|
||||||
/// Must not exceed the actual number of committee members voted for in @ref votes
|
/// Must not exceed the actual number of committee members voted for in @ref votes
|
||||||
uint16_t num_committee = 0;
|
uint16_t num_committee = 0;
|
||||||
/// The number of active son members this account votes the blockchain should appoint
|
|
||||||
/// Must not exceed the actual number of son members voted for in @ref votes
|
|
||||||
uint16_t num_son = 0;
|
|
||||||
/// This is the list of vote IDs this account votes for. The weight of these votes is determined by this
|
/// This is the list of vote IDs this account votes for. The weight of these votes is determined by this
|
||||||
/// account's balance of core asset.
|
/// account's balance of core asset.
|
||||||
flat_set<vote_id_type> votes;
|
flat_set<vote_id_type> votes;
|
||||||
extensions_type extensions;
|
extension< ext > extensions;
|
||||||
|
|
||||||
/// Whether this account is voting
|
/// Whether this account is voting
|
||||||
inline bool is_voting() const
|
inline bool is_voting() const
|
||||||
|
|
@ -289,6 +307,7 @@ namespace graphene { namespace chain {
|
||||||
|
|
||||||
} } // graphene::chain
|
} } // graphene::chain
|
||||||
|
|
||||||
|
FC_REFLECT(graphene::chain::account_options::ext, (num_son))
|
||||||
FC_REFLECT(graphene::chain::account_options, (memo_key)(voting_account)(num_witness)(num_committee)(votes)(extensions))
|
FC_REFLECT(graphene::chain::account_options, (memo_key)(voting_account)(num_witness)(num_committee)(votes)(extensions))
|
||||||
// FC_REFLECT_TYPENAME( graphene::chain::account_whitelist_operation::account_listing)
|
// FC_REFLECT_TYPENAME( graphene::chain::account_whitelist_operation::account_listing)
|
||||||
FC_REFLECT_ENUM( graphene::chain::account_whitelist_operation::account_listing,
|
FC_REFLECT_ENUM( graphene::chain::account_whitelist_operation::account_listing,
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,9 @@ namespace graphene { namespace chain {
|
||||||
optional < account_id_type > son_account = GRAPHENE_NULL_ACCOUNT;
|
optional < account_id_type > son_account = GRAPHENE_NULL_ACCOUNT;
|
||||||
optional < asset_id_type > btc_asset = asset_id_type();
|
optional < asset_id_type > btc_asset = asset_id_type();
|
||||||
optional < uint16_t > maximum_son_count = GRAPHENE_DEFAULT_MAX_SONS; ///< maximum number of active SONS
|
optional < uint16_t > maximum_son_count = GRAPHENE_DEFAULT_MAX_SONS; ///< maximum number of active SONS
|
||||||
|
optional < asset_id_type > hbd_asset = asset_id_type();
|
||||||
|
optional < asset_id_type > hive_asset = asset_id_type();
|
||||||
|
optional < asset_id_type > eth_asset = asset_id_type();
|
||||||
};
|
};
|
||||||
|
|
||||||
struct chain_parameters
|
struct chain_parameters
|
||||||
|
|
@ -212,6 +215,15 @@ namespace graphene { namespace chain {
|
||||||
inline uint16_t maximum_son_count()const {
|
inline uint16_t maximum_son_count()const {
|
||||||
return extensions.value.maximum_son_count.valid() ? *extensions.value.maximum_son_count : GRAPHENE_DEFAULT_MAX_SONS;
|
return extensions.value.maximum_son_count.valid() ? *extensions.value.maximum_son_count : GRAPHENE_DEFAULT_MAX_SONS;
|
||||||
}
|
}
|
||||||
|
inline asset_id_type hbd_asset() const {
|
||||||
|
return extensions.value.hbd_asset.valid() ? *extensions.value.hbd_asset : asset_id_type();
|
||||||
|
}
|
||||||
|
inline asset_id_type hive_asset() const {
|
||||||
|
return extensions.value.hive_asset.valid() ? *extensions.value.hive_asset : asset_id_type();
|
||||||
|
}
|
||||||
|
inline asset_id_type eth_asset() const {
|
||||||
|
return extensions.value.eth_asset.valid() ? *extensions.value.eth_asset : asset_id_type();
|
||||||
|
}
|
||||||
private:
|
private:
|
||||||
static void safe_copy(chain_parameters& to, const chain_parameters& from);
|
static void safe_copy(chain_parameters& to, const chain_parameters& from);
|
||||||
};
|
};
|
||||||
|
|
@ -247,6 +259,9 @@ FC_REFLECT( graphene::chain::parameter_extension,
|
||||||
(son_account)
|
(son_account)
|
||||||
(btc_asset)
|
(btc_asset)
|
||||||
(maximum_son_count)
|
(maximum_son_count)
|
||||||
|
(hbd_asset)
|
||||||
|
(hive_asset)
|
||||||
|
(eth_asset)
|
||||||
)
|
)
|
||||||
|
|
||||||
FC_REFLECT( graphene::chain::chain_parameters,
|
FC_REFLECT( graphene::chain::chain_parameters,
|
||||||
|
|
|
||||||
|
|
@ -111,12 +111,12 @@ struct stealth_confirmation
|
||||||
/**
|
/**
|
||||||
* Packs *this then encodes as base58 encoded string.
|
* Packs *this then encodes as base58 encoded string.
|
||||||
*/
|
*/
|
||||||
operator string()const;
|
//operator string()const;
|
||||||
/**
|
/**
|
||||||
* Unpacks from a base58 string
|
* Unpacks from a base58 string
|
||||||
*/
|
*/
|
||||||
stealth_confirmation( const std::string& base58 );
|
//stealth_confirmation( const std::string& base58 );
|
||||||
stealth_confirmation(){}
|
//stealth_confirmation(){}
|
||||||
|
|
||||||
public_key_type one_time_key;
|
public_key_type one_time_key;
|
||||||
optional<public_key_type> to;
|
optional<public_key_type> to;
|
||||||
|
|
@ -152,7 +152,6 @@ struct transfer_to_blind_operation : public base_operation
|
||||||
uint32_t price_per_output = 5*GRAPHENE_BLOCKCHAIN_PRECISION;
|
uint32_t price_per_output = 5*GRAPHENE_BLOCKCHAIN_PRECISION;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
asset fee;
|
asset fee;
|
||||||
asset amount;
|
asset amount;
|
||||||
account_id_type from;
|
account_id_type from;
|
||||||
|
|
@ -160,8 +159,8 @@ struct transfer_to_blind_operation : public base_operation
|
||||||
vector<blind_output> outputs;
|
vector<blind_output> outputs;
|
||||||
|
|
||||||
account_id_type fee_payer()const { return from; }
|
account_id_type fee_payer()const { return from; }
|
||||||
void validate()const;
|
//void validate()const;
|
||||||
share_type calculate_fee(const fee_parameters_type& )const;
|
//share_type calculate_fee(const fee_parameters_type& )const;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -181,13 +180,12 @@ struct transfer_from_blind_operation : public base_operation
|
||||||
vector<blind_input> inputs;
|
vector<blind_input> inputs;
|
||||||
|
|
||||||
account_id_type fee_payer()const { return GRAPHENE_TEMP_ACCOUNT; }
|
account_id_type fee_payer()const { return GRAPHENE_TEMP_ACCOUNT; }
|
||||||
void validate()const;
|
//void validate()const;
|
||||||
|
//void get_required_authorities( vector<authority>& a )const
|
||||||
void get_required_authorities( vector<authority>& a )const
|
//{
|
||||||
{
|
// for( const auto& in : inputs )
|
||||||
for( const auto& in : inputs )
|
// a.push_back( in.owner );
|
||||||
a.push_back( in.owner );
|
//}
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -245,15 +243,14 @@ struct blind_transfer_operation : public base_operation
|
||||||
vector<blind_output> outputs;
|
vector<blind_output> outputs;
|
||||||
|
|
||||||
/** graphene TEMP account */
|
/** graphene TEMP account */
|
||||||
account_id_type fee_payer()const;
|
account_id_type fee_payer()const { return GRAPHENE_TEMP_ACCOUNT; }
|
||||||
void validate()const;
|
//void validate()const;
|
||||||
share_type calculate_fee( const fee_parameters_type& k )const;
|
//share_type calculate_fee( const fee_parameters_type& k )const;
|
||||||
|
//void get_required_authorities( vector<authority>& a )const
|
||||||
void get_required_authorities( vector<authority>& a )const
|
//{
|
||||||
{
|
// for( const auto& in : inputs )
|
||||||
for( const auto& in : inputs )
|
// a.push_back( in.owner );
|
||||||
a.push_back( in.owner );
|
//}
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
///@} endgroup stealth
|
///@} endgroup stealth
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ namespace graphene
|
||||||
// Buyer purchasing lottery tickets
|
// Buyer purchasing lottery tickets
|
||||||
account_id_type buyer;
|
account_id_type buyer;
|
||||||
// count of tickets to buy
|
// count of tickets to buy
|
||||||
uint64_t tickets_to_buy;
|
share_type tickets_to_buy;
|
||||||
// amount that can spent
|
// amount that can spent
|
||||||
asset amount;
|
asset amount;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -106,9 +106,9 @@ namespace graphene { namespace chain {
|
||||||
assert_operation,
|
assert_operation,
|
||||||
balance_claim_operation,
|
balance_claim_operation,
|
||||||
override_transfer_operation,
|
override_transfer_operation,
|
||||||
transfer_to_blind_operation,
|
transfer_to_blind_operation, //! We don't use this operation
|
||||||
blind_transfer_operation,
|
blind_transfer_operation, //! We don't use this operation
|
||||||
transfer_from_blind_operation,
|
transfer_from_blind_operation, //! We don't use this operation
|
||||||
asset_settle_cancel_operation, // VIRTUAL
|
asset_settle_cancel_operation, // VIRTUAL
|
||||||
asset_claim_fees_operation,
|
asset_claim_fees_operation,
|
||||||
fba_distribute_operation, // VIRTUAL
|
fba_distribute_operation, // VIRTUAL
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ FC_REFLECT( graphene::chain::sidechain_transaction_create_operation, (fee)(payer
|
||||||
(sidechain)
|
(sidechain)
|
||||||
(object_id)
|
(object_id)
|
||||||
(transaction)
|
(transaction)
|
||||||
(signers) )
|
(signers))
|
||||||
|
|
||||||
FC_REFLECT( graphene::chain::sidechain_transaction_sign_operation::fee_parameters_type, (fee) )
|
FC_REFLECT( graphene::chain::sidechain_transaction_sign_operation::fee_parameters_type, (fee) )
|
||||||
FC_REFLECT( graphene::chain::sidechain_transaction_sign_operation, (fee)(signer)(payer)
|
FC_REFLECT( graphene::chain::sidechain_transaction_sign_operation, (fee)(signer)(payer)
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <graphene/chain/protocol/base.hpp>
|
#include <graphene/chain/protocol/base.hpp>
|
||||||
#include <graphene/chain/sidechain_defs.hpp>
|
#include <graphene/chain/sidechain_defs.hpp>
|
||||||
|
#include <graphene/chain/son_object.hpp>
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
namespace graphene { namespace chain {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,23 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <graphene/chain/protocol/base.hpp>
|
#include <graphene/chain/protocol/base.hpp>
|
||||||
#include <graphene/chain/son_info.hpp>
|
#include <graphene/chain/son_info.hpp>
|
||||||
|
#include <graphene/chain/son_sidechain_info.hpp>
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
namespace graphene { namespace chain {
|
||||||
|
|
||||||
struct son_wallet_recreate_operation : public base_operation
|
struct son_wallet_recreate_operation : public base_operation
|
||||||
{
|
{
|
||||||
struct fee_parameters_type { uint64_t fee = 0; };
|
struct fee_parameters_type { uint64_t fee = 0; };
|
||||||
|
struct ext
|
||||||
|
{
|
||||||
|
optional<flat_map<sidechain_type, vector<son_sidechain_info> > > sidechain_sons;
|
||||||
|
};
|
||||||
|
|
||||||
asset fee;
|
asset fee;
|
||||||
account_id_type payer;
|
account_id_type payer;
|
||||||
|
|
||||||
vector<son_info> sons;
|
vector<son_info> sons;
|
||||||
|
extension< ext > extensions;
|
||||||
|
|
||||||
account_id_type fee_payer()const { return payer; }
|
account_id_type fee_payer()const { return payer; }
|
||||||
share_type calculate_fee(const fee_parameters_type& k)const { return 0; }
|
share_type calculate_fee(const fee_parameters_type& k)const { return 0; }
|
||||||
|
|
@ -35,6 +41,7 @@ namespace graphene { namespace chain {
|
||||||
} } // namespace graphene::chain
|
} } // namespace graphene::chain
|
||||||
|
|
||||||
FC_REFLECT(graphene::chain::son_wallet_recreate_operation::fee_parameters_type, (fee) )
|
FC_REFLECT(graphene::chain::son_wallet_recreate_operation::fee_parameters_type, (fee) )
|
||||||
FC_REFLECT(graphene::chain::son_wallet_recreate_operation, (fee)(payer)(sons) )
|
FC_REFLECT(graphene::chain::son_wallet_recreate_operation::ext, (sidechain_sons))
|
||||||
|
FC_REFLECT(graphene::chain::son_wallet_recreate_operation, (fee)(payer)(sons)(extensions) )
|
||||||
FC_REFLECT(graphene::chain::son_wallet_update_operation::fee_parameters_type, (fee) )
|
FC_REFLECT(graphene::chain::son_wallet_update_operation::fee_parameters_type, (fee) )
|
||||||
FC_REFLECT(graphene::chain::son_wallet_update_operation, (fee)(payer)(son_wallet_id)(sidechain)(address) )
|
FC_REFLECT(graphene::chain::son_wallet_update_operation, (fee)(payer)(son_wallet_id)(sidechain)(address) )
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue