mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-05 19:55:53 +00:00
Compare commits
634 Commits
1.10.1
...
a1q123456/
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cb352f5ec6 | ||
|
|
21a5260bb7 | ||
|
|
52becffa48 | ||
|
|
b5c4fd4c51 | ||
|
|
ffa323808d | ||
|
|
e7e800197e | ||
|
|
6e35bb91ec | ||
|
|
276c02197f | ||
|
|
fb228860c8 | ||
|
|
b6c2b5cec5 | ||
|
|
516271e8fc | ||
|
|
0d87dfbdb4 | ||
|
|
f7b00a929b | ||
|
|
9b3dd2c3b2 | ||
|
|
1a159e040e | ||
|
|
56964984a5 | ||
|
|
0b31d52896 | ||
|
|
5cf589af16 | ||
|
|
2754c6343b | ||
|
|
98bc036d1f | ||
|
|
429617e1ca | ||
|
|
a513f95fb5 | ||
|
|
3740308b61 | ||
|
|
f1625c9802 | ||
|
|
73bc28bf4f | ||
|
|
1240bae12b | ||
|
|
ceb0ce5634 | ||
|
|
fb89213d4d | ||
|
|
d8628d481d | ||
|
|
a14551b151 | ||
|
|
de33a6a241 | ||
|
|
28eec6ce1b | ||
|
|
c9a723128a | ||
|
|
da82e52613 | ||
|
|
c9d73b6135 | ||
|
|
b7ed99426b | ||
|
|
97f0747e10 | ||
|
|
abf12db788 | ||
|
|
bdfc376951 | ||
|
|
b40a3684ae | ||
|
|
86ef16dbeb | ||
|
|
39b5031ab5 | ||
|
|
94decc753b | ||
|
|
991891625a | ||
|
|
69314e6832 | ||
|
|
dbeb841b5a | ||
|
|
4eae037fee | ||
|
|
b5a63b39d3 | ||
|
|
6419f9a253 | ||
|
|
31c99caa65 | ||
|
|
d835e97490 | ||
|
|
baf4b8381f | ||
|
|
9b45b6888b | ||
|
|
7179ce9c58 | ||
|
|
921aef9934 | ||
|
|
e7a7bb83c1 | ||
|
|
5c2a3a2779 | ||
|
|
b2960b9e7f | ||
|
|
5713f9782a | ||
|
|
60e340d356 | ||
|
|
80d82c5b2b | ||
|
|
433eeabfa5 | ||
|
|
faa781b71f | ||
|
|
c233df720a | ||
|
|
7ff4f79d30 | ||
|
|
60909655d3 | ||
|
|
03e46cd026 | ||
|
|
e95683a0fb | ||
|
|
13353ae36d | ||
|
|
1a40f18bdd | ||
|
|
90e6380383 | ||
|
|
8bfaa7fe0a | ||
|
|
c9135a63cd | ||
|
|
452263eaa5 | ||
|
|
8aa94ea09a | ||
|
|
258ba71363 | ||
|
|
b8626ea3c6 | ||
|
|
6534757d85 | ||
|
|
8e94ea3154 | ||
|
|
b113190563 | ||
|
|
358b7f50a7 | ||
|
|
f47e2f4e82 | ||
|
|
a7eea9546f | ||
|
|
9874d47d7f | ||
|
|
c2f3e2e263 | ||
|
|
e18f27f5f7 | ||
|
|
df6daf0d8f | ||
|
|
e9d46f0bfc | ||
|
|
42fd74b77b | ||
|
|
c55ea56c5e | ||
|
|
1e01cd34f7 | ||
|
|
e2fa5c1b7c | ||
|
|
fc0984d286 | ||
|
|
8b3dcd41f7 | ||
|
|
8f2f5310e2 | ||
|
|
edb4f0342c | ||
|
|
ea17abb92a | ||
|
|
35a40a8e62 | ||
|
|
d494bf45b2 | ||
|
|
8bf4a5cbff | ||
|
|
58c2c82a30 | ||
|
|
11edaa441d | ||
|
|
a5e953b191 | ||
|
|
506ae12a8c | ||
|
|
0310c5cbe0 | ||
|
|
053e1af7ff | ||
|
|
7e24adbdd0 | ||
|
|
621df422a7 | ||
|
|
0a34b5c691 | ||
|
|
e0bc3dd51f | ||
|
|
dacecd24ba | ||
|
|
05105743e9 | ||
|
|
9e1fe9a85e | ||
|
|
d71ce51901 | ||
|
|
be668ee26d | ||
|
|
cae5294b4e | ||
|
|
cd777f79ef | ||
|
|
8b9e21e3f5 | ||
|
|
2a61aee562 | ||
|
|
40ce8a8833 | ||
|
|
7713ff8c5c | ||
|
|
70371a4344 | ||
|
|
e514de76ed | ||
|
|
dd62cfcc22 | ||
|
|
09690f1b38 | ||
|
|
380ba9f1c1 | ||
|
|
c3e9380fb4 | ||
|
|
e3ebc253fa | ||
|
|
c6c7c84355 | ||
|
|
28f50cb7cf | ||
|
|
3e152fec74 | ||
|
|
2db2791805 | ||
|
|
9ec2d7f8ff | ||
|
|
4a084ce34c | ||
|
|
3502df2174 | ||
|
|
fa1e25abef | ||
|
|
217ba8dd4d | ||
|
|
405f4613d8 | ||
|
|
cba512068b | ||
|
|
1c99ea23d1 | ||
|
|
c4308b216f | ||
|
|
aafd2d8525 | ||
|
|
a574ec6023 | ||
|
|
e429455f4d | ||
|
|
7692eeb9a0 | ||
|
|
a099f5a804 | ||
|
|
ca0bc767fe | ||
|
|
4ba9288935 | ||
|
|
e923ec6d36 | ||
|
|
851d99d99e | ||
|
|
f608e653ca | ||
|
|
72e076b694 | ||
|
|
6cf37c4abe | ||
|
|
fc204773d6 | ||
|
|
2bc5cb240f | ||
|
|
67028d6ea6 | ||
|
|
d22a5057b9 | ||
|
|
75a20194c5 | ||
|
|
7fe81fe62e | ||
|
|
345ddc7234 | ||
|
|
d167d4864f | ||
|
|
bf504912a4 | ||
|
|
a7fb8ae915 | ||
|
|
d9b7a2688f | ||
|
|
c0299dba88 | ||
|
|
c3ecdb4746 | ||
|
|
c17676a9be | ||
|
|
ed8e32cc92 | ||
|
|
2406b28e64 | ||
|
|
2216e5a13f | ||
|
|
5bf3a308d5 | ||
|
|
53ea31c69a | ||
|
|
c1c2b5bf52 | ||
|
|
af018c7b0b | ||
|
|
0a1ca0600f | ||
|
|
cd7c62818b | ||
|
|
37d06bcce8 | ||
|
|
9745718467 | ||
|
|
ab44cc31e2 | ||
|
|
dce3e1efa6 | ||
|
|
159dfb5acb | ||
|
|
844646dc50 | ||
|
|
01fc8f2209 | ||
|
|
43e1d4440e | ||
|
|
466849efe8 | ||
|
|
db0fad6826 | ||
|
|
dd5e6559dd | ||
|
|
7c9d652d9b | ||
|
|
dc9e6c37fe | ||
|
|
01fe9477f4 | ||
|
|
97e3dae6f4 | ||
|
|
e8e7888a23 | ||
|
|
b02b8d016c | ||
|
|
a079bac153 | ||
|
|
3a55a64e1c | ||
|
|
fa5a85439f | ||
|
|
81034596a8 | ||
|
|
0968cdf340 | ||
|
|
d9e4009e33 | ||
|
|
02387fd227 | ||
|
|
fb3713bc25 | ||
|
|
f6d63082c0 | ||
|
|
33e1c42599 | ||
|
|
1b75dc8bcd | ||
|
|
3d02580c09 | ||
|
|
8458233a31 | ||
|
|
cb0ddbf863 | ||
|
|
dcc4581220 | ||
|
|
50b8f19cb5 | ||
|
|
f3e201f983 | ||
|
|
b14c24960b | ||
|
|
b6e3453f49 | ||
|
|
ed4870cdb4 | ||
|
|
5fbee8c824 | ||
|
|
3868c04e99 | ||
|
|
409c1d5aa2 | ||
|
|
20710f5232 | ||
|
|
870882f567 | ||
|
|
e1e67b2c9e | ||
|
|
eac3abdca9 | ||
|
|
ebd8e63276 | ||
|
|
839d17e7bd | ||
|
|
7be5c31bc6 | ||
|
|
9e4a7d5871 | ||
|
|
ff8b9aa439 | ||
|
|
ccc0889803 | ||
|
|
07f118caec | ||
|
|
58af62f388 | ||
|
|
040cd23e4a | ||
|
|
0324764a83 | ||
|
|
679e35fd46 | ||
|
|
49e0d54c76 | ||
|
|
7506852a99 | ||
|
|
bcbfb04992 | ||
|
|
5cd72f2431 | ||
|
|
eabca8439f | ||
|
|
ea1fffeebf | ||
|
|
6d58065909 | ||
|
|
47b0543461 | ||
|
|
8215c605b4 | ||
|
|
d7e949193f | ||
|
|
f64cf9187a | ||
|
|
b54d85d862 | ||
|
|
f419c18056 | ||
|
|
0ec17b6026 | ||
|
|
838978b869 | ||
|
|
8186253707 | ||
|
|
2316d843d7 | ||
|
|
9d58f11a60 | ||
|
|
7b18006193 | ||
|
|
9e48fc0c83 | ||
|
|
8e827e32ac | ||
|
|
c5c0e70e23 | ||
|
|
ec61f5e9d3 | ||
|
|
d57cced17b | ||
|
|
54a350be79 | ||
|
|
d6dbf0e0a6 | ||
|
|
0d887ad815 | ||
|
|
d4a5f8390e | ||
|
|
ab5d450d3c | ||
|
|
23c37fa506 | ||
|
|
63209c2646 | ||
|
|
f0dabd1446 | ||
|
|
552377c76f | ||
|
|
e7cd03325b | ||
|
|
decb3c178e | ||
|
|
f6d647d6c3 | ||
|
|
bf4a7b6ce8 | ||
|
|
8e2c85d14d | ||
|
|
1fbf8da79f | ||
|
|
a75309919e | ||
|
|
0ece395c24 | ||
|
|
b6391fe011 | ||
|
|
9a6af9c431 | ||
|
|
fa1cbb0746 | ||
|
|
68e1be3cf5 | ||
|
|
9abc4868d6 | ||
|
|
23991c99c3 | ||
|
|
cc0177be87 | ||
|
|
37b3e96b04 | ||
|
|
85214bdf81 | ||
|
|
fbbea9e6e2 | ||
|
|
7741483894 | ||
|
|
2f432e812c | ||
|
|
cad8970a57 | ||
|
|
4d7aed84ec | ||
|
|
00ed7c9424 | ||
|
|
d9bd75e683 | ||
|
|
93d8bafb24 | ||
|
|
c19a88fee9 | ||
|
|
0a331ea72e | ||
|
|
7d27b11190 | ||
|
|
eedfec015e | ||
|
|
ffc343a2bc | ||
|
|
e5aa605742 | ||
|
|
8b181ed818 | ||
|
|
f5a349558e | ||
|
|
b9b75ddcf5 | ||
|
|
a39720e94a | ||
|
|
2820feb02a | ||
|
|
8fc805d2e2 | ||
|
|
d54151e7c4 | ||
|
|
21a0a64648 | ||
|
|
20707fac4a | ||
|
|
e6ef0fc26c | ||
|
|
c157816017 | ||
|
|
eba5d19377 | ||
|
|
ad14d09a2b | ||
|
|
f3bcc651c7 | ||
|
|
e8602b81fa | ||
|
|
0f32109993 | ||
|
|
a17ccca615 | ||
|
|
7a1b238035 | ||
|
|
e1534a3200 | ||
|
|
9fec615dca | ||
|
|
ef02893f2f | ||
|
|
7cf4611d7c | ||
|
|
d028005aa6 | ||
|
|
1d23148e6d | ||
|
|
e416ee72ca | ||
|
|
2e902dee53 | ||
|
|
f6879da6c9 | ||
|
|
ae20a3ad3f | ||
|
|
c706926ee3 | ||
|
|
223e6c7590 | ||
|
|
825864032a | ||
|
|
06733ec21a | ||
|
|
9f7c619e4f | ||
|
|
3f5e3212fe | ||
|
|
20d05492d2 | ||
|
|
ae7ea33b75 | ||
|
|
263e984bf4 | ||
|
|
58f3abe3c6 | ||
|
|
d576416953 | ||
|
|
e3d1bb271f | ||
|
|
2df635693d | ||
|
|
40b4adc9cc | ||
|
|
0c971b4415 | ||
|
|
f2d37da4ca | ||
|
|
d5e5c3c220 | ||
|
|
15390bedd5 | ||
|
|
7f6a079aa4 | ||
|
|
2a25f58d40 | ||
|
|
2705109592 | ||
|
|
244ac5e024 | ||
|
|
f4da2e31d9 | ||
|
|
f650949573 | ||
|
|
76128051c0 | ||
|
|
5aa1106ba1 | ||
|
|
dccf3f49ef | ||
|
|
02ec8b7962 | ||
|
|
3f7ce939c8 | ||
|
|
b65cea1984 | ||
|
|
b422e71eed | ||
|
|
e9859ac1b1 | ||
|
|
b84f7e7c10 | ||
|
|
513842b23f | ||
|
|
985c80fbc6 | ||
|
|
35fe957020 | ||
|
|
0eebe6a5f4 | ||
|
|
760f16f568 | ||
|
|
241b9ddde9 | ||
|
|
3fcfb5cd49 | ||
|
|
e2384885f5 | ||
|
|
dd312c3cc5 | ||
|
|
80379927e8 | ||
|
|
676aae2755 | ||
|
|
f20e66e6f9 | ||
|
|
cd737ad7d3 | ||
|
|
df3aa84523 | ||
|
|
24a275ba25 | ||
|
|
aae438315f | ||
|
|
8b0d049b9f | ||
|
|
659bd99a67 | ||
|
|
c88166e055 | ||
|
|
099c0bcd34 | ||
|
|
d992e63075 | ||
|
|
c187f750fe | ||
|
|
bcbf6c1973 | ||
|
|
4bcbf70cae | ||
|
|
2d1854f354 | ||
|
|
a7c4a47723 | ||
|
|
61672ad3ff | ||
|
|
cea43099d2 | ||
|
|
6edf03c152 | ||
|
|
47c8cc24f4 | ||
|
|
64e46878e0 | ||
|
|
ea9b1e3503 | ||
|
|
2e9261cb26 | ||
|
|
69143d71f8 | ||
|
|
0c32fc5f2a | ||
|
|
af9cabe100 | ||
|
|
2ecb851926 | ||
|
|
2ffead76c1 | ||
|
|
5cc377751a | ||
|
|
ad8e9764e6 | ||
|
|
4ce426d8f6 | ||
|
|
c28e005087 | ||
|
|
22b751834f | ||
|
|
cce09b717e | ||
|
|
62dae3c6c6 | ||
|
|
97863e0b62 | ||
|
|
8a2f6bec33 | ||
|
|
e718378bdb | ||
|
|
d7d15a922a | ||
|
|
e74cb35aa4 | ||
|
|
da68651f61 | ||
|
|
be12136b8a | ||
|
|
6d3c21e369 | ||
|
|
1e96a1d6eb | ||
|
|
828bb64ebc | ||
|
|
6f00d32f7e | ||
|
|
f9e365828a | ||
|
|
90d463b925 | ||
|
|
22cdb5728b | ||
|
|
901152bd93 | ||
|
|
d9a5bca625 | ||
|
|
1676e9fe21 | ||
|
|
fad9d639bf | ||
|
|
efe6722bf8 | ||
|
|
a41f38547b | ||
|
|
87ee7868ea | ||
|
|
861bd1a96e | ||
|
|
6ac2b705dd | ||
|
|
fe4d6c68b5 | ||
|
|
5a7af5bb77 | ||
|
|
d9f90c84c0 | ||
|
|
4308407dc1 | ||
|
|
2b0313d60c | ||
|
|
350d213ee8 | ||
|
|
ca3198164c | ||
|
|
c53a5e7a72 | ||
|
|
ffb53f2085 | ||
|
|
3b191a3097 | ||
|
|
656948cd0f | ||
|
|
46f3d3ef61 | ||
|
|
06251aa76f | ||
|
|
5aef102f4f | ||
|
|
431646437e | ||
|
|
fe8621b00f | ||
|
|
c045060560 | ||
|
|
8ec475b1fd | ||
|
|
e33a6d5c2b | ||
|
|
923e1cef99 | ||
|
|
2e93dd57eb | ||
|
|
92957d685d | ||
|
|
f05acbd782 | ||
|
|
44a9266c9e | ||
|
|
c1710900b4 | ||
|
|
d5059b11b9 | ||
|
|
f95fa338c9 | ||
|
|
96c926c71e | ||
|
|
4dff203787 | ||
|
|
4977a5d43c | ||
|
|
8ce85a9750 | ||
|
|
d5939727e0 | ||
|
|
7b49f1e1de | ||
|
|
ac27089c69 | ||
|
|
4cb0bcb003 | ||
|
|
cf4e9e5578 | ||
|
|
32ced493de | ||
|
|
09e0f103f4 | ||
|
|
056255e396 | ||
|
|
85342b21c8 | ||
|
|
26b0322aa5 | ||
|
|
3b624d8bf8 | ||
|
|
ac02e56519 | ||
|
|
1eac4d2c07 | ||
|
|
3e5f770a38 | ||
|
|
2a66bb3fc7 | ||
|
|
397268394b | ||
|
|
5026cbdaf3 | ||
|
|
5af9dc5abd | ||
|
|
8d86c5e17d | ||
|
|
078bd606c7 | ||
|
|
b421945e71 | ||
|
|
41cd337506 | ||
|
|
b69156ac01 | ||
|
|
be6ac7e7a1 | ||
|
|
1fc1eb9f68 | ||
|
|
1fde585003 | ||
|
|
c915984340 | ||
|
|
50cc1cf0c9 | ||
|
|
1151fba415 | ||
|
|
3e08c390f5 | ||
|
|
053b69c63f | ||
|
|
ced14ec1ab | ||
|
|
6ba9450c89 | ||
|
|
ec8626046b | ||
|
|
4e84ad6cd7 | ||
|
|
40ebbecac8 | ||
|
|
0c43eb3973 | ||
|
|
3dea78d34b | ||
|
|
e27d24ba00 | ||
|
|
925aca764b | ||
|
|
2bb8de030f | ||
|
|
b92d511558 | ||
|
|
548c91ebb6 | ||
|
|
2c56d9fc3e | ||
|
|
6b61505ac2 | ||
|
|
e4db0fba2b | ||
|
|
8f89694fae | ||
|
|
5433e133d5 | ||
|
|
2487dab194 | ||
|
|
77e0912a0e | ||
|
|
a948203dae | ||
|
|
8f65bc24a0 | ||
|
|
9f102fc99d | ||
|
|
7bff9dc7f0 | ||
|
|
e86181c096 | ||
|
|
65df4bceaa | ||
|
|
3397922989 | ||
|
|
046d0c2f0a | ||
|
|
01fc4b0203 | ||
|
|
5b7d2c133a | ||
|
|
237b406e8c | ||
|
|
5427321260 | ||
|
|
ce570c166d | ||
|
|
649c11a78e | ||
|
|
7fae1c1262 | ||
|
|
f259cc1ab6 | ||
|
|
002893f280 | ||
|
|
1d9db1bfdd | ||
|
|
3b5fcd5873 | ||
|
|
a95505739d | ||
|
|
31c8281922 | ||
|
|
c6f6375015 | ||
|
|
6f74a745db | ||
|
|
36cb5f90e2 | ||
|
|
89780c8e4f | ||
|
|
9d4d8c22d9 | ||
|
|
b014b79d88 | ||
|
|
a61a88ea81 | ||
|
|
f31c50d04d | ||
|
|
8ceb0f3a79 | ||
|
|
d943c58b3d | ||
|
|
7ca1c644d1 | ||
|
|
300b7e078a | ||
|
|
3574956e5e | ||
|
|
e8a7b2a1fc | ||
|
|
b580049ec0 | ||
|
|
21c4aaf993 | ||
|
|
213491d94b | ||
|
|
da203b241b | ||
|
|
5d88b726c2 | ||
|
|
dcb7dd8d27 | ||
|
|
91e9658217 | ||
|
|
b28f62bbd9 | ||
|
|
4f4951022c | ||
|
|
58f7aecb0b | ||
|
|
5530a0b665 | ||
|
|
aded4a7a92 | ||
|
|
01df19c08b | ||
|
|
c197c4cdd9 | ||
|
|
5ba1f984df | ||
|
|
cb09e61d2f | ||
|
|
3c9db4b69e | ||
|
|
eeb8b41889 | ||
|
|
f7dd37e355 | ||
|
|
a45a95e5ea | ||
|
|
c6fee28b92 | ||
|
|
77dc63b549 | ||
|
|
66bfe909e6 | ||
|
|
9c50415ebe | ||
|
|
516ffb2147 | ||
|
|
f18c6dfea7 | ||
|
|
1cb67fbd20 | ||
|
|
54afdaa101 | ||
|
|
1c2ae10dc0 | ||
|
|
d34e8be316 | ||
|
|
4111382a31 | ||
|
|
11e914fbe9 | ||
|
|
0e983528e1 | ||
|
|
6b4437db39 | ||
|
|
534a36536c | ||
|
|
beba87129e | ||
|
|
b7e902dccc | ||
|
|
9eb30d4316 | ||
|
|
8fdad0d7fd | ||
|
|
0b812cdece | ||
|
|
724a301599 | ||
|
|
71d7d67fa3 | ||
|
|
264280edd7 | ||
|
|
beb0904a32 | ||
|
|
77c0a62a74 | ||
|
|
5d011c7e6b | ||
|
|
5644c8704f | ||
|
|
c9a586c243 | ||
|
|
f709311762 | ||
|
|
adde0c2d11 | ||
|
|
adf672ff83 | ||
|
|
029580886e | ||
|
|
32f8ae1af1 | ||
|
|
ce997a6de8 | ||
|
|
3620ac287e | ||
|
|
629ed5c691 | ||
|
|
78076a6903 | ||
|
|
67238b9fa6 | ||
|
|
c7ef4c9783 | ||
|
|
b21a05d465 | ||
|
|
436de0e03a | ||
|
|
8d482d3557 | ||
|
|
c5003969de | ||
|
|
1f417764c3 | ||
|
|
e75cd49313 | ||
|
|
4f95b9d7a6 | ||
|
|
066f91ca07 | ||
|
|
c3acbce82d | ||
|
|
b7f588b789 | ||
|
|
9346842eed | ||
|
|
f191c911d4 | ||
|
|
e6f49040f5 | ||
|
|
2f3f6dcb03 | ||
|
|
5ebcaf0a6c | ||
|
|
8bfdbcbab5 | ||
|
|
135b63dbe0 | ||
|
|
46167d1c46 | ||
|
|
79e621d96c | ||
|
|
66627b26cf | ||
|
|
7aad6e5127 | ||
|
|
dffcdea12b | ||
|
|
d7725837f5 | ||
|
|
7745c72b2c | ||
|
|
acb373280b | ||
|
|
9fcb28acad | ||
|
|
305c9a8d61 | ||
|
|
9b2d563dec | ||
|
|
150d4a47e4 | ||
|
|
1c9df69b33 | ||
|
|
10555faa92 | ||
|
|
0f1ffff068 | ||
|
|
9309b57364 | ||
|
|
cb08f2b6ec | ||
|
|
84cde3ce0b |
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
Language: Cpp
|
Language: Cpp
|
||||||
AccessModifierOffset: -4
|
AccessModifierOffset: -4
|
||||||
AlignAfterOpenBracket: AlwaysBreak
|
AlignAfterOpenBracket: AlwaysBreak
|
||||||
AlignConsecutiveAssignments: false
|
AlignConsecutiveAssignments: false
|
||||||
@@ -19,44 +19,52 @@ AlwaysBreakTemplateDeclarations: true
|
|||||||
BinPackArguments: false
|
BinPackArguments: false
|
||||||
BinPackParameters: false
|
BinPackParameters: false
|
||||||
BraceWrapping:
|
BraceWrapping:
|
||||||
AfterClass: true
|
AfterClass: true
|
||||||
AfterControlStatement: true
|
AfterControlStatement: true
|
||||||
AfterEnum: false
|
AfterEnum: false
|
||||||
AfterFunction: true
|
AfterFunction: true
|
||||||
AfterNamespace: false
|
AfterNamespace: false
|
||||||
AfterObjCDeclaration: true
|
AfterObjCDeclaration: true
|
||||||
AfterStruct: true
|
AfterStruct: true
|
||||||
AfterUnion: true
|
AfterUnion: true
|
||||||
BeforeCatch: true
|
BeforeCatch: true
|
||||||
BeforeElse: true
|
BeforeElse: true
|
||||||
IndentBraces: false
|
IndentBraces: false
|
||||||
BreakBeforeBinaryOperators: false
|
BreakBeforeBinaryOperators: false
|
||||||
BreakBeforeBraces: Custom
|
BreakBeforeBraces: Custom
|
||||||
BreakBeforeTernaryOperators: true
|
BreakBeforeTernaryOperators: true
|
||||||
BreakConstructorInitializersBeforeComma: true
|
BreakConstructorInitializersBeforeComma: true
|
||||||
ColumnLimit: 80
|
ColumnLimit: 80
|
||||||
CommentPragmas: '^ IWYU pragma:'
|
CommentPragmas: "^ IWYU pragma:"
|
||||||
ConstructorInitializerAllOnOneLineOrOnePerLine: true
|
ConstructorInitializerAllOnOneLineOrOnePerLine: true
|
||||||
ConstructorInitializerIndentWidth: 4
|
ConstructorInitializerIndentWidth: 4
|
||||||
ContinuationIndentWidth: 4
|
ContinuationIndentWidth: 4
|
||||||
Cpp11BracedListStyle: true
|
Cpp11BracedListStyle: true
|
||||||
DerivePointerAlignment: false
|
DerivePointerAlignment: false
|
||||||
DisableFormat: false
|
DisableFormat: false
|
||||||
ExperimentalAutoDetectBinPacking: false
|
ExperimentalAutoDetectBinPacking: false
|
||||||
ForEachMacros: [ Q_FOREACH, BOOST_FOREACH ]
|
ForEachMacros: [Q_FOREACH, BOOST_FOREACH]
|
||||||
|
IncludeBlocks: Regroup
|
||||||
IncludeCategories:
|
IncludeCategories:
|
||||||
- Regex: '^<(BeastConfig)'
|
- Regex: "^<(test)/"
|
||||||
Priority: 0
|
Priority: 0
|
||||||
- Regex: '^<(ripple)/'
|
- Regex: "^<(xrpld)/"
|
||||||
Priority: 2
|
Priority: 1
|
||||||
- Regex: '^<(boost)/'
|
- Regex: "^<(xrpl)/"
|
||||||
Priority: 3
|
Priority: 2
|
||||||
- Regex: '.*'
|
- Regex: "^<(boost)/"
|
||||||
Priority: 4
|
Priority: 3
|
||||||
IncludeIsMainRegex: '$'
|
- Regex: "^.*/"
|
||||||
|
Priority: 4
|
||||||
|
- Regex: '^.*\.h'
|
||||||
|
Priority: 5
|
||||||
|
- Regex: ".*"
|
||||||
|
Priority: 6
|
||||||
|
IncludeIsMainRegex: "$"
|
||||||
IndentCaseLabels: true
|
IndentCaseLabels: true
|
||||||
IndentFunctionDeclarationAfterType: false
|
IndentFunctionDeclarationAfterType: false
|
||||||
IndentWidth: 4
|
IndentRequiresClause: true
|
||||||
|
IndentWidth: 4
|
||||||
IndentWrappedFunctionNames: false
|
IndentWrappedFunctionNames: false
|
||||||
KeepEmptyLinesAtTheStartOfBlocks: false
|
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||||
MaxEmptyLinesToKeep: 1
|
MaxEmptyLinesToKeep: 1
|
||||||
@@ -70,18 +78,25 @@ PenaltyBreakString: 1000
|
|||||||
PenaltyExcessCharacter: 1000000
|
PenaltyExcessCharacter: 1000000
|
||||||
PenaltyReturnTypeOnItsOwnLine: 200
|
PenaltyReturnTypeOnItsOwnLine: 200
|
||||||
PointerAlignment: Left
|
PointerAlignment: Left
|
||||||
ReflowComments: true
|
ReflowComments: true
|
||||||
SortIncludes: true
|
RequiresClausePosition: OwnLine
|
||||||
|
SortIncludes: true
|
||||||
SpaceAfterCStyleCast: false
|
SpaceAfterCStyleCast: false
|
||||||
SpaceBeforeAssignmentOperators: true
|
SpaceBeforeAssignmentOperators: true
|
||||||
SpaceBeforeParens: ControlStatements
|
SpaceBeforeParens: ControlStatements
|
||||||
SpaceInEmptyParentheses: false
|
SpaceInEmptyParentheses: false
|
||||||
SpacesBeforeTrailingComments: 2
|
SpacesBeforeTrailingComments: 2
|
||||||
SpacesInAngles: false
|
SpacesInAngles: false
|
||||||
SpacesInContainerLiterals: true
|
SpacesInContainerLiterals: true
|
||||||
SpacesInCStyleCastParentheses: false
|
SpacesInCStyleCastParentheses: false
|
||||||
SpacesInParentheses: false
|
SpacesInParentheses: false
|
||||||
SpacesInSquareBrackets: false
|
SpacesInSquareBrackets: false
|
||||||
Standard: Cpp11
|
Standard: Cpp11
|
||||||
TabWidth: 8
|
TabWidth: 8
|
||||||
UseTab: Never
|
UseTab: Never
|
||||||
|
QualifierAlignment: Right
|
||||||
|
---
|
||||||
|
Language: JavaScript
|
||||||
|
---
|
||||||
|
Language: Json
|
||||||
|
IndentWidth: 2
|
||||||
|
|||||||
40
.codecov.yml
40
.codecov.yml
@@ -1,5 +1,37 @@
|
|||||||
|
|
||||||
codecov:
|
codecov:
|
||||||
ci:
|
require_ci_to_pass: true
|
||||||
- !appveyor
|
|
||||||
- travis
|
comment:
|
||||||
|
behavior: default
|
||||||
|
layout: reach,diff,flags,tree,reach
|
||||||
|
show_carryforward_flags: false
|
||||||
|
|
||||||
|
coverage:
|
||||||
|
range: "70..85"
|
||||||
|
precision: 1
|
||||||
|
round: nearest
|
||||||
|
status:
|
||||||
|
project:
|
||||||
|
default:
|
||||||
|
target: 75%
|
||||||
|
threshold: 2%
|
||||||
|
patch:
|
||||||
|
default:
|
||||||
|
target: auto
|
||||||
|
threshold: 2%
|
||||||
|
changes: false
|
||||||
|
|
||||||
|
github_checks:
|
||||||
|
annotations: true
|
||||||
|
|
||||||
|
parsers:
|
||||||
|
cobertura:
|
||||||
|
partials_as_hits: true
|
||||||
|
handle_missing_conditions: true
|
||||||
|
|
||||||
|
slack_app: false
|
||||||
|
|
||||||
|
ignore:
|
||||||
|
- "src/test/"
|
||||||
|
- "include/xrpl/beast/test/"
|
||||||
|
- "include/xrpl/beast/unit_test/"
|
||||||
|
|||||||
@@ -2,3 +2,13 @@
|
|||||||
# To use it by default in git blame:
|
# To use it by default in git blame:
|
||||||
# git config blame.ignoreRevsFile .git-blame-ignore-revs
|
# git config blame.ignoreRevsFile .git-blame-ignore-revs
|
||||||
50760c693510894ca368e90369b0cc2dabfd07f3
|
50760c693510894ca368e90369b0cc2dabfd07f3
|
||||||
|
e2384885f5f630c8f0ffe4bf21a169b433a16858
|
||||||
|
241b9ddde9e11beb7480600fd5ed90e1ef109b21
|
||||||
|
760f16f56835663d9286bd29294d074de26a7ba6
|
||||||
|
0eebe6a5f4246fced516d52b83ec4e7f47373edd
|
||||||
|
2189cc950c0cebb89e4e2fa3b2d8817205bf7cef
|
||||||
|
b9d007813378ad0ff45660dc07285b823c7e9855
|
||||||
|
fe9a5365b8a52d4acc42eb27369247e6f238a4f9
|
||||||
|
9a93577314e6a8d4b4a8368cc9d2b15a5d8303e8
|
||||||
|
552377c76f55b403a1c876df873a23d780fcc81c
|
||||||
|
97f0747e103f13e26e45b731731059b32f7679ac
|
||||||
|
|||||||
8
.github/CODEOWNERS
vendored
Normal file
8
.github/CODEOWNERS
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# Allow anyone to review any change by default.
|
||||||
|
*
|
||||||
|
|
||||||
|
# Require the rpc-reviewers team to review changes to the rpc code.
|
||||||
|
include/xrpl/protocol/ @xrplf/rpc-reviewers
|
||||||
|
src/libxrpl/protocol/ @xrplf/rpc-reviewers
|
||||||
|
src/xrpld/rpc/ @xrplf/rpc-reviewers
|
||||||
|
src/xrpld/app/misc/ @xrplf/rpc-reviewers
|
||||||
13
.github/ISSUE_TEMPLATE/bug_report.md
vendored
13
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -2,30 +2,35 @@
|
|||||||
name: Bug Report
|
name: Bug Report
|
||||||
about: Create a report to help us improve rippled
|
about: Create a report to help us improve rippled
|
||||||
title: "[Title with short description] (Version: [rippled version])"
|
title: "[Title with short description] (Version: [rippled version])"
|
||||||
labels: ''
|
labels: ""
|
||||||
assignees: ''
|
assignees: ""
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<!-- Please search existing issues to avoid creating duplicates.-->
|
<!-- Please search existing issues to avoid creating duplicates.-->
|
||||||
|
|
||||||
## Issue Description
|
## Issue Description
|
||||||
|
|
||||||
<!--Provide a summary for your issue/bug.-->
|
<!--Provide a summary for your issue/bug.-->
|
||||||
|
|
||||||
## Steps to Reproduce
|
## Steps to Reproduce
|
||||||
|
|
||||||
<!--List in detail the exact steps to reproduce the unexpected behavior of the software.-->
|
<!--List in detail the exact steps to reproduce the unexpected behavior of the software.-->
|
||||||
|
|
||||||
## Expected Result
|
## Expected Result
|
||||||
|
|
||||||
<!--Explain in detail what behavior you expected to happen.-->
|
<!--Explain in detail what behavior you expected to happen.-->
|
||||||
|
|
||||||
## Actual Result
|
## Actual Result
|
||||||
|
|
||||||
<!--Explain in detail what behavior actually happened.-->
|
<!--Explain in detail what behavior actually happened.-->
|
||||||
|
|
||||||
## Environment
|
## Environment
|
||||||
|
|
||||||
<!--Please describe your environment setup (such as Ubuntu 18.04 with Boost 1.70).-->
|
<!--Please describe your environment setup (such as Ubuntu 18.04 with Boost 1.70).-->
|
||||||
<!-- If you are using a formal release, please use the version returned by './rippled --version' as the version number-->
|
<!-- If you are using a formal release, please use the version returned by './rippled --version' as the version number-->
|
||||||
<!-- If you are working off of develop, please add the git hash via 'git rev-parse HEAD'-->
|
<!-- If you are working off of develop, please add the git hash via 'git rev-parse HEAD'-->
|
||||||
|
|
||||||
## Supporting Files
|
## Supporting Files
|
||||||
|
|
||||||
<!--If you have supporting files such as a log, feel free to post a link here using Github Gist.-->
|
<!--If you have supporting files such as a log, feel free to post a link here using Github Gist.-->
|
||||||
<!--Consider adding configuration files with private information removed via Github Gist. -->
|
<!--Consider adding configuration files with private information removed via Github Gist. -->
|
||||||
|
|
||||||
|
|||||||
8
.github/ISSUE_TEMPLATE/feature_request.md
vendored
8
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -3,19 +3,23 @@ name: Feature Request
|
|||||||
about: Suggest a new feature for the rippled project
|
about: Suggest a new feature for the rippled project
|
||||||
title: "[Title with short description] (Version: [rippled version])"
|
title: "[Title with short description] (Version: [rippled version])"
|
||||||
labels: Feature Request
|
labels: Feature Request
|
||||||
assignees: ''
|
assignees: ""
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<!-- Please search existing issues to avoid creating duplicates.-->
|
<!-- Please search existing issues to avoid creating duplicates.-->
|
||||||
|
|
||||||
## Summary
|
## Summary
|
||||||
|
|
||||||
<!-- Provide a summary to the feature request-->
|
<!-- Provide a summary to the feature request-->
|
||||||
|
|
||||||
## Motivation
|
## Motivation
|
||||||
|
|
||||||
<!-- Why do we need this feature?-->
|
<!-- Why do we need this feature?-->
|
||||||
|
|
||||||
## Solution
|
## Solution
|
||||||
|
|
||||||
<!-- What is the solution?-->
|
<!-- What is the solution?-->
|
||||||
|
|
||||||
## Paths Not Taken
|
## Paths Not Taken
|
||||||
|
|
||||||
<!-- What other alternatives have been considered?-->
|
<!-- What other alternatives have been considered?-->
|
||||||
|
|||||||
34
.github/actions/build/action.yml
vendored
Normal file
34
.github/actions/build/action.yml
vendored
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
name: build
|
||||||
|
inputs:
|
||||||
|
generator:
|
||||||
|
default: null
|
||||||
|
configuration:
|
||||||
|
required: true
|
||||||
|
cmake-args:
|
||||||
|
default: null
|
||||||
|
cmake-target:
|
||||||
|
default: all
|
||||||
|
# An implicit input is the environment variable `build_dir`.
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- name: configure
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
cd ${build_dir}
|
||||||
|
cmake \
|
||||||
|
${{ inputs.generator && format('-G "{0}"', inputs.generator) || '' }} \
|
||||||
|
-DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake \
|
||||||
|
-DCMAKE_BUILD_TYPE=${{ inputs.configuration }} \
|
||||||
|
-Dtests=TRUE \
|
||||||
|
-Dxrpld=TRUE \
|
||||||
|
${{ inputs.cmake-args }} \
|
||||||
|
..
|
||||||
|
- name: build
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
cmake \
|
||||||
|
--build ${build_dir} \
|
||||||
|
--config ${{ inputs.configuration }} \
|
||||||
|
--parallel ${NUM_PROCESSORS:-$(nproc)} \
|
||||||
|
--target ${{ inputs.cmake-target }}
|
||||||
38
.github/actions/dependencies/action.yml
vendored
Normal file
38
.github/actions/dependencies/action.yml
vendored
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
name: dependencies
|
||||||
|
inputs:
|
||||||
|
configuration:
|
||||||
|
required: true
|
||||||
|
# Implicit inputs are the environment variables `build_dir`, CONAN_REMOTE_URL,
|
||||||
|
# CONAN_REMOTE_USERNAME, and CONAN_REMOTE_PASSWORD. The latter two are only
|
||||||
|
# used to upload newly built dependencies to the Conan remote.
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- name: add Conan remote
|
||||||
|
if: ${{ env.CONAN_REMOTE_URL != '' }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "Adding Conan remote 'xrplf' at ${{ env.CONAN_REMOTE_URL }}."
|
||||||
|
conan remote add --index 0 --force xrplf ${{ env.CONAN_REMOTE_URL }}
|
||||||
|
echo "Listing Conan remotes."
|
||||||
|
conan remote list
|
||||||
|
- name: install dependencies
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
mkdir -p ${{ env.build_dir }}
|
||||||
|
cd ${{ env.build_dir }}
|
||||||
|
conan install \
|
||||||
|
--output-folder . \
|
||||||
|
--build missing \
|
||||||
|
--options:host "&:tests=True" \
|
||||||
|
--options:host "&:xrpld=True" \
|
||||||
|
--settings:all build_type=${{ inputs.configuration }} \
|
||||||
|
..
|
||||||
|
- name: upload dependencies
|
||||||
|
if: ${{ env.CONAN_REMOTE_URL != '' && env.CONAN_REMOTE_USERNAME != '' && env.CONAN_REMOTE_PASSWORD != '' && github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "Logging into Conan remote 'xrplf' at ${{ env.CONAN_REMOTE_URL }}."
|
||||||
|
conan remote login xrplf "${{ env.CONAN_REMOTE_USERNAME }}" --password "${{ env.CONAN_REMOTE_PASSWORD }}"
|
||||||
|
echo "Uploading dependencies."
|
||||||
|
conan upload '*' --confirm --check --remote xrplf
|
||||||
34
.github/pull_request_template.md
vendored
34
.github/pull_request_template.md
vendored
@@ -1,6 +1,12 @@
|
|||||||
<!--
|
<!--
|
||||||
This PR template helps you to write a good pull request description.
|
This PR template helps you to write a good pull request description.
|
||||||
Please feel free to include additional useful information even beyond what is requested below.
|
Please feel free to include additional useful information even beyond what is requested below.
|
||||||
|
|
||||||
|
If your branch is on a personal fork and has a name that allows it to
|
||||||
|
run CI build/test jobs (e.g. "ci/foo"), remember to rename it BEFORE
|
||||||
|
opening the PR. This avoids unnecessary redundant test runs. Renaming
|
||||||
|
the branch after opening the PR will close the PR.
|
||||||
|
https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-branches-in-your-repository/renaming-a-branch
|
||||||
-->
|
-->
|
||||||
|
|
||||||
## High Level Overview of Change
|
## High Level Overview of Change
|
||||||
@@ -33,14 +39,38 @@ Please check [x] relevant options, delete irrelevant ones.
|
|||||||
- [ ] New feature (non-breaking change which adds functionality)
|
- [ ] New feature (non-breaking change which adds functionality)
|
||||||
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
||||||
- [ ] Refactor (non-breaking change that only restructures code)
|
- [ ] Refactor (non-breaking change that only restructures code)
|
||||||
- [ ] Tests (You added tests for code that already exists, or your new feature included in this PR)
|
- [ ] Performance (increase or change in throughput and/or latency)
|
||||||
- [ ] Documentation Updates
|
- [ ] Tests (you added tests for code that already exists, or your new feature included in this PR)
|
||||||
|
- [ ] Documentation update
|
||||||
|
- [ ] Chore (no impact to binary, e.g. `.gitignore`, formatting, dropping support for older tooling)
|
||||||
- [ ] Release
|
- [ ] Release
|
||||||
|
|
||||||
|
### API Impact
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Please check [x] relevant options, delete irrelevant ones.
|
||||||
|
|
||||||
|
* If there is any impact to the public API methods (HTTP / WebSocket), please update https://github.com/xrplf/rippled/blob/develop/API-CHANGELOG.md
|
||||||
|
* Update API-CHANGELOG.md and add the change directly in this PR by pushing to your PR branch.
|
||||||
|
* libxrpl: See https://github.com/XRPLF/rippled/blob/develop/docs/build/depend.md
|
||||||
|
* Peer Protocol: See https://xrpl.org/peer-protocol.html
|
||||||
|
-->
|
||||||
|
|
||||||
|
- [ ] Public API: New feature (new methods and/or new fields)
|
||||||
|
- [ ] Public API: Breaking change (in general, breaking changes should only impact the next api_version)
|
||||||
|
- [ ] `libxrpl` change (any change that may affect `libxrpl` or dependents of `libxrpl`)
|
||||||
|
- [ ] Peer protocol change (must be backward compatible or bump the peer protocol version)
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
## Before / After
|
## Before / After
|
||||||
If relevant, use this section for an English description of the change at a technical level.
|
If relevant, use this section for an English description of the change at a technical level.
|
||||||
If this change affects an API, examples should be included here.
|
If this change affects an API, examples should be included here.
|
||||||
|
|
||||||
|
For performance-impacting changes, please provide these details:
|
||||||
|
1. Is this a new feature, bug fix, or improvement to existing functionality?
|
||||||
|
2. What behavior/functionality does the change impact?
|
||||||
|
3. In what processing can the impact be measured? Be as specific as possible - e.g. RPC client call, payment transaction that involves LOB, AMM, caching, DB operations, etc.
|
||||||
|
4. Does this change affect concurrent processing - e.g. does it involve acquiring locks, multi-threaded processing, or async processing?
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
|||||||
111
.github/workflows/clang-format.yml
vendored
111
.github/workflows/clang-format.yml
vendored
@@ -1,61 +1,64 @@
|
|||||||
name: clang-format
|
name: clang-format
|
||||||
|
|
||||||
on: [push, pull_request]
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
types: [opened, reopened, synchronize, ready_for_review]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check:
|
check:
|
||||||
runs-on: ubuntu-20.04
|
if: ${{ github.event_name == 'push' || github.event.pull_request.draft != true || contains(github.event.pull_request.labels.*.name, 'DraftRunCI') }}
|
||||||
env:
|
runs-on: ubuntu-24.04
|
||||||
CLANG_VERSION: 10
|
container: ghcr.io/xrplf/ci/tools-rippled-clang-format
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
# For jobs running in containers, $GITHUB_WORKSPACE and ${{ github.workspace }} might not be the
|
||||||
- name: Install clang-format
|
# same directory. The actions/checkout step is *supposed* to checkout into $GITHUB_WORKSPACE and
|
||||||
run: |
|
# then add it to safe.directory (see instructions at https://github.com/actions/checkout)
|
||||||
codename=$( lsb_release --codename --short )
|
# but that's apparently not happening for some container images. We can't be sure what is actually
|
||||||
sudo tee /etc/apt/sources.list.d/llvm.list >/dev/null <<EOF
|
# happening, so let's pre-emptively add both directories to safe.directory. There's a
|
||||||
deb http://apt.llvm.org/${codename}/ llvm-toolchain-${codename}-${CLANG_VERSION} main
|
# Github issue opened in 2022 and not resolved in 2025 https://github.com/actions/runner/issues/2058 ¯\_(ツ)_/¯
|
||||||
deb-src http://apt.llvm.org/${codename}/ llvm-toolchain-${codename}-${CLANG_VERSION} main
|
- run: |
|
||||||
EOF
|
git config --global --add safe.directory $GITHUB_WORKSPACE
|
||||||
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add
|
git config --global --add safe.directory ${{ github.workspace }}
|
||||||
sudo apt-get update
|
- uses: actions/checkout@v4
|
||||||
sudo apt-get install clang-format-${CLANG_VERSION}
|
- name: Format first-party sources
|
||||||
- name: Format src/ripple
|
run: |
|
||||||
run: find src/ripple -type f \( -name '*.cpp' -o -name '*.h' -o -name '*.ipp' \) -print0 | xargs -0 clang-format-${CLANG_VERSION} -i
|
clang-format --version
|
||||||
- name: Format src/test
|
find include src tests -type f \( -name '*.cpp' -o -name '*.hpp' -o -name '*.h' -o -name '*.ipp' \) -exec clang-format -i {} +
|
||||||
run: find src/test -type f \( -name '*.cpp' -o -name '*.h' -o -name '*.ipp' \) -print0 | xargs -0 clang-format-${CLANG_VERSION} -i
|
- name: Check for differences
|
||||||
- name: Check for differences
|
id: assert
|
||||||
id: assert
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
git diff --exit-code | tee "clang-format.patch"
|
git diff --exit-code | tee "clang-format.patch"
|
||||||
- name: Upload patch
|
- name: Upload patch
|
||||||
if: failure() && steps.assert.outcome == 'failure'
|
if: failure() && steps.assert.outcome == 'failure'
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v4
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
name: clang-format.patch
|
name: clang-format.patch
|
||||||
if-no-files-found: ignore
|
if-no-files-found: ignore
|
||||||
path: clang-format.patch
|
path: clang-format.patch
|
||||||
- name: What happened?
|
- name: What happened?
|
||||||
if: failure() && steps.assert.outcome == 'failure'
|
if: failure() && steps.assert.outcome == 'failure'
|
||||||
env:
|
env:
|
||||||
PREAMBLE: |
|
PREAMBLE: |
|
||||||
If you are reading this, you are looking at a failed Github Actions
|
If you are reading this, you are looking at a failed Github Actions
|
||||||
job. That means you pushed one or more files that did not conform
|
job. That means you pushed one or more files that did not conform
|
||||||
to the formatting specified in .clang-format. That may be because
|
to the formatting specified in .clang-format. That may be because
|
||||||
you neglected to run 'git clang-format' or 'clang-format' before
|
you neglected to run 'git clang-format' or 'clang-format' before
|
||||||
committing, or that your version of clang-format has an
|
committing, or that your version of clang-format has an
|
||||||
incompatibility with the one on this
|
incompatibility with the one on this
|
||||||
machine, which is:
|
machine, which is:
|
||||||
SUGGESTION: |
|
SUGGESTION: |
|
||||||
|
|
||||||
To fix it, you can do one of two things:
|
To fix it, you can do one of two things:
|
||||||
1. Download and apply the patch generated as an artifact of this
|
1. Download and apply the patch generated as an artifact of this
|
||||||
job to your repo, commit, and push.
|
job to your repo, commit, and push.
|
||||||
2. Run 'git-clang-format --extensions c,cpp,h,cxx,ipp develop'
|
2. Run 'git-clang-format --extensions cpp,h,hpp,ipp develop'
|
||||||
in your repo, commit, and push.
|
in your repo, commit, and push.
|
||||||
run: |
|
run: |
|
||||||
echo "${PREAMBLE}"
|
echo "${PREAMBLE}"
|
||||||
clang-format-${CLANG_VERSION} --version
|
clang-format --version
|
||||||
echo "${SUGGESTION}"
|
echo "${SUGGESTION}"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
15
.github/workflows/doxygen.yml
vendored
15
.github/workflows/doxygen.yml
vendored
@@ -4,21 +4,26 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- develop
|
- develop
|
||||||
|
- doxygen
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
job:
|
documentation:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
permissions:
|
||||||
image: docker://rippleci/rippled-ci-builder:2944b78d22db
|
contents: write
|
||||||
|
container: ghcr.io/xrplf/rippled-build-ubuntu:aaf5e3e
|
||||||
steps:
|
steps:
|
||||||
- name: checkout
|
- name: checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: check environment
|
- name: check environment
|
||||||
run: |
|
run: |
|
||||||
echo ${PATH} | tr ':' '\n'
|
echo ${PATH} | tr ':' '\n'
|
||||||
cmake --version
|
cmake --version
|
||||||
doxygen --version
|
doxygen --version
|
||||||
env
|
env | sort
|
||||||
- name: build
|
- name: build
|
||||||
run: |
|
run: |
|
||||||
mkdir build
|
mkdir build
|
||||||
|
|||||||
78
.github/workflows/levelization.yml
vendored
78
.github/workflows/levelization.yml
vendored
@@ -1,49 +1,53 @@
|
|||||||
name: levelization
|
name: levelization
|
||||||
|
|
||||||
on: [push, pull_request]
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
types: [opened, reopened, synchronize, ready_for_review]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check:
|
check:
|
||||||
|
if: ${{ github.event_name == 'push' || github.event.pull_request.draft != true || contains(github.event.pull_request.labels.*.name, 'DraftRunCI') }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
CLANG_VERSION: 10
|
CLANG_VERSION: 10
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
- name: Check levelization
|
- name: Check levelization
|
||||||
run: Builds/levelization/levelization.sh
|
run: Builds/levelization/levelization.sh
|
||||||
- name: Check for differences
|
- name: Check for differences
|
||||||
id: assert
|
id: assert
|
||||||
run: |
|
run: |
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
git diff --exit-code | tee "levelization.patch"
|
git diff --exit-code | tee "levelization.patch"
|
||||||
- name: Upload patch
|
- name: Upload patch
|
||||||
if: failure() && steps.assert.outcome == 'failure'
|
if: failure() && steps.assert.outcome == 'failure'
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v4
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
name: levelization.patch
|
name: levelization.patch
|
||||||
if-no-files-found: ignore
|
if-no-files-found: ignore
|
||||||
path: levelization.patch
|
path: levelization.patch
|
||||||
- name: What happened?
|
- name: What happened?
|
||||||
if: failure() && steps.assert.outcome == 'failure'
|
if: failure() && steps.assert.outcome == 'failure'
|
||||||
env:
|
env:
|
||||||
MESSAGE: |
|
MESSAGE: |
|
||||||
If you are reading this, you are looking at a failed Github
|
If you are reading this, you are looking at a failed Github
|
||||||
Actions job. That means you changed the dependency relationships
|
Actions job. That means you changed the dependency relationships
|
||||||
between the modules in rippled. That may be an improvement or a
|
between the modules in rippled. That may be an improvement or a
|
||||||
regression. This check doesn't judge.
|
regression. This check doesn't judge.
|
||||||
|
|
||||||
A rule of thumb, though, is that if your changes caused
|
A rule of thumb, though, is that if your changes caused
|
||||||
something to be removed from loops.txt, that's probably an
|
something to be removed from loops.txt, that's probably an
|
||||||
improvement. If something was added, it's probably a regression.
|
improvement. If something was added, it's probably a regression.
|
||||||
|
|
||||||
To fix it, you can do one of two things:
|
To fix it, you can do one of two things:
|
||||||
1. Download and apply the patch generated as an artifact of this
|
1. Download and apply the patch generated as an artifact of this
|
||||||
job to your repo, commit, and push.
|
job to your repo, commit, and push.
|
||||||
2. Run './Builds/levelization/levelization.sh' in your repo,
|
2. Run './Builds/levelization/levelization.sh' in your repo,
|
||||||
commit, and push.
|
commit, and push.
|
||||||
|
|
||||||
See Builds/levelization/README.md for more info.
|
See Builds/levelization/README.md for more info.
|
||||||
run: |
|
run: |
|
||||||
echo "${MESSAGE}"
|
echo "${MESSAGE}"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
91
.github/workflows/libxrpl.yml
vendored
Normal file
91
.github/workflows/libxrpl.yml
vendored
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
name: Check libXRPL compatibility with Clio
|
||||||
|
env:
|
||||||
|
CONAN_REMOTE_URL: https://conan.ripplex.io
|
||||||
|
CONAN_LOGIN_USERNAME_XRPLF: ${{ secrets.CONAN_REMOTE_USERNAME }}
|
||||||
|
CONAN_PASSWORD_XRPLF: ${{ secrets.CONAN_REMOTE_PASSWORD }}
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- "src/libxrpl/protocol/BuildInfo.cpp"
|
||||||
|
- ".github/workflows/libxrpl.yml"
|
||||||
|
types: [opened, reopened, synchronize, ready_for_review]
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
publish:
|
||||||
|
if: ${{ github.event_name == 'push' || github.event.pull_request.draft != true || contains(github.event.pull_request.labels.*.name, 'DraftRunCI') }}
|
||||||
|
name: Publish libXRPL
|
||||||
|
outputs:
|
||||||
|
outcome: ${{ steps.upload.outputs.outcome }}
|
||||||
|
version: ${{ steps.version.outputs.version }}
|
||||||
|
channel: ${{ steps.channel.outputs.channel }}
|
||||||
|
runs-on: [self-hosted, heavy]
|
||||||
|
container: ghcr.io/xrplf/rippled-build-ubuntu:aaf5e3e
|
||||||
|
steps:
|
||||||
|
- name: Wait for essential checks to succeed
|
||||||
|
uses: lewagon/wait-on-check-action@v1.3.4
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.pull_request.head.sha || github.sha }}
|
||||||
|
running-workflow-name: wait-for-check-regexp
|
||||||
|
check-regexp: "(dependencies|test).*linux.*" # Ignore windows and mac tests but make sure linux passes
|
||||||
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
wait-interval: 10
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Generate channel
|
||||||
|
id: channel
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo channel="clio/pr_${{ github.event.pull_request.number }}" | tee ${GITHUB_OUTPUT}
|
||||||
|
- name: Export new package
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
conan export . ${{ steps.channel.outputs.channel }}
|
||||||
|
- name: Add Conan remote
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "Adding Conan remote 'xrplf' at ${{ env.CONAN_REMOTE_URL }}."
|
||||||
|
conan remote add xrplf ${{ env.CONAN_REMOTE_URL }} --insert 0 --force
|
||||||
|
echo "Listing Conan remotes."
|
||||||
|
conan remote list
|
||||||
|
- name: Parse new version
|
||||||
|
id: version
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo version="$(cat src/libxrpl/protocol/BuildInfo.cpp | grep "versionString =" \
|
||||||
|
| awk -F '"' '{print $2}')" | tee ${GITHUB_OUTPUT}
|
||||||
|
- name: Try to authenticate to Conan remote
|
||||||
|
id: remote
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
# `conan user` implicitly uses the environment variables CONAN_LOGIN_USERNAME_<REMOTE> and CONAN_PASSWORD_<REMOTE>.
|
||||||
|
# https://docs.conan.io/1/reference/commands/misc/user.html#using-environment-variables
|
||||||
|
# https://docs.conan.io/1/reference/env_vars.html#conan-login-username-conan-login-username-remote-name
|
||||||
|
# https://docs.conan.io/1/reference/env_vars.html#conan-password-conan-password-remote-name
|
||||||
|
echo outcome=$(conan user --remote xrplf --password >&2 \
|
||||||
|
&& echo success || echo failure) | tee ${GITHUB_OUTPUT}
|
||||||
|
- name: Upload new package
|
||||||
|
id: upload
|
||||||
|
if: (steps.remote.outputs.outcome == 'success')
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "conan upload version ${{ steps.version.outputs.version }} on channel ${{ steps.channel.outputs.channel }}"
|
||||||
|
echo outcome=$(conan upload xrpl/${{ steps.version.outputs.version }}@${{ steps.channel.outputs.channel }} --remote ripple --confirm >&2 \
|
||||||
|
&& echo success || echo failure) | tee ${GITHUB_OUTPUT}
|
||||||
|
notify_clio:
|
||||||
|
name: Notify Clio
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: publish
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.CLIO_NOTIFY_TOKEN }}
|
||||||
|
steps:
|
||||||
|
- name: Notify Clio about new version
|
||||||
|
if: (needs.publish.outputs.outcome == 'success')
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
gh api --method POST -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" \
|
||||||
|
/repos/xrplf/clio/dispatches -f "event_type=check_libxrpl" \
|
||||||
|
-F "client_payload[version]=${{ needs.publish.outputs.version }}@${{ needs.publish.outputs.channel }}" \
|
||||||
|
-F "client_payload[pr]=${{ github.event.pull_request.number }}"
|
||||||
112
.github/workflows/macos.yml
vendored
Normal file
112
.github/workflows/macos.yml
vendored
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
name: macos
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types: [opened, reopened, synchronize, ready_for_review]
|
||||||
|
push:
|
||||||
|
# If the branches list is ever changed, be sure to change it on all
|
||||||
|
# build/test jobs (nix, macos, windows, instrumentation)
|
||||||
|
branches:
|
||||||
|
# Always build the package branches
|
||||||
|
- develop
|
||||||
|
- release
|
||||||
|
- master
|
||||||
|
# Branches that opt-in to running
|
||||||
|
- "ci/**"
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
# This part of Conan configuration is specific to this workflow only; we do not want
|
||||||
|
# to pollute conan/profiles directory with settings which might not work for others
|
||||||
|
env:
|
||||||
|
CONAN_REMOTE_URL: https://conan.ripplex.io
|
||||||
|
CONAN_REMOTE_USERNAME: ${{ secrets.CONAN_REMOTE_USERNAME }}
|
||||||
|
CONAN_REMOTE_PASSWORD: ${{ secrets.CONAN_REMOTE_PASSWORD }}
|
||||||
|
# This part of the Conan configuration is specific to this workflow only; we
|
||||||
|
# do not want to pollute the 'conan/profiles' directory with settings that
|
||||||
|
# might not work for other workflows.
|
||||||
|
CONAN_GLOBAL_CONF: |
|
||||||
|
core.download:parallel={{os.cpu_count()}}
|
||||||
|
core.upload:parallel={{os.cpu_count()}}
|
||||||
|
tools.build:jobs={{ (os.cpu_count() * 4/5) | int }}
|
||||||
|
tools.build:verbosity=verbose
|
||||||
|
tools.compilation:verbosity=verbose
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
if: ${{ github.event_name == 'push' || github.event.pull_request.draft != true || contains(github.event.pull_request.labels.*.name, 'DraftRunCI') }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
platform:
|
||||||
|
- macos
|
||||||
|
generator:
|
||||||
|
- Ninja
|
||||||
|
configuration:
|
||||||
|
- Release
|
||||||
|
runs-on: [self-hosted, macOS, mac-runner-m1]
|
||||||
|
env:
|
||||||
|
# The `build` action requires these variables.
|
||||||
|
build_dir: .build
|
||||||
|
NUM_PROCESSORS: 12
|
||||||
|
steps:
|
||||||
|
- name: checkout
|
||||||
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||||
|
- name: install Conan
|
||||||
|
run: |
|
||||||
|
brew install conan
|
||||||
|
- name: install Ninja
|
||||||
|
if: matrix.generator == 'Ninja'
|
||||||
|
run: brew install ninja
|
||||||
|
- name: install python
|
||||||
|
run: |
|
||||||
|
if which python > /dev/null 2>&1; then
|
||||||
|
echo "Python executable exists"
|
||||||
|
else
|
||||||
|
brew install python@3.13
|
||||||
|
ln -s /opt/homebrew/bin/python3 /opt/homebrew/bin/python
|
||||||
|
fi
|
||||||
|
- name: install cmake
|
||||||
|
run: |
|
||||||
|
if which cmake > /dev/null 2>&1; then
|
||||||
|
echo "cmake executable exists"
|
||||||
|
else
|
||||||
|
brew install cmake
|
||||||
|
fi
|
||||||
|
- name: install nproc
|
||||||
|
run: |
|
||||||
|
brew install coreutils
|
||||||
|
- name: check environment
|
||||||
|
run: |
|
||||||
|
env | sort
|
||||||
|
echo ${PATH} | tr ':' '\n'
|
||||||
|
python --version
|
||||||
|
conan --version
|
||||||
|
cmake --version
|
||||||
|
nproc --version
|
||||||
|
echo -n "nproc returns: "
|
||||||
|
nproc
|
||||||
|
system_profiler SPHardwareDataType
|
||||||
|
sysctl -n hw.logicalcpu
|
||||||
|
clang --version
|
||||||
|
- name: configure Conan
|
||||||
|
run: |
|
||||||
|
echo "${CONAN_GLOBAL_CONF}" > $(conan config home)/global.conf
|
||||||
|
conan config install conan/profiles/ -tf $(conan config home)/profiles/
|
||||||
|
conan profile show
|
||||||
|
- name: build dependencies
|
||||||
|
uses: ./.github/actions/dependencies
|
||||||
|
with:
|
||||||
|
configuration: ${{ matrix.configuration }}
|
||||||
|
- name: build
|
||||||
|
uses: ./.github/actions/build
|
||||||
|
with:
|
||||||
|
generator: ${{ matrix.generator }}
|
||||||
|
configuration: ${{ matrix.configuration }}
|
||||||
|
cmake-args: "-Dassert=TRUE -Dwerr=TRUE ${{ matrix.cmake-args }}"
|
||||||
|
- name: test
|
||||||
|
run: |
|
||||||
|
n=$(nproc)
|
||||||
|
echo "Using $n test jobs"
|
||||||
|
|
||||||
|
cd ${build_dir}
|
||||||
|
./rippled --unittest --unittest-jobs $n
|
||||||
|
ctest -j $n --output-on-failure
|
||||||
60
.github/workflows/missing-commits.yml
vendored
Normal file
60
.github/workflows/missing-commits.yml
vendored
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
name: missing-commits
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
# Only check that the branches are up to date when updating the
|
||||||
|
# relevant branches.
|
||||||
|
- develop
|
||||||
|
- release
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
up_to_date:
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Check for missing commits
|
||||||
|
id: commits
|
||||||
|
env:
|
||||||
|
SUGGESTION: |
|
||||||
|
|
||||||
|
If you are reading this, then the commits indicated above are
|
||||||
|
missing from "develop" and/or "release". Do a reverse-merge
|
||||||
|
as soon as possible. See CONTRIBUTING.md for instructions.
|
||||||
|
run: |
|
||||||
|
set -o pipefail
|
||||||
|
# Branches ordered by how "canonical" they are. Every commit in
|
||||||
|
# one branch should be in all the branches behind it
|
||||||
|
order=( master release develop )
|
||||||
|
branches=()
|
||||||
|
for branch in "${order[@]}"
|
||||||
|
do
|
||||||
|
# Check that the branches exist so that this job will work on
|
||||||
|
# forked repos, which don't necessarily have master and
|
||||||
|
# release branches.
|
||||||
|
if git ls-remote --exit-code --heads origin \
|
||||||
|
refs/heads/${branch} > /dev/null
|
||||||
|
then
|
||||||
|
branches+=( origin/${branch} )
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
prior=()
|
||||||
|
for branch in "${branches[@]}"
|
||||||
|
do
|
||||||
|
if [[ ${#prior[@]} -ne 0 ]]
|
||||||
|
then
|
||||||
|
echo "Checking ${prior[@]} for commits missing from ${branch}"
|
||||||
|
git log --oneline --no-merges "${prior[@]}" \
|
||||||
|
^$branch | tee -a "missing-commits.txt"
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
prior+=( "${branch}" )
|
||||||
|
done
|
||||||
|
if [[ $( cat missing-commits.txt | wc -l ) -ne 0 ]]
|
||||||
|
then
|
||||||
|
echo "${SUGGESTION}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
462
.github/workflows/nix.yml
vendored
462
.github/workflows/nix.yml
vendored
@@ -1,96 +1,422 @@
|
|||||||
name: nix
|
name: nix
|
||||||
on: [push, pull_request]
|
on:
|
||||||
|
pull_request:
|
||||||
|
types: [opened, reopened, synchronize, ready_for_review]
|
||||||
|
push:
|
||||||
|
# If the branches list is ever changed, be sure to change it on all
|
||||||
|
# build/test jobs (nix, macos, windows)
|
||||||
|
branches:
|
||||||
|
# Always build the package branches
|
||||||
|
- develop
|
||||||
|
- release
|
||||||
|
- master
|
||||||
|
# Branches that opt-in to running
|
||||||
|
- "ci/**"
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
env:
|
||||||
|
CONAN_REMOTE_URL: https://conan.ripplex.io
|
||||||
|
CONAN_REMOTE_USERNAME: ${{ secrets.CONAN_REMOTE_USERNAME }}
|
||||||
|
CONAN_REMOTE_PASSWORD: ${{ secrets.CONAN_REMOTE_PASSWORD }}
|
||||||
|
# This part of the Conan configuration is specific to this workflow only; we
|
||||||
|
# do not want to pollute the 'conan/profiles' directory with settings that
|
||||||
|
# might not work for other workflows.
|
||||||
|
CONAN_GLOBAL_CONF: |
|
||||||
|
core.download:parallel={{ os.cpu_count() }}
|
||||||
|
core.upload:parallel={{ os.cpu_count() }}
|
||||||
|
tools.build:jobs={{ (os.cpu_count() * 4/5) | int }}
|
||||||
|
tools.build:verbosity=verbose
|
||||||
|
tools.compilation:verbosity=verbose
|
||||||
|
|
||||||
|
# This workflow has multiple job matrixes.
|
||||||
|
# They can be considered phases because most of the matrices ("test",
|
||||||
|
# "coverage", "conan", ) depend on the first ("dependencies").
|
||||||
|
#
|
||||||
|
# The first phase has a job in the matrix for each combination of
|
||||||
|
# variables that affects dependency ABI:
|
||||||
|
# platform, compiler, and configuration.
|
||||||
|
# It creates a GitHub artifact holding the Conan profile,
|
||||||
|
# and builds and caches binaries for all the dependencies.
|
||||||
|
# If an Artifactory remote is configured, they are cached there.
|
||||||
|
# If not, they are added to the GitHub artifact.
|
||||||
|
# GitHub's "cache" action has a size limit (10 GB) that is too small
|
||||||
|
# to hold the binaries if they are built locally.
|
||||||
|
# We must use the "{upload,download}-artifact" actions instead.
|
||||||
|
#
|
||||||
|
# The remaining phases have a job in the matrix for each test
|
||||||
|
# configuration. They install dependency binaries from the cache,
|
||||||
|
# whichever was used, and build and test rippled.
|
||||||
|
#
|
||||||
|
# "instrumentation" is independent, but is included here because it also
|
||||||
|
# builds on linux in the same "on:" conditions.
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
dependencies:
|
||||||
|
if: ${{ github.event_name == 'push' || github.event.pull_request.draft != true || contains(github.event.pull_request.labels.*.name, 'DraftRunCI') }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
platform:
|
||||||
|
- linux
|
||||||
|
compiler:
|
||||||
|
- gcc
|
||||||
|
- clang
|
||||||
|
configuration:
|
||||||
|
- Debug
|
||||||
|
- Release
|
||||||
|
include:
|
||||||
|
- compiler: gcc
|
||||||
|
compiler_version: 12
|
||||||
|
distro: ubuntu
|
||||||
|
codename: jammy
|
||||||
|
- compiler: clang
|
||||||
|
compiler_version: 16
|
||||||
|
distro: debian
|
||||||
|
codename: bookworm
|
||||||
|
runs-on: [self-hosted, heavy]
|
||||||
|
container: ghcr.io/xrplf/ci/${{ matrix.distro }}-${{ matrix.codename }}:${{ matrix.compiler }}-${{ matrix.compiler_version }}
|
||||||
|
env:
|
||||||
|
build_dir: .build
|
||||||
|
steps:
|
||||||
|
- name: checkout
|
||||||
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||||
|
- name: check environment
|
||||||
|
run: |
|
||||||
|
echo ${PATH} | tr ':' '\n'
|
||||||
|
lsb_release -a || true
|
||||||
|
${{ matrix.compiler }}-${{ matrix.compiler_version }} --version
|
||||||
|
conan --version
|
||||||
|
cmake --version
|
||||||
|
env | sort
|
||||||
|
- name: configure Conan
|
||||||
|
run: |
|
||||||
|
echo "${CONAN_GLOBAL_CONF}" >> $(conan config home)/global.conf
|
||||||
|
conan config install conan/profiles/ -tf $(conan config home)/profiles/
|
||||||
|
conan profile show
|
||||||
|
- name: archive profile
|
||||||
|
# Create this archive before dependencies are added to the local cache.
|
||||||
|
run: tar -czf conan.tar.gz -C ${CONAN_HOME} .
|
||||||
|
- name: build dependencies
|
||||||
|
uses: ./.github/actions/dependencies
|
||||||
|
with:
|
||||||
|
configuration: ${{ matrix.configuration }}
|
||||||
|
- name: upload archive
|
||||||
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.platform }}-${{ matrix.compiler }}-${{ matrix.configuration }}
|
||||||
|
path: conan.tar.gz
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
test:
|
test:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
platform:
|
platform:
|
||||||
- ubuntu-latest
|
- linux
|
||||||
- macos-12
|
compiler:
|
||||||
generator:
|
- gcc
|
||||||
- Ninja
|
- clang
|
||||||
configuration:
|
configuration:
|
||||||
|
- Debug
|
||||||
- Release
|
- Release
|
||||||
runs-on: ${{ matrix.platform }}
|
include:
|
||||||
|
- compiler: gcc
|
||||||
|
compiler_version: 12
|
||||||
|
distro: ubuntu
|
||||||
|
codename: jammy
|
||||||
|
- compiler: clang
|
||||||
|
compiler_version: 16
|
||||||
|
distro: debian
|
||||||
|
codename: bookworm
|
||||||
|
cmake-args:
|
||||||
|
-
|
||||||
|
- "-Dunity=ON"
|
||||||
|
needs: dependencies
|
||||||
|
runs-on: [self-hosted, heavy]
|
||||||
|
container: ghcr.io/xrplf/ci/${{ matrix.distro }}-${{ matrix.codename }}:${{ matrix.compiler }}-${{ matrix.compiler_version }}
|
||||||
env:
|
env:
|
||||||
build_dir: .build
|
build_dir: .build
|
||||||
steps:
|
steps:
|
||||||
- name: checkout
|
- name: download cache
|
||||||
uses: actions/checkout@v3
|
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
|
||||||
- name: install Ninja on Linux
|
|
||||||
if: matrix.generator == 'Ninja' && runner.os == 'Linux'
|
|
||||||
run: sudo apt install ninja-build
|
|
||||||
- name: install Ninja on OSX
|
|
||||||
if: matrix.generator == 'Ninja' && runner.os == 'macOS'
|
|
||||||
run: brew install ninja
|
|
||||||
- name: install nproc on OSX
|
|
||||||
if: runner.os == 'macOS'
|
|
||||||
run: brew install coreutils
|
|
||||||
- name: choose Python
|
|
||||||
uses: actions/setup-python@v3
|
|
||||||
with:
|
with:
|
||||||
python-version: 3.9
|
name: ${{ matrix.platform }}-${{ matrix.compiler }}-${{ matrix.configuration }}
|
||||||
- name: learn Python cache directory
|
- name: extract cache
|
||||||
id: pip-cache
|
|
||||||
run: |
|
run: |
|
||||||
sudo pip install --upgrade pip
|
mkdir -p ${CONAN_HOME}
|
||||||
echo "::set-output name=dir::$(pip cache dir)"
|
tar -xzf conan.tar.gz -C ${CONAN_HOME}
|
||||||
- name: restore Python cache directory
|
- name: check environment
|
||||||
uses: actions/cache@v2
|
run: |
|
||||||
|
env | sort
|
||||||
|
echo ${PATH} | tr ':' '\n'
|
||||||
|
conan --version
|
||||||
|
cmake --version
|
||||||
|
- name: checkout
|
||||||
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||||
|
- name: dependencies
|
||||||
|
uses: ./.github/actions/dependencies
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.pip-cache.outputs.dir }}
|
configuration: ${{ matrix.configuration }}
|
||||||
key: ${{ runner.os }}-${{ hashFiles('.github/workflows/nix.yml') }}
|
- name: build
|
||||||
- name: install Conan
|
uses: ./.github/actions/build
|
||||||
run: pip install wheel 'conan~=1.52'
|
with:
|
||||||
|
generator: Ninja
|
||||||
|
configuration: ${{ matrix.configuration }}
|
||||||
|
cmake-args: "-Dassert=TRUE -Dwerr=TRUE ${{ matrix.cmake-args }}"
|
||||||
|
- name: check linking
|
||||||
|
run: |
|
||||||
|
cd ${build_dir}
|
||||||
|
ldd ./rippled
|
||||||
|
if [ "$(ldd ./rippled | grep -E '(libstdc\+\+|libgcc)' | wc -l)" -eq 0 ]; then
|
||||||
|
echo 'The binary is statically linked.'
|
||||||
|
else
|
||||||
|
echo 'The binary is dynamically linked.'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
- name: test
|
||||||
|
run: |
|
||||||
|
cd ${build_dir}
|
||||||
|
./rippled --unittest --unittest-jobs $(nproc)
|
||||||
|
ctest -j $(nproc) --output-on-failure
|
||||||
|
|
||||||
|
reference-fee-test:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
platform:
|
||||||
|
- linux
|
||||||
|
compiler:
|
||||||
|
- gcc
|
||||||
|
configuration:
|
||||||
|
- Debug
|
||||||
|
cmake-args:
|
||||||
|
- "-DUNIT_TEST_REFERENCE_FEE=200"
|
||||||
|
- "-DUNIT_TEST_REFERENCE_FEE=1000"
|
||||||
|
needs: dependencies
|
||||||
|
runs-on: [self-hosted, heavy]
|
||||||
|
container: ghcr.io/xrplf/ci/ubuntu-jammy:gcc-12
|
||||||
|
env:
|
||||||
|
build_dir: .build
|
||||||
|
steps:
|
||||||
|
- name: download cache
|
||||||
|
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.platform }}-${{ matrix.compiler }}-${{ matrix.configuration }}
|
||||||
|
- name: extract cache
|
||||||
|
run: |
|
||||||
|
mkdir -p ${CONAN_HOME}
|
||||||
|
tar -xzf conan.tar.gz -C ${CONAN_HOME}
|
||||||
|
- name: check environment
|
||||||
|
run: |
|
||||||
|
env | sort
|
||||||
|
echo ${PATH} | tr ':' '\n'
|
||||||
|
conan --version
|
||||||
|
cmake --version
|
||||||
|
- name: checkout
|
||||||
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||||
|
- name: dependencies
|
||||||
|
uses: ./.github/actions/dependencies
|
||||||
|
with:
|
||||||
|
configuration: ${{ matrix.configuration }}
|
||||||
|
- name: build
|
||||||
|
uses: ./.github/actions/build
|
||||||
|
with:
|
||||||
|
generator: Ninja
|
||||||
|
configuration: ${{ matrix.configuration }}
|
||||||
|
cmake-args: "-Dassert=TRUE -Dwerr=TRUE ${{ matrix.cmake-args }}"
|
||||||
|
- name: test
|
||||||
|
run: |
|
||||||
|
cd ${build_dir}
|
||||||
|
./rippled --unittest --unittest-jobs $(nproc)
|
||||||
|
ctest -j $(nproc) --output-on-failure
|
||||||
|
|
||||||
|
coverage:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
platform:
|
||||||
|
- linux
|
||||||
|
compiler:
|
||||||
|
- gcc
|
||||||
|
configuration:
|
||||||
|
- Debug
|
||||||
|
needs: dependencies
|
||||||
|
runs-on: [self-hosted, heavy]
|
||||||
|
container: ghcr.io/xrplf/ci/ubuntu-jammy:gcc-12
|
||||||
|
env:
|
||||||
|
build_dir: .build
|
||||||
|
steps:
|
||||||
|
- name: download cache
|
||||||
|
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.platform }}-${{ matrix.compiler }}-${{ matrix.configuration }}
|
||||||
|
- name: extract cache
|
||||||
|
run: |
|
||||||
|
mkdir -p ${CONAN_HOME}
|
||||||
|
tar -xzf conan.tar.gz -C ${CONAN_HOME}
|
||||||
- name: check environment
|
- name: check environment
|
||||||
run: |
|
run: |
|
||||||
echo ${PATH} | tr ':' '\n'
|
echo ${PATH} | tr ':' '\n'
|
||||||
python --version
|
|
||||||
conan --version
|
conan --version
|
||||||
cmake --version
|
cmake --version
|
||||||
env
|
gcovr --version
|
||||||
- name: configure Conan
|
env | sort
|
||||||
run: |
|
ls ${CONAN_HOME}
|
||||||
conan profile new default --detect
|
- name: checkout
|
||||||
conan profile update settings.compiler.cppstd=20 default
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||||
- name: configure Conan on Linux
|
- name: dependencies
|
||||||
if: runner.os == 'Linux'
|
uses: ./.github/actions/dependencies
|
||||||
run: |
|
|
||||||
conan profile update settings.compiler.libcxx=libstdc++11 default
|
|
||||||
- name: learn Conan cache directory
|
|
||||||
id: conan-cache
|
|
||||||
run: |
|
|
||||||
echo "::set-output name=dir::$(conan config get storage.path)"
|
|
||||||
- name: restore Conan cache directory
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.conan-cache.outputs.dir }}
|
configuration: ${{ matrix.configuration }}
|
||||||
key: ${{ hashFiles('~/.conan/profiles/default', 'conanfile.py', 'external/rocksdb/*', '.github/workflows/nix.yml') }}
|
- name: build
|
||||||
- name: export Snappy
|
uses: ./.github/actions/build
|
||||||
run: conan export external/snappy snappy/1.1.9@
|
with:
|
||||||
- name: install dependencies
|
generator: Ninja
|
||||||
|
configuration: ${{ matrix.configuration }}
|
||||||
|
cmake-args: >-
|
||||||
|
-Dassert=TRUE
|
||||||
|
-Dwerr=TRUE
|
||||||
|
-Dcoverage=ON
|
||||||
|
-Dcoverage_format=xml
|
||||||
|
-DCODE_COVERAGE_VERBOSE=ON
|
||||||
|
-DCMAKE_CXX_FLAGS="-O0"
|
||||||
|
-DCMAKE_C_FLAGS="-O0"
|
||||||
|
cmake-target: coverage
|
||||||
|
- name: move coverage report
|
||||||
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
mkdir ${build_dir}
|
mv "${build_dir}/coverage.xml" ./
|
||||||
cd ${build_dir}
|
- name: archive coverage report
|
||||||
conan install .. --build missing --settings build_type=${{ matrix.configuration }}
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
|
||||||
- name: configure
|
with:
|
||||||
|
name: coverage.xml
|
||||||
|
path: coverage.xml
|
||||||
|
retention-days: 30
|
||||||
|
- name: upload coverage report
|
||||||
|
uses: wandalen/wretry.action@v1.4.10
|
||||||
|
with:
|
||||||
|
action: codecov/codecov-action@v4.5.0
|
||||||
|
with: |
|
||||||
|
files: coverage.xml
|
||||||
|
fail_ci_if_error: true
|
||||||
|
disable_search: true
|
||||||
|
verbose: true
|
||||||
|
plugin: noop
|
||||||
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
attempt_limit: 5
|
||||||
|
attempt_delay: 210000 # in milliseconds
|
||||||
|
|
||||||
|
conan:
|
||||||
|
needs: dependencies
|
||||||
|
runs-on: [self-hosted, heavy]
|
||||||
|
container:
|
||||||
|
image: ghcr.io/xrplf/ci/ubuntu-jammy:gcc-12
|
||||||
|
env:
|
||||||
|
build_dir: .build
|
||||||
|
platform: linux
|
||||||
|
compiler: gcc
|
||||||
|
compiler_version: 12
|
||||||
|
configuration: Release
|
||||||
|
steps:
|
||||||
|
- name: download cache
|
||||||
|
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
|
||||||
|
with:
|
||||||
|
name: ${{ env.platform }}-${{ env.compiler }}-${{ env.configuration }}
|
||||||
|
- name: extract cache
|
||||||
run: |
|
run: |
|
||||||
cd ${build_dir}
|
mkdir -p ${CONAN_HOME}
|
||||||
cmake \
|
tar -xzf conan.tar.gz -C ${CONAN_HOME}
|
||||||
-G ${{ matrix.generator }} \
|
- name: check environment
|
||||||
-DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake \
|
run: |
|
||||||
-DCMAKE_BUILD_TYPE=${{ matrix.configuration }} \
|
env | sort
|
||||||
-Dassert=ON \
|
echo ${PATH} | tr ':' '\n'
|
||||||
-Dcoverage=OFF \
|
conan --version
|
||||||
-Dreporting=OFF \
|
cmake --version
|
||||||
-Dunity=OFF \
|
- name: checkout
|
||||||
..
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||||
|
- name: dependencies
|
||||||
|
uses: ./.github/actions/dependencies
|
||||||
|
with:
|
||||||
|
configuration: ${{ env.configuration }}
|
||||||
|
- name: export
|
||||||
|
run: |
|
||||||
|
conan export . --version head
|
||||||
- name: build
|
- name: build
|
||||||
run: |
|
run: |
|
||||||
cmake --build ${build_dir} --target rippled --parallel $(nproc)
|
cd tests/conan
|
||||||
- name: test
|
mkdir ${build_dir} && cd ${build_dir}
|
||||||
|
conan install .. \
|
||||||
|
--settings:all build_type=${configuration} \
|
||||||
|
--output-folder . \
|
||||||
|
--build missing
|
||||||
|
cmake .. \
|
||||||
|
-DCMAKE_TOOLCHAIN_FILE:FILEPATH=./build/${configuration}/generators/conan_toolchain.cmake \
|
||||||
|
-DCMAKE_BUILD_TYPE=${configuration}
|
||||||
|
cmake --build .
|
||||||
|
./example | grep '^[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+'
|
||||||
|
|
||||||
|
instrumentation-build:
|
||||||
|
needs: dependencies
|
||||||
|
runs-on: [self-hosted, heavy]
|
||||||
|
container: ghcr.io/xrplf/ci/debian-bookworm:clang-16
|
||||||
|
env:
|
||||||
|
build_dir: .build
|
||||||
|
steps:
|
||||||
|
- name: download cache
|
||||||
|
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
|
||||||
|
with:
|
||||||
|
name: linux-clang-Debug
|
||||||
|
|
||||||
|
- name: extract cache
|
||||||
run: |
|
run: |
|
||||||
${build_dir}/rippled --unittest --unittest-jobs $(nproc)
|
mkdir -p ${CONAN_HOME}
|
||||||
|
tar -xzf conan.tar.gz -C ${CONAN_HOME}
|
||||||
|
|
||||||
|
- name: check environment
|
||||||
|
run: |
|
||||||
|
echo ${PATH} | tr ':' '\n'
|
||||||
|
conan --version
|
||||||
|
cmake --version
|
||||||
|
env | sort
|
||||||
|
ls ${CONAN_HOME}
|
||||||
|
|
||||||
|
- name: checkout
|
||||||
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||||
|
|
||||||
|
- name: dependencies
|
||||||
|
uses: ./.github/actions/dependencies
|
||||||
|
with:
|
||||||
|
configuration: Debug
|
||||||
|
|
||||||
|
- name: prepare environment
|
||||||
|
run: |
|
||||||
|
mkdir -p ${build_dir}
|
||||||
|
echo "SOURCE_DIR=$(pwd)" >> $GITHUB_ENV
|
||||||
|
echo "BUILD_DIR=$(pwd)/${build_dir}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: build with instrumentation
|
||||||
|
run: |
|
||||||
|
cd ${BUILD_DIR}
|
||||||
|
cmake -S ${SOURCE_DIR} -B ${BUILD_DIR} \
|
||||||
|
-Dvoidstar=ON \
|
||||||
|
-Dtests=ON \
|
||||||
|
-Dxrpld=ON \
|
||||||
|
-DCMAKE_BUILD_TYPE=Debug \
|
||||||
|
-DSECP256K1_BUILD_BENCHMARK=OFF \
|
||||||
|
-DSECP256K1_BUILD_TESTS=OFF \
|
||||||
|
-DSECP256K1_BUILD_EXHAUSTIVE_TESTS=OFF \
|
||||||
|
-DCMAKE_TOOLCHAIN_FILE=${BUILD_DIR}/build/generators/conan_toolchain.cmake
|
||||||
|
cmake --build . --parallel $(nproc)
|
||||||
|
|
||||||
|
- name: verify instrumentation enabled
|
||||||
|
run: |
|
||||||
|
cd ${BUILD_DIR}
|
||||||
|
./rippled --version | grep libvoidstar
|
||||||
|
|
||||||
|
- name: run unit tests
|
||||||
|
run: |
|
||||||
|
cd ${BUILD_DIR}
|
||||||
|
./rippled -u --unittest-jobs $(( $(nproc)/4 ))
|
||||||
|
ctest -j $(nproc) --output-on-failure
|
||||||
|
|||||||
133
.github/workflows/windows.yml
vendored
133
.github/workflows/windows.yml
vendored
@@ -1,97 +1,106 @@
|
|||||||
name: windows
|
name: windows
|
||||||
# We have disabled this workflow because it fails in our CI Windows
|
|
||||||
# environment, but we cannot replicate the failure in our personal Windows
|
|
||||||
# test environments, nor have we gone through the trouble of setting up an
|
|
||||||
# interactive CI Windows environment.
|
|
||||||
# We welcome contributions to diagnose or debug the problems on Windows. Until
|
|
||||||
# then, we leave this tombstone as a reminder that we have tried (but failed)
|
|
||||||
# to write a reliable test for Windows.
|
|
||||||
# on: [push, pull_request]
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
pull_request:
|
||||||
|
types: [opened, reopened, synchronize, ready_for_review]
|
||||||
push:
|
push:
|
||||||
|
# If the branches list is ever changed, be sure to change it on all
|
||||||
|
# build/test jobs (nix, macos, windows, instrumentation)
|
||||||
branches:
|
branches:
|
||||||
- 'action'
|
# Always build the package branches
|
||||||
paths:
|
- develop
|
||||||
- '.github/workflow/windows.yml'
|
- release
|
||||||
|
- master
|
||||||
|
# Branches that opt-in to running
|
||||||
|
- "ci/**"
|
||||||
|
|
||||||
|
# https://docs.github.com/en/actions/using-jobs/using-concurrency
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
env:
|
||||||
|
CONAN_REMOTE_URL: https://conan.ripplex.io
|
||||||
|
CONAN_REMOTE_USERNAME: ${{ secrets.CONAN_REMOTE_USERNAME }}
|
||||||
|
CONAN_REMOTE_PASSWORD: ${{ secrets.CONAN_REMOTE_PASSWORD }}
|
||||||
|
# This part of the Conan configuration is specific to this workflow only; we
|
||||||
|
# do not want to pollute the 'conan/profiles' directory with settings that
|
||||||
|
# might not work for other workflows.
|
||||||
|
CONAN_GLOBAL_CONF: |
|
||||||
|
core.download:parallel={{os.cpu_count()}}
|
||||||
|
core.upload:parallel={{os.cpu_count()}}
|
||||||
|
tools.build:jobs=24
|
||||||
|
tools.build:verbosity=verbose
|
||||||
|
tools.compilation:verbosity=verbose
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
test:
|
test:
|
||||||
|
if: ${{ github.event_name == 'push' || github.event.pull_request.draft != true || contains(github.event.pull_request.labels.*.name, 'DraftRunCI') }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
generator:
|
version:
|
||||||
- Visual Studio 16 2019
|
- generator: Visual Studio 17 2022
|
||||||
|
runs-on: windows-2022
|
||||||
configuration:
|
configuration:
|
||||||
- Release
|
- type: Release
|
||||||
runs-on: windows-2019
|
tests: true
|
||||||
|
- type: Debug
|
||||||
|
# Skip running unit tests on debug builds, because they
|
||||||
|
# take an unreasonable amount of time
|
||||||
|
tests: false
|
||||||
|
runtime: d
|
||||||
|
runs-on: ${{ matrix.version.runs-on }}
|
||||||
env:
|
env:
|
||||||
build_dir: .build
|
build_dir: .build
|
||||||
steps:
|
steps:
|
||||||
- name: checkout
|
- name: checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||||
- name: choose Python
|
- name: choose Python
|
||||||
uses: actions/setup-python@v3
|
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
|
||||||
with:
|
with:
|
||||||
python-version: 3.9
|
python-version: 3.13
|
||||||
- name: learn Python cache directory
|
- name: learn Python cache directory
|
||||||
id: pip-cache
|
id: pip-cache
|
||||||
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
echo "::set-output name=dir::$(pip cache dir)"
|
echo "dir=$(pip cache dir)" | tee ${GITHUB_OUTPUT}
|
||||||
- name: restore Python cache directory
|
- name: restore Python cache directory
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.pip-cache.outputs.dir }}
|
path: ${{ steps.pip-cache.outputs.dir }}
|
||||||
key: ${{ runner.os }}-${{ hashFiles('.github/workflows/windows.yml') }}
|
key: ${{ runner.os }}-${{ hashFiles('.github/workflows/windows.yml') }}
|
||||||
- name: install Conan
|
- name: install Conan
|
||||||
run: pip install wheel 'conan~=1.52'
|
run: pip install wheel conan
|
||||||
- name: check environment
|
- name: check environment
|
||||||
run: |
|
run: |
|
||||||
|
dir env:
|
||||||
$env:PATH -split ';'
|
$env:PATH -split ';'
|
||||||
python --version
|
python --version
|
||||||
conan --version
|
conan --version
|
||||||
cmake --version
|
cmake --version
|
||||||
dir env:
|
|
||||||
- name: configure Conan
|
- name: configure Conan
|
||||||
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
conan profile new default --detect
|
echo "${CONAN_GLOBAL_CONF}" > $(conan config home)/global.conf
|
||||||
conan profile update settings.compiler.cppstd=20 default
|
conan config install conan/profiles/ -tf $(conan config home)/profiles/
|
||||||
conan profile update settings.compiler.runtime=MT default
|
conan profile show
|
||||||
conan profile update settings.compiler.toolset=v141 default
|
- name: build dependencies
|
||||||
- name: learn Conan cache directory
|
uses: ./.github/actions/dependencies
|
||||||
id: conan-cache
|
|
||||||
run: |
|
|
||||||
echo "::set-output name=dir::$(conan config get storage.path)"
|
|
||||||
- name: restore Conan cache directory
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.conan-cache.outputs.dir }}
|
configuration: ${{ matrix.configuration.type }}
|
||||||
key: ${{ hashFiles('~/.conan/profiles/default', 'conanfile.py', 'external/rocksdb/*', '.github/workflows/windows.yml') }}
|
|
||||||
- name: export Snappy
|
|
||||||
run: conan export external/snappy snappy/1.1.9@
|
|
||||||
- name: install dependencies
|
|
||||||
run: |
|
|
||||||
mkdir $env:build_dir
|
|
||||||
cd $env:build_dir
|
|
||||||
conan install .. --build missing --settings build_type=${{ matrix.configuration }}
|
|
||||||
- name: configure
|
|
||||||
run: |
|
|
||||||
$env:build_dir
|
|
||||||
cd $env:build_dir
|
|
||||||
pwd
|
|
||||||
ls
|
|
||||||
cmake `
|
|
||||||
-G "${{ matrix.generator }}" `
|
|
||||||
-DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake `
|
|
||||||
-Dassert=ON `
|
|
||||||
-Dreporting=OFF `
|
|
||||||
-Dunity=OFF `
|
|
||||||
..
|
|
||||||
- name: build
|
- name: build
|
||||||
run: |
|
uses: ./.github/actions/build
|
||||||
cmake --build $env:build_dir --target rippled --config ${{ matrix.configuration }} --parallel $env:NUMBER_OF_PROCESSORS
|
with:
|
||||||
|
generator: "${{ matrix.version.generator }}"
|
||||||
|
configuration: ${{ matrix.configuration.type }}
|
||||||
|
# Hard code for now. Move to the matrix if varied options are needed
|
||||||
|
cmake-args: "-Dassert=TRUE -Dwerr=TRUE -Dreporting=OFF -Dunity=ON"
|
||||||
|
cmake-target: install
|
||||||
- name: test
|
- name: test
|
||||||
|
shell: bash
|
||||||
|
if: ${{ matrix.configuration.tests }}
|
||||||
run: |
|
run: |
|
||||||
& "$env:build_dir\${{ matrix.configuration }}\rippled.exe" --unittest
|
cd ${build_dir}/${{ matrix.configuration.type }}
|
||||||
|
./rippled --unittest --unittest-jobs $(nproc)
|
||||||
|
ctest -j $(nproc) --output-on-failure
|
||||||
|
|||||||
7
.gitignore
vendored
7
.gitignore
vendored
@@ -21,7 +21,6 @@ bin/project-cache.jam
|
|||||||
|
|
||||||
# Ignore object files.
|
# Ignore object files.
|
||||||
*.o
|
*.o
|
||||||
build
|
|
||||||
.nih_c
|
.nih_c
|
||||||
tags
|
tags
|
||||||
TAGS
|
TAGS
|
||||||
@@ -65,7 +64,7 @@ docs/html_doc
|
|||||||
# Xcode user-specific project settings
|
# Xcode user-specific project settings
|
||||||
# Xcode
|
# Xcode
|
||||||
.DS_Store
|
.DS_Store
|
||||||
*/build/*
|
/build/
|
||||||
*.pbxuser
|
*.pbxuser
|
||||||
!default.pbxuser
|
!default.pbxuser
|
||||||
*.mode1v3
|
*.mode1v3
|
||||||
@@ -109,3 +108,7 @@ pkg_out
|
|||||||
pkg
|
pkg
|
||||||
CMakeUserPresets.json
|
CMakeUserPresets.json
|
||||||
bld.rippled/
|
bld.rippled/
|
||||||
|
.vscode
|
||||||
|
|
||||||
|
# Suggested in-tree build directory
|
||||||
|
/.build/
|
||||||
|
|||||||
6
.pre-commit-config.yaml
Normal file
6
.pre-commit-config.yaml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
# .pre-commit-config.yaml
|
||||||
|
repos:
|
||||||
|
- repo: https://github.com/pre-commit/mirrors-clang-format
|
||||||
|
rev: v18.1.8
|
||||||
|
hooks:
|
||||||
|
- id: clang-format
|
||||||
225
API-CHANGELOG.md
Normal file
225
API-CHANGELOG.md
Normal file
@@ -0,0 +1,225 @@
|
|||||||
|
# API Changelog
|
||||||
|
|
||||||
|
This changelog is intended to list all updates to the [public API methods](https://xrpl.org/public-api-methods.html).
|
||||||
|
|
||||||
|
For info about how [API versioning](https://xrpl.org/request-formatting.html#api-versioning) works, including examples, please view the [XLS-22d spec](https://github.com/XRPLF/XRPL-Standards/discussions/54). For details about the implementation of API versioning, view the [implementation PR](https://github.com/XRPLF/rippled/pull/3155). API versioning ensures existing integrations and users continue to receive existing behavior, while those that request a higher API version will experience new behavior.
|
||||||
|
|
||||||
|
The API version controls the API behavior you see. This includes what properties you see in responses, what parameters you're permitted to send in requests, and so on. You specify the API version in each of your requests. When a breaking change is introduced to the `rippled` API, a new version is released. To avoid breaking your code, you should set (or increase) your version when you're ready to upgrade.
|
||||||
|
|
||||||
|
For a log of breaking changes, see the **API Version [number]** headings. In general, breaking changes are associated with a particular API Version number. For non-breaking changes, scroll to the **XRP Ledger version [x.y.z]** headings. Non-breaking changes are associated with a particular XRP Ledger (`rippled`) release.
|
||||||
|
|
||||||
|
## API Version 2
|
||||||
|
|
||||||
|
API version 2 is available in `rippled` version 2.0.0 and later. To use this API, clients specify `"api_version" : 2` in each request.
|
||||||
|
|
||||||
|
#### Removed methods
|
||||||
|
|
||||||
|
In API version 2, the following deprecated methods are no longer available: (https://github.com/XRPLF/rippled/pull/4759)
|
||||||
|
|
||||||
|
- `tx_history` - Instead, use other methods such as `account_tx` or `ledger` with the `transactions` field set to `true`.
|
||||||
|
- `ledger_header` - Instead, use the `ledger` method.
|
||||||
|
|
||||||
|
#### Modifications to JSON transaction element in V2
|
||||||
|
|
||||||
|
In API version 2, JSON elements for transaction output have been changed and made consistent for all methods which output transactions. (https://github.com/XRPLF/rippled/pull/4775)
|
||||||
|
This helps to unify the JSON serialization format of transactions. (https://github.com/XRPLF/clio/issues/722, https://github.com/XRPLF/rippled/issues/4727)
|
||||||
|
|
||||||
|
- JSON transaction element is named `tx_json`
|
||||||
|
- Binary transaction element is named `tx_blob`
|
||||||
|
- JSON transaction metadata element is named `meta`
|
||||||
|
- Binary transaction metadata element is named `meta_blob`
|
||||||
|
|
||||||
|
Additionally, these elements are now consistently available next to `tx_json` (i.e. sibling elements), where possible:
|
||||||
|
|
||||||
|
- `hash` - Transaction ID. This data was stored inside transaction output in API version 1, but in API version 2 is a sibling element.
|
||||||
|
- `ledger_index` - Ledger index (only set on validated ledgers)
|
||||||
|
- `ledger_hash` - Ledger hash (only set on closed or validated ledgers)
|
||||||
|
- `close_time_iso` - Ledger close time expressed in ISO 8601 time format (only set on validated ledgers)
|
||||||
|
- `validated` - Bool element set to `true` if the transaction is in a validated ledger, otherwise `false`
|
||||||
|
|
||||||
|
This change affects the following methods:
|
||||||
|
|
||||||
|
- `tx` - Transaction data moved into element `tx_json` (was inline inside `result`) or, if binary output was requested, moved from `tx` to `tx_blob`. Renamed binary transaction metadata element (if it was requested) from `meta` to `meta_blob`. Changed location of `hash` and added new elements
|
||||||
|
- `account_tx` - Renamed transaction element from `tx` to `tx_json`. Renamed binary transaction metadata element (if it was requested) from `meta` to `meta_blob`. Changed location of `hash` and added new elements
|
||||||
|
- `transaction_entry` - Renamed transaction metadata element from `metadata` to `meta`. Changed location of `hash` and added new elements
|
||||||
|
- `subscribe` - Renamed transaction element from `transaction` to `tx_json`. Changed location of `hash` and added new elements
|
||||||
|
- `sign`, `sign_for`, `submit` and `submit_multisigned` - Changed location of `hash` element.
|
||||||
|
|
||||||
|
#### Modification to `Payment` transaction JSON schema
|
||||||
|
|
||||||
|
When reading Payments, the `Amount` field should generally **not** be used. Instead, use [delivered_amount](https://xrpl.org/partial-payments.html#the-delivered_amount-field) to see the amount that the Payment delivered. To clarify its meaning, the `Amount` field is being renamed to `DeliverMax`. (https://github.com/XRPLF/rippled/pull/4733)
|
||||||
|
|
||||||
|
- In `Payment` transaction type, JSON RPC field `Amount` is renamed to `DeliverMax`. To enable smooth client transition, `Amount` is still handled, as described below: (https://github.com/XRPLF/rippled/pull/4733)
|
||||||
|
- On JSON RPC input (e.g. `submit_multisigned` etc. methods), `Amount` is recognized as an alias to `DeliverMax` for both API version 1 and version 2 clients.
|
||||||
|
- On JSON RPC input, submitting both `Amount` and `DeliverMax` fields is allowed _only_ if they are identical; otherwise such input is rejected with `rpcINVALID_PARAMS` error.
|
||||||
|
- On JSON RPC output (e.g. `subscribe`, `account_tx` etc. methods), `DeliverMax` is present in both API version 1 and version 2.
|
||||||
|
- On JSON RPC output, `Amount` is only present in API version 1 and _not_ in version 2.
|
||||||
|
|
||||||
|
#### Modifications to account_info response
|
||||||
|
|
||||||
|
- `signer_lists` is returned in the root of the response. (In API version 1, it was nested under `account_data`.) (https://github.com/XRPLF/rippled/pull/3770)
|
||||||
|
- When using an invalid `signer_lists` value, the API now returns an "invalidParams" error. (https://github.com/XRPLF/rippled/pull/4585)
|
||||||
|
- (`signer_lists` must be a boolean. In API version 1, strings were accepted and may return a normal response - i.e. as if `signer_lists` were `true`.)
|
||||||
|
|
||||||
|
#### Modifications to [account_tx](https://xrpl.org/account_tx.html#account_tx) response
|
||||||
|
|
||||||
|
- Using `ledger_index_min`, `ledger_index_max`, and `ledger_index` returns `invalidParams` because if you use `ledger_index_min` or `ledger_index_max`, then it does not make sense to also specify `ledger_index`. In API version 1, no error was returned. (https://github.com/XRPLF/rippled/pull/4571)
|
||||||
|
- The same applies for `ledger_index_min`, `ledger_index_max`, and `ledger_hash`. (https://github.com/XRPLF/rippled/issues/4545#issuecomment-1565065579)
|
||||||
|
- Using a `ledger_index_min` or `ledger_index_max` beyond the range of ledgers that the server has:
|
||||||
|
- returns `lgrIdxMalformed` in API version 2. Previously, in API version 1, no error was returned. (https://github.com/XRPLF/rippled/issues/4288)
|
||||||
|
- Attempting to use a non-boolean value (such as a string) for the `binary` or `forward` parameters returns `invalidParams` (`rpcINVALID_PARAMS`). Previously, in API version 1, no error was returned. (https://github.com/XRPLF/rippled/pull/4620)
|
||||||
|
|
||||||
|
#### Modifications to [noripple_check](https://xrpl.org/noripple_check.html#noripple_check) response
|
||||||
|
|
||||||
|
- Attempting to use a non-boolean value (such as a string) for the `transactions` parameter returns `invalidParams` (`rpcINVALID_PARAMS`). Previously, in API version 1, no error was returned. (https://github.com/XRPLF/rippled/pull/4620)
|
||||||
|
|
||||||
|
## API Version 1
|
||||||
|
|
||||||
|
This version is supported by all `rippled` versions. For WebSocket and HTTP JSON-RPC requests, it is currently the default API version used when no `api_version` is specified.
|
||||||
|
|
||||||
|
The [commandline](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#commandline-format) always uses the latest API version. The command line is intended for ad-hoc usage by humans, not programs or automated scripts. The command line is not meant for use in production code.
|
||||||
|
|
||||||
|
### Inconsistency: server_info - network_id
|
||||||
|
|
||||||
|
The `network_id` field was added in the `server_info` response in version 1.5.0 (2019), but it is not returned in [reporting mode](https://xrpl.org/rippled-server-modes.html#reporting-mode). However, use of reporting mode is now discouraged, in favor of using [Clio](https://github.com/XRPLF/clio) instead.
|
||||||
|
|
||||||
|
## XRP Ledger server version 2.5.0
|
||||||
|
|
||||||
|
As of 2025-04-04, version 2.5.0 is in development. You can use a pre-release version by building from source or [using the `nightly` package](https://xrpl.org/docs/infrastructure/installation/install-rippled-on-ubuntu).
|
||||||
|
|
||||||
|
### Additions and bugfixes in 2.5.0
|
||||||
|
|
||||||
|
- `channel_authorize`: If `signing_support` is not enabled in the config, the RPC is disabled.
|
||||||
|
|
||||||
|
## XRP Ledger server version 2.4.0
|
||||||
|
|
||||||
|
[Version 2.4.0](https://github.com/XRPLF/rippled/releases/tag/2.4.0) was released on March 4, 2025.
|
||||||
|
|
||||||
|
### Additions and bugfixes in 2.4.0
|
||||||
|
|
||||||
|
- `ledger_entry`: `state` is added an alias for `ripple_state`.
|
||||||
|
- `ledger_entry`: Enables case-insensitive filtering by canonical name in addition to case-sensitive filtering by RPC name.
|
||||||
|
- `validators`: Added new field `validator_list_threshold` in response.
|
||||||
|
- `simulate`: A new RPC that executes a [dry run of a transaction submission](https://github.com/XRPLF/XRPL-Standards/tree/master/XLS-0069d-simulate#2-rpc-simulate)
|
||||||
|
- Signing methods autofill fees better and properly handle transactions that don't have a base fee, and will also autofill the `NetworkID` field.
|
||||||
|
|
||||||
|
## XRP Ledger server version 2.3.0
|
||||||
|
|
||||||
|
[Version 2.3.0](https://github.com/XRPLF/rippled/releases/tag/2.3.0) was released on Nov 25, 2024.
|
||||||
|
|
||||||
|
### Breaking changes in 2.3.0
|
||||||
|
|
||||||
|
- `book_changes`: If the requested ledger version is not available on this node, a `ledgerNotFound` error is returned and the node does not attempt to acquire the ledger from the p2p network (as with other non-admin RPCs).
|
||||||
|
|
||||||
|
Admins can still attempt to retrieve old ledgers with the `ledger_request` RPC.
|
||||||
|
|
||||||
|
### Additions and bugfixes in 2.3.0
|
||||||
|
|
||||||
|
- `book_changes`: Returns a `validated` field in its response, which was missing in prior versions.
|
||||||
|
|
||||||
|
## XRP Ledger server version 2.2.0
|
||||||
|
|
||||||
|
[Version 2.2.0](https://github.com/XRPLF/rippled/releases/tag/2.2.0) was released on Jun 5, 2024. The following additions are non-breaking (because they are purely additive):
|
||||||
|
|
||||||
|
- The `feature` method now has a non-admin mode for users. (It was previously only available to admin connections.) The method returns an updated list of amendments, including their names and other information. ([#4781](https://github.com/XRPLF/rippled/pull/4781))
|
||||||
|
|
||||||
|
## XRP Ledger server version 2.0.0
|
||||||
|
|
||||||
|
[Version 2.0.0](https://github.com/XRPLF/rippled/releases/tag/2.0.0) was released on Jan 9, 2024. The following additions are non-breaking (because they are purely additive):
|
||||||
|
|
||||||
|
- `server_definitions`: A new RPC that generates a `definitions.json`-like output that can be used in XRPL libraries.
|
||||||
|
- In `Payment` transactions, `DeliverMax` has been added. This is a replacement for the `Amount` field, which should not be used. Typically, the `delivered_amount` (in transaction metadata) should be used. To ease the transition, `DeliverMax` is present regardless of API version, since adding a field is non-breaking.
|
||||||
|
- API version 2 has been moved from beta to supported, meaning that it is generally available (regardless of the `beta_rpc_api` setting).
|
||||||
|
|
||||||
|
## XRP Ledger server version 2.2.0
|
||||||
|
|
||||||
|
The following is a non-breaking addition to the API.
|
||||||
|
|
||||||
|
- The `feature` method now has a non-admin mode for users. (It was previously only available to admin connections.) The method returns an updated list of amendments, including their names and other information. ([#4781](https://github.com/XRPLF/rippled/pull/4781))
|
||||||
|
|
||||||
|
## XRP Ledger server version 1.12.0
|
||||||
|
|
||||||
|
[Version 1.12.0](https://github.com/XRPLF/rippled/releases/tag/1.12.0) was released on Sep 6, 2023. The following additions are non-breaking (because they are purely additive).
|
||||||
|
|
||||||
|
- `server_info`: Added `ports`, an array which advertises the RPC and WebSocket ports. This information is also included in the `/crawl` endpoint (which calls `server_info` internally). `grpc` and `peer` ports are also included. (https://github.com/XRPLF/rippled/pull/4427)
|
||||||
|
- `ports` contains objects, each containing a `port` for the listening port (a number string), and a `protocol` array listing the supported protocols on that port.
|
||||||
|
- This allows crawlers to build a more detailed topology without needing to port-scan nodes.
|
||||||
|
- (For peers and other non-admin clients, the info about admin ports is excluded.)
|
||||||
|
- Clawback: The following additions are gated by the Clawback amendment (`featureClawback`). (https://github.com/XRPLF/rippled/pull/4553)
|
||||||
|
- Adds an [AccountRoot flag](https://xrpl.org/accountroot.html#accountroot-flags) called `lsfAllowTrustLineClawback` (https://github.com/XRPLF/rippled/pull/4617)
|
||||||
|
- Adds the corresponding `asfAllowTrustLineClawback` [AccountSet Flag](https://xrpl.org/accountset.html#accountset-flags) as well.
|
||||||
|
- Clawback is disabled by default, so if an issuer desires the ability to claw back funds, they must use an `AccountSet` transaction to set the AllowTrustLineClawback flag. They must do this before creating any trust lines, offers, escrows, payment channels, or checks.
|
||||||
|
- Adds the [Clawback transaction type](https://github.com/XRPLF/XRPL-Standards/blob/master/XLS-39d-clawback/README.md#331-clawback-transaction), containing these fields:
|
||||||
|
- `Account`: The issuer of the asset being clawed back. Must also be the sender of the transaction.
|
||||||
|
- `Amount`: The amount being clawed back, with the `Amount.issuer` being the token holder's address.
|
||||||
|
- Adds [AMM](https://github.com/XRPLF/XRPL-Standards/discussions/78) ([#4294](https://github.com/XRPLF/rippled/pull/4294), [#4626](https://github.com/XRPLF/rippled/pull/4626)) feature:
|
||||||
|
- Adds `amm_info` API to retrieve AMM information for a given tokens pair.
|
||||||
|
- Adds `AMMCreate` transaction type to create `AMM` instance.
|
||||||
|
- Adds `AMMDeposit` transaction type to deposit funds into `AMM` instance.
|
||||||
|
- Adds `AMMWithdraw` transaction type to withdraw funds from `AMM` instance.
|
||||||
|
- Adds `AMMVote` transaction type to vote for the trading fee of `AMM` instance.
|
||||||
|
- Adds `AMMBid` transaction type to bid for the Auction Slot of `AMM` instance.
|
||||||
|
- Adds `AMMDelete` transaction type to delete `AMM` instance.
|
||||||
|
- Adds `sfAMMID` to `AccountRoot` to indicate that the account is `AMM`'s account. `AMMID` is used to fetch `ltAMM`.
|
||||||
|
- Adds `lsfAMMNode` `TrustLine` flag to indicate that one side of the `TrustLine` is `AMM` account.
|
||||||
|
- Adds `tfLPToken`, `tfSingleAsset`, `tfTwoAsset`, `tfOneAssetLPToken`, `tfLimitLPToken`, `tfTwoAssetIfEmpty`,
|
||||||
|
`tfWithdrawAll`, `tfOneAssetWithdrawAll` which allow a trader to specify different fields combination
|
||||||
|
for `AMMDeposit` and `AMMWithdraw` transactions.
|
||||||
|
- Adds new transaction result codes:
|
||||||
|
- tecUNFUNDED_AMM: insufficient balance to fund AMM. The account does not have funds for liquidity provision.
|
||||||
|
- tecAMM_BALANCE: AMM has invalid balance. Calculated balances greater than the current pool balances.
|
||||||
|
- tecAMM_FAILED: AMM transaction failed. Fails due to a processing failure.
|
||||||
|
- tecAMM_INVALID_TOKENS: AMM invalid LP tokens. Invalid input values, format, or calculated values.
|
||||||
|
- tecAMM_EMPTY: AMM is in empty state. Transaction requires AMM in non-empty state (LP tokens > 0).
|
||||||
|
- tecAMM_NOT_EMPTY: AMM is not in empty state. Transaction requires AMM in empty state (LP tokens == 0).
|
||||||
|
- tecAMM_ACCOUNT: AMM account. Clawback of AMM account.
|
||||||
|
- tecINCOMPLETE: Some work was completed, but more submissions required to finish. AMMDelete partially deletes the trustlines.
|
||||||
|
|
||||||
|
## XRP Ledger server version 1.11.0
|
||||||
|
|
||||||
|
[Version 1.11.0](https://github.com/XRPLF/rippled/releases/tag/1.11.0) was released on Jun 20, 2023.
|
||||||
|
|
||||||
|
### Breaking changes in 1.11
|
||||||
|
|
||||||
|
- Added the ability to mark amendments as obsolete. For the `feature` admin API, there is a new possible value for the `vetoed` field. (https://github.com/XRPLF/rippled/pull/4291)
|
||||||
|
- The value of `vetoed` can now be `true`, `false`, or `"Obsolete"`.
|
||||||
|
- Removed the acceptance of seeds or public keys in place of account addresses. (https://github.com/XRPLF/rippled/pull/4404)
|
||||||
|
- This simplifies the API and encourages better security practices (i.e. seeds should never be sent over the network).
|
||||||
|
- For the `ledger_data` method, when all entries are filtered out, the `state` field of the response is now an empty list (in other words, an empty array, `[]`). (Previously, it would return `null`.) While this is technically a breaking change, the new behavior is consistent with the documentation, so this is considered only a bug fix. (https://github.com/XRPLF/rippled/pull/4398)
|
||||||
|
- If and when the `fixNFTokenRemint` amendment activates, there will be a new AccountRoot field, `FirstNFTSequence`. This field is set to the current account sequence when the account issues their first NFT. If an account has not issued any NFTs, then the field is not set. ([#4406](https://github.com/XRPLF/rippled/pull/4406))
|
||||||
|
- There is a new account deletion restriction: an account can only be deleted if `FirstNFTSequence` + `MintedNFTokens` + `256` is less than the current ledger sequence.
|
||||||
|
- This is potentially a breaking change if clients have logic for determining whether an account can be deleted.
|
||||||
|
- NetworkID
|
||||||
|
- For sidechains and networks with a network ID greater than 1024, there is a new [transaction common field](https://xrpl.org/transaction-common-fields.html), `NetworkID`. (https://github.com/XRPLF/rippled/pull/4370)
|
||||||
|
- This field helps to prevent replay attacks and is now required for chains whose network ID is 1025 or higher.
|
||||||
|
- The field must be omitted for Mainnet, so there is no change for Mainnet users.
|
||||||
|
- There are three new local error codes:
|
||||||
|
- `telNETWORK_ID_MAKES_TX_NON_CANONICAL`: a `NetworkID` is present but the chain's network ID is less than 1025. Remove the field from the transaction, and try again.
|
||||||
|
- `telREQUIRES_NETWORK_ID`: a `NetworkID` is required, but is not present. Add the field to the transaction, and try again.
|
||||||
|
- `telWRONG_NETWORK`: a `NetworkID` is specified, but it is for a different network. Submit the transaction to a different server which is connected to the correct network.
|
||||||
|
|
||||||
|
### Additions and bug fixes in 1.11
|
||||||
|
|
||||||
|
- Added `nftoken_id`, `nftoken_ids` and `offer_id` meta fields into NFT `tx` and `account_tx` responses. (https://github.com/XRPLF/rippled/pull/4447)
|
||||||
|
- Added an `account_flags` object to the `account_info` method response. (https://github.com/XRPLF/rippled/pull/4459)
|
||||||
|
- Added `NFTokenPages` to the `account_objects` RPC. (https://github.com/XRPLF/rippled/pull/4352)
|
||||||
|
- Fixed: `marker` returned from the `account_lines` command would not work on subsequent commands. (https://github.com/XRPLF/rippled/pull/4361)
|
||||||
|
|
||||||
|
## XRP Ledger server version 1.10.0
|
||||||
|
|
||||||
|
[Version 1.10.0](https://github.com/XRPLF/rippled/releases/tag/1.10.0)
|
||||||
|
was released on Mar 14, 2023.
|
||||||
|
|
||||||
|
### Breaking changes in 1.10
|
||||||
|
|
||||||
|
- If the `XRPFees` feature is enabled, the `fee_ref` field will be
|
||||||
|
removed from the [ledger subscription stream](https://xrpl.org/subscribe.html#ledger-stream), because it will no longer
|
||||||
|
have any meaning.
|
||||||
|
|
||||||
|
# Unit tests for API changes
|
||||||
|
|
||||||
|
The following information is useful to developers contributing to this project:
|
||||||
|
|
||||||
|
The purpose of unit tests is to catch bugs and prevent regressions. In general, it often makes sense to create a test function when there is a breaking change to the API. For APIs that have changed in a new API version, the tests should be modified so that both the prior version and the new version are properly tested.
|
||||||
|
|
||||||
|
To take one example: for `account_info` version 1, WebSocket and JSON-RPC behavior should be tested. The latest API version, i.e. API version 2, should be tested over WebSocket, JSON-RPC, and command line.
|
||||||
837
BUILD.md
837
BUILD.md
@@ -1,434 +1,611 @@
|
|||||||
## A crash course in CMake and Conan
|
| :warning: **WARNING** :warning:
|
||||||
|
|---|
|
||||||
To better understand how to use Conan,
|
| These instructions assume you have a C++ development environment ready with Git, Python, Conan, CMake, and a C++ compiler. For help setting one up on Linux, macOS, or Windows, [see this guide](./docs/build/environment.md). |
|
||||||
we should first understand _why_ we use Conan,
|
|
||||||
and to understand that,
|
|
||||||
we need to understand how we use CMake.
|
|
||||||
|
|
||||||
|
|
||||||
### CMake
|
|
||||||
|
|
||||||
Technically, you don't need CMake to build this project.
|
|
||||||
You could manually compile every translation unit into an object file,
|
|
||||||
using the right compiler options,
|
|
||||||
and then manually link all those objects together,
|
|
||||||
using the right linker options.
|
|
||||||
However, that is very tedious and error-prone,
|
|
||||||
which is why we lean on tools like CMake.
|
|
||||||
|
|
||||||
We have written CMake configuration files
|
|
||||||
([`CMakeLists.txt`](./CMakeLists.txt) and friends)
|
|
||||||
for this project so that CMake can be used to correctly compile and link
|
|
||||||
all of the translation units in it.
|
|
||||||
Or rather, CMake will generate files for a separate build system
|
|
||||||
(e.g. Make, Ninja, Visual Studio, Xcode, etc.)
|
|
||||||
that compile and link all of the translation units.
|
|
||||||
Even then, CMake has parameters, some of which are platform-specific.
|
|
||||||
In CMake's parlance, parameters are specially-named **variables** like
|
|
||||||
[`CMAKE_BUILD_TYPE`][build_type] or
|
|
||||||
[`CMAKE_MSVC_RUNTIME_LIBRARY`][runtime].
|
|
||||||
Parameters include:
|
|
||||||
|
|
||||||
- what build system to generate files for
|
|
||||||
- where to find the compiler and linker
|
|
||||||
- where to find dependencies, e.g. libraries and headers
|
|
||||||
- how to link dependencies, e.g. any special compiler or linker flags that
|
|
||||||
need to be used with them, including preprocessor definitions
|
|
||||||
- how to compile translation units, e.g. with optimizations, debug symbols,
|
|
||||||
position-independent code, etc.
|
|
||||||
- on Windows, which runtime library to link with
|
|
||||||
|
|
||||||
For some of these parameters, like the build system and compiler,
|
|
||||||
CMake goes through a complicated search process to choose default values.
|
|
||||||
For others, like the dependencies,
|
|
||||||
_we_ had written in the CMake configuration files of this project
|
|
||||||
our own complicated process to choose defaults.
|
|
||||||
For most developers, things "just worked"... until they didn't, and then
|
|
||||||
you were left trying to debug one of these complicated processes, instead of
|
|
||||||
choosing and manually passing the parameter values yourself.
|
|
||||||
|
|
||||||
You can pass every parameter to CMake on the command line,
|
|
||||||
but writing out these parameters every time we want to configure CMake is
|
|
||||||
a pain.
|
|
||||||
Most humans prefer to put them into a configuration file, once, that
|
|
||||||
CMake can read every time it is configured.
|
|
||||||
For CMake, that file is a [toolchain file][toolchain].
|
|
||||||
|
|
||||||
|
|
||||||
### Conan
|
|
||||||
|
|
||||||
These next few paragraphs on Conan are going to read much like the ones above
|
|
||||||
for CMake.
|
|
||||||
|
|
||||||
Technically, you don't need Conan to build this project.
|
|
||||||
You could manually download, configure, build, and install all of the
|
|
||||||
dependencies yourself, and then pass all of the parameters necessary for
|
|
||||||
CMake to link to those dependencies.
|
|
||||||
To guarantee ABI compatibility, you must be sure to use the same set of
|
|
||||||
compiler and linker options for all dependencies _and_ this project.
|
|
||||||
However, that is very tedious and error-prone, which is why we lean on tools
|
|
||||||
like Conan.
|
|
||||||
|
|
||||||
We have written a Conan configuration file ([`conanfile.py`](./conanfile.py))
|
|
||||||
so that Conan can be used to correctly download, configure, build, and install
|
|
||||||
all of the dependencies for this project,
|
|
||||||
using a single set of compiler and linker options for all of them.
|
|
||||||
It generates files that contain almost all of the parameters that CMake
|
|
||||||
expects.
|
|
||||||
Those files include:
|
|
||||||
|
|
||||||
- A single toolchain file.
|
|
||||||
- For every dependency, a CMake [package configuration file][pcf],
|
|
||||||
[package version file][pvf], and for every build type, a package
|
|
||||||
targets file.
|
|
||||||
Together, these files implement version checking and define `IMPORTED`
|
|
||||||
targets for the dependencies.
|
|
||||||
|
|
||||||
The toolchain file itself amends the search path
|
|
||||||
([`CMAKE_PREFIX_PATH`][prefix_path]) so that [`find_package()`][find_package]
|
|
||||||
will [discover][search] the generated package configuration files.
|
|
||||||
|
|
||||||
**Nearly all we must do to properly configure CMake is pass the toolchain
|
|
||||||
file.**
|
|
||||||
What CMake parameters are left out?
|
|
||||||
You'll still need to pick a build system generator,
|
|
||||||
and if you choose a single-configuration generator,
|
|
||||||
you'll need to pass the `CMAKE_BUILD_TYPE`,
|
|
||||||
which should match the `build_type` setting you gave to Conan.
|
|
||||||
|
|
||||||
Even then, Conan has parameters, some of which are platform-specific.
|
|
||||||
In Conan's parlance, parameters are either settings or options.
|
|
||||||
**Settings** are shared by all packages, e.g. the build type.
|
|
||||||
**Options** are specific to a given package, e.g. whether to build and link
|
|
||||||
OpenSSL as a shared library.
|
|
||||||
|
|
||||||
For settings, Conan goes through a complicated search process to choose
|
|
||||||
defaults.
|
|
||||||
For options, each package recipe defines its own defaults.
|
|
||||||
|
|
||||||
You can pass every parameter to Conan on the command line,
|
|
||||||
but it is more convenient to put them in a [profile][profile].
|
|
||||||
**All we must do to properly configure Conan is edit and pass the profile.**
|
|
||||||
By default, Conan will use the profile named "default".
|
|
||||||
You can let Conan create the default profile with this command:
|
|
||||||
|
|
||||||
```
|
|
||||||
conan profile new default --detect
|
|
||||||
```
|
|
||||||
|
|
||||||
|
> These instructions also assume a basic familiarity with Conan and CMake.
|
||||||
|
> If you are unfamiliar with Conan, you can read our
|
||||||
|
> [crash course](./docs/build/conan.md) or the official [Getting Started][3]
|
||||||
|
> walkthrough.
|
||||||
|
|
||||||
## Branches
|
## Branches
|
||||||
|
|
||||||
For a stable release, choose the `master` branch or one of the [tagged
|
For a stable release, choose the `master` branch or one of the [tagged
|
||||||
releases](https://github.com/ripple/rippled/releases).
|
releases](https://github.com/ripple/rippled/releases).
|
||||||
|
|
||||||
```
|
```bash
|
||||||
git checkout master
|
git checkout master
|
||||||
```
|
```
|
||||||
|
|
||||||
For the latest release candidate, choose the `release` branch.
|
For the latest release candidate, choose the `release` branch.
|
||||||
|
|
||||||
```
|
```bash
|
||||||
git checkout release
|
git checkout release
|
||||||
```
|
```
|
||||||
|
|
||||||
If you are contributing or want the latest set of untested features,
|
For the latest set of untested features, or to contribute, choose the `develop`
|
||||||
then use the `develop` branch.
|
branch.
|
||||||
|
|
||||||
```
|
```bash
|
||||||
git checkout develop
|
git checkout develop
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Minimum Requirements
|
||||||
|
|
||||||
## Platforms
|
See [System Requirements](https://xrpl.org/system-requirements.html).
|
||||||
|
|
||||||
rippled is written in the C++20 dialect and includes the `<concepts>` header.
|
Building rippled generally requires git, Python, Conan, CMake, and a C++
|
||||||
The [minimum compiler versions][2] that can compile this dialect are given
|
compiler. Some guidance on setting up such a [C++ development environment can be
|
||||||
below:
|
found here](./docs/build/environment.md).
|
||||||
|
|
||||||
| Compiler | Minimum Version
|
- [Python 3.11](https://www.python.org/downloads/), or higher
|
||||||
|---|---
|
- [Conan 2.17](https://conan.io/downloads.html)[^1], or higher
|
||||||
| GCC | 10
|
- [CMake 3.22](https://cmake.org/download/)[^2], or higher
|
||||||
| Clang | 13
|
|
||||||
| Apple Clang | 13.1.6
|
|
||||||
| MSVC | 19.23
|
|
||||||
|
|
||||||
We do not recommend Windows for rippled production use at this time.
|
[^1]:
|
||||||
As of January 2023, the Ubuntu platform has received the highest level of
|
It is possible to build with Conan 1.60+, but the instructions are
|
||||||
quality assurance, testing, and support.
|
significantly different, which is why we are not recommending it.
|
||||||
Additionally, 32-bit Windows development is not supported.
|
|
||||||
|
|
||||||
Visual Studio 2022 is not yet supported.
|
[^2]:
|
||||||
This is because rippled is not compatible with [Boost][] versions 1.78 or 1.79,
|
CMake 4 is not yet supported by all dependencies required by this project.
|
||||||
but Conan cannot build Boost versions released earlier than them with VS 2022.
|
If you are affected by this issue, follow [conan workaround for cmake
|
||||||
We expect that rippled will be compatible with Boost 1.80, which should be
|
4](#workaround-for-cmake-4)
|
||||||
released in August 2022.
|
|
||||||
Until then, we advise Windows developers to use Visual Studio 2019.
|
|
||||||
|
|
||||||
[Boost]: https://www.boost.org/
|
`rippled` is written in the C++20 dialect and includes the `<concepts>` header.
|
||||||
|
The [minimum compiler versions][2] required are:
|
||||||
|
|
||||||
|
| Compiler | Version |
|
||||||
|
| ----------- | --------- |
|
||||||
|
| GCC | 12 |
|
||||||
|
| Clang | 16 |
|
||||||
|
| Apple Clang | 16 |
|
||||||
|
| MSVC | 19.44[^3] |
|
||||||
|
|
||||||
## Prerequisites
|
### Linux
|
||||||
|
|
||||||
To build this package, you will need Python (>= 3.7),
|
The Ubuntu Linux distribution has received the highest level of quality
|
||||||
[Conan][] (>= 1.55), and [CMake][] (>= 3.16).
|
assurance, testing, and support. We also support Red Hat and use Debian
|
||||||
|
internally.
|
||||||
|
|
||||||
> **Warning**
|
Here are [sample instructions for setting up a C++ development environment on
|
||||||
> The commands in this document are not meant to be blindly copied and pasted.
|
Linux](./docs/build/environment.md#linux).
|
||||||
> This document is written for multiple audiences,
|
|
||||||
> meaning that your particular circumstances may require some commands and not
|
|
||||||
> others.
|
|
||||||
> You should never run any commands without understanding what they do
|
|
||||||
> and why you are running them.
|
|
||||||
>
|
|
||||||
> These instructions assume a basic familiarity with Conan and CMake.
|
|
||||||
> If you are unfamiliar with Conan,
|
|
||||||
> then please read the [crash course](#a-crash-course-in-cmake-and-conan)
|
|
||||||
> at the beginning of this document,
|
|
||||||
> or the official [Getting Started][3] walkthrough.
|
|
||||||
|
|
||||||
[Conan]: https://conan.io/downloads.html
|
### Mac
|
||||||
[CMake]: https://cmake.org/download/
|
|
||||||
|
|
||||||
You'll need to compile in the C++20 dialect:
|
Many rippled engineers use macOS for development.
|
||||||
|
|
||||||
```
|
Here are [sample instructions for setting up a C++ development environment on
|
||||||
conan profile update settings.compiler.cppstd=20 default
|
macOS](./docs/build/environment.md#macos).
|
||||||
|
|
||||||
|
### Windows
|
||||||
|
|
||||||
|
Windows is used by some engineers for development only.
|
||||||
|
|
||||||
|
[^3]: Windows is not recommended for production use.
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
### Set Up Conan
|
||||||
|
|
||||||
|
After you have a [C++ development environment](./docs/build/environment.md) ready with Git, Python,
|
||||||
|
Conan, CMake, and a C++ compiler, you may need to set up your Conan profile.
|
||||||
|
|
||||||
|
These instructions assume a basic familiarity with Conan and CMake. If you are
|
||||||
|
unfamiliar with Conan, then please read [this crash course](./docs/build/conan.md) or the official
|
||||||
|
[Getting Started][3] walkthrough.
|
||||||
|
|
||||||
|
#### Default profile
|
||||||
|
|
||||||
|
We recommend that you import the provided `conan/profiles/default` profile:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
conan config install conan/profiles/ -tf $(conan config home)/profiles/
|
||||||
```
|
```
|
||||||
|
|
||||||
Linux developers will commonly have a default Conan [profile][] that compiles
|
You can check your Conan profile by running:
|
||||||
with GCC and links with libstdc++.
|
|
||||||
If you are linking with libstdc++ (see profile setting `compiler.libcxx`),
|
|
||||||
then you will need to choose the `libstdc++11` ABI:
|
|
||||||
|
|
||||||
```
|
```bash
|
||||||
conan profile update settings.compiler.libcxx=libstdc++11 default
|
conan profile show
|
||||||
```
|
```
|
||||||
|
|
||||||
We find it necessary to use the x64 native build tools on Windows.
|
#### Custom profile
|
||||||
An easy way to do that is to run the shortcut "x64 Native Tools Command
|
|
||||||
Prompt" for the version of Visual Studio that you have installed.
|
|
||||||
|
|
||||||
Windows developers must build rippled and its dependencies for the x64
|
If the default profile does not work for you and you do not yet have a Conan
|
||||||
|
profile, you can create one by running:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
conan profile detect
|
||||||
|
```
|
||||||
|
|
||||||
|
You may need to make changes to the profile to suit your environment. You can
|
||||||
|
refer to the provided `conan/profiles/default` profile for inspiration, and you
|
||||||
|
may also need to apply the required [tweaks](#conan-profile-tweaks) to this
|
||||||
|
default profile.
|
||||||
|
|
||||||
|
### Patched recipes
|
||||||
|
|
||||||
|
The recipes in Conan Center occasionally need to be patched for compatibility
|
||||||
|
with the latest version of `rippled`. We maintain a fork of the Conan Center
|
||||||
|
[here](https://github.com/XRPLF/conan-center-index/) containing the patches.
|
||||||
|
|
||||||
|
To ensure our patched recipes are used, you must add our Conan remote at a
|
||||||
|
higher index than the default Conan Center remote, so it is consulted first. You
|
||||||
|
can do this by running:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
conan remote add --index 0 xrplf "https://conan.ripplex.io"
|
||||||
|
```
|
||||||
|
|
||||||
|
Alternatively, you can pull the patched recipes into the repository and use them
|
||||||
|
locally:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd external
|
||||||
|
git init
|
||||||
|
git remote add origin git@github.com:XRPLF/conan-center-index.git
|
||||||
|
git sparse-checkout init
|
||||||
|
git sparse-checkout set recipes/snappy
|
||||||
|
git sparse-checkout add recipes/soci
|
||||||
|
git fetch origin master
|
||||||
|
git checkout master
|
||||||
|
conan export --version 1.1.10 recipes/snappy/all
|
||||||
|
conan export --version 4.0.3 recipes/soci/all
|
||||||
|
rm -rf .git
|
||||||
|
```
|
||||||
|
|
||||||
|
In the case we switch to a newer version of a dependency that still requires a
|
||||||
|
patch, it will be necessary for you to pull in the changes and re-export the
|
||||||
|
updated dependencies with the newer version. However, if we switch to a newer
|
||||||
|
version that no longer requires a patch, no action is required on your part, as
|
||||||
|
the new recipe will be automatically pulled from the official Conan Center.
|
||||||
|
|
||||||
|
### Conan profile tweaks
|
||||||
|
|
||||||
|
#### Missing compiler version
|
||||||
|
|
||||||
|
If you see an error similar to the following after running `conan profile show`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ERROR: Invalid setting '17' is not a valid 'settings.compiler.version' value.
|
||||||
|
Possible values are ['5.0', '5.1', '6.0', '6.1', '7.0', '7.3', '8.0', '8.1',
|
||||||
|
'9.0', '9.1', '10.0', '11.0', '12.0', '13', '13.0', '13.1', '14', '14.0', '15',
|
||||||
|
'15.0', '16', '16.0']
|
||||||
|
Read "http://docs.conan.io/2/knowledge/faq.html#error-invalid-setting"
|
||||||
|
```
|
||||||
|
|
||||||
|
you need to amend the list of compiler versions in
|
||||||
|
`$(conan config home)/settings.yml`, by appending the required version number(s)
|
||||||
|
to the `version` array specific for your compiler. For example:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
apple-clang:
|
||||||
|
version:
|
||||||
|
[
|
||||||
|
"5.0",
|
||||||
|
"5.1",
|
||||||
|
"6.0",
|
||||||
|
"6.1",
|
||||||
|
"7.0",
|
||||||
|
"7.3",
|
||||||
|
"8.0",
|
||||||
|
"8.1",
|
||||||
|
"9.0",
|
||||||
|
"9.1",
|
||||||
|
"10.0",
|
||||||
|
"11.0",
|
||||||
|
"12.0",
|
||||||
|
"13",
|
||||||
|
"13.0",
|
||||||
|
"13.1",
|
||||||
|
"14",
|
||||||
|
"14.0",
|
||||||
|
"15",
|
||||||
|
"15.0",
|
||||||
|
"16",
|
||||||
|
"16.0",
|
||||||
|
"17",
|
||||||
|
"17.0",
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Multiple compilers
|
||||||
|
|
||||||
|
If you have multiple compilers installed, make sure to select the one to use in
|
||||||
|
your default Conan configuration **before** running `conan profile detect`, by
|
||||||
|
setting the `CC` and `CXX` environment variables.
|
||||||
|
|
||||||
|
For example, if you are running MacOS and have [homebrew
|
||||||
|
LLVM@18](https://formulae.brew.sh/formula/llvm@18), and want to use it as a
|
||||||
|
compiler in the new Conan profile:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
export CC=$(brew --prefix llvm@18)/bin/clang
|
||||||
|
export CXX=$(brew --prefix llvm@18)/bin/clang++
|
||||||
|
conan profile detect
|
||||||
|
```
|
||||||
|
|
||||||
|
You should also explicitly set the path to the compiler in the profile file,
|
||||||
|
which helps to avoid errors when `CC` and/or `CXX` are set and disagree with the
|
||||||
|
selected Conan profile. For example:
|
||||||
|
|
||||||
|
```text
|
||||||
|
[conf]
|
||||||
|
tools.build:compiler_executables={'c':'/usr/bin/gcc','cpp':'/usr/bin/g++'}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Multiple profiles
|
||||||
|
|
||||||
|
You can manage multiple Conan profiles in the directory
|
||||||
|
`$(conan config home)/profiles`, for example renaming `default` to a different
|
||||||
|
name and then creating a new `default` profile for a different compiler.
|
||||||
|
|
||||||
|
#### Select language
|
||||||
|
|
||||||
|
The default profile created by Conan will typically select different C++ dialect
|
||||||
|
than C++20 used by this project. You should set `20` in the profile line
|
||||||
|
starting with `compiler.cppstd=`. For example:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sed -i.bak -e 's|^compiler\.cppstd=.*$|compiler.cppstd=20|' $(conan config home)/profiles/default
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Select standard library in Linux
|
||||||
|
|
||||||
|
**Linux** developers will commonly have a default Conan [profile][] that
|
||||||
|
compiles with GCC and links with libstdc++. If you are linking with libstdc++
|
||||||
|
(see profile setting `compiler.libcxx`), then you will need to choose the
|
||||||
|
`libstdc++11` ABI:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sed -i.bak -e 's|^compiler\.libcxx=.*$|compiler.libcxx=libstdc++11|' $(conan config home)/profiles/default
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Select architecture and runtime in Windows
|
||||||
|
|
||||||
|
**Windows** developers may need to use the x64 native build tools. An easy way
|
||||||
|
to do that is to run the shortcut "x64 Native Tools Command Prompt" for the
|
||||||
|
version of Visual Studio that you have installed.
|
||||||
|
|
||||||
|
Windows developers must also build `rippled` and its dependencies for the x64
|
||||||
architecture:
|
architecture:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
conan profile update settings.arch=x86_64 default
|
sed -i.bak -e 's|^arch=.*$|arch=x86_64|' $(conan config home)/profiles/default
|
||||||
```
|
```
|
||||||
|
|
||||||
If you have multiple compilers installed on your platform,
|
**Windows** developers also must select static runtime:
|
||||||
then you'll need to make sure that Conan and CMake select the one you want to
|
|
||||||
use.
|
|
||||||
This setting will set the correct variables (`CMAKE_<LANG>_COMPILER`) in the
|
|
||||||
generated CMake toolchain file:
|
|
||||||
|
|
||||||
```
|
```bash
|
||||||
conan profile update 'conf.tools.build:compiler_executables={"c": "<path>", "cpp": "<path>"}' default
|
sed -i.bak -e 's|^compiler\.runtime=.*$|compiler.runtime=static|' $(conan config home)/profiles/default
|
||||||
```
|
```
|
||||||
|
|
||||||
It should choose the compiler for dependencies as well,
|
#### Workaround for CMake 4
|
||||||
but not all of them have a Conan recipe that respects this setting (yet).
|
|
||||||
For the rest, you can set these environment variables:
|
|
||||||
|
|
||||||
```
|
If your system CMake is version 4 rather than 3, you may have to configure Conan
|
||||||
conan profile update env.CC=<path> default
|
profile to use CMake version 3 for dependencies, by adding the following two
|
||||||
conan profile update env.CXX=<path> default
|
lines to your profile:
|
||||||
|
|
||||||
|
```text
|
||||||
|
[tool_requires]
|
||||||
|
!cmake/*: cmake/[>=3 <4]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
This will force Conan to download and use a locally cached CMake 3 version, and
|
||||||
|
is needed because some of the dependencies used by this project do not support
|
||||||
|
CMake 4.
|
||||||
|
|
||||||
## How to build and test
|
#### Clang workaround for grpc
|
||||||
|
|
||||||
Let's start with a couple of examples of common workflows.
|
If your compiler is clang, version 19 or later, or apple-clang, version 17 or
|
||||||
The first is for a single-configuration generator (e.g. Unix Makefiles) on
|
later, you may encounter a compilation error while building the `grpc`
|
||||||
Linux or MacOS:
|
dependency:
|
||||||
|
|
||||||
```
|
```text
|
||||||
conan export external/snappy snappy/1.1.9@
|
In file included from .../lib/promise/try_seq.h:26:
|
||||||
mkdir .build
|
.../lib/promise/detail/basic_seq.h:499:38: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
|
||||||
cd .build
|
499 | Traits::template CallSeqFactory(f_, *cur_, std::move(arg)));
|
||||||
conan install .. --output-folder . --build missing --settings build_type=Release
|
| ^
|
||||||
cmake -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release ..
|
|
||||||
cmake --build .
|
|
||||||
./rippled --unittest
|
|
||||||
```
|
```
|
||||||
|
|
||||||
The second is for a multi-configuration generator (e.g. Visual Studio) on
|
The workaround for this error is to add two lines to profile:
|
||||||
Windows:
|
|
||||||
|
|
||||||
```
|
```text
|
||||||
conan export external/snappy snappy/1.1.9@
|
[conf]
|
||||||
mkdir .build
|
tools.build:cxxflags=['-Wno-missing-template-arg-list-after-template-kw']
|
||||||
cd .build
|
|
||||||
conan install .. --output-folder . --build missing --settings build_type=Release --settings compiler.runtime=MT
|
|
||||||
conan install .. --output-folder . --build missing --settings build_type=Debug --settings compiler.runtime=MTd
|
|
||||||
cmake -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake ..
|
|
||||||
cmake --build . --config Release
|
|
||||||
cmake --build . --config Debug
|
|
||||||
./Release/rippled --unittest
|
|
||||||
./Debug/rippled --unittest
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Now to explain the individual steps in each example:
|
#### Workaround for gcc 12
|
||||||
|
|
||||||
1. Export our [Conan recipe for Snappy](./external/snappy).
|
If your compiler is gcc, version 12, and you have enabled `werr` option, you may
|
||||||
|
encounter a compilation error such as:
|
||||||
|
|
||||||
It does not explicitly link the C++ standard library,
|
```text
|
||||||
which allows us to statically link it.
|
/usr/include/c++/12/bits/char_traits.h:435:56: error: 'void* __builtin_memcpy(void*, const void*, long unsigned int)' accessing 9223372036854775810 or more bytes at offsets [2, 9223372036854775807] and 1 may overlap up to 9223372036854775813 bytes at offset -3 [-Werror=restrict]
|
||||||
|
435 | return static_cast<char_type*>(__builtin_memcpy(__s1, __s2, __n));
|
||||||
|
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
|
||||||
|
cc1plus: all warnings being treated as errors
|
||||||
|
```
|
||||||
|
|
||||||
1. Create a build directory (and move into it).
|
The workaround for this error is to add two lines to your profile:
|
||||||
|
|
||||||
You can choose any name you want.
|
```text
|
||||||
|
[conf]
|
||||||
|
tools.build:cxxflags=['-Wno-restrict']
|
||||||
|
```
|
||||||
|
|
||||||
Conan will generate some files in what it calls the "install folder".
|
#### Workaround for clang 16
|
||||||
These files are implementation details that you don't need to worry about.
|
|
||||||
By default, the install folder is your current working directory.
|
|
||||||
If you don't move into your build directory before calling Conan,
|
|
||||||
then you may be annoyed to see it polluting your project root directory
|
|
||||||
with these files.
|
|
||||||
To make Conan put them in your build directory,
|
|
||||||
you'll have to add the option
|
|
||||||
`--install-folder` or `-if` to every `conan install` command.
|
|
||||||
|
|
||||||
1. Generate CMake files for every configuration you want to build.
|
If your compiler is clang, version 16, you may encounter compilation error such
|
||||||
|
as:
|
||||||
|
|
||||||
For a single-configuration generator, e.g. `Unix Makefiles` or `Ninja`,
|
```text
|
||||||
you only need to run this command once.
|
In file included from .../boost/beast/websocket/stream.hpp:2857:
|
||||||
For a multi-configuration generator, e.g. `Visual Studio`, you may want to
|
.../boost/beast/websocket/impl/read.hpp:695:17: error: call to 'async_teardown' is ambiguous
|
||||||
run it more than once.
|
async_teardown(impl.role, impl.stream(),
|
||||||
|
^~~~~~~~~~~~~~
|
||||||
|
```
|
||||||
|
|
||||||
Each of these commands should have a different `build_type` setting.
|
The workaround for this error is to add two lines to your profile:
|
||||||
A second command with the same `build_type` setting will just overwrite
|
|
||||||
the files generated by the first.
|
|
||||||
You can pass the build type on the command line with `--settings
|
|
||||||
build_type=$BUILD_TYPE` or in the profile itself, under the section
|
|
||||||
`[settings]`, with the key `build_type`.
|
|
||||||
|
|
||||||
If you are using a Microsoft Visual C++ compiler, then you will need to
|
```text
|
||||||
ensure consistency between the `build_type` setting and the
|
[conf]
|
||||||
`compiler.runtime` setting.
|
tools.build:cxxflags=['-DBOOST_ASIO_DISABLE_CONCEPTS']
|
||||||
When `build_type` is `Release`, `compiler.runtime` should be `MT`.
|
```
|
||||||
When `build_type` is `Debug`, `compiler.runtime` should be `MTd`.
|
|
||||||
|
|
||||||
1. Configure CMake once.
|
### Build and Test
|
||||||
|
|
||||||
For all choices of generator, pass the toolchain file generated by Conan.
|
1. Create a build directory and move into it.
|
||||||
It will be located at
|
|
||||||
`$OUTPUT_FOLDER/build/generators/conan_toolchain.cmake`.
|
|
||||||
If you are using a single-configuration generator, then pass the CMake
|
|
||||||
variable [`CMAKE_BUILD_TYPE`][build_type] and make sure it matches the
|
|
||||||
`build_type` setting you chose in the previous step.
|
|
||||||
|
|
||||||
This step is where you may pass build options for rippled.
|
```
|
||||||
|
mkdir .build
|
||||||
|
cd .build
|
||||||
|
```
|
||||||
|
|
||||||
1. Build rippled.
|
You can use any directory name. Conan treats your working directory as an
|
||||||
|
install folder and generates files with implementation details.
|
||||||
|
You don't need to worry about these files, but make sure to change
|
||||||
|
your working directory to your build directory before calling Conan.
|
||||||
|
|
||||||
For a multi-configuration generator, you must pass the option `--config`
|
**Note:** You can specify a directory for the installation files by adding
|
||||||
to select the build configuration.
|
the `install-folder` or `-if` option to every `conan install` command
|
||||||
For a single-configuration generator, it will build whatever configuration
|
in the next step.
|
||||||
you passed for `CMAKE_BUILD_TYPE`.
|
|
||||||
|
2. Use conan to generate CMake files for every configuration you want to build:
|
||||||
|
|
||||||
|
```
|
||||||
|
conan install .. --output-folder . --build missing --settings build_type=Release
|
||||||
|
conan install .. --output-folder . --build missing --settings build_type=Debug
|
||||||
|
```
|
||||||
|
|
||||||
|
To build Debug, in the next step, be sure to set `-DCMAKE_BUILD_TYPE=Debug`
|
||||||
|
|
||||||
|
For a single-configuration generator, e.g. `Unix Makefiles` or `Ninja`,
|
||||||
|
you only need to run this command once.
|
||||||
|
For a multi-configuration generator, e.g. `Visual Studio`, you may want to
|
||||||
|
run it more than once.
|
||||||
|
|
||||||
|
Each of these commands should also have a different `build_type` setting.
|
||||||
|
A second command with the same `build_type` setting will overwrite the files
|
||||||
|
generated by the first. You can pass the build type on the command line with
|
||||||
|
`--settings build_type=$BUILD_TYPE` or in the profile itself,
|
||||||
|
under the section `[settings]` with the key `build_type`.
|
||||||
|
|
||||||
|
If you are using a Microsoft Visual C++ compiler,
|
||||||
|
then you will need to ensure consistency between the `build_type` setting
|
||||||
|
and the `compiler.runtime` setting.
|
||||||
|
|
||||||
|
When `build_type` is `Release`, `compiler.runtime` should be `MT`.
|
||||||
|
|
||||||
|
When `build_type` is `Debug`, `compiler.runtime` should be `MTd`.
|
||||||
|
|
||||||
|
```
|
||||||
|
conan install .. --output-folder . --build missing --settings build_type=Release --settings compiler.runtime=MT
|
||||||
|
conan install .. --output-folder . --build missing --settings build_type=Debug --settings compiler.runtime=MTd
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Configure CMake and pass the toolchain file generated by Conan, located at
|
||||||
|
`$OUTPUT_FOLDER/build/generators/conan_toolchain.cmake`.
|
||||||
|
|
||||||
|
Single-config generators:
|
||||||
|
|
||||||
|
Pass the CMake variable [`CMAKE_BUILD_TYPE`][build_type]
|
||||||
|
and make sure it matches the one of the `build_type` settings
|
||||||
|
you chose in the previous step.
|
||||||
|
|
||||||
|
For example, to build Debug, in the next command, replace "Release" with "Debug"
|
||||||
|
|
||||||
|
```
|
||||||
|
cmake -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release -Dxrpld=ON -Dtests=ON ..
|
||||||
|
```
|
||||||
|
|
||||||
|
Multi-config generators:
|
||||||
|
|
||||||
|
```
|
||||||
|
cmake -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake -Dxrpld=ON -Dtests=ON ..
|
||||||
|
```
|
||||||
|
|
||||||
|
**Note:** You can pass build options for `rippled` in this step.
|
||||||
|
|
||||||
|
4. Build `rippled`.
|
||||||
|
|
||||||
|
For a single-configuration generator, it will build whatever configuration
|
||||||
|
you passed for `CMAKE_BUILD_TYPE`. For a multi-configuration generator, you
|
||||||
|
must pass the option `--config` to select the build configuration.
|
||||||
|
|
||||||
|
Single-config generators:
|
||||||
|
|
||||||
|
```
|
||||||
|
cmake --build .
|
||||||
|
```
|
||||||
|
|
||||||
|
Multi-config generators:
|
||||||
|
|
||||||
|
```
|
||||||
|
cmake --build . --config Release
|
||||||
|
cmake --build . --config Debug
|
||||||
|
```
|
||||||
|
|
||||||
5. Test rippled.
|
5. Test rippled.
|
||||||
|
|
||||||
The exact location of rippled in your build directory
|
Single-config generators:
|
||||||
depends on your choice of CMake generator.
|
|
||||||
You can run unit tests by passing `--unittest`.
|
|
||||||
Pass `--help` to see the rest of the command line options.
|
|
||||||
|
|
||||||
|
```
|
||||||
|
./rippled --unittest --unittest-jobs N
|
||||||
|
```
|
||||||
|
|
||||||
### Options
|
Multi-config generators:
|
||||||
|
|
||||||
The `unity` option allows you to select between [unity][5] and non-unity
|
```
|
||||||
builds.
|
./Release/rippled --unittest --unittest-jobs N
|
||||||
Unity builds may be faster for the first build (at the cost of much
|
./Debug/rippled --unittest --unittest-jobs N
|
||||||
more memory) since they concatenate sources into fewer translation
|
```
|
||||||
units.
|
|
||||||
Non-unity builds may be faster for incremental builds, and can be helpful for
|
|
||||||
detecting `#include` omissions.
|
|
||||||
|
|
||||||
Below are the most commonly used options,
|
Replace the `--unittest-jobs` parameter N with the desired unit tests
|
||||||
with their default values in parentheses.
|
concurrency. Recommended setting is half of the number of available CPU
|
||||||
|
cores.
|
||||||
|
|
||||||
- `assert` (OFF): Enable assertions.
|
The location of `rippled` binary in your build directory depends on your
|
||||||
- `reporting` (OFF): Build the reporting mode feature.
|
CMake generator. Pass `--help` to see the rest of the command line options.
|
||||||
- `tests` (ON): Build tests.
|
|
||||||
- `unity` (ON): Configure a [unity build][5].
|
|
||||||
- `san` (): Enable a sanitizer with Clang. Choices are `thread` and `address`.
|
|
||||||
|
|
||||||
|
## Coverage report
|
||||||
|
|
||||||
### Troubleshooting
|
The coverage report is intended for developers using compilers GCC
|
||||||
|
or Clang (including Apple Clang). It is generated by the build target `coverage`,
|
||||||
|
which is only enabled when the `coverage` option is set, e.g. with
|
||||||
|
`--options coverage=True` in `conan` or `-Dcoverage=ON` variable in `cmake`
|
||||||
|
|
||||||
#### Conan
|
Prerequisites for the coverage report:
|
||||||
|
|
||||||
If you find trouble building dependencies after changing Conan settings,
|
- [gcovr tool][gcovr] (can be installed e.g. with [pip][python-pip])
|
||||||
then you should retry after removing the Conan cache:
|
- `gcov` for GCC (installed with the compiler by default) or
|
||||||
|
- `llvm-cov` for Clang (installed with the compiler by default)
|
||||||
|
- `Debug` build type
|
||||||
|
|
||||||
|
A coverage report is created when the following steps are completed, in order:
|
||||||
|
|
||||||
|
1. `rippled` binary built with instrumentation data, enabled by the `coverage`
|
||||||
|
option mentioned above
|
||||||
|
2. completed run of unit tests, which populates coverage capture data
|
||||||
|
3. completed run of the `gcovr` tool (which internally invokes either `gcov` or `llvm-cov`)
|
||||||
|
to assemble both instrumentation data and the coverage capture data into a coverage report
|
||||||
|
|
||||||
|
The above steps are automated into a single target `coverage`. The instrumented
|
||||||
|
`rippled` binary can also be used for regular development or testing work, at
|
||||||
|
the cost of extra disk space utilization and a small performance hit
|
||||||
|
(to store coverage capture). In case of a spurious failure of unit tests, it is
|
||||||
|
possible to re-run the `coverage` target without rebuilding the `rippled` binary
|
||||||
|
(since it is simply a dependency of the coverage report target). It is also possible
|
||||||
|
to select only specific tests for the purpose of the coverage report, by setting
|
||||||
|
the `coverage_test` variable in `cmake`
|
||||||
|
|
||||||
|
The default coverage report format is `html-details`, but the user
|
||||||
|
can override it to any of the formats listed in `Builds/CMake/CodeCoverage.cmake`
|
||||||
|
by setting the `coverage_format` variable in `cmake`. It is also possible
|
||||||
|
to generate more than one format at a time by setting the `coverage_extra_args`
|
||||||
|
variable in `cmake`. The specific command line used to run the `gcovr` tool will be
|
||||||
|
displayed if the `CODE_COVERAGE_VERBOSE` variable is set.
|
||||||
|
|
||||||
|
By default, the code coverage tool runs parallel unit tests with `--unittest-jobs`
|
||||||
|
set to the number of available CPU cores. This may cause spurious test
|
||||||
|
errors on Apple. Developers can override the number of unit test jobs with
|
||||||
|
the `coverage_test_parallelism` variable in `cmake`.
|
||||||
|
|
||||||
|
Example use with some cmake variables set:
|
||||||
|
|
||||||
```
|
```
|
||||||
rm -rf ~/.conan/data
|
cd .build
|
||||||
|
conan install .. --output-folder . --build missing --settings build_type=Debug
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=Debug -Dcoverage=ON -Dxrpld=ON -Dtests=ON -Dcoverage_test_parallelism=2 -Dcoverage_format=html-details -Dcoverage_extra_args="--json coverage.json" -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake ..
|
||||||
|
cmake --build . --target coverage
|
||||||
```
|
```
|
||||||
|
|
||||||
|
After the `coverage` target is completed, the generated coverage report will be
|
||||||
|
stored inside the build directory, as either of:
|
||||||
|
|
||||||
#### no std::result_of
|
- file named `coverage.`_extension_, with a suitable extension for the report format, or
|
||||||
|
- directory named `coverage`, with the `index.html` and other files inside, for the `html-details` or `html-nested` report formats.
|
||||||
|
|
||||||
If your compiler version is recent enough to have removed `std::result_of` as
|
## Options
|
||||||
part of C++20, e.g. Apple Clang 15.0,
|
|
||||||
then you might need to add a preprocessor definition to your bulid:
|
| Option | Default Value | Description |
|
||||||
|
| ---------- | ------------- | -------------------------------------------------------------------------- |
|
||||||
|
| `assert` | OFF | Enable assertions. |
|
||||||
|
| `coverage` | OFF | Prepare the coverage report. |
|
||||||
|
| `san` | N/A | Enable a sanitizer with Clang. Choices are `thread` and `address`. |
|
||||||
|
| `tests` | OFF | Build tests. |
|
||||||
|
| `unity` | OFF | Configure a unity build. |
|
||||||
|
| `xrpld` | OFF | Build the xrpld (`rippled`) application, and not just the libxrpl library. |
|
||||||
|
| `werr` | OFF | Treat compilation warnings as errors |
|
||||||
|
| `wextra` | OFF | Enable additional compilation warnings |
|
||||||
|
|
||||||
|
[Unity builds][5] may be faster for the first build
|
||||||
|
(at the cost of much more memory) since they concatenate sources into fewer
|
||||||
|
translation units. Non-unity builds may be faster for incremental builds,
|
||||||
|
and can be helpful for detecting `#include` omissions.
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
### Conan
|
||||||
|
|
||||||
|
After any updates or changes to dependencies, you may need to do the following:
|
||||||
|
|
||||||
|
1. Remove your build directory.
|
||||||
|
2. Remove individual libraries from the Conan cache, e.g.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
conan remove 'grpc/*'
|
||||||
|
```
|
||||||
|
|
||||||
|
**or**
|
||||||
|
|
||||||
|
Remove all libraries from Conan cache:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
conan remove '*'
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Re-run [conan export](#patched-recipes) if needed.
|
||||||
|
4. Re-run [conan install](#build-and-test).
|
||||||
|
|
||||||
|
### `protobuf/port_def.inc` file not found
|
||||||
|
|
||||||
|
If `cmake --build .` results in an error due to a missing a protobuf file, then
|
||||||
|
you might have generated CMake files for a different `build_type` than the
|
||||||
|
`CMAKE_BUILD_TYPE` you passed to Conan.
|
||||||
|
|
||||||
```
|
```
|
||||||
conan profile update 'env.CFLAGS="-DBOOST_ASIO_HAS_STD_INVOKE_RESULT"' default
|
/rippled/.build/pb-xrpl.libpb/xrpl/proto/ripple.pb.h:10:10: fatal error: 'google/protobuf/port_def.inc' file not found
|
||||||
conan profile update 'env.CXXFLAGS="-DBOOST_ASIO_HAS_STD_INVOKE_RESULT"' default
|
10 | #include <google/protobuf/port_def.inc>
|
||||||
conan profile update 'tools.build:cflags+=["-DBOOST_ASIO_HAS_STD_INVOKE_RESULT"]' default
|
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
conan profile update 'tools.build:cxxflags+=["-DBOOST_ASIO_HAS_STD_INVOKE_RESULT"]' default
|
1 error generated.
|
||||||
```
|
```
|
||||||
|
|
||||||
|
For example, if you want to build Debug:
|
||||||
|
|
||||||
#### recompile with -fPIC
|
1. For conan install, pass `--settings build_type=Debug`
|
||||||
|
2. For cmake, pass `-DCMAKE_BUILD_TYPE=Debug`
|
||||||
|
|
||||||
```
|
## Add a Dependency
|
||||||
/usr/bin/ld.gold: error: /home/username/.conan/data/boost/1.77.0/_/_/package/.../lib/libboost_container.a(alloc_lib.o):
|
|
||||||
requires unsupported dynamic reloc 11; recompile with -fPIC
|
|
||||||
```
|
|
||||||
|
|
||||||
If you get a linker error like the one above suggesting that you recompile
|
If you want to experiment with a new package, follow these steps:
|
||||||
Boost with position-independent code, the reason is most likely that Conan
|
|
||||||
downloaded a bad binary distribution of the dependency.
|
|
||||||
For now, this seems to be a [bug][1] in Conan just for Boost 1.77.0 compiled
|
|
||||||
with GCC for Linux.
|
|
||||||
The solution is to build the dependency locally by passing `--build boost`
|
|
||||||
when calling `conan install`:
|
|
||||||
|
|
||||||
```
|
|
||||||
conan install --build boost ...
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
## How to add a dependency
|
|
||||||
|
|
||||||
If you want to experiment with a new package, here are the steps to get it
|
|
||||||
working:
|
|
||||||
|
|
||||||
1. Search for the package on [Conan Center](https://conan.io/center/).
|
1. Search for the package on [Conan Center](https://conan.io/center/).
|
||||||
1. In [`conanfile.py`](./conanfile.py):
|
2. Modify [`conanfile.py`](./conanfile.py):
|
||||||
1. Add a version of the package to the `requires` property.
|
- Add a version of the package to the `requires` property.
|
||||||
1. Change any default options for the package by adding them to the
|
- Change any default options for the package by adding them to the
|
||||||
`default_options` property (with syntax `'$package:$option': $value`)
|
`default_options` property (with syntax `'$package:$option': $value`).
|
||||||
1. In [`CMakeLists.txt`](./CMakeLists.txt):
|
3. Modify [`CMakeLists.txt`](./CMakeLists.txt):
|
||||||
1. Add a call to `find_package($package REQUIRED)`.
|
- Add a call to `find_package($package REQUIRED)`.
|
||||||
1. Link a library from the package to the target `ripple_libs` (search for
|
- Link a library from the package to the target `ripple_libs`
|
||||||
the existing call to `target_link_libraries(ripple_libs INTERFACE ...)`).
|
(search for the existing call to `target_link_libraries(ripple_libs INTERFACE ...)`).
|
||||||
1. Start coding! Don't forget to include whatever headers you need from the
|
4. Start coding! Don't forget to include whatever headers you need from the package.
|
||||||
package.
|
|
||||||
|
|
||||||
|
|
||||||
[1]: https://github.com/conan-io/conan-center-index/issues/13168
|
[1]: https://github.com/conan-io/conan-center-index/issues/13168
|
||||||
[2]: https://en.cppreference.com/w/cpp/compiler_support/20
|
[2]: https://en.cppreference.com/w/cpp/compiler_support/20
|
||||||
[3]: https://docs.conan.io/en/latest/getting_started.html
|
[3]: https://docs.conan.io/en/latest/getting_started.html
|
||||||
[5]: https://en.wikipedia.org/wiki/Unity_build
|
[5]: https://en.wikipedia.org/wiki/Unity_build
|
||||||
|
[6]: https://github.com/boostorg/beast/issues/2648
|
||||||
|
[7]: https://github.com/boostorg/beast/issues/2661
|
||||||
|
[gcovr]: https://gcovr.com/en/stable/getting-started.html
|
||||||
|
[python-pip]: https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/
|
||||||
[build_type]: https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html
|
[build_type]: https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html
|
||||||
[runtime]: https://cmake.org/cmake/help/latest/variable/CMAKE_MSVC_RUNTIME_LIBRARY.html
|
|
||||||
[toolchain]: https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html
|
|
||||||
[pcf]: https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#package-configuration-file
|
|
||||||
[pvf]: https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#package-version-file
|
|
||||||
[find_package]: https://cmake.org/cmake/help/latest/command/find_package.html
|
|
||||||
[search]: https://cmake.org/cmake/help/latest/command/find_package.html#search-procedure
|
|
||||||
[prefix_path]: https://cmake.org/cmake/help/latest/variable/CMAKE_PREFIX_PATH.html
|
|
||||||
[profile]: https://docs.conan.io/en/latest/reference/profiles.html
|
[profile]: https://docs.conan.io/en/latest/reference/profiles.html
|
||||||
|
|||||||
@@ -1,207 +0,0 @@
|
|||||||
|
|
||||||
macro(group_sources_in source_dir curdir)
|
|
||||||
file(GLOB children RELATIVE ${source_dir}/${curdir}
|
|
||||||
${source_dir}/${curdir}/*)
|
|
||||||
foreach (child ${children})
|
|
||||||
if (IS_DIRECTORY ${source_dir}/${curdir}/${child})
|
|
||||||
group_sources_in(${source_dir} ${curdir}/${child})
|
|
||||||
else()
|
|
||||||
string(REPLACE "/" "\\" groupname ${curdir})
|
|
||||||
source_group(${groupname} FILES
|
|
||||||
${source_dir}/${curdir}/${child})
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
macro(group_sources curdir)
|
|
||||||
group_sources_in(${PROJECT_SOURCE_DIR} ${curdir})
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
macro (exclude_from_default target_)
|
|
||||||
set_target_properties (${target_} PROPERTIES EXCLUDE_FROM_ALL ON)
|
|
||||||
set_target_properties (${target_} PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD ON)
|
|
||||||
endmacro ()
|
|
||||||
|
|
||||||
macro (exclude_if_included target_)
|
|
||||||
get_directory_property(has_parent PARENT_DIRECTORY)
|
|
||||||
if (has_parent)
|
|
||||||
exclude_from_default (${target_})
|
|
||||||
endif ()
|
|
||||||
endmacro ()
|
|
||||||
|
|
||||||
function (print_ep_logs _target)
|
|
||||||
ExternalProject_Get_Property (${_target} STAMP_DIR)
|
|
||||||
add_custom_command(TARGET ${_target} POST_BUILD
|
|
||||||
COMMENT "${_target} BUILD OUTPUT"
|
|
||||||
COMMAND ${CMAKE_COMMAND}
|
|
||||||
-DIN_FILE=${STAMP_DIR}/${_target}-build-out.log
|
|
||||||
-P ${CMAKE_CURRENT_SOURCE_DIR}/Builds/CMake/echo_file.cmake
|
|
||||||
COMMAND ${CMAKE_COMMAND}
|
|
||||||
-DIN_FILE=${STAMP_DIR}/${_target}-build-err.log
|
|
||||||
-P ${CMAKE_CURRENT_SOURCE_DIR}/Builds/CMake/echo_file.cmake)
|
|
||||||
endfunction ()
|
|
||||||
|
|
||||||
#[=========================================================[
|
|
||||||
This is a function override for one function in the
|
|
||||||
standard ExternalProject module. We want to change
|
|
||||||
the generated build script slightly to include printing
|
|
||||||
the build logs in the case of failure. Those modifications
|
|
||||||
have been made here. This function override could break
|
|
||||||
in the future if the ExternalProject module changes internal
|
|
||||||
function names or changes the way it generates the build
|
|
||||||
scripts.
|
|
||||||
See:
|
|
||||||
https://gitlab.kitware.com/cmake/cmake/blob/df1ddeec128d68cc636f2dde6c2acd87af5658b6/Modules/ExternalProject.cmake#L1855-1952
|
|
||||||
#]=========================================================]
|
|
||||||
|
|
||||||
function(_ep_write_log_script name step cmd_var)
|
|
||||||
ExternalProject_Get_Property(${name} stamp_dir)
|
|
||||||
set(command "${${cmd_var}}")
|
|
||||||
|
|
||||||
set(make "")
|
|
||||||
set(code_cygpath_make "")
|
|
||||||
if(command MATCHES "^\\$\\(MAKE\\)")
|
|
||||||
# GNU make recognizes the string "$(MAKE)" as recursive make, so
|
|
||||||
# ensure that it appears directly in the makefile.
|
|
||||||
string(REGEX REPLACE "^\\$\\(MAKE\\)" "\${make}" command "${command}")
|
|
||||||
set(make "-Dmake=$(MAKE)")
|
|
||||||
|
|
||||||
if(WIN32 AND NOT CYGWIN)
|
|
||||||
set(code_cygpath_make "
|
|
||||||
if(\${make} MATCHES \"^/\")
|
|
||||||
execute_process(
|
|
||||||
COMMAND cygpath -w \${make}
|
|
||||||
OUTPUT_VARIABLE cygpath_make
|
|
||||||
ERROR_VARIABLE cygpath_make
|
|
||||||
RESULT_VARIABLE cygpath_error
|
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
||||||
)
|
|
||||||
if(NOT cygpath_error)
|
|
||||||
set(make \${cygpath_make})
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(config "")
|
|
||||||
if("${CMAKE_CFG_INTDIR}" MATCHES "^\\$")
|
|
||||||
string(REPLACE "${CMAKE_CFG_INTDIR}" "\${config}" command "${command}")
|
|
||||||
set(config "-Dconfig=${CMAKE_CFG_INTDIR}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Wrap multiple 'COMMAND' lines up into a second-level wrapper
|
|
||||||
# script so all output can be sent to one log file.
|
|
||||||
if(command MATCHES "(^|;)COMMAND;")
|
|
||||||
set(code_execute_process "
|
|
||||||
${code_cygpath_make}
|
|
||||||
execute_process(COMMAND \${command} RESULT_VARIABLE result)
|
|
||||||
if(result)
|
|
||||||
set(msg \"Command failed (\${result}):\\n\")
|
|
||||||
foreach(arg IN LISTS command)
|
|
||||||
set(msg \"\${msg} '\${arg}'\")
|
|
||||||
endforeach()
|
|
||||||
message(FATAL_ERROR \"\${msg}\")
|
|
||||||
endif()
|
|
||||||
")
|
|
||||||
set(code "")
|
|
||||||
set(cmd "")
|
|
||||||
set(sep "")
|
|
||||||
foreach(arg IN LISTS command)
|
|
||||||
if("x${arg}" STREQUAL "xCOMMAND")
|
|
||||||
if(NOT "x${cmd}" STREQUAL "x")
|
|
||||||
string(APPEND code "set(command \"${cmd}\")${code_execute_process}")
|
|
||||||
endif()
|
|
||||||
set(cmd "")
|
|
||||||
set(sep "")
|
|
||||||
else()
|
|
||||||
string(APPEND cmd "${sep}${arg}")
|
|
||||||
set(sep ";")
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
string(APPEND code "set(command \"${cmd}\")${code_execute_process}")
|
|
||||||
file(GENERATE OUTPUT "${stamp_dir}/${name}-${step}-$<CONFIG>-impl.cmake" CONTENT "${code}")
|
|
||||||
set(command ${CMAKE_COMMAND} "-Dmake=\${make}" "-Dconfig=\${config}" -P ${stamp_dir}/${name}-${step}-$<CONFIG>-impl.cmake)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Wrap the command in a script to log output to files.
|
|
||||||
set(script ${stamp_dir}/${name}-${step}-$<CONFIG>.cmake)
|
|
||||||
set(logbase ${stamp_dir}/${name}-${step})
|
|
||||||
set(code "
|
|
||||||
${code_cygpath_make}
|
|
||||||
function (_echo_file _fil)
|
|
||||||
file (READ \${_fil} _cont)
|
|
||||||
execute_process (COMMAND \${CMAKE_COMMAND} -E echo \"\${_cont}\")
|
|
||||||
endfunction ()
|
|
||||||
set(command \"${command}\")
|
|
||||||
execute_process(
|
|
||||||
COMMAND \${command}
|
|
||||||
RESULT_VARIABLE result
|
|
||||||
OUTPUT_FILE \"${logbase}-out.log\"
|
|
||||||
ERROR_FILE \"${logbase}-err.log\"
|
|
||||||
)
|
|
||||||
if(result)
|
|
||||||
set(msg \"Command failed: \${result}\\n\")
|
|
||||||
foreach(arg IN LISTS command)
|
|
||||||
set(msg \"\${msg} '\${arg}'\")
|
|
||||||
endforeach()
|
|
||||||
execute_process (COMMAND \${CMAKE_COMMAND} -E echo \"Build output for ${logbase} : \")
|
|
||||||
_echo_file (\"${logbase}-out.log\")
|
|
||||||
_echo_file (\"${logbase}-err.log\")
|
|
||||||
set(msg \"\${msg}\\nSee above\\n\")
|
|
||||||
message(FATAL_ERROR \"\${msg}\")
|
|
||||||
else()
|
|
||||||
set(msg \"${name} ${step} command succeeded. See also ${logbase}-*.log\")
|
|
||||||
message(STATUS \"\${msg}\")
|
|
||||||
endif()
|
|
||||||
")
|
|
||||||
file(GENERATE OUTPUT "${script}" CONTENT "${code}")
|
|
||||||
set(command ${CMAKE_COMMAND} ${make} ${config} -P ${script})
|
|
||||||
set(${cmd_var} "${command}" PARENT_SCOPE)
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
find_package(Git)
|
|
||||||
|
|
||||||
# function that calls git log to get current hash
|
|
||||||
function (git_hash hash_val)
|
|
||||||
# note: optional second extra string argument not in signature
|
|
||||||
if (NOT GIT_FOUND)
|
|
||||||
return ()
|
|
||||||
endif ()
|
|
||||||
set (_hash "")
|
|
||||||
set (_format "%H")
|
|
||||||
if (ARGC GREATER_EQUAL 2)
|
|
||||||
string (TOLOWER ${ARGV1} _short)
|
|
||||||
if (_short STREQUAL "short")
|
|
||||||
set (_format "%h")
|
|
||||||
endif ()
|
|
||||||
endif ()
|
|
||||||
execute_process (COMMAND ${GIT_EXECUTABLE} "log" "--pretty=${_format}" "-n1"
|
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
RESULT_VARIABLE _git_exit_code
|
|
||||||
OUTPUT_VARIABLE _temp_hash
|
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
||||||
ERROR_QUIET)
|
|
||||||
if (_git_exit_code EQUAL 0)
|
|
||||||
set (_hash ${_temp_hash})
|
|
||||||
endif ()
|
|
||||||
set (${hash_val} "${_hash}" PARENT_SCOPE)
|
|
||||||
endfunction ()
|
|
||||||
|
|
||||||
function (git_branch branch_val)
|
|
||||||
if (NOT GIT_FOUND)
|
|
||||||
return ()
|
|
||||||
endif ()
|
|
||||||
set (_branch "")
|
|
||||||
execute_process (COMMAND ${GIT_EXECUTABLE} "rev-parse" "--abbrev-ref" "HEAD"
|
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
RESULT_VARIABLE _git_exit_code
|
|
||||||
OUTPUT_VARIABLE _temp_branch
|
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
||||||
ERROR_QUIET)
|
|
||||||
if (_git_exit_code EQUAL 0)
|
|
||||||
set (_branch ${_temp_branch})
|
|
||||||
endif ()
|
|
||||||
set (${branch_val} "${_branch}" PARENT_SCOPE)
|
|
||||||
endfunction ()
|
|
||||||
|
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
|
|
||||||
#[=========================================================[
|
|
||||||
SQLITE doesn't provide build files in the
|
|
||||||
standard source-only distribution. So we wrote
|
|
||||||
a simple cmake file and we copy it to the
|
|
||||||
external project folder so that we can use
|
|
||||||
this file to build the lib with ExternalProject
|
|
||||||
#]=========================================================]
|
|
||||||
|
|
||||||
add_library (sqlite3 STATIC sqlite3.c)
|
|
||||||
#[=========================================================[
|
|
||||||
When compiled with SQLITE_THREADSAFE=1, SQLite operates
|
|
||||||
in serialized mode. In this mode, SQLite can be safely
|
|
||||||
used by multiple threads with no restriction.
|
|
||||||
|
|
||||||
NOTE: This implies a global mutex!
|
|
||||||
|
|
||||||
When compiled with SQLITE_THREADSAFE=2, SQLite can be
|
|
||||||
used in a multithreaded program so long as no two
|
|
||||||
threads attempt to use the same database connection at
|
|
||||||
the same time.
|
|
||||||
|
|
||||||
NOTE: This is the preferred threading model, but not
|
|
||||||
currently enabled because we need to investigate our
|
|
||||||
use-model and concurrency requirements.
|
|
||||||
|
|
||||||
TODO: consider whether any other options should be
|
|
||||||
used: https://www.sqlite.org/compile.html
|
|
||||||
#]=========================================================]
|
|
||||||
|
|
||||||
target_compile_definitions (sqlite3
|
|
||||||
PRIVATE
|
|
||||||
SQLITE_THREADSAFE=1
|
|
||||||
HAVE_USLEEP=1)
|
|
||||||
target_compile_options (sqlite3
|
|
||||||
PRIVATE
|
|
||||||
$<$<BOOL:${MSVC}>:
|
|
||||||
-wd4100
|
|
||||||
-wd4127
|
|
||||||
-wd4232
|
|
||||||
-wd4244
|
|
||||||
-wd4701
|
|
||||||
-wd4706
|
|
||||||
-wd4996
|
|
||||||
>
|
|
||||||
$<$<NOT:$<BOOL:${MSVC}>>:-Wno-array-bounds>)
|
|
||||||
install (
|
|
||||||
TARGETS
|
|
||||||
sqlite3
|
|
||||||
LIBRARY DESTINATION lib
|
|
||||||
ARCHIVE DESTINATION lib
|
|
||||||
RUNTIME DESTINATION bin
|
|
||||||
INCLUDES DESTINATION include)
|
|
||||||
install (
|
|
||||||
FILES
|
|
||||||
sqlite3.h
|
|
||||||
sqlite3ext.h
|
|
||||||
DESTINATION include)
|
|
||||||
|
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,98 +0,0 @@
|
|||||||
#[===================================================================[
|
|
||||||
coverage report target
|
|
||||||
#]===================================================================]
|
|
||||||
|
|
||||||
if (coverage)
|
|
||||||
if (is_clang)
|
|
||||||
if (APPLE)
|
|
||||||
execute_process (COMMAND xcrun -f llvm-profdata
|
|
||||||
OUTPUT_VARIABLE LLVM_PROFDATA
|
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
||||||
else ()
|
|
||||||
find_program (LLVM_PROFDATA llvm-profdata)
|
|
||||||
endif ()
|
|
||||||
if (NOT LLVM_PROFDATA)
|
|
||||||
message (WARNING "unable to find llvm-profdata - skipping coverage_report target")
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
if (APPLE)
|
|
||||||
execute_process (COMMAND xcrun -f llvm-cov
|
|
||||||
OUTPUT_VARIABLE LLVM_COV
|
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
||||||
else ()
|
|
||||||
find_program (LLVM_COV llvm-cov)
|
|
||||||
endif ()
|
|
||||||
if (NOT LLVM_COV)
|
|
||||||
message (WARNING "unable to find llvm-cov - skipping coverage_report target")
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
set (extract_pattern "")
|
|
||||||
if (coverage_core_only)
|
|
||||||
set (extract_pattern "${CMAKE_CURRENT_SOURCE_DIR}/src/ripple/")
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
if (LLVM_COV AND LLVM_PROFDATA)
|
|
||||||
add_custom_target (coverage_report
|
|
||||||
USES_TERMINAL
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E echo "Generating coverage - results will be in ${CMAKE_BINARY_DIR}/coverage/index.html."
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E echo "Running rippled tests."
|
|
||||||
COMMAND rippled --unittest$<$<BOOL:${coverage_test}>:=${coverage_test}> --quiet --unittest-log
|
|
||||||
COMMAND ${LLVM_PROFDATA}
|
|
||||||
merge -sparse default.profraw -o rip.profdata
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E echo "Summary of coverage:"
|
|
||||||
COMMAND ${LLVM_COV}
|
|
||||||
report -instr-profile=rip.profdata
|
|
||||||
$<TARGET_FILE:rippled> ${extract_pattern}
|
|
||||||
# generate html report
|
|
||||||
COMMAND ${LLVM_COV}
|
|
||||||
show -format=html -output-dir=${CMAKE_BINARY_DIR}/coverage
|
|
||||||
-instr-profile=rip.profdata
|
|
||||||
$<TARGET_FILE:rippled> ${extract_pattern}
|
|
||||||
BYPRODUCTS coverage/index.html)
|
|
||||||
endif ()
|
|
||||||
elseif (is_gcc)
|
|
||||||
find_program (LCOV lcov)
|
|
||||||
if (NOT LCOV)
|
|
||||||
message (WARNING "unable to find lcov - skipping coverage_report target")
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
find_program (GENHTML genhtml)
|
|
||||||
if (NOT GENHTML)
|
|
||||||
message (WARNING "unable to find genhtml - skipping coverage_report target")
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
set (extract_pattern "*")
|
|
||||||
if (coverage_core_only)
|
|
||||||
set (extract_pattern "*/src/ripple/*")
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
if (LCOV AND GENHTML)
|
|
||||||
add_custom_target (coverage_report
|
|
||||||
USES_TERMINAL
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E echo "Generating coverage- results will be in ${CMAKE_BINARY_DIR}/coverage/index.html."
|
|
||||||
# create baseline info file
|
|
||||||
COMMAND ${LCOV}
|
|
||||||
--no-external -d "${CMAKE_CURRENT_SOURCE_DIR}" -c -d . -i -o baseline.info
|
|
||||||
| grep -v "ignoring data for external file"
|
|
||||||
# run tests
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E echo "Running rippled tests for coverage report."
|
|
||||||
COMMAND rippled --unittest$<$<BOOL:${coverage_test}>:=${coverage_test}> --quiet --unittest-log
|
|
||||||
# Create test coverage data file
|
|
||||||
COMMAND ${LCOV}
|
|
||||||
--no-external -d "${CMAKE_CURRENT_SOURCE_DIR}" -c -d . -o tests.info
|
|
||||||
| grep -v "ignoring data for external file"
|
|
||||||
# Combine baseline and test coverage data
|
|
||||||
COMMAND ${LCOV}
|
|
||||||
-a baseline.info -a tests.info -o lcov-all.info
|
|
||||||
# extract our files
|
|
||||||
COMMAND ${LCOV}
|
|
||||||
-e lcov-all.info "${extract_pattern}" -o lcov.info
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E echo "Summary of coverage:"
|
|
||||||
COMMAND ${LCOV} --summary lcov.info
|
|
||||||
# generate HTML report
|
|
||||||
COMMAND ${GENHTML}
|
|
||||||
-o ${CMAKE_BINARY_DIR}/coverage lcov.info
|
|
||||||
BYPRODUCTS coverage/index.html)
|
|
||||||
endif ()
|
|
||||||
endif ()
|
|
||||||
endif ()
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
#[===================================================================[
|
|
||||||
multiconfig misc
|
|
||||||
#]===================================================================]
|
|
||||||
|
|
||||||
if (is_multiconfig)
|
|
||||||
# This code finds all source files in the src subdirectory for inclusion
|
|
||||||
# in the IDE file tree as non-compiled sources. Since this file list will
|
|
||||||
# have some overlap with files we have already added to our targets to
|
|
||||||
# be compiled, we explicitly remove any of these target source files from
|
|
||||||
# this list.
|
|
||||||
file (GLOB_RECURSE all_sources RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
CONFIGURE_DEPENDS
|
|
||||||
src/*.* Builds/*.md docs/*.md src/*.md Builds/*.cmake)
|
|
||||||
file(GLOB md_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} CONFIGURE_DEPENDS
|
|
||||||
*.md)
|
|
||||||
LIST(APPEND all_sources ${md_files})
|
|
||||||
foreach (_target secp256k1::secp256k1 ed25519::ed25519 pbufs xrpl_core rippled)
|
|
||||||
get_target_property (_type ${_target} TYPE)
|
|
||||||
if(_type STREQUAL "INTERFACE_LIBRARY")
|
|
||||||
continue()
|
|
||||||
endif()
|
|
||||||
get_target_property (_src ${_target} SOURCES)
|
|
||||||
list (REMOVE_ITEM all_sources ${_src})
|
|
||||||
endforeach ()
|
|
||||||
target_sources (rippled PRIVATE ${all_sources})
|
|
||||||
set_property (
|
|
||||||
SOURCE ${all_sources}
|
|
||||||
APPEND
|
|
||||||
PROPERTY HEADER_FILE_ONLY true)
|
|
||||||
if (MSVC)
|
|
||||||
set_property(
|
|
||||||
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
PROPERTY VS_STARTUP_PROJECT rippled)
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
group_sources(src)
|
|
||||||
group_sources(docs)
|
|
||||||
group_sources(Builds)
|
|
||||||
endif ()
|
|
||||||
@@ -1,180 +0,0 @@
|
|||||||
#[===================================================================[
|
|
||||||
package/container targets - (optional)
|
|
||||||
#]===================================================================]
|
|
||||||
|
|
||||||
if (is_root_project)
|
|
||||||
if (NOT DOCKER)
|
|
||||||
find_program (DOCKER docker)
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
if (DOCKER)
|
|
||||||
# if no container label is provided, use current git hash
|
|
||||||
git_hash (commit_hash)
|
|
||||||
if (NOT container_label)
|
|
||||||
set (container_label ${commit_hash})
|
|
||||||
endif ()
|
|
||||||
message (STATUS "using [${container_label}] as build container tag...")
|
|
||||||
|
|
||||||
file (MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/packages)
|
|
||||||
|
|
||||||
#[===================================================================[
|
|
||||||
rpm
|
|
||||||
#]===================================================================]
|
|
||||||
add_custom_target (rpm_container
|
|
||||||
docker build
|
|
||||||
--pull
|
|
||||||
--build-arg GIT_COMMIT=${commit_hash}
|
|
||||||
-t rippleci/rippled-rpm-builder:${container_label}
|
|
||||||
$<$<BOOL:${rpm_cache_from}>:--cache-from=${rpm_cache_from}>
|
|
||||||
-f centos-builder/Dockerfile .
|
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Builds/containers
|
|
||||||
VERBATIM
|
|
||||||
USES_TERMINAL
|
|
||||||
COMMAND_EXPAND_LISTS
|
|
||||||
SOURCES
|
|
||||||
Builds/containers/centos-builder/Dockerfile
|
|
||||||
Builds/containers/centos-builder/centos_setup.sh
|
|
||||||
Builds/containers/shared/update-rippled.sh
|
|
||||||
Builds/containers/shared/update_sources.sh
|
|
||||||
Builds/containers/shared/rippled.service
|
|
||||||
Builds/containers/shared/rippled-reporting.service
|
|
||||||
Builds/containers/packaging/rpm/rippled.spec
|
|
||||||
Builds/containers/packaging/rpm/build_rpm.sh
|
|
||||||
Builds/containers/packaging/rpm/50-rippled.preset
|
|
||||||
Builds/containers/packaging/rpm/50-rippled-reporting.preset
|
|
||||||
bin/getRippledInfo
|
|
||||||
)
|
|
||||||
exclude_from_default (rpm_container)
|
|
||||||
add_custom_target (rpm
|
|
||||||
docker run
|
|
||||||
-v ${CMAKE_CURRENT_SOURCE_DIR}:/opt/rippled_bld/pkg/rippled
|
|
||||||
-v ${CMAKE_CURRENT_BINARY_DIR}/packages:/opt/rippled_bld/pkg/out
|
|
||||||
-t rippleci/rippled-rpm-builder:${container_label}
|
|
||||||
/bin/bash -c "cp -fpu rippled/Builds/containers/packaging/rpm/build_rpm.sh . && ./build_rpm.sh"
|
|
||||||
VERBATIM
|
|
||||||
USES_TERMINAL
|
|
||||||
COMMAND_EXPAND_LISTS
|
|
||||||
SOURCES
|
|
||||||
Builds/containers/packaging/rpm/rippled.spec
|
|
||||||
)
|
|
||||||
exclude_from_default (rpm)
|
|
||||||
if (NOT have_package_container)
|
|
||||||
add_dependencies(rpm rpm_container)
|
|
||||||
endif ()
|
|
||||||
#[===================================================================[
|
|
||||||
dpkg
|
|
||||||
#]===================================================================]
|
|
||||||
# currently use ubuntu 18.04 as a base b/c it has one of
|
|
||||||
# the lower versions of libc among ubuntu and debian releases.
|
|
||||||
# we could change this in the future and build with some other deb
|
|
||||||
# based system.
|
|
||||||
add_custom_target (dpkg_container
|
|
||||||
docker build
|
|
||||||
--pull
|
|
||||||
--build-arg DIST_TAG=18.04
|
|
||||||
--build-arg GIT_COMMIT=${commit_hash}
|
|
||||||
-t rippled-dpkg-builder:${container_label}
|
|
||||||
$<$<BOOL:${dpkg_cache_from}>:--cache-from=${dpkg_cache_from}>
|
|
||||||
-f ubuntu-builder/Dockerfile .
|
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Builds/containers
|
|
||||||
VERBATIM
|
|
||||||
USES_TERMINAL
|
|
||||||
COMMAND_EXPAND_LISTS
|
|
||||||
SOURCES
|
|
||||||
Builds/containers/packaging/dpkg/debian/rippled-reporting.links
|
|
||||||
Builds/containers/packaging/dpkg/debian/copyright
|
|
||||||
Builds/containers/packaging/dpkg/debian/rules
|
|
||||||
Builds/containers/packaging/dpkg/debian/rippled-reporting.install
|
|
||||||
Builds/containers/packaging/dpkg/debian/rippled-reporting.postinst
|
|
||||||
Builds/containers/packaging/dpkg/debian/rippled.links
|
|
||||||
Builds/containers/packaging/dpkg/debian/rippled.prerm
|
|
||||||
Builds/containers/packaging/dpkg/debian/rippled.postinst
|
|
||||||
Builds/containers/packaging/dpkg/debian/rippled-dev.install
|
|
||||||
Builds/containers/packaging/dpkg/debian/dirs
|
|
||||||
Builds/containers/packaging/dpkg/debian/rippled.postrm
|
|
||||||
Builds/containers/packaging/dpkg/debian/rippled.conffiles
|
|
||||||
Builds/containers/packaging/dpkg/debian/compat
|
|
||||||
Builds/containers/packaging/dpkg/debian/source/format
|
|
||||||
Builds/containers/packaging/dpkg/debian/source/local-options
|
|
||||||
Builds/containers/packaging/dpkg/debian/README.Debian
|
|
||||||
Builds/containers/packaging/dpkg/debian/rippled.install
|
|
||||||
Builds/containers/packaging/dpkg/debian/rippled.preinst
|
|
||||||
Builds/containers/packaging/dpkg/debian/docs
|
|
||||||
Builds/containers/packaging/dpkg/debian/control
|
|
||||||
Builds/containers/packaging/dpkg/debian/rippled-reporting.dirs
|
|
||||||
Builds/containers/packaging/dpkg/build_dpkg.sh
|
|
||||||
Builds/containers/ubuntu-builder/Dockerfile
|
|
||||||
Builds/containers/ubuntu-builder/ubuntu_setup.sh
|
|
||||||
bin/getRippledInfo
|
|
||||||
Builds/containers/shared/install_cmake.sh
|
|
||||||
Builds/containers/shared/update-rippled.sh
|
|
||||||
Builds/containers/shared/update_sources.sh
|
|
||||||
Builds/containers/shared/rippled.service
|
|
||||||
Builds/containers/shared/rippled-reporting.service
|
|
||||||
Builds/containers/shared/rippled-logrotate
|
|
||||||
Builds/containers/shared/update-rippled-cron
|
|
||||||
)
|
|
||||||
exclude_from_default (dpkg_container)
|
|
||||||
add_custom_target (dpkg
|
|
||||||
docker run
|
|
||||||
-v ${CMAKE_CURRENT_SOURCE_DIR}:/opt/rippled_bld/pkg/rippled
|
|
||||||
-v ${CMAKE_CURRENT_BINARY_DIR}/packages:/opt/rippled_bld/pkg/out
|
|
||||||
-t rippled-dpkg-builder:${container_label}
|
|
||||||
/bin/bash -c "cp -fpu rippled/Builds/containers/packaging/dpkg/build_dpkg.sh . && ./build_dpkg.sh"
|
|
||||||
VERBATIM
|
|
||||||
USES_TERMINAL
|
|
||||||
COMMAND_EXPAND_LISTS
|
|
||||||
SOURCES
|
|
||||||
Builds/containers/packaging/dpkg/debian/control
|
|
||||||
)
|
|
||||||
exclude_from_default (dpkg)
|
|
||||||
if (NOT have_package_container)
|
|
||||||
add_dependencies(dpkg dpkg_container)
|
|
||||||
endif ()
|
|
||||||
#[===================================================================[
|
|
||||||
ci container
|
|
||||||
#]===================================================================]
|
|
||||||
# now use the same ubuntu image for our travis-ci docker images,
|
|
||||||
# but we use a newer distro (18.04 vs 16.04).
|
|
||||||
#
|
|
||||||
# the following steps assume the github pkg repo, but it's possible to
|
|
||||||
# adapt these for other docker hub repositories.
|
|
||||||
#
|
|
||||||
# steps for publishing a new CI image when you make changes:
|
|
||||||
#
|
|
||||||
# mkdir bld.ci && cd bld.ci && cmake -Dpackages_only=ON -Dcontainer_label=CI_LATEST
|
|
||||||
# cmake --build . --target ci_container --verbose
|
|
||||||
# docker tag rippled-ci-builder:CI_LATEST <HUB REPO PATH>/rippled-ci-builder:YYYY-MM-DD
|
|
||||||
# (NOTE: change YYYY-MM-DD to match current date, or use a different
|
|
||||||
# tag/version scheme if you prefer)
|
|
||||||
# docker push <HUB REPO PATH>/rippled-ci-builder:YYYY-MM-DD
|
|
||||||
# (NOTE: <HUB REPO PATH> is probably your user or org name if using
|
|
||||||
# docker hub, or it might be something like
|
|
||||||
# docker.pkg.github.com/ripple/rippled if using the github pkg
|
|
||||||
# registry. for any registry, you will need to be logged-in via
|
|
||||||
# docker and have push access.)
|
|
||||||
#
|
|
||||||
# ...then change the DOCKER_IMAGE line in .travis.yml :
|
|
||||||
# - DOCKER_IMAGE="<HUB REPO PATH>/rippled-ci-builder:YYYY-MM-DD"
|
|
||||||
add_custom_target (ci_container
|
|
||||||
docker build
|
|
||||||
--pull
|
|
||||||
--build-arg DIST_TAG=18.04
|
|
||||||
--build-arg GIT_COMMIT=${commit_hash}
|
|
||||||
--build-arg CI_USE=true
|
|
||||||
-t rippled-ci-builder:${container_label}
|
|
||||||
$<$<BOOL:${ci_cache_from}>:--cache-from=${ci_cache_from}>
|
|
||||||
-f ubuntu-builder/Dockerfile .
|
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Builds/containers
|
|
||||||
VERBATIM
|
|
||||||
USES_TERMINAL
|
|
||||||
COMMAND_EXPAND_LISTS
|
|
||||||
SOURCES
|
|
||||||
Builds/containers/ubuntu-builder/Dockerfile
|
|
||||||
Builds/containers/ubuntu-builder/ubuntu_setup.sh
|
|
||||||
)
|
|
||||||
exclude_from_default (ci_container)
|
|
||||||
else ()
|
|
||||||
message (STATUS "docker NOT found -- won't be able to build containers for packaging")
|
|
||||||
endif ()
|
|
||||||
endif ()
|
|
||||||
@@ -1,122 +0,0 @@
|
|||||||
#[===================================================================[
|
|
||||||
declare user options/settings
|
|
||||||
#]===================================================================]
|
|
||||||
|
|
||||||
option (assert "Enables asserts, even in release builds" OFF)
|
|
||||||
|
|
||||||
option (reporting "Build rippled with reporting mode enabled" OFF)
|
|
||||||
|
|
||||||
option (tests "Build tests" ON)
|
|
||||||
|
|
||||||
option (unity "Creates a build using UNITY support in cmake. This is the default" ON)
|
|
||||||
if (unity)
|
|
||||||
if (NOT is_ci)
|
|
||||||
set (CMAKE_UNITY_BUILD_BATCH_SIZE 15 CACHE STRING "")
|
|
||||||
endif ()
|
|
||||||
endif ()
|
|
||||||
if (is_gcc OR is_clang)
|
|
||||||
option (coverage "Generates coverage info." OFF)
|
|
||||||
option (profile "Add profiling flags" OFF)
|
|
||||||
set (coverage_test "" CACHE STRING
|
|
||||||
"On gcc & clang, the specific unit test(s) to run for coverage. Default is all tests.")
|
|
||||||
if (coverage_test AND NOT coverage)
|
|
||||||
set (coverage ON CACHE BOOL "gcc/clang only" FORCE)
|
|
||||||
endif ()
|
|
||||||
option (coverage_core_only
|
|
||||||
"Include only src/ripple files when generating coverage report. \
|
|
||||||
Set to OFF to include all sources in coverage report."
|
|
||||||
ON)
|
|
||||||
option (wextra "compile with extra gcc/clang warnings enabled" ON)
|
|
||||||
else ()
|
|
||||||
set (profile OFF CACHE BOOL "gcc/clang only" FORCE)
|
|
||||||
set (coverage OFF CACHE BOOL "gcc/clang only" FORCE)
|
|
||||||
set (wextra OFF CACHE BOOL "gcc/clang only" FORCE)
|
|
||||||
endif ()
|
|
||||||
if (is_linux)
|
|
||||||
option (BUILD_SHARED_LIBS "build shared ripple libraries" OFF)
|
|
||||||
option (static "link protobuf, openssl, libc++, and boost statically" ON)
|
|
||||||
option (perf "Enables flags that assist with perf recording" OFF)
|
|
||||||
option (use_gold "enables detection of gold (binutils) linker" ON)
|
|
||||||
else ()
|
|
||||||
# we are not ready to allow shared-libs on windows because it would require
|
|
||||||
# export declarations. On macos it's more feasible, but static openssl
|
|
||||||
# produces odd linker errors, thus we disable shared lib builds for now.
|
|
||||||
set (BUILD_SHARED_LIBS OFF CACHE BOOL "build shared ripple libraries - OFF for win/macos" FORCE)
|
|
||||||
set (static ON CACHE BOOL "static link, linux only. ON for WIN/macos" FORCE)
|
|
||||||
set (perf OFF CACHE BOOL "perf flags, linux only" FORCE)
|
|
||||||
set (use_gold OFF CACHE BOOL "gold linker, linux only" FORCE)
|
|
||||||
endif ()
|
|
||||||
if (is_clang)
|
|
||||||
option (use_lld "enables detection of lld linker" ON)
|
|
||||||
else ()
|
|
||||||
set (use_lld OFF CACHE BOOL "try lld linker, clang only" FORCE)
|
|
||||||
endif ()
|
|
||||||
option (jemalloc "Enables jemalloc for heap profiling" OFF)
|
|
||||||
option (werr "treat warnings as errors" OFF)
|
|
||||||
option (local_protobuf
|
|
||||||
"Force a local build of protobuf instead of looking for an installed version." OFF)
|
|
||||||
option (local_grpc
|
|
||||||
"Force a local build of gRPC instead of looking for an installed version." OFF)
|
|
||||||
|
|
||||||
# this one is a string and therefore can't be an option
|
|
||||||
set (san "" CACHE STRING "On gcc & clang, add sanitizer instrumentation")
|
|
||||||
set_property (CACHE san PROPERTY STRINGS ";undefined;memory;address;thread")
|
|
||||||
if (san)
|
|
||||||
string (TOLOWER ${san} san)
|
|
||||||
set (SAN_FLAG "-fsanitize=${san}")
|
|
||||||
set (SAN_LIB "")
|
|
||||||
if (is_gcc)
|
|
||||||
if (san STREQUAL "address")
|
|
||||||
set (SAN_LIB "asan")
|
|
||||||
elseif (san STREQUAL "thread")
|
|
||||||
set (SAN_LIB "tsan")
|
|
||||||
elseif (san STREQUAL "memory")
|
|
||||||
set (SAN_LIB "msan")
|
|
||||||
elseif (san STREQUAL "undefined")
|
|
||||||
set (SAN_LIB "ubsan")
|
|
||||||
endif ()
|
|
||||||
endif ()
|
|
||||||
set (_saved_CRL ${CMAKE_REQUIRED_LIBRARIES})
|
|
||||||
set (CMAKE_REQUIRED_LIBRARIES "${SAN_FLAG};${SAN_LIB}")
|
|
||||||
check_cxx_compiler_flag (${SAN_FLAG} COMPILER_SUPPORTS_SAN)
|
|
||||||
set (CMAKE_REQUIRED_LIBRARIES ${_saved_CRL})
|
|
||||||
if (NOT COMPILER_SUPPORTS_SAN)
|
|
||||||
message (FATAL_ERROR "${san} sanitizer does not seem to be supported by your compiler")
|
|
||||||
endif ()
|
|
||||||
endif ()
|
|
||||||
set (container_label "" CACHE STRING "tag to use for package building containers")
|
|
||||||
option (packages_only
|
|
||||||
"ONLY generate package building targets. This is special use-case and almost \
|
|
||||||
certainly not what you want. Use with caution as you won't be able to build \
|
|
||||||
any compiled targets locally." OFF)
|
|
||||||
option (have_package_container
|
|
||||||
"Sometimes you already have the tagged container you want to use for package \
|
|
||||||
building and you don't want docker to rebuild it. This flag will detach the \
|
|
||||||
dependency of the package build from the container build. It's an advanced \
|
|
||||||
use case and most likely you should not be touching this flag." OFF)
|
|
||||||
|
|
||||||
# the remaining options are obscure and rarely used
|
|
||||||
option (beast_no_unit_test_inline
|
|
||||||
"Prevents unit test definitions from being inserted into global table"
|
|
||||||
OFF)
|
|
||||||
option (single_io_service_thread
|
|
||||||
"Restricts the number of threads calling io_service::run to one. \
|
|
||||||
This can be useful when debugging."
|
|
||||||
OFF)
|
|
||||||
option (boost_show_deprecated
|
|
||||||
"Allow boost to fail on deprecated usage. Only useful if you're trying\
|
|
||||||
to find deprecated calls."
|
|
||||||
OFF)
|
|
||||||
option (beast_hashers
|
|
||||||
"Use local implementations for sha/ripemd hashes (experimental, not recommended)"
|
|
||||||
OFF)
|
|
||||||
|
|
||||||
if (WIN32)
|
|
||||||
option (beast_disable_autolink "Disables autolinking of system libraries on WIN32" OFF)
|
|
||||||
else ()
|
|
||||||
set (beast_disable_autolink OFF CACHE BOOL "WIN32 only" FORCE)
|
|
||||||
endif ()
|
|
||||||
if (coverage)
|
|
||||||
message (STATUS "coverage build requested - forcing Debug build")
|
|
||||||
set (CMAKE_BUILD_TYPE Debug CACHE STRING "build type" FORCE)
|
|
||||||
endif ()
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
#[===================================================================[
|
|
||||||
read version from source
|
|
||||||
#]===================================================================]
|
|
||||||
|
|
||||||
file (STRINGS src/ripple/protocol/impl/BuildInfo.cpp BUILD_INFO)
|
|
||||||
foreach (line_ ${BUILD_INFO})
|
|
||||||
if (line_ MATCHES "versionString[ ]*=[ ]*\"(.+)\"")
|
|
||||||
set (rippled_version ${CMAKE_MATCH_1})
|
|
||||||
endif ()
|
|
||||||
endforeach ()
|
|
||||||
if (rippled_version)
|
|
||||||
message (STATUS "rippled version: ${rippled_version}")
|
|
||||||
else ()
|
|
||||||
message (FATAL_ERROR "unable to determine rippled version")
|
|
||||||
endif ()
|
|
||||||
@@ -1,106 +0,0 @@
|
|||||||
################################################################################
|
|
||||||
# SociConfig.cmake - CMake build configuration of SOCI library
|
|
||||||
################################################################################
|
|
||||||
# Copyright (C) 2010 Mateusz Loskot <mateusz@loskot.net>
|
|
||||||
#
|
|
||||||
# Distributed under the Boost Software License, Version 1.0.
|
|
||||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
# http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
include(CheckCXXSymbolExists)
|
|
||||||
|
|
||||||
if(WIN32)
|
|
||||||
check_cxx_symbol_exists("_M_AMD64" "" SOCI_TARGET_ARCH_X64)
|
|
||||||
if(NOT RTC_ARCH_X64)
|
|
||||||
check_cxx_symbol_exists("_M_IX86" "" SOCI_TARGET_ARCH_X86)
|
|
||||||
endif(NOT RTC_ARCH_X64)
|
|
||||||
# add check for arm here
|
|
||||||
# see http://msdn.microsoft.com/en-us/library/b0084kay.aspx
|
|
||||||
else(WIN32)
|
|
||||||
check_cxx_symbol_exists("__i386__" "" SOCI_TARGET_ARCH_X86)
|
|
||||||
check_cxx_symbol_exists("__x86_64__" "" SOCI_TARGET_ARCH_X64)
|
|
||||||
check_cxx_symbol_exists("__arm__" "" SOCI_TARGET_ARCH_ARM)
|
|
||||||
endif(WIN32)
|
|
||||||
|
|
||||||
if(NOT DEFINED LIB_SUFFIX)
|
|
||||||
if(SOCI_TARGET_ARCH_X64)
|
|
||||||
set(_lib_suffix "64")
|
|
||||||
else()
|
|
||||||
set(_lib_suffix "")
|
|
||||||
endif()
|
|
||||||
set(LIB_SUFFIX ${_lib_suffix} CACHE STRING "Specifies suffix for the lib directory")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
#
|
|
||||||
# C++11 Option
|
|
||||||
#
|
|
||||||
|
|
||||||
if(NOT SOCI_CXX_C11)
|
|
||||||
set (SOCI_CXX_C11 OFF CACHE BOOL "Build to the C++11 standard")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
#
|
|
||||||
# Force compilation flags and set desired warnings level
|
|
||||||
#
|
|
||||||
|
|
||||||
if (MSVC)
|
|
||||||
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
|
|
||||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
|
||||||
add_definitions(-D_CRT_NONSTDC_NO_WARNING)
|
|
||||||
add_definitions(-D_SCL_SECURE_NO_WARNINGS)
|
|
||||||
|
|
||||||
if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
|
|
||||||
string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
|
||||||
else()
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /we4266")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
else()
|
|
||||||
|
|
||||||
set(SOCI_GCC_CLANG_COMMON_FLAGS "")
|
|
||||||
# "-pedantic -Werror -Wno-error=parentheses -Wall -Wextra -Wpointer-arith -Wcast-align -Wcast-qual -Wfloat-equal -Woverloaded-virtual -Wredundant-decls -Wno-long-long")
|
|
||||||
|
|
||||||
|
|
||||||
if (SOCI_CXX_C11)
|
|
||||||
set(SOCI_CXX_VERSION_FLAGS "-std=c++11")
|
|
||||||
else()
|
|
||||||
set(SOCI_CXX_VERSION_FLAGS "-std=gnu++98")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR "${CMAKE_CXX_COMPILER}" MATCHES "clang")
|
|
||||||
|
|
||||||
if(NOT CMAKE_CXX_COMPILER_VERSION LESS 3.1 AND SOCI_ASAN)
|
|
||||||
set(SOCI_GCC_CLANG_COMMON_FLAGS "${SOCI_GCC_CLANG_COMMON_FLAGS} -fsanitize=address")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# enforce C++11 for Clang
|
|
||||||
set(SOCI_CXX_C11 ON)
|
|
||||||
set(SOCI_CXX_VERSION_FLAGS "-std=c++11")
|
|
||||||
add_definitions(-DCATCH_CONFIG_CPP11_NO_IS_ENUM)
|
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SOCI_GCC_CLANG_COMMON_FLAGS} ${SOCI_CXX_VERSION_FLAGS}")
|
|
||||||
|
|
||||||
elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
|
|
||||||
|
|
||||||
if(NOT CMAKE_CXX_COMPILER_VERSION LESS 4.8 AND SOCI_ASAN)
|
|
||||||
set(SOCI_GCC_CLANG_COMMON_FLAGS "${SOCI_GCC_CLANG_COMMON_FLAGS} -fsanitize=address")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SOCI_GCC_CLANG_COMMON_FLAGS} ${SOCI_CXX_VERSION_FLAGS} ")
|
|
||||||
if (CMAKE_COMPILER_IS_GNUCXX)
|
|
||||||
if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
|
||||||
else()
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-variadic-macros")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
else()
|
|
||||||
message(WARNING "Unknown toolset - using default flags to build SOCI")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Set SOCI_HAVE_* variables for soci-config.h generator
|
|
||||||
set(SOCI_HAVE_CXX_C11 ${SOCI_CXX_C11} CACHE INTERNAL "Enables C++11 support")
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
find_package(Protobuf 3.8)
|
|
||||||
|
|
||||||
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/proto_gen)
|
|
||||||
set(ccbd ${CMAKE_CURRENT_BINARY_DIR})
|
|
||||||
set(CMAKE_CURRENT_BINARY_DIR ${CMAKE_BINARY_DIR}/proto_gen)
|
|
||||||
protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS src/ripple/proto/ripple.proto)
|
|
||||||
set(CMAKE_CURRENT_BINARY_DIR ${ccbd})
|
|
||||||
|
|
||||||
add_library(pbufs STATIC ${PROTO_SRCS} ${PROTO_HDRS})
|
|
||||||
target_include_directories(pbufs SYSTEM PUBLIC
|
|
||||||
${CMAKE_BINARY_DIR}/proto_gen
|
|
||||||
${CMAKE_BINARY_DIR}/proto_gen/src/ripple/proto
|
|
||||||
)
|
|
||||||
target_link_libraries(pbufs protobuf::libprotobuf)
|
|
||||||
target_compile_options(pbufs
|
|
||||||
PUBLIC
|
|
||||||
$<$<BOOL:${XCODE}>:
|
|
||||||
--system-header-prefix="google/protobuf"
|
|
||||||
-Wno-deprecated-dynamic-exception-spec
|
|
||||||
>
|
|
||||||
)
|
|
||||||
add_library(Ripple::pbufs ALIAS pbufs)
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
find_package(gRPC 1.23)
|
|
||||||
|
|
||||||
#[=================================[
|
|
||||||
generate protobuf sources for
|
|
||||||
grpc defs and bundle into a
|
|
||||||
static lib
|
|
||||||
#]=================================]
|
|
||||||
set(GRPC_GEN_DIR "${CMAKE_BINARY_DIR}/proto_gen_grpc")
|
|
||||||
file(MAKE_DIRECTORY ${GRPC_GEN_DIR})
|
|
||||||
set(GRPC_PROTO_SRCS)
|
|
||||||
set(GRPC_PROTO_HDRS)
|
|
||||||
set(GRPC_PROTO_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/src/ripple/proto/org")
|
|
||||||
file(GLOB_RECURSE GRPC_DEFINITION_FILES LIST_DIRECTORIES false "${GRPC_PROTO_ROOT}/*.proto")
|
|
||||||
foreach(file ${GRPC_DEFINITION_FILES})
|
|
||||||
get_filename_component(_abs_file ${file} ABSOLUTE)
|
|
||||||
get_filename_component(_abs_dir ${_abs_file} DIRECTORY)
|
|
||||||
get_filename_component(_basename ${file} NAME_WE)
|
|
||||||
get_filename_component(_proto_inc ${GRPC_PROTO_ROOT} DIRECTORY) # updir one level
|
|
||||||
file(RELATIVE_PATH _rel_root_file ${_proto_inc} ${_abs_file})
|
|
||||||
get_filename_component(_rel_root_dir ${_rel_root_file} DIRECTORY)
|
|
||||||
file(RELATIVE_PATH _rel_dir ${CMAKE_CURRENT_SOURCE_DIR} ${_abs_dir})
|
|
||||||
|
|
||||||
set(src_1 "${GRPC_GEN_DIR}/${_rel_root_dir}/${_basename}.grpc.pb.cc")
|
|
||||||
set(src_2 "${GRPC_GEN_DIR}/${_rel_root_dir}/${_basename}.pb.cc")
|
|
||||||
set(hdr_1 "${GRPC_GEN_DIR}/${_rel_root_dir}/${_basename}.grpc.pb.h")
|
|
||||||
set(hdr_2 "${GRPC_GEN_DIR}/${_rel_root_dir}/${_basename}.pb.h")
|
|
||||||
add_custom_command(
|
|
||||||
OUTPUT ${src_1} ${src_2} ${hdr_1} ${hdr_2}
|
|
||||||
COMMAND protobuf::protoc
|
|
||||||
ARGS --grpc_out=${GRPC_GEN_DIR}
|
|
||||||
--cpp_out=${GRPC_GEN_DIR}
|
|
||||||
--plugin=protoc-gen-grpc=$<TARGET_FILE:gRPC::grpc_cpp_plugin>
|
|
||||||
-I ${_proto_inc} -I ${_rel_dir}
|
|
||||||
${_abs_file}
|
|
||||||
DEPENDS ${_abs_file} protobuf::protoc gRPC::grpc_cpp_plugin
|
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
COMMENT "Running gRPC C++ protocol buffer compiler on ${file}"
|
|
||||||
VERBATIM)
|
|
||||||
set_source_files_properties(${src_1} ${src_2} ${hdr_1} ${hdr_2} PROPERTIES GENERATED TRUE)
|
|
||||||
list(APPEND GRPC_PROTO_SRCS ${src_1} ${src_2})
|
|
||||||
list(APPEND GRPC_PROTO_HDRS ${hdr_1} ${hdr_2})
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
add_library(grpc_pbufs STATIC ${GRPC_PROTO_SRCS} ${GRPC_PROTO_HDRS})
|
|
||||||
#target_include_directories(grpc_pbufs PRIVATE src)
|
|
||||||
target_include_directories(grpc_pbufs SYSTEM PUBLIC ${GRPC_GEN_DIR})
|
|
||||||
target_link_libraries(grpc_pbufs
|
|
||||||
"gRPC::grpc++"
|
|
||||||
# libgrpc is missing references.
|
|
||||||
absl::random_random
|
|
||||||
)
|
|
||||||
target_compile_options(grpc_pbufs
|
|
||||||
PRIVATE
|
|
||||||
$<$<BOOL:${MSVC}>:-wd4065>
|
|
||||||
$<$<NOT:$<BOOL:${MSVC}>>:-Wno-deprecated-declarations>
|
|
||||||
PUBLIC
|
|
||||||
$<$<BOOL:${MSVC}>:-wd4996>
|
|
||||||
$<$<BOOL:${XCODE}>:
|
|
||||||
--system-header-prefix="google/protobuf"
|
|
||||||
-Wno-deprecated-dynamic-exception-spec
|
|
||||||
>)
|
|
||||||
add_library(Ripple::grpc_pbufs ALIAS grpc_pbufs)
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
#[=========================================================[
|
|
||||||
This is a CMake script file that is used to write
|
|
||||||
the contents of a file to stdout (using the cmake
|
|
||||||
echo command). The input file is passed via the
|
|
||||||
IN_FILE variable.
|
|
||||||
#]=========================================================]
|
|
||||||
|
|
||||||
if (EXISTS ${IN_FILE})
|
|
||||||
file (READ ${IN_FILE} contents)
|
|
||||||
## only print files that actually have some text in them
|
|
||||||
if (contents MATCHES "[a-z0-9A-Z]+")
|
|
||||||
execute_process(
|
|
||||||
COMMAND
|
|
||||||
${CMAKE_COMMAND} -E echo "${contents}")
|
|
||||||
endif ()
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
405
Builds/Test.py
405
Builds/Test.py
@@ -1,405 +0,0 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
|
|
||||||
# This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
# Copyright (c) 2012 - 2017 Ripple Labs Inc.
|
|
||||||
#
|
|
||||||
# Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
# purpose with or without fee is hereby granted, provided that the above
|
|
||||||
# copyright notice and this permission notice appear in all copies.
|
|
||||||
#
|
|
||||||
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
# ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
|
|
||||||
"""
|
|
||||||
Invocation:
|
|
||||||
|
|
||||||
./Builds/Test.py - builds and tests all configurations
|
|
||||||
|
|
||||||
The build must succeed without shell aliases for this to work.
|
|
||||||
|
|
||||||
To pass flags to cmake, put them at the very end of the command line, after
|
|
||||||
the -- flag - like this:
|
|
||||||
|
|
||||||
./Builds/Test.py -- -j4 # Pass -j4 to cmake --build
|
|
||||||
|
|
||||||
|
|
||||||
Common problems:
|
|
||||||
|
|
||||||
1) Boost not found. Solution: export BOOST_ROOT=[path to boost folder]
|
|
||||||
|
|
||||||
2) OpenSSL not found. Solution: export OPENSSL_ROOT=[path to OpenSSL folder]
|
|
||||||
|
|
||||||
3) cmake is not found. Solution: Be sure cmake directory is on your $PATH
|
|
||||||
|
|
||||||
"""
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
import argparse
|
|
||||||
import itertools
|
|
||||||
import os
|
|
||||||
import platform
|
|
||||||
import re
|
|
||||||
import shutil
|
|
||||||
import sys
|
|
||||||
import subprocess
|
|
||||||
|
|
||||||
|
|
||||||
def powerset(iterable):
|
|
||||||
"""powerset([1,2,3]) --> () (1,) (2,) (3,) (1,2) (1,3) (2,3) (1,2,3)"""
|
|
||||||
s = list(iterable)
|
|
||||||
return itertools.chain.from_iterable(itertools.combinations(s, r) for r in range(len(s) + 1))
|
|
||||||
|
|
||||||
IS_WINDOWS = platform.system().lower() == 'windows'
|
|
||||||
IS_OS_X = platform.system().lower() == 'darwin'
|
|
||||||
|
|
||||||
# CMake
|
|
||||||
if IS_WINDOWS:
|
|
||||||
CMAKE_UNITY_CONFIGS = ['Debug', 'Release']
|
|
||||||
CMAKE_NONUNITY_CONFIGS = ['Debug', 'Release']
|
|
||||||
else:
|
|
||||||
CMAKE_UNITY_CONFIGS = []
|
|
||||||
CMAKE_NONUNITY_CONFIGS = []
|
|
||||||
CMAKE_UNITY_COMBOS = { '' : [['rippled'], CMAKE_UNITY_CONFIGS],
|
|
||||||
'.nounity' : [['rippled'], CMAKE_NONUNITY_CONFIGS] }
|
|
||||||
|
|
||||||
if IS_WINDOWS:
|
|
||||||
CMAKE_DIR_TARGETS = { ('msvc' + unity,) : targets for unity, targets in
|
|
||||||
CMAKE_UNITY_COMBOS.items() }
|
|
||||||
elif IS_OS_X:
|
|
||||||
CMAKE_DIR_TARGETS = { (build + unity,) : targets
|
|
||||||
for build in ['debug', 'release']
|
|
||||||
for unity, targets in CMAKE_UNITY_COMBOS.items() }
|
|
||||||
else:
|
|
||||||
CMAKE_DIR_TARGETS = { (cc + "." + build + unity,) : targets
|
|
||||||
for cc in ['gcc', 'clang']
|
|
||||||
for build in ['debug', 'release', 'coverage', 'profile']
|
|
||||||
for unity, targets in CMAKE_UNITY_COMBOS.items() }
|
|
||||||
|
|
||||||
# list of tuples of all possible options
|
|
||||||
if IS_WINDOWS or IS_OS_X:
|
|
||||||
CMAKE_ALL_GENERATE_OPTIONS = [tuple(x) for x in powerset(['-GNinja', '-Dassert=true'])]
|
|
||||||
else:
|
|
||||||
CMAKE_ALL_GENERATE_OPTIONS = list(set(
|
|
||||||
[tuple(x) for x in powerset(['-GNinja', '-Dstatic=true', '-Dassert=true', '-Dsan=address'])] +
|
|
||||||
[tuple(x) for x in powerset(['-GNinja', '-Dstatic=true', '-Dassert=true', '-Dsan=thread'])]))
|
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(
|
|
||||||
description='Test.py - run ripple tests'
|
|
||||||
)
|
|
||||||
|
|
||||||
parser.add_argument(
|
|
||||||
'--all', '-a',
|
|
||||||
action='store_true',
|
|
||||||
help='Build all configurations.',
|
|
||||||
)
|
|
||||||
|
|
||||||
parser.add_argument(
|
|
||||||
'--keep_going', '-k',
|
|
||||||
action='store_true',
|
|
||||||
help='Keep going after one configuration has failed.',
|
|
||||||
)
|
|
||||||
|
|
||||||
parser.add_argument(
|
|
||||||
'--silent', '-s',
|
|
||||||
action='store_true',
|
|
||||||
help='Silence all messages except errors',
|
|
||||||
)
|
|
||||||
|
|
||||||
parser.add_argument(
|
|
||||||
'--verbose', '-v',
|
|
||||||
action='store_true',
|
|
||||||
help=('Report more information about which commands are executed and the '
|
|
||||||
'results.'),
|
|
||||||
)
|
|
||||||
|
|
||||||
parser.add_argument(
|
|
||||||
'--test', '-t',
|
|
||||||
default='',
|
|
||||||
help='Add a prefix for unit tests',
|
|
||||||
)
|
|
||||||
|
|
||||||
parser.add_argument(
|
|
||||||
'--testjobs',
|
|
||||||
default='0',
|
|
||||||
type=int,
|
|
||||||
help='Run tests in parallel'
|
|
||||||
)
|
|
||||||
|
|
||||||
parser.add_argument(
|
|
||||||
'--ipv6',
|
|
||||||
action='store_true',
|
|
||||||
help='Use IPv6 localhost when running unit tests.',
|
|
||||||
)
|
|
||||||
|
|
||||||
parser.add_argument(
|
|
||||||
'--clean', '-c',
|
|
||||||
action='store_true',
|
|
||||||
help='delete all build artifacts after testing',
|
|
||||||
)
|
|
||||||
|
|
||||||
parser.add_argument(
|
|
||||||
'--quiet', '-q',
|
|
||||||
action='store_true',
|
|
||||||
help='Reduce output where possible (unit tests)',
|
|
||||||
)
|
|
||||||
|
|
||||||
parser.add_argument(
|
|
||||||
'--dir', '-d',
|
|
||||||
default=(),
|
|
||||||
nargs='*',
|
|
||||||
help='Specify one or more CMake dir names. '
|
|
||||||
'Will also be used as -Dtarget=<dir> running cmake.'
|
|
||||||
)
|
|
||||||
|
|
||||||
parser.add_argument(
|
|
||||||
'--target',
|
|
||||||
default=(),
|
|
||||||
nargs='*',
|
|
||||||
help='Specify one or more CMake build targets. '
|
|
||||||
'Will be used as --target <target> running cmake --build.'
|
|
||||||
)
|
|
||||||
|
|
||||||
parser.add_argument(
|
|
||||||
'--config',
|
|
||||||
default=(),
|
|
||||||
nargs='*',
|
|
||||||
help='Specify one or more CMake build configs. '
|
|
||||||
'Will be used as --config <config> running cmake --build.'
|
|
||||||
)
|
|
||||||
|
|
||||||
parser.add_argument(
|
|
||||||
'--generator_option',
|
|
||||||
action='append',
|
|
||||||
help='Specify a CMake generator option. Repeat for multiple options. '
|
|
||||||
'Will be passed to the cmake generator. '
|
|
||||||
'Due to limits of the argument parser, arguments starting with \'-\' '
|
|
||||||
'must be attached to this option. e.g. --generator_option=-GNinja.')
|
|
||||||
|
|
||||||
parser.add_argument(
|
|
||||||
'--build_option',
|
|
||||||
action='append',
|
|
||||||
help='Specify a build option. Repeat for multiple options. '
|
|
||||||
'Will be passed to the build tool via cmake --build. '
|
|
||||||
'Due to limits of the argument parser, arguments starting with \'-\' '
|
|
||||||
'must be attached to this option. e.g. --build_option=-j8.')
|
|
||||||
|
|
||||||
parser.add_argument(
|
|
||||||
'extra_args',
|
|
||||||
default=(),
|
|
||||||
nargs='*',
|
|
||||||
help='Extra arguments are passed through to the tools'
|
|
||||||
)
|
|
||||||
|
|
||||||
ARGS = parser.parse_args()
|
|
||||||
|
|
||||||
def decodeString(line):
|
|
||||||
# Python 2 vs. Python 3
|
|
||||||
if isinstance(line, str):
|
|
||||||
return line
|
|
||||||
else:
|
|
||||||
return line.decode()
|
|
||||||
|
|
||||||
def shell(cmd, args=(), silent=False, cust_env=None):
|
|
||||||
""""Execute a shell command and return the output."""
|
|
||||||
silent = ARGS.silent or silent
|
|
||||||
verbose = not silent and ARGS.verbose
|
|
||||||
if verbose:
|
|
||||||
print('$' + cmd, *args)
|
|
||||||
|
|
||||||
command = (cmd,) + args
|
|
||||||
|
|
||||||
# shell is needed in Windows to find executable in the path
|
|
||||||
process = subprocess.Popen(
|
|
||||||
command,
|
|
||||||
stdin=subprocess.PIPE,
|
|
||||||
stdout=subprocess.PIPE,
|
|
||||||
stderr=subprocess.STDOUT,
|
|
||||||
env=cust_env,
|
|
||||||
shell=IS_WINDOWS)
|
|
||||||
lines = []
|
|
||||||
count = 0
|
|
||||||
# readline returns '' at EOF
|
|
||||||
for line in iter(process.stdout.readline, ''):
|
|
||||||
if process.poll() is None:
|
|
||||||
decoded = decodeString(line)
|
|
||||||
lines.append(decoded)
|
|
||||||
if verbose:
|
|
||||||
print(decoded, end='')
|
|
||||||
elif not silent:
|
|
||||||
count += 1
|
|
||||||
if count >= 80:
|
|
||||||
print()
|
|
||||||
count = 0
|
|
||||||
else:
|
|
||||||
print('.', end='')
|
|
||||||
else:
|
|
||||||
break
|
|
||||||
|
|
||||||
if not verbose and count:
|
|
||||||
print()
|
|
||||||
process.wait()
|
|
||||||
return process.returncode, lines
|
|
||||||
|
|
||||||
def get_cmake_dir(cmake_dir):
|
|
||||||
return os.path.join('build' , 'cmake' , cmake_dir)
|
|
||||||
|
|
||||||
def run_cmake(directory, cmake_dir, args):
|
|
||||||
print('Generating build in', directory, 'with', *args or ('default options',))
|
|
||||||
old_dir = os.getcwd()
|
|
||||||
if not os.path.exists(directory):
|
|
||||||
os.makedirs(directory)
|
|
||||||
os.chdir(directory)
|
|
||||||
if IS_WINDOWS and not any(arg.startswith("-G") for arg in args) and not os.path.exists("CMakeCache.txt"):
|
|
||||||
if '--ninja' in args:
|
|
||||||
args += ( '-GNinja', )
|
|
||||||
else:
|
|
||||||
args += ( '-GVisual Studio 14 2015 Win64', )
|
|
||||||
# hack to extract cmake options/args from the legacy target format
|
|
||||||
if re.search('\.unity', cmake_dir):
|
|
||||||
args += ( '-Dunity=ON', )
|
|
||||||
if re.search('\.nounity', cmake_dir):
|
|
||||||
args += ( '-Dunity=OFF', )
|
|
||||||
if re.search('coverage', cmake_dir):
|
|
||||||
args += ( '-Dcoverage=ON', )
|
|
||||||
if re.search('profile', cmake_dir):
|
|
||||||
args += ( '-Dprofile=ON', )
|
|
||||||
if re.search('debug', cmake_dir):
|
|
||||||
args += ( '-DCMAKE_BUILD_TYPE=Debug', )
|
|
||||||
if re.search('release', cmake_dir):
|
|
||||||
args += ( '-DCMAKE_BUILD_TYPE=Release', )
|
|
||||||
m = re.search('gcc(-[^.]*)', cmake_dir)
|
|
||||||
if m:
|
|
||||||
args += ( '-DCMAKE_C_COMPILER=' + m.group(0),
|
|
||||||
'-DCMAKE_CXX_COMPILER=g++' + m.group(1), )
|
|
||||||
elif re.search('gcc', cmake_dir):
|
|
||||||
args += ( '-DCMAKE_C_COMPILER=gcc', '-DCMAKE_CXX_COMPILER=g++', )
|
|
||||||
m = re.search('clang(-[^.]*)', cmake_dir)
|
|
||||||
if m:
|
|
||||||
args += ( '-DCMAKE_C_COMPILER=' + m.group(0),
|
|
||||||
'-DCMAKE_CXX_COMPILER=clang++' + m.group(1), )
|
|
||||||
elif re.search('clang', cmake_dir):
|
|
||||||
args += ( '-DCMAKE_C_COMPILER=clang', '-DCMAKE_CXX_COMPILER=clang++', )
|
|
||||||
|
|
||||||
args += ( os.path.join('..', '..', '..'), )
|
|
||||||
resultcode, lines = shell('cmake', args)
|
|
||||||
|
|
||||||
if resultcode:
|
|
||||||
print('Generating FAILED:')
|
|
||||||
if not ARGS.verbose:
|
|
||||||
print(*lines, sep='')
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
os.chdir(old_dir)
|
|
||||||
|
|
||||||
def run_cmake_build(directory, target, config, args):
|
|
||||||
print('Building', target, config, 'in', directory, 'with', *args or ('default options',))
|
|
||||||
build_args=('--build', directory)
|
|
||||||
if target:
|
|
||||||
build_args += ('--target', target)
|
|
||||||
if config:
|
|
||||||
build_args += ('--config', config)
|
|
||||||
if args:
|
|
||||||
build_args += ('--',)
|
|
||||||
build_args += tuple(args)
|
|
||||||
resultcode, lines = shell('cmake', build_args)
|
|
||||||
|
|
||||||
if resultcode:
|
|
||||||
print('Build FAILED:')
|
|
||||||
if not ARGS.verbose:
|
|
||||||
print(*lines, sep='')
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
def run_cmake_tests(directory, target, config):
|
|
||||||
failed = []
|
|
||||||
if IS_WINDOWS:
|
|
||||||
target += '.exe'
|
|
||||||
executable = os.path.join(directory, config if config else 'Debug', target)
|
|
||||||
if(not os.path.exists(executable)):
|
|
||||||
executable = os.path.join(directory, target)
|
|
||||||
print('Unit tests for', executable)
|
|
||||||
testflag = '--unittest'
|
|
||||||
quiet = ''
|
|
||||||
testjobs = ''
|
|
||||||
ipv6 = ''
|
|
||||||
if ARGS.test:
|
|
||||||
testflag += ('=' + ARGS.test)
|
|
||||||
if ARGS.quiet:
|
|
||||||
quiet = '-q'
|
|
||||||
if ARGS.ipv6:
|
|
||||||
ipv6 = '--unittest-ipv6'
|
|
||||||
if ARGS.testjobs:
|
|
||||||
testjobs = ('--unittest-jobs=' + str(ARGS.testjobs))
|
|
||||||
resultcode, lines = shell(executable, (testflag, quiet, testjobs, ipv6))
|
|
||||||
|
|
||||||
if resultcode:
|
|
||||||
if not ARGS.verbose:
|
|
||||||
print('ERROR:', *lines, sep='')
|
|
||||||
failed.append([target, 'unittest'])
|
|
||||||
|
|
||||||
return failed
|
|
||||||
|
|
||||||
def main():
|
|
||||||
all_failed = []
|
|
||||||
if ARGS.all:
|
|
||||||
build_dir_targets = CMAKE_DIR_TARGETS
|
|
||||||
generator_options = CMAKE_ALL_GENERATE_OPTIONS
|
|
||||||
else:
|
|
||||||
build_dir_targets = { tuple(ARGS.dir) : [ARGS.target, ARGS.config] }
|
|
||||||
if ARGS.generator_option:
|
|
||||||
generator_options = [tuple(ARGS.generator_option)]
|
|
||||||
else:
|
|
||||||
generator_options = [tuple()]
|
|
||||||
|
|
||||||
if not build_dir_targets:
|
|
||||||
# Let CMake choose the build tool.
|
|
||||||
build_dir_targets = { () : [] }
|
|
||||||
|
|
||||||
if ARGS.build_option:
|
|
||||||
ARGS.build_option = ARGS.build_option + list(ARGS.extra_args)
|
|
||||||
else:
|
|
||||||
ARGS.build_option = list(ARGS.extra_args)
|
|
||||||
|
|
||||||
for args in generator_options:
|
|
||||||
for build_dirs, (build_targets, build_configs) in build_dir_targets.items():
|
|
||||||
if not build_dirs:
|
|
||||||
build_dirs = ('default',)
|
|
||||||
if not build_targets:
|
|
||||||
build_targets = ('rippled',)
|
|
||||||
if not build_configs:
|
|
||||||
build_configs = ('',)
|
|
||||||
for cmake_dir in build_dirs:
|
|
||||||
cmake_full_dir = get_cmake_dir(cmake_dir)
|
|
||||||
run_cmake(cmake_full_dir, cmake_dir, args)
|
|
||||||
|
|
||||||
for target in build_targets:
|
|
||||||
for config in build_configs:
|
|
||||||
run_cmake_build(cmake_full_dir, target, config, ARGS.build_option)
|
|
||||||
failed = run_cmake_tests(cmake_full_dir, target, config)
|
|
||||||
|
|
||||||
if failed:
|
|
||||||
print('FAILED:', *(':'.join(f) for f in failed))
|
|
||||||
if not ARGS.keep_going:
|
|
||||||
sys.exit(1)
|
|
||||||
else:
|
|
||||||
all_failed.extend([decodeString(cmake_dir +
|
|
||||||
"." + target + "." + config), ':'.join(f)]
|
|
||||||
for f in failed)
|
|
||||||
else:
|
|
||||||
print('Success')
|
|
||||||
if ARGS.clean:
|
|
||||||
shutil.rmtree(cmake_full_dir)
|
|
||||||
|
|
||||||
if all_failed:
|
|
||||||
if len(all_failed) > 1:
|
|
||||||
print()
|
|
||||||
print('FAILED:', *(':'.join(f) for f in all_failed))
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
main()
|
|
||||||
sys.exit(0)
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
[Build instructions are currently located in `BUILD.md`](../../BUILD.md)
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
{
|
|
||||||
// See https://go.microsoft.com//fwlink//?linkid=834763 for more information about this file.
|
|
||||||
"configurations": [
|
|
||||||
{
|
|
||||||
"name": "x64-Debug",
|
|
||||||
"generator": "Visual Studio 16 2019",
|
|
||||||
"configurationType": "Debug",
|
|
||||||
"inheritEnvironments": [ "msvc_x64_x64" ],
|
|
||||||
"buildRoot": "${thisFileDir}\\build\\${name}",
|
|
||||||
"cmakeCommandArgs": "",
|
|
||||||
"buildCommandArgs": "-v:minimal",
|
|
||||||
"ctestCommandArgs": "",
|
|
||||||
"variables": [
|
|
||||||
{
|
|
||||||
"name": "BOOST_ROOT",
|
|
||||||
"value": "C:\\lib\\boost"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "OPENSSL_ROOT",
|
|
||||||
"value": "C:\\lib\\OpenSSL-Win64"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "x64-Release",
|
|
||||||
"generator": "Visual Studio 16 2019",
|
|
||||||
"configurationType": "Release",
|
|
||||||
"inheritEnvironments": [ "msvc_x64_x64" ],
|
|
||||||
"buildRoot": "${thisFileDir}\\build\\${name}",
|
|
||||||
"cmakeCommandArgs": "",
|
|
||||||
"buildCommandArgs": "-v:minimal",
|
|
||||||
"ctestCommandArgs": "",
|
|
||||||
"variables": [
|
|
||||||
{
|
|
||||||
"name": "BOOST_ROOT",
|
|
||||||
"value": "C:\\lib\\boost"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "OPENSSL_ROOT",
|
|
||||||
"value": "C:\\lib\\OpenSSL-Win64"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,263 +0,0 @@
|
|||||||
# Visual Studio 2019 Build Instructions
|
|
||||||
|
|
||||||
## Important
|
|
||||||
|
|
||||||
We do not recommend Windows for rippled production use at this time. Currently,
|
|
||||||
the Ubuntu platform has received the highest level of quality assurance,
|
|
||||||
testing, and support. Additionally, 32-bit Windows versions are not supported.
|
|
||||||
|
|
||||||
## Prerequisites
|
|
||||||
|
|
||||||
To clone the source code repository, create branches for inspection or
|
|
||||||
modification, build rippled under Visual Studio, and run the unit tests you will
|
|
||||||
need these software components
|
|
||||||
|
|
||||||
| Component | Minimum Recommended Version |
|
|
||||||
|-----------|-----------------------|
|
|
||||||
| [Visual Studio 2019](README.md#install-visual-studio-2019)| 15.5.4 |
|
|
||||||
| [Git for Windows](README.md#install-git-for-windows)| 2.16.1 |
|
|
||||||
| [OpenSSL Library](README.md#install-openssl) | 1.1.1L |
|
|
||||||
| [Boost library](README.md#build-boost) | 1.70.0 |
|
|
||||||
| [CMake for Windows](README.md#optional-install-cmake-for-windows)* | 3.12 |
|
|
||||||
|
|
||||||
\* Only needed if not using the integrated CMake in VS 2019 and prefer generating dedicated project/solution files.
|
|
||||||
|
|
||||||
## Install Software
|
|
||||||
|
|
||||||
### Install Visual Studio 2019
|
|
||||||
|
|
||||||
If not already installed on your system, download your choice of installer from
|
|
||||||
the [Visual Studio 2019
|
|
||||||
Download](https://www.visualstudio.com/downloads/download-visual-studio-vs)
|
|
||||||
page, run the installer, and follow the directions. **You may need to choose the
|
|
||||||
`Desktop development with C++` workload to install all necessary C++ features.**
|
|
||||||
|
|
||||||
Any version of Visual Studio 2019 may be used to build rippled. The **Visual
|
|
||||||
Studio 2019 Community** edition is available free of charge (see [the product
|
|
||||||
page](https://www.visualstudio.com/products/visual-studio-community-vs) for
|
|
||||||
licensing details), while paid editions may be used for an initial free-trial
|
|
||||||
period.
|
|
||||||
|
|
||||||
### Install Git for Windows
|
|
||||||
|
|
||||||
Git is a distributed revision control system. The Windows version also provides
|
|
||||||
the bash shell and many Windows versions of Unix commands. While there are other
|
|
||||||
varieties of Git (such as TortoiseGit, which has a native Windows interface and
|
|
||||||
integrates with the Explorer shell), we recommend installing [Git for
|
|
||||||
Windows](https://git-scm.com/) since it provides a Unix-like command line
|
|
||||||
environment useful for running shell scripts. Use of the bash shell under
|
|
||||||
Windows is mandatory for running the unit tests.
|
|
||||||
|
|
||||||
### Install OpenSSL
|
|
||||||
|
|
||||||
[Download the latest version of
|
|
||||||
OpenSSL.](http://slproweb.com/products/Win32OpenSSL.html) There will
|
|
||||||
several `Win64` bit variants available, you want the non-light
|
|
||||||
`v1.1` line. As of this writing, you **should** select
|
|
||||||
|
|
||||||
* Win64 OpenSSL v1.1.1q
|
|
||||||
|
|
||||||
and should **not** select
|
|
||||||
|
|
||||||
* Anything with "Win32" in the name
|
|
||||||
* Anything with "light" in the name
|
|
||||||
* Anything with "EXPERIMENTAL" in the name
|
|
||||||
* Anything in the 3.0 line - rippled won't currently build with this version.
|
|
||||||
|
|
||||||
Run the installer, and choose an appropriate location for your OpenSSL
|
|
||||||
installation. In this guide we use `C:\lib\OpenSSL-Win64` as the destination
|
|
||||||
location.
|
|
||||||
|
|
||||||
You may be informed on running the installer that "Visual C++ 2008
|
|
||||||
Redistributables" must first be installed first. If so, download it from the
|
|
||||||
[same page](http://slproweb.com/products/Win32OpenSSL.html), again making sure
|
|
||||||
to get the correct 32-/64-bit variant.
|
|
||||||
|
|
||||||
* NOTE: Since rippled links statically to OpenSSL, it does not matter where the
|
|
||||||
OpenSSL .DLL files are placed, or what version they are. rippled does not use
|
|
||||||
or require any external .DLL files to run other than the standard operating
|
|
||||||
system ones.
|
|
||||||
|
|
||||||
### Build Boost
|
|
||||||
|
|
||||||
Boost 1.70 or later is required.
|
|
||||||
|
|
||||||
[Download boost](http://www.boost.org/users/download/) and unpack it
|
|
||||||
to `c:\lib`. As of this writing, the most recent version of boost is 1.80.0,
|
|
||||||
which will unpack into a directory named `boost_1_80_0`. We recommended either
|
|
||||||
renaming this directory to `boost`, or creating a junction link `mklink /J boost
|
|
||||||
boost_1_80_0`, so that you can more easily switch between versions.
|
|
||||||
|
|
||||||
Next, open **Developer Command Prompt** and type the following commands
|
|
||||||
|
|
||||||
```powershell
|
|
||||||
cd C:\lib\boost
|
|
||||||
bootstrap
|
|
||||||
```
|
|
||||||
|
|
||||||
The rippled application is linked statically to the standard runtimes and
|
|
||||||
external dependencies on Windows, to ensure that the behavior of the executable
|
|
||||||
is not affected by changes in outside files. Therefore, it is necessary to build
|
|
||||||
the required boost static libraries using this command:
|
|
||||||
|
|
||||||
```powershell
|
|
||||||
b2 -j<Num Parallel> --toolset=msvc-14.2 address-model=64 architecture=x86 link=static threading=multi runtime-link=shared,static stage
|
|
||||||
```
|
|
||||||
|
|
||||||
where you should replace `<Num Parallel>` with the number of parallel
|
|
||||||
invocations to use build, e.g. `bjam -j8 ...` would use up to 8 concurrent build
|
|
||||||
shell commands for the build.
|
|
||||||
|
|
||||||
Building the boost libraries may take considerable time. When the build process
|
|
||||||
is completed, take note of both the reported compiler include paths and linker
|
|
||||||
library paths as they will be required later.
|
|
||||||
|
|
||||||
### (Optional) Install CMake for Windows
|
|
||||||
|
|
||||||
[CMake](http://cmake.org) is a cross platform build system generator. Visual
|
|
||||||
Studio 2019 includes an integrated version of CMake that avoids having to
|
|
||||||
manually run CMake, but it is undergoing continuous improvement. Users that
|
|
||||||
prefer to use standard Visual Studio project and solution files need to install
|
|
||||||
a dedicated version of CMake to generate them. The latest version can be found
|
|
||||||
at the [CMake download site](https://cmake.org/download/). It is recommended you
|
|
||||||
select the install option to add CMake to your path.
|
|
||||||
|
|
||||||
## Clone the rippled repository
|
|
||||||
|
|
||||||
If you are familiar with cloning github repositories, just follow your normal
|
|
||||||
process and clone `git@github.com:ripple/rippled.git`. Otherwise follow this
|
|
||||||
section for instructions.
|
|
||||||
|
|
||||||
1. If you don't have a github account, sign up for one at
|
|
||||||
[github.com](https://github.com/).
|
|
||||||
2. Make sure you have Github ssh keys. For help see
|
|
||||||
[generating-ssh-keys](https://help.github.com/articles/generating-ssh-keys).
|
|
||||||
|
|
||||||
Open the "Git Bash" shell that was installed with "Git for Windows" in the step
|
|
||||||
above. Navigate to the directory where you want to clone rippled (git bash uses
|
|
||||||
`/c` for windows's `C:` and forward slash where windows uses backslash, so
|
|
||||||
`C:\Users\joe\projs` would be `/c/Users/joe/projs` in git bash). Now clone the
|
|
||||||
repository and optionally switch to the *master* branch. Type the following at
|
|
||||||
the bash prompt:
|
|
||||||
|
|
||||||
```powershell
|
|
||||||
git clone git@github.com:XRPLF/rippled.git
|
|
||||||
cd rippled
|
|
||||||
```
|
|
||||||
If you receive an error about not having the "correct access rights" make sure
|
|
||||||
you have Github ssh keys, as described above.
|
|
||||||
|
|
||||||
For a stable release, choose the `master` branch or one of the tagged releases
|
|
||||||
listed on [rippled's GitHub page](https://github.com/ripple/rippled/releases).
|
|
||||||
|
|
||||||
```
|
|
||||||
git checkout master
|
|
||||||
```
|
|
||||||
|
|
||||||
To test the latest release candidate, choose the `release` branch.
|
|
||||||
|
|
||||||
```
|
|
||||||
git checkout release
|
|
||||||
```
|
|
||||||
|
|
||||||
If you are doing development work and want the latest set of beta features,
|
|
||||||
you can consider using the `develop` branch instead.
|
|
||||||
|
|
||||||
```
|
|
||||||
git checkout develop
|
|
||||||
```
|
|
||||||
|
|
||||||
# Build using Visual Studio integrated CMake
|
|
||||||
|
|
||||||
In Visual Studio 2017, Microsoft added [integrated IDE support for
|
|
||||||
cmake](https://blogs.msdn.microsoft.com/vcblog/2016/10/05/cmake-support-in-visual-studio/).
|
|
||||||
To begin, simply:
|
|
||||||
|
|
||||||
1. Launch Visual Studio and choose **File | Open | Folder**, navigating to the
|
|
||||||
cloned rippled folder.
|
|
||||||
2. Right-click on `CMakeLists.txt` in the **Solution Explorer - Folder View** to
|
|
||||||
generate a `CMakeSettings.json` file. A sample settings file is provided
|
|
||||||
[here](/Builds/VisualStudio2019/CMakeSettings-example.json). Customize the
|
|
||||||
settings for `BOOST_ROOT`, `OPENSSL_ROOT` to match the install paths if they
|
|
||||||
differ from those in the file.
|
|
||||||
4. Select either the `x64-Release` or `x64-Debug` configuration from the
|
|
||||||
**Project Settings** drop-down. This should invoke the built-in CMake project
|
|
||||||
generator. If not, you can right-click on the `CMakeLists.txt` file and
|
|
||||||
choose **Configure rippled**.
|
|
||||||
5. Select the `rippled.exe`
|
|
||||||
option in the **Select Startup Item** drop-down. This will be the target
|
|
||||||
built when you press F7. Alternatively, you can choose a target to build from
|
|
||||||
the top-level **CMake | Build** menu. Note that at this time, there are other
|
|
||||||
targets listed that come from third party visual studio files embedded in the
|
|
||||||
rippled repo, e.g. `datagen.vcxproj`. Please ignore them.
|
|
||||||
|
|
||||||
For details on configuring debugging sessions or further customization of CMake,
|
|
||||||
please refer to the [CMake tools for VS
|
|
||||||
documentation](https://docs.microsoft.com/en-us/cpp/ide/cmake-tools-for-visual-cpp).
|
|
||||||
|
|
||||||
If using the provided `CMakeSettings.json` file, the executable will be in
|
|
||||||
```
|
|
||||||
.\build\x64-Release\Release\rippled.exe
|
|
||||||
```
|
|
||||||
or
|
|
||||||
```
|
|
||||||
.\build\x64-Debug\Debug\rippled.exe
|
|
||||||
```
|
|
||||||
These paths are relative to your cloned git repository.
|
|
||||||
|
|
||||||
# Build using stand-alone CMake
|
|
||||||
|
|
||||||
This requires having installed [CMake for
|
|
||||||
Windows](README.md#optional-install-cmake-for-windows). We do not recommend
|
|
||||||
mixing this method with the integrated CMake method for the same repository
|
|
||||||
clone. Assuming you included the cmake executable folder in your path,
|
|
||||||
execute the following commands within your `rippled` cloned repository:
|
|
||||||
|
|
||||||
```
|
|
||||||
mkdir build\cmake
|
|
||||||
cd build\cmake
|
|
||||||
cmake ..\.. -G"Visual Studio 16 2019" -Ax64 -DBOOST_ROOT="C:\lib\boost" -DOPENSSL_ROOT="C:\lib\OpenSSL-Win64" -DCMAKE_GENERATOR_TOOLSET=host=x64
|
|
||||||
```
|
|
||||||
Now launch Visual Studio 2019 and select **File | Open | Project/Solution**.
|
|
||||||
Navigate to the `build\cmake` folder created above and select the `rippled.sln`
|
|
||||||
file. You can then choose whether to build the `Debug` or `Release` solution
|
|
||||||
configuration.
|
|
||||||
|
|
||||||
The executable will be in
|
|
||||||
```
|
|
||||||
.\build\cmake\Release\rippled.exe
|
|
||||||
```
|
|
||||||
or
|
|
||||||
```
|
|
||||||
.\build\cmake\Debug\rippled.exe
|
|
||||||
```
|
|
||||||
These paths are relative to your cloned git repository.
|
|
||||||
|
|
||||||
# Unity/No-Unity Builds
|
|
||||||
|
|
||||||
The rippled build system defaults to using
|
|
||||||
[unity source files](http://onqtam.com/programming/2018-07-07-unity-builds/)
|
|
||||||
to improve build times. In some cases it might be desirable to disable the
|
|
||||||
unity build and compile individual translation units. Here is how you can
|
|
||||||
switch to a "no-unity" build configuration:
|
|
||||||
|
|
||||||
## Visual Studio Integrated CMake
|
|
||||||
|
|
||||||
Edit your `CmakeSettings.json` (described above) by adding `-Dunity=OFF`
|
|
||||||
to the `cmakeCommandArgs` entry for each build configuration.
|
|
||||||
|
|
||||||
## Standalone CMake Builds
|
|
||||||
|
|
||||||
When running cmake to generate the Visual Studio project files, add
|
|
||||||
`-Dunity=OFF` to the command line options passed to cmake.
|
|
||||||
|
|
||||||
**Note:** you will need to re-run the cmake configuration step anytime you
|
|
||||||
want to switch between unity/no-unity builds.
|
|
||||||
|
|
||||||
# Unit Test (Recommended)
|
|
||||||
|
|
||||||
`rippled` builds a set of unit tests into the server executable. To run these
|
|
||||||
unit tests after building, pass the `--unittest` option to the compiled
|
|
||||||
`rippled` executable. The executable will exit with summary info after running
|
|
||||||
the unit tests.
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
num_procs=$(lscpu -p | grep -v '^#' | sort -u -t, -k 2,4 | wc -l) # number of physical cores
|
|
||||||
|
|
||||||
path=$(cd $(dirname $0) && pwd)
|
|
||||||
cd $(dirname $path)
|
|
||||||
${path}/Test.py -a -c --testjobs=${num_procs} -- -j${num_procs}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
|
|
||||||
# rippled Packaging and Containers
|
|
||||||
|
|
||||||
This folder contains docker container definitions and configuration
|
|
||||||
files to support building rpm and deb packages of rippled. The container
|
|
||||||
definitions include some additional software/packages that are used
|
|
||||||
for general build/test CI workflows of rippled but are not explicitly
|
|
||||||
needed for the package building workflow.
|
|
||||||
|
|
||||||
## CMake Targets
|
|
||||||
|
|
||||||
If you have docker installed on your local system, then the main
|
|
||||||
CMake file will enable several targets related to building packages:
|
|
||||||
`rpm_container`, `rpm`, `dpkg_container`, and `dpkg`. The package targets
|
|
||||||
depend on the container targets and will trigger a build of those first.
|
|
||||||
The container builds can take several dozen minutes to complete (depending
|
|
||||||
on hardware specs), so quick build cycles are not possible currently. As
|
|
||||||
such, these targets are often best suited to CI/automated build systems.
|
|
||||||
|
|
||||||
The package build can be invoked like any other cmake target from the
|
|
||||||
rippled root folder:
|
|
||||||
```
|
|
||||||
mkdir -p build/pkg && cd build/pkg
|
|
||||||
cmake -Dpackages_only=ON ../..
|
|
||||||
cmake --build . --target rpm
|
|
||||||
```
|
|
||||||
Upon successful completion, the generated package files will be in
|
|
||||||
the `build/pkg/packages` directory. For deb packages, simply replace
|
|
||||||
`rpm` with `dpkg` in the build command above.
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
FROM rippleci/centos:7
|
|
||||||
ARG GIT_COMMIT=unknown
|
|
||||||
ARG CI_USE=false
|
|
||||||
|
|
||||||
LABEL git-commit=$GIT_COMMIT
|
|
||||||
|
|
||||||
COPY centos-builder/centos_setup.sh /tmp/
|
|
||||||
COPY shared/install_cmake.sh /tmp/
|
|
||||||
RUN chmod +x /tmp/centos_setup.sh && \
|
|
||||||
chmod +x /tmp/install_cmake.sh
|
|
||||||
RUN /tmp/centos_setup.sh
|
|
||||||
|
|
||||||
RUN /tmp/install_cmake.sh 3.16.3 /opt/local/cmake-3.16
|
|
||||||
RUN ln -s /opt/local/cmake-3.16 /opt/local/cmake
|
|
||||||
ENV PATH="/opt/local/cmake/bin:$PATH"
|
|
||||||
# TODO: Install latest CMake for testing
|
|
||||||
RUN if [ "${CI_USE}" = true ] ; then /tmp/install_cmake.sh 3.16.3 /opt/local/cmake-3.16; fi
|
|
||||||
|
|
||||||
RUN mkdir -m 777 -p /opt/rippled_bld/pkg
|
|
||||||
|
|
||||||
WORKDIR /opt/rippled_bld/pkg
|
|
||||||
RUN mkdir -m 777 ./rpmbuild
|
|
||||||
RUN mkdir -m 777 ./rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
|
|
||||||
|
|
||||||
COPY packaging/rpm/build_rpm.sh ./
|
|
||||||
CMD ./build_rpm.sh
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -ex
|
|
||||||
|
|
||||||
source /etc/os-release
|
|
||||||
|
|
||||||
yum -y upgrade
|
|
||||||
yum -y update
|
|
||||||
yum -y install epel-release centos-release-scl
|
|
||||||
yum -y install \
|
|
||||||
wget curl time gcc-c++ yum-utils autoconf automake pkgconfig libtool \
|
|
||||||
libstdc++-static rpm-build gnupg which make cmake \
|
|
||||||
devtoolset-11 devtoolset-11-gdb devtoolset-11-binutils devtoolset-11-libstdc++-devel \
|
|
||||||
devtoolset-11-libasan-devel devtoolset-11-libtsan-devel devtoolset-11-libubsan-devel devtoolset-11-liblsan-devel \
|
|
||||||
flex flex-devel bison bison-devel parallel \
|
|
||||||
ncurses ncurses-devel ncurses-libs graphviz graphviz-devel \
|
|
||||||
lzip p7zip bzip2 bzip2-devel lzma-sdk lzma-sdk-devel xz-devel \
|
|
||||||
zlib zlib-devel zlib-static texinfo openssl openssl-static \
|
|
||||||
jemalloc jemalloc-devel \
|
|
||||||
libicu-devel htop \
|
|
||||||
rh-python38 \
|
|
||||||
ninja-build git svn \
|
|
||||||
swig perl-Digest-MD5
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
set -ex
|
|
||||||
pkgtype=$1
|
|
||||||
if [ "${pkgtype}" = "rpm" ] ; then
|
|
||||||
container_name="${RPM_CONTAINER_NAME}"
|
|
||||||
elif [ "${pkgtype}" = "dpkg" ] ; then
|
|
||||||
container_name="${DPKG_CONTAINER_NAME}"
|
|
||||||
else
|
|
||||||
echo "invalid package type"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if docker pull "${ARTIFACTORY_HUB}/${container_name}:latest_${CI_COMMIT_REF_SLUG}"; then
|
|
||||||
echo "found container for latest - using as cache."
|
|
||||||
docker tag \
|
|
||||||
"${ARTIFACTORY_HUB}/${container_name}:latest_${CI_COMMIT_REF_SLUG}" \
|
|
||||||
"${container_name}:latest_${CI_COMMIT_REF_SLUG}"
|
|
||||||
CMAKE_EXTRA="-D${pkgtype}_cache_from=${container_name}:latest_${CI_COMMIT_REF_SLUG}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
cmake --version
|
|
||||||
test -d build && rm -rf build
|
|
||||||
mkdir -p build/container && cd build/container
|
|
||||||
eval time \
|
|
||||||
cmake -Dpackages_only=ON -DCMAKE_VERBOSE_MAKEFILE=ON ${CMAKE_EXTRA} \
|
|
||||||
-G Ninja ../..
|
|
||||||
time cmake --build . --target "${pkgtype}_container" -- -v
|
|
||||||
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
set -ex
|
|
||||||
pkgtype=$1
|
|
||||||
if [ "${pkgtype}" = "rpm" ] ; then
|
|
||||||
container_name="${RPM_CONTAINER_FULLNAME}"
|
|
||||||
container_tag="${RPM_CONTAINER_TAG}"
|
|
||||||
elif [ "${pkgtype}" = "dpkg" ] ; then
|
|
||||||
container_name="${DPKG_CONTAINER_FULLNAME}"
|
|
||||||
container_tag="${DPKG_CONTAINER_TAG}"
|
|
||||||
else
|
|
||||||
echo "invalid package type"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
time docker pull "${ARTIFACTORY_HUB}/${container_name}"
|
|
||||||
docker tag \
|
|
||||||
"${ARTIFACTORY_HUB}/${container_name}" \
|
|
||||||
"${container_name}"
|
|
||||||
docker images
|
|
||||||
test -d build && rm -rf build
|
|
||||||
mkdir -p build/${pkgtype} && cd build/${pkgtype}
|
|
||||||
time cmake \
|
|
||||||
-Dpackages_only=ON \
|
|
||||||
-Dcontainer_label="${container_tag}" \
|
|
||||||
-Dhave_package_container=ON \
|
|
||||||
-DCMAKE_VERBOSE_MAKEFILE=ON \
|
|
||||||
-Dunity=OFF \
|
|
||||||
-G Ninja ../..
|
|
||||||
time cmake --build . --target ${pkgtype} -- -v
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
set -e
|
|
||||||
# used as a before/setup script for docker steps in gitlab-ci
|
|
||||||
# expects to be run in standard alpine/dind image
|
|
||||||
echo $(nproc)
|
|
||||||
docker login -u rippled \
|
|
||||||
-p ${ARTIFACTORY_DEPLOY_KEY_RIPPLED} ${ARTIFACTORY_HUB}
|
|
||||||
apk add --update py-pip
|
|
||||||
apk add \
|
|
||||||
bash util-linux coreutils binutils grep \
|
|
||||||
make ninja cmake build-base gcc g++ abuild git \
|
|
||||||
python3 python3-dev
|
|
||||||
pip3 install awscli
|
|
||||||
# list curdir contents to build log:
|
|
||||||
ls -la
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
case ${CI_COMMIT_REF_NAME} in
|
|
||||||
develop)
|
|
||||||
export COMPONENT="nightly"
|
|
||||||
;;
|
|
||||||
release)
|
|
||||||
export COMPONENT="unstable"
|
|
||||||
;;
|
|
||||||
master)
|
|
||||||
export COMPONENT="stable"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
export COMPONENT="_unknown_"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
@@ -1,646 +0,0 @@
|
|||||||
#########################################################################
|
|
||||||
## ##
|
|
||||||
## gitlab CI defintition for rippled build containers and distro ##
|
|
||||||
## packages (rpm and dpkg). ##
|
|
||||||
## ##
|
|
||||||
#########################################################################
|
|
||||||
|
|
||||||
# NOTE: these are sensible defaults for Ripple pipelines. These
|
|
||||||
# can be overridden by project or group variables as needed.
|
|
||||||
variables:
|
|
||||||
# these containers are built manually using the rippled
|
|
||||||
# cmake build (container targets) and tagged/pushed so they
|
|
||||||
# can be used here
|
|
||||||
RPM_CONTAINER_TAG: "2023-02-13"
|
|
||||||
RPM_CONTAINER_NAME: "rippled-rpm-builder"
|
|
||||||
RPM_CONTAINER_FULLNAME: "${RPM_CONTAINER_NAME}:${RPM_CONTAINER_TAG}"
|
|
||||||
DPKG_CONTAINER_TAG: "2023-03-20"
|
|
||||||
DPKG_CONTAINER_NAME: "rippled-dpkg-builder"
|
|
||||||
DPKG_CONTAINER_FULLNAME: "${DPKG_CONTAINER_NAME}:${DPKG_CONTAINER_TAG}"
|
|
||||||
ARTIFACTORY_HOST: "artifactory.ops.ripple.com"
|
|
||||||
ARTIFACTORY_HUB: "${ARTIFACTORY_HOST}:6555"
|
|
||||||
GIT_SIGN_PUBKEYS_URL: "https://gitlab.ops.ripple.com/xrpledger/rippled-packages/snippets/49/raw"
|
|
||||||
PUBLIC_REPO_ROOT: "https://repos.ripple.com/repos"
|
|
||||||
# also need to define this variable ONLY for the primary
|
|
||||||
# build/publish pipeline on the mainline repo:
|
|
||||||
# IS_PRIMARY_REPO = "true"
|
|
||||||
|
|
||||||
stages:
|
|
||||||
- build_packages
|
|
||||||
- sign_packages
|
|
||||||
- smoketest
|
|
||||||
- verify_sig
|
|
||||||
- tag_images
|
|
||||||
- push_to_test
|
|
||||||
- verify_from_test
|
|
||||||
- wait_approval_prod
|
|
||||||
- push_to_prod
|
|
||||||
- verify_from_prod
|
|
||||||
- get_final_hashes
|
|
||||||
- build_containers
|
|
||||||
|
|
||||||
.dind_template: &dind_param
|
|
||||||
before_script:
|
|
||||||
- . ./Builds/containers/gitlab-ci/docker_alpine_setup.sh
|
|
||||||
variables:
|
|
||||||
docker_driver: overlay2
|
|
||||||
DOCKER_TLS_CERTDIR: ""
|
|
||||||
image:
|
|
||||||
name: artifactory.ops.ripple.com/docker:latest
|
|
||||||
services:
|
|
||||||
# workaround for TLS issues - consider going back
|
|
||||||
# back to unversioned `dind` when issues are resolved
|
|
||||||
- name: artifactory.ops.ripple.com/docker:stable-dind
|
|
||||||
alias: docker
|
|
||||||
tags:
|
|
||||||
- 4xlarge
|
|
||||||
|
|
||||||
.only_primary_template: &only_primary
|
|
||||||
only:
|
|
||||||
refs:
|
|
||||||
- /^(master|release|develop)$/
|
|
||||||
variables:
|
|
||||||
- $IS_PRIMARY_REPO == "true"
|
|
||||||
|
|
||||||
.smoketest_local_template: &run_local_smoketest
|
|
||||||
tags:
|
|
||||||
- xlarge
|
|
||||||
script:
|
|
||||||
- . ./Builds/containers/gitlab-ci/smoketest.sh local
|
|
||||||
|
|
||||||
.smoketest_repo_template: &run_repo_smoketest
|
|
||||||
tags:
|
|
||||||
- xlarge
|
|
||||||
script:
|
|
||||||
- . ./Builds/containers/gitlab-ci/smoketest.sh repo
|
|
||||||
|
|
||||||
#########################################################################
|
|
||||||
## ##
|
|
||||||
## stage: build_packages ##
|
|
||||||
## ##
|
|
||||||
## build packages using containers from previous stage. ##
|
|
||||||
## ##
|
|
||||||
#########################################################################
|
|
||||||
|
|
||||||
rpm_build:
|
|
||||||
timeout: "1h 30m"
|
|
||||||
stage: build_packages
|
|
||||||
<<: *dind_param
|
|
||||||
artifacts:
|
|
||||||
paths:
|
|
||||||
- build/rpm/packages/
|
|
||||||
script:
|
|
||||||
- . ./Builds/containers/gitlab-ci/build_package.sh rpm
|
|
||||||
|
|
||||||
dpkg_build:
|
|
||||||
timeout: "1h 30m"
|
|
||||||
stage: build_packages
|
|
||||||
<<: *dind_param
|
|
||||||
artifacts:
|
|
||||||
paths:
|
|
||||||
- build/dpkg/packages/
|
|
||||||
script:
|
|
||||||
- . ./Builds/containers/gitlab-ci/build_package.sh dpkg
|
|
||||||
|
|
||||||
#########################################################################
|
|
||||||
## ##
|
|
||||||
## stage: sign_packages ##
|
|
||||||
## ##
|
|
||||||
## build packages using containers from previous stage. ##
|
|
||||||
## ##
|
|
||||||
#########################################################################
|
|
||||||
|
|
||||||
rpm_sign:
|
|
||||||
stage: sign_packages
|
|
||||||
dependencies:
|
|
||||||
- rpm_build
|
|
||||||
image:
|
|
||||||
name: artifactory.ops.ripple.com/centos:7
|
|
||||||
<<: *only_primary
|
|
||||||
before_script:
|
|
||||||
- |
|
|
||||||
# Make sure GnuPG is installed
|
|
||||||
yum -y install gnupg rpm-sign
|
|
||||||
# checking GPG signing support
|
|
||||||
if [ -n "$GPG_KEY_B64" ]; then
|
|
||||||
echo "$GPG_KEY_B64"| base64 -d | gpg --batch --no-tty --allow-secret-key-import --import -
|
|
||||||
unset GPG_KEY_B64
|
|
||||||
export GPG_PASSPHRASE=$(echo $GPG_KEY_PASS_B64 | base64 -di)
|
|
||||||
unset GPG_KEY_PASS_B64
|
|
||||||
export GPG_KEYID=$(gpg --with-colon --list-secret-keys | head -n1 | cut -d : -f 5)
|
|
||||||
else
|
|
||||||
echo -e "\033[0;31m****** GPG signing disabled ******\033[0m"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
artifacts:
|
|
||||||
paths:
|
|
||||||
- build/rpm/packages/
|
|
||||||
script:
|
|
||||||
- ls -alh build/rpm/packages
|
|
||||||
- . ./Builds/containers/gitlab-ci/sign_package.sh rpm
|
|
||||||
|
|
||||||
dpkg_sign:
|
|
||||||
stage: sign_packages
|
|
||||||
dependencies:
|
|
||||||
- dpkg_build
|
|
||||||
image:
|
|
||||||
name: artifactory.ops.ripple.com/ubuntu:18.04
|
|
||||||
<<: *only_primary
|
|
||||||
before_script:
|
|
||||||
- |
|
|
||||||
# make sure we have GnuPG
|
|
||||||
apt update
|
|
||||||
apt install -y gpg dpkg-sig
|
|
||||||
# checking GPG signing support
|
|
||||||
if [ -n "$GPG_KEY_B64" ]; then
|
|
||||||
echo "$GPG_KEY_B64"| base64 -d | gpg --batch --no-tty --allow-secret-key-import --import -
|
|
||||||
unset GPG_KEY_B64
|
|
||||||
export GPG_PASSPHRASE=$(echo $GPG_KEY_PASS_B64 | base64 -di)
|
|
||||||
unset GPG_KEY_PASS_B64
|
|
||||||
export GPG_KEYID=$(gpg --with-colon --list-secret-keys | head -n1 | cut -d : -f 5)
|
|
||||||
else
|
|
||||||
echo -e "\033[0;31m****** GPG signing disabled ******\033[0m"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
artifacts:
|
|
||||||
paths:
|
|
||||||
- build/dpkg/packages/
|
|
||||||
script:
|
|
||||||
- ls -alh build/dpkg/packages
|
|
||||||
- . ./Builds/containers/gitlab-ci/sign_package.sh dpkg
|
|
||||||
|
|
||||||
#########################################################################
|
|
||||||
## ##
|
|
||||||
## stage: smoketest ##
|
|
||||||
## ##
|
|
||||||
## install unsigned packages from previous step and run unit tests. ##
|
|
||||||
## ##
|
|
||||||
#########################################################################
|
|
||||||
|
|
||||||
centos_7_smoketest:
|
|
||||||
stage: smoketest
|
|
||||||
dependencies:
|
|
||||||
- rpm_build
|
|
||||||
image:
|
|
||||||
name: artifactory.ops.ripple.com/centos:7
|
|
||||||
<<: *run_local_smoketest
|
|
||||||
|
|
||||||
rocky_8_smoketest:
|
|
||||||
stage: smoketest
|
|
||||||
dependencies:
|
|
||||||
- rpm_build
|
|
||||||
image:
|
|
||||||
name: artifactory.ops.ripple.com/rockylinux/rockylinux:8
|
|
||||||
<<: *run_local_smoketest
|
|
||||||
|
|
||||||
fedora_37_smoketest:
|
|
||||||
stage: smoketest
|
|
||||||
dependencies:
|
|
||||||
- rpm_build
|
|
||||||
image:
|
|
||||||
name: artifactory.ops.ripple.com/fedora:37
|
|
||||||
<<: *run_local_smoketest
|
|
||||||
|
|
||||||
fedora_38_smoketest:
|
|
||||||
stage: smoketest
|
|
||||||
dependencies:
|
|
||||||
- rpm_build
|
|
||||||
image:
|
|
||||||
name: artifactory.ops.ripple.com/fedora:38
|
|
||||||
<<: *run_local_smoketest
|
|
||||||
|
|
||||||
ubuntu_18_smoketest:
|
|
||||||
stage: smoketest
|
|
||||||
dependencies:
|
|
||||||
- dpkg_build
|
|
||||||
image:
|
|
||||||
name: artifactory.ops.ripple.com/ubuntu:18.04
|
|
||||||
<<: *run_local_smoketest
|
|
||||||
|
|
||||||
ubuntu_20_smoketest:
|
|
||||||
stage: smoketest
|
|
||||||
dependencies:
|
|
||||||
- dpkg_build
|
|
||||||
image:
|
|
||||||
name: artifactory.ops.ripple.com/ubuntu:20.04
|
|
||||||
<<: *run_local_smoketest
|
|
||||||
|
|
||||||
ubuntu_22_smoketest:
|
|
||||||
stage: smoketest
|
|
||||||
dependencies:
|
|
||||||
- dpkg_build
|
|
||||||
image:
|
|
||||||
name: artifactory.ops.ripple.com/ubuntu:22.04
|
|
||||||
<<: *run_local_smoketest
|
|
||||||
|
|
||||||
debian_10_smoketest:
|
|
||||||
stage: smoketest
|
|
||||||
dependencies:
|
|
||||||
- dpkg_build
|
|
||||||
image:
|
|
||||||
name: artifactory.ops.ripple.com/debian:10
|
|
||||||
<<: *run_local_smoketest
|
|
||||||
|
|
||||||
debian_11_smoketest:
|
|
||||||
stage: smoketest
|
|
||||||
dependencies:
|
|
||||||
- dpkg_build
|
|
||||||
image:
|
|
||||||
name: artifactory.ops.ripple.com/debian:11
|
|
||||||
<<: *run_local_smoketest
|
|
||||||
|
|
||||||
#########################################################################
|
|
||||||
## ##
|
|
||||||
## stage: verify_sig ##
|
|
||||||
## ##
|
|
||||||
## use git/gpg to verify that HEAD is signed by an approved ##
|
|
||||||
## committer. The whitelist of pubkeys is manually mantained ##
|
|
||||||
## and fetched from GIT_SIGN_PUBKEYS_URL (currently a snippet ##
|
|
||||||
## link). ##
|
|
||||||
## ONLY RUNS FOR PRIMARY BRANCHES/REPO ##
|
|
||||||
## ##
|
|
||||||
#########################################################################
|
|
||||||
|
|
||||||
verify_head_signed:
|
|
||||||
stage: verify_sig
|
|
||||||
image:
|
|
||||||
name: artifactory.ops.ripple.com/ubuntu:latest
|
|
||||||
<<: *only_primary
|
|
||||||
script:
|
|
||||||
- . ./Builds/containers/gitlab-ci/verify_head_commit.sh
|
|
||||||
|
|
||||||
#########################################################################
|
|
||||||
## ##
|
|
||||||
## stage: tag_images ##
|
|
||||||
## ##
|
|
||||||
## apply rippled version tag to containers from previous stage. ##
|
|
||||||
## ONLY RUNS FOR PRIMARY BRANCHES/REPO ##
|
|
||||||
## ##
|
|
||||||
#########################################################################
|
|
||||||
|
|
||||||
tag_bld_images:
|
|
||||||
stage: tag_images
|
|
||||||
variables:
|
|
||||||
docker_driver: overlay2
|
|
||||||
DOCKER_TLS_CERTDIR: ""
|
|
||||||
image:
|
|
||||||
name: artifactory.ops.ripple.com/docker:latest
|
|
||||||
services:
|
|
||||||
# workaround for TLS issues - consider going back
|
|
||||||
# back to unversioned `dind` when issues are resolved
|
|
||||||
- name: artifactory.ops.ripple.com/docker:stable-dind
|
|
||||||
alias: docker
|
|
||||||
tags:
|
|
||||||
- large
|
|
||||||
dependencies:
|
|
||||||
- rpm_sign
|
|
||||||
- dpkg_sign
|
|
||||||
<<: *only_primary
|
|
||||||
script:
|
|
||||||
- . ./Builds/containers/gitlab-ci/tag_docker_image.sh
|
|
||||||
|
|
||||||
#########################################################################
|
|
||||||
## ##
|
|
||||||
## stage: push_to_test ##
|
|
||||||
## ##
|
|
||||||
## push packages to artifactory repositories (test) ##
|
|
||||||
## ONLY RUNS FOR PRIMARY BRANCHES/REPO ##
|
|
||||||
## ##
|
|
||||||
#########################################################################
|
|
||||||
|
|
||||||
push_test:
|
|
||||||
stage: push_to_test
|
|
||||||
variables:
|
|
||||||
DEB_REPO: "rippled-deb-test-mirror"
|
|
||||||
RPM_REPO: "rippled-rpm-test-mirror"
|
|
||||||
image:
|
|
||||||
name: artifactory.ops.ripple.com/alpine:latest
|
|
||||||
artifacts:
|
|
||||||
paths:
|
|
||||||
- files.info
|
|
||||||
dependencies:
|
|
||||||
- rpm_sign
|
|
||||||
- dpkg_sign
|
|
||||||
<<: *only_primary
|
|
||||||
script:
|
|
||||||
- . ./Builds/containers/gitlab-ci/push_to_artifactory.sh "PUT" "."
|
|
||||||
|
|
||||||
#########################################################################
|
|
||||||
## ##
|
|
||||||
## stage: verify_from_test ##
|
|
||||||
## ##
|
|
||||||
## install/test packages from test repos. ##
|
|
||||||
## ONLY RUNS FOR PRIMARY BRANCHES/REPO ##
|
|
||||||
## ##
|
|
||||||
#########################################################################
|
|
||||||
|
|
||||||
centos_7_verify_repo_test:
|
|
||||||
stage: verify_from_test
|
|
||||||
variables:
|
|
||||||
RPM_REPO: "rippled-rpm-test-mirror"
|
|
||||||
image:
|
|
||||||
name: artifactory.ops.ripple.com/centos:7
|
|
||||||
dependencies:
|
|
||||||
- rpm_sign
|
|
||||||
<<: *only_primary
|
|
||||||
<<: *run_repo_smoketest
|
|
||||||
|
|
||||||
|
|
||||||
rocky_8_verify_repo_test:
|
|
||||||
stage: verify_from_test
|
|
||||||
variables:
|
|
||||||
RPM_REPO: "rippled-rpm-test-mirror"
|
|
||||||
image:
|
|
||||||
name: artifactory.ops.ripple.com/rockylinux/rockylinux:8
|
|
||||||
dependencies:
|
|
||||||
- rpm_sign
|
|
||||||
<<: *only_primary
|
|
||||||
<<: *run_repo_smoketest
|
|
||||||
|
|
||||||
fedora_37_verify_repo_test:
|
|
||||||
stage: verify_from_test
|
|
||||||
variables:
|
|
||||||
RPM_REPO: "rippled-rpm-test-mirror"
|
|
||||||
image:
|
|
||||||
name: artifactory.ops.ripple.com/fedora:37
|
|
||||||
dependencies:
|
|
||||||
- rpm_sign
|
|
||||||
<<: *only_primary
|
|
||||||
<<: *run_repo_smoketest
|
|
||||||
|
|
||||||
fedora_38_verify_repo_test:
|
|
||||||
stage: verify_from_test
|
|
||||||
variables:
|
|
||||||
RPM_REPO: "rippled-rpm-test-mirror"
|
|
||||||
image:
|
|
||||||
name: artifactory.ops.ripple.com/fedora:38
|
|
||||||
dependencies:
|
|
||||||
- rpm_sign
|
|
||||||
<<: *only_primary
|
|
||||||
<<: *run_repo_smoketest
|
|
||||||
|
|
||||||
ubuntu_18_verify_repo_test:
|
|
||||||
stage: verify_from_test
|
|
||||||
variables:
|
|
||||||
DISTRO: "bionic"
|
|
||||||
DEB_REPO: "rippled-deb-test-mirror"
|
|
||||||
image:
|
|
||||||
name: artifactory.ops.ripple.com/ubuntu:18.04
|
|
||||||
dependencies:
|
|
||||||
- dpkg_sign
|
|
||||||
<<: *only_primary
|
|
||||||
<<: *run_repo_smoketest
|
|
||||||
|
|
||||||
ubuntu_20_verify_repo_test:
|
|
||||||
stage: verify_from_test
|
|
||||||
variables:
|
|
||||||
DISTRO: "focal"
|
|
||||||
DEB_REPO: "rippled-deb-test-mirror"
|
|
||||||
image:
|
|
||||||
name: artifactory.ops.ripple.com/ubuntu:20.04
|
|
||||||
dependencies:
|
|
||||||
- dpkg_sign
|
|
||||||
<<: *only_primary
|
|
||||||
<<: *run_repo_smoketest
|
|
||||||
|
|
||||||
ubuntu_22_verify_repo_test:
|
|
||||||
stage: verify_from_test
|
|
||||||
variables:
|
|
||||||
DISTRO: "jammy"
|
|
||||||
DEB_REPO: "rippled-deb-test-mirror"
|
|
||||||
image:
|
|
||||||
name: artifactory.ops.ripple.com/ubuntu:22.04
|
|
||||||
dependencies:
|
|
||||||
- dpkg_sign
|
|
||||||
<<: *only_primary
|
|
||||||
<<: *run_repo_smoketest
|
|
||||||
|
|
||||||
debian_10_verify_repo_test:
|
|
||||||
stage: verify_from_test
|
|
||||||
variables:
|
|
||||||
DISTRO: "buster"
|
|
||||||
DEB_REPO: "rippled-deb-test-mirror"
|
|
||||||
image:
|
|
||||||
name: artifactory.ops.ripple.com/debian:10
|
|
||||||
dependencies:
|
|
||||||
- dpkg_sign
|
|
||||||
<<: *only_primary
|
|
||||||
<<: *run_repo_smoketest
|
|
||||||
|
|
||||||
debian_11_verify_repo_test:
|
|
||||||
stage: verify_from_test
|
|
||||||
variables:
|
|
||||||
DISTRO: "bullseye"
|
|
||||||
DEB_REPO: "rippled-deb-test-mirror"
|
|
||||||
image:
|
|
||||||
name: artifactory.ops.ripple.com/debian:11
|
|
||||||
dependencies:
|
|
||||||
- dpkg_sign
|
|
||||||
<<: *only_primary
|
|
||||||
<<: *run_repo_smoketest
|
|
||||||
|
|
||||||
#########################################################################
|
|
||||||
## ##
|
|
||||||
## stage: wait_approval_prod ##
|
|
||||||
## ##
|
|
||||||
## wait for manual approval before proceeding to next stage ##
|
|
||||||
## which pushes to prod repo. ##
|
|
||||||
## ONLY RUNS FOR PRIMARY BRANCHES/REPO ##
|
|
||||||
## ##
|
|
||||||
#########################################################################
|
|
||||||
wait_before_push_prod:
|
|
||||||
stage: wait_approval_prod
|
|
||||||
image:
|
|
||||||
name: artifactory.ops.ripple.com/alpine:latest
|
|
||||||
<<: *only_primary
|
|
||||||
script:
|
|
||||||
- echo "proceeding to next stage"
|
|
||||||
when: manual
|
|
||||||
allow_failure: false
|
|
||||||
|
|
||||||
#########################################################################
|
|
||||||
## ##
|
|
||||||
## stage: push_to_prod ##
|
|
||||||
## ##
|
|
||||||
## push packages to artifactory repositories (prod) ##
|
|
||||||
## ONLY RUNS FOR PRIMARY BRANCHES/REPO ##
|
|
||||||
## ##
|
|
||||||
#########################################################################
|
|
||||||
|
|
||||||
push_prod:
|
|
||||||
variables:
|
|
||||||
DEB_REPO: "rippled-deb"
|
|
||||||
RPM_REPO: "rippled-rpm"
|
|
||||||
image:
|
|
||||||
name: artifactory.ops.ripple.com/alpine:latest
|
|
||||||
stage: push_to_prod
|
|
||||||
artifacts:
|
|
||||||
paths:
|
|
||||||
- files.info
|
|
||||||
dependencies:
|
|
||||||
- rpm_sign
|
|
||||||
- dpkg_sign
|
|
||||||
<<: *only_primary
|
|
||||||
script:
|
|
||||||
- . ./Builds/containers/gitlab-ci/push_to_artifactory.sh "PUT" "."
|
|
||||||
|
|
||||||
#########################################################################
|
|
||||||
## ##
|
|
||||||
## stage: verify_from_prod ##
|
|
||||||
## ##
|
|
||||||
## install/test packages from prod repos. ##
|
|
||||||
## ONLY RUNS FOR PRIMARY BRANCHES/REPO ##
|
|
||||||
## ##
|
|
||||||
#########################################################################
|
|
||||||
|
|
||||||
centos_7_verify_repo_prod:
|
|
||||||
stage: verify_from_prod
|
|
||||||
variables:
|
|
||||||
RPM_REPO: "rippled-rpm"
|
|
||||||
image:
|
|
||||||
name: artifactory.ops.ripple.com/centos:7
|
|
||||||
dependencies:
|
|
||||||
- rpm_sign
|
|
||||||
<<: *only_primary
|
|
||||||
<<: *run_repo_smoketest
|
|
||||||
|
|
||||||
rocky_8_verify_repo_prod:
|
|
||||||
stage: verify_from_prod
|
|
||||||
variables:
|
|
||||||
RPM_REPO: "rippled-rpm"
|
|
||||||
image:
|
|
||||||
name: artifactory.ops.ripple.com/rockylinux/rockylinux:8
|
|
||||||
dependencies:
|
|
||||||
- rpm_sign
|
|
||||||
<<: *only_primary
|
|
||||||
<<: *run_repo_smoketest
|
|
||||||
|
|
||||||
fedora_37_verify_repo_prod:
|
|
||||||
stage: verify_from_prod
|
|
||||||
variables:
|
|
||||||
RPM_REPO: "rippled-rpm"
|
|
||||||
image:
|
|
||||||
name: artifactory.ops.ripple.com/fedora:37
|
|
||||||
dependencies:
|
|
||||||
- rpm_sign
|
|
||||||
<<: *only_primary
|
|
||||||
<<: *run_repo_smoketest
|
|
||||||
|
|
||||||
fedora_38_verify_repo_prod:
|
|
||||||
stage: verify_from_prod
|
|
||||||
variables:
|
|
||||||
RPM_REPO: "rippled-rpm"
|
|
||||||
image:
|
|
||||||
name: artifactory.ops.ripple.com/fedora:38
|
|
||||||
dependencies:
|
|
||||||
- rpm_sign
|
|
||||||
<<: *only_primary
|
|
||||||
<<: *run_repo_smoketest
|
|
||||||
|
|
||||||
ubuntu_18_verify_repo_prod:
|
|
||||||
stage: verify_from_prod
|
|
||||||
variables:
|
|
||||||
DISTRO: "bionic"
|
|
||||||
DEB_REPO: "rippled-deb"
|
|
||||||
image:
|
|
||||||
name: artifactory.ops.ripple.com/ubuntu:18.04
|
|
||||||
dependencies:
|
|
||||||
- dpkg_sign
|
|
||||||
<<: *only_primary
|
|
||||||
<<: *run_repo_smoketest
|
|
||||||
|
|
||||||
ubuntu_20_verify_repo_prod:
|
|
||||||
stage: verify_from_prod
|
|
||||||
variables:
|
|
||||||
DISTRO: "focal"
|
|
||||||
DEB_REPO: "rippled-deb"
|
|
||||||
image:
|
|
||||||
name: artifactory.ops.ripple.com/ubuntu:20.04
|
|
||||||
dependencies:
|
|
||||||
- dpkg_sign
|
|
||||||
<<: *only_primary
|
|
||||||
<<: *run_repo_smoketest
|
|
||||||
|
|
||||||
ubuntu_22_verify_repo_prod:
|
|
||||||
stage: verify_from_prod
|
|
||||||
variables:
|
|
||||||
DISTRO: "jammy"
|
|
||||||
DEB_REPO: "rippled-deb"
|
|
||||||
image:
|
|
||||||
name: artifactory.ops.ripple.com/ubuntu:22.04
|
|
||||||
dependencies:
|
|
||||||
- dpkg_sign
|
|
||||||
<<: *only_primary
|
|
||||||
<<: *run_repo_smoketest
|
|
||||||
|
|
||||||
debian_10_verify_repo_prod:
|
|
||||||
stage: verify_from_prod
|
|
||||||
variables:
|
|
||||||
DISTRO: "buster"
|
|
||||||
DEB_REPO: "rippled-deb"
|
|
||||||
image:
|
|
||||||
name: artifactory.ops.ripple.com/debian:10
|
|
||||||
dependencies:
|
|
||||||
- dpkg_sign
|
|
||||||
<<: *only_primary
|
|
||||||
<<: *run_repo_smoketest
|
|
||||||
|
|
||||||
debian_11_verify_repo_prod:
|
|
||||||
stage: verify_from_prod
|
|
||||||
variables:
|
|
||||||
DISTRO: "bullseye"
|
|
||||||
DEB_REPO: "rippled-deb"
|
|
||||||
image:
|
|
||||||
name: artifactory.ops.ripple.com/debian:11
|
|
||||||
dependencies:
|
|
||||||
- dpkg_sign
|
|
||||||
<<: *only_primary
|
|
||||||
<<: *run_repo_smoketest
|
|
||||||
|
|
||||||
#########################################################################
|
|
||||||
## ##
|
|
||||||
## stage: get_final_hashes ##
|
|
||||||
## ##
|
|
||||||
## fetch final hashes from artifactory. ##
|
|
||||||
## ONLY RUNS FOR PRIMARY BRANCHES/REPO ##
|
|
||||||
## ##
|
|
||||||
#########################################################################
|
|
||||||
|
|
||||||
get_prod_hashes:
|
|
||||||
variables:
|
|
||||||
DEB_REPO: "rippled-deb"
|
|
||||||
RPM_REPO: "rippled-rpm"
|
|
||||||
image:
|
|
||||||
name: artifactory.ops.ripple.com/alpine:latest
|
|
||||||
stage: get_final_hashes
|
|
||||||
artifacts:
|
|
||||||
paths:
|
|
||||||
- files.info
|
|
||||||
dependencies:
|
|
||||||
- rpm_sign
|
|
||||||
- dpkg_sign
|
|
||||||
<<: *only_primary
|
|
||||||
script:
|
|
||||||
- . ./Builds/containers/gitlab-ci/push_to_artifactory.sh "GET" ".checksums"
|
|
||||||
|
|
||||||
#########################################################################
|
|
||||||
## ##
|
|
||||||
## stage: build_containers ##
|
|
||||||
## ##
|
|
||||||
## build containers from docker definitions. These containers are NOT ##
|
|
||||||
## used for the package build. This step is only used to ensure that ##
|
|
||||||
## the package build targets and files are still working properly. ##
|
|
||||||
## ##
|
|
||||||
#########################################################################
|
|
||||||
|
|
||||||
build_centos_container:
|
|
||||||
stage: build_containers
|
|
||||||
<<: *dind_param
|
|
||||||
script:
|
|
||||||
- . ./Builds/containers/gitlab-ci/build_container.sh rpm
|
|
||||||
|
|
||||||
build_ubuntu_container:
|
|
||||||
stage: build_containers
|
|
||||||
<<: *dind_param
|
|
||||||
script:
|
|
||||||
- . ./Builds/containers/gitlab-ci/build_container.sh dpkg
|
|
||||||
@@ -1,92 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
set -e
|
|
||||||
action=$1
|
|
||||||
filter=$2
|
|
||||||
|
|
||||||
. ./Builds/containers/gitlab-ci/get_component.sh
|
|
||||||
|
|
||||||
apk add curl jq coreutils util-linux
|
|
||||||
TOPDIR=$(pwd)
|
|
||||||
|
|
||||||
# DPKG
|
|
||||||
|
|
||||||
cd $TOPDIR
|
|
||||||
cd build/dpkg/packages
|
|
||||||
CURLARGS="-sk -X${action} -urippled:${ARTIFACTORY_DEPLOY_KEY_RIPPLED}"
|
|
||||||
RIPPLED_PKG=$(ls rippled_*.deb)
|
|
||||||
RIPPLED_REPORTING_PKG=$(ls rippled-reporting_*.deb)
|
|
||||||
RIPPLED_DBG_PKG=$(ls rippled-dbgsym_*.*deb)
|
|
||||||
RIPPLED_REPORTING_DBG_PKG=$(ls rippled-reporting-dbgsym_*.*deb)
|
|
||||||
# TODO - where to upload src tgz?
|
|
||||||
RIPPLED_SRC=$(ls rippled_*.orig.tar.gz)
|
|
||||||
DEB_MATRIX=";deb.component=${COMPONENT};deb.architecture=amd64"
|
|
||||||
for dist in buster bullseye bionic focal jammy; do
|
|
||||||
DEB_MATRIX="${DEB_MATRIX};deb.distribution=${dist}"
|
|
||||||
done
|
|
||||||
echo "{ \"debs\": {" > "${TOPDIR}/files.info"
|
|
||||||
for deb in ${RIPPLED_PKG} ${RIPPLED_DBG_PKG} ${RIPPLED_REPORTING_PKG} ${RIPPLED_REPORTING_DBG_PKG}; do
|
|
||||||
# first item doesn't get a comma separator
|
|
||||||
if [ $deb != $RIPPLED_PKG ] ; then
|
|
||||||
echo "," >> "${TOPDIR}/files.info"
|
|
||||||
fi
|
|
||||||
echo "\"${deb}\"": | tee -a "${TOPDIR}/files.info"
|
|
||||||
ca="${CURLARGS}"
|
|
||||||
if [ "${action}" = "PUT" ] ; then
|
|
||||||
url="https://${ARTIFACTORY_HOST}/artifactory/${DEB_REPO}/pool/${COMPONENT}/${deb}${DEB_MATRIX}"
|
|
||||||
ca="${ca} -T${deb}"
|
|
||||||
elif [ "${action}" = "GET" ] ; then
|
|
||||||
url="https://${ARTIFACTORY_HOST}/artifactory/api/storage/${DEB_REPO}/pool/${COMPONENT}/${deb}"
|
|
||||||
fi
|
|
||||||
echo "file info request url --> ${url}"
|
|
||||||
eval "curl ${ca} \"${url}\"" | jq -M "${filter}" | tee -a "${TOPDIR}/files.info"
|
|
||||||
done
|
|
||||||
echo "}," >> "${TOPDIR}/files.info"
|
|
||||||
|
|
||||||
# RPM
|
|
||||||
|
|
||||||
cd $TOPDIR
|
|
||||||
cd build/rpm/packages
|
|
||||||
RIPPLED_PKG=$(ls rippled-[0-9]*.x86_64.rpm)
|
|
||||||
RIPPLED_DEV_PKG=$(ls rippled-devel*.rpm)
|
|
||||||
RIPPLED_DBG_PKG=$(ls rippled-debuginfo*.rpm)
|
|
||||||
RIPPLED_REPORTING_PKG=$(ls rippled-reporting*.rpm)
|
|
||||||
# TODO - where to upload src rpm ?
|
|
||||||
RIPPLED_SRC=$(ls rippled-[0-9]*.src.rpm)
|
|
||||||
echo "\"rpms\": {" >> "${TOPDIR}/files.info"
|
|
||||||
for rpm in ${RIPPLED_PKG} ${RIPPLED_DEV_PKG} ${RIPPLED_DBG_PKG} ${RIPPLED_REPORTING_PKG}; do
|
|
||||||
# first item doesn't get a comma separator
|
|
||||||
if [ $rpm != $RIPPLED_PKG ] ; then
|
|
||||||
echo "," >> "${TOPDIR}/files.info"
|
|
||||||
fi
|
|
||||||
echo "\"${rpm}\"": | tee -a "${TOPDIR}/files.info"
|
|
||||||
ca="${CURLARGS}"
|
|
||||||
if [ "${action}" = "PUT" ] ; then
|
|
||||||
url="https://${ARTIFACTORY_HOST}/artifactory/${RPM_REPO}/${COMPONENT}/"
|
|
||||||
ca="${ca} -T${rpm}"
|
|
||||||
elif [ "${action}" = "GET" ] ; then
|
|
||||||
url="https://${ARTIFACTORY_HOST}/artifactory/api/storage/${RPM_REPO}/${COMPONENT}/${rpm}"
|
|
||||||
fi
|
|
||||||
echo "file info request url --> ${url}"
|
|
||||||
eval "curl ${ca} \"${url}\"" | jq -M "${filter}" | tee -a "${TOPDIR}/files.info"
|
|
||||||
done
|
|
||||||
echo "}}" >> "${TOPDIR}/files.info"
|
|
||||||
jq '.' "${TOPDIR}/files.info" > "${TOPDIR}/files.info.tmp"
|
|
||||||
mv "${TOPDIR}/files.info.tmp" "${TOPDIR}/files.info"
|
|
||||||
|
|
||||||
if [ ! -z "${SLACK_NOTIFY_URL}" ] && [ "${action}" = "GET" ] ; then
|
|
||||||
# extract files.info content to variable and sanitize so it can
|
|
||||||
# be interpolated into a slack text field below
|
|
||||||
finfo=$(cat ${TOPDIR}/files.info | sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/\\n/g' | sed -E 's/"/\\"/g')
|
|
||||||
# try posting file info to slack.
|
|
||||||
# can add channel field to payload if the
|
|
||||||
# default channel is incorrect. Get rid of
|
|
||||||
# newlines in payload json since slack doesn't accept them
|
|
||||||
CONTENT=$(tr -d '[\n]' <<JSON
|
|
||||||
payload={
|
|
||||||
"username": "GitlabCI",
|
|
||||||
"text": "The package build for branch \`${CI_COMMIT_REF_NAME}\` is complete. File hashes are: \`\`\`${finfo}\`\`\`",
|
|
||||||
"icon_emoji": ":package:"}
|
|
||||||
JSON
|
|
||||||
)
|
|
||||||
curl ${SLACK_NOTIFY_URL} --data-urlencode "${CONTENT}"
|
|
||||||
fi
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -eo pipefail
|
|
||||||
|
|
||||||
sign_dpkg() {
|
|
||||||
if [ -n "${GPG_KEYID}" ]; then
|
|
||||||
dpkg-sig \
|
|
||||||
-g "--no-tty --digest-algo 'sha512' --passphrase '${GPG_PASSPHRASE}' --pinentry-mode=loopback" \
|
|
||||||
-k "${GPG_KEYID}" \
|
|
||||||
--sign builder \
|
|
||||||
"build/dpkg/packages/*.deb"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
sign_rpm() {
|
|
||||||
if [ -n "${GPG_KEYID}" ] ; then
|
|
||||||
find build/rpm/packages -name "*.rpm" -exec bash -c '
|
|
||||||
echo "yes" | setsid rpm \
|
|
||||||
--define "_gpg_name ${GPG_KEYID}" \
|
|
||||||
--define "_signature gpg" \
|
|
||||||
--define "__gpg_check_password_cmd /bin/true" \
|
|
||||||
--define "__gpg_sign_cmd %{__gpg} gpg --batch --no-armor --digest-algo 'sha512' --passphrase '${GPG_PASSPHRASE}' --no-secmem-warning -u '%{_gpg_name}' --sign --detach-sign --output %{__signature_filename} %{__plaintext_filename}" \
|
|
||||||
--addsign '{} \;
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
case "${1}" in
|
|
||||||
dpkg)
|
|
||||||
sign_dpkg
|
|
||||||
;;
|
|
||||||
rpm)
|
|
||||||
sign_rpm
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Usage: ${0} (dpkg|rpm)"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
@@ -1,108 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
set -e
|
|
||||||
install_from=$1
|
|
||||||
use_private=${2:-0} # this option not currently needed by any CI scripts,
|
|
||||||
# reserved for possible future use
|
|
||||||
if [ "$use_private" -gt 0 ] ; then
|
|
||||||
REPO_ROOT="https://rippled:${ARTIFACTORY_DEPLOY_KEY_RIPPLED}@${ARTIFACTORY_HOST}/artifactory"
|
|
||||||
else
|
|
||||||
REPO_ROOT="${PUBLIC_REPO_ROOT}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
. ./Builds/containers/gitlab-ci/get_component.sh
|
|
||||||
|
|
||||||
. /etc/os-release
|
|
||||||
case ${ID} in
|
|
||||||
ubuntu|debian)
|
|
||||||
pkgtype="dpkg"
|
|
||||||
;;
|
|
||||||
fedora|centos|rhel|scientific|rocky)
|
|
||||||
pkgtype="rpm"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "unrecognized distro!"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# this script provides info variables about pkg version
|
|
||||||
. build/${pkgtype}/packages/build_vars
|
|
||||||
|
|
||||||
if [ "${pkgtype}" = "dpkg" ] ; then
|
|
||||||
# sometimes update fails and requires a cleanup
|
|
||||||
updateWithRetry()
|
|
||||||
{
|
|
||||||
if ! apt-get -y update ; then
|
|
||||||
rm -rvf /var/lib/apt/lists/*
|
|
||||||
apt-get -y clean
|
|
||||||
apt-get -y update
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
if [ "${install_from}" = "repo" ] ; then
|
|
||||||
apt-get -y upgrade
|
|
||||||
updateWithRetry
|
|
||||||
apt-get -y install apt apt-transport-https ca-certificates coreutils util-linux wget gnupg
|
|
||||||
wget -q -O - "${REPO_ROOT}/api/gpg/key/public" | apt-key add -
|
|
||||||
echo "deb ${REPO_ROOT}/${DEB_REPO} ${DISTRO} ${COMPONENT}" >> /etc/apt/sources.list
|
|
||||||
updateWithRetry
|
|
||||||
# uncomment this next line if you want to see the available package versions
|
|
||||||
# apt-cache policy rippled
|
|
||||||
apt-get -y install rippled=${dpkg_full_version}
|
|
||||||
elif [ "${install_from}" = "local" ] ; then
|
|
||||||
# cached pkg install
|
|
||||||
updateWithRetry
|
|
||||||
apt-get -y install libprotobuf-dev libprotoc-dev protobuf-compiler libssl-dev
|
|
||||||
rm -f build/dpkg/packages/rippled-dbgsym*.*
|
|
||||||
dpkg --no-debsig -i build/dpkg/packages/*.deb
|
|
||||||
else
|
|
||||||
echo "unrecognized pkg source!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
yum -y update
|
|
||||||
if [ "${install_from}" = "repo" ] ; then
|
|
||||||
pkgs=("yum-utils coreutils util-linux")
|
|
||||||
if [ "$ID" = "rocky" ]; then
|
|
||||||
pkgs="${pkgs[@]/coreutils}"
|
|
||||||
fi
|
|
||||||
yum install -y $pkgs
|
|
||||||
REPOFILE="/etc/yum.repos.d/artifactory.repo"
|
|
||||||
echo "[Artifactory]" > ${REPOFILE}
|
|
||||||
echo "name=Artifactory" >> ${REPOFILE}
|
|
||||||
echo "baseurl=${REPO_ROOT}/${RPM_REPO}/${COMPONENT}/" >> ${REPOFILE}
|
|
||||||
echo "enabled=1" >> ${REPOFILE}
|
|
||||||
echo "gpgcheck=0" >> ${REPOFILE}
|
|
||||||
echo "gpgkey=${REPO_ROOT}/${RPM_REPO}/${COMPONENT}/repodata/repomd.xml.key" >> ${REPOFILE}
|
|
||||||
echo "repo_gpgcheck=1" >> ${REPOFILE}
|
|
||||||
yum -y update
|
|
||||||
# uncomment this next line if you want to see the available package versions
|
|
||||||
# yum --showduplicates list rippled
|
|
||||||
yum -y install ${rpm_version_release}
|
|
||||||
elif [ "${install_from}" = "local" ] ; then
|
|
||||||
# cached pkg install
|
|
||||||
pkgs=("yum-utils openssl-static zlib-static")
|
|
||||||
if [[ "$ID" =~ rocky|fedora ]]; then
|
|
||||||
if [[ "$ID" =~ "rocky" ]]; then
|
|
||||||
sed -i 's/enabled=0/enabled=1/g' /etc/yum.repos.d/Rocky-PowerTools.repo
|
|
||||||
fi
|
|
||||||
pkgs="${pkgs[@]/openssl-static}"
|
|
||||||
fi
|
|
||||||
yum install -y $pkgs
|
|
||||||
rm -f build/rpm/packages/rippled-debug*.rpm
|
|
||||||
rm -f build/rpm/packages/*.src.rpm
|
|
||||||
rpm -i build/rpm/packages/*.rpm
|
|
||||||
else
|
|
||||||
echo "unrecognized pkg source!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# verify installed version
|
|
||||||
INSTALLED=$(/opt/ripple/bin/rippled --version | awk '{print $NF}')
|
|
||||||
if [ "${rippled_version}" != "${INSTALLED}" ] ; then
|
|
||||||
echo "INSTALLED version ${INSTALLED} does not match ${rippled_version}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
# run unit tests
|
|
||||||
/opt/ripple/bin/rippled --unittest --unittest-jobs $(nproc)
|
|
||||||
/opt/ripple/bin/validator-keys --unittest
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
set -e
|
|
||||||
docker login -u rippled \
|
|
||||||
-p ${ARTIFACTORY_DEPLOY_KEY_RIPPLED} "${ARTIFACTORY_HUB}"
|
|
||||||
# this gives us rippled_version :
|
|
||||||
source build/rpm/packages/build_vars
|
|
||||||
docker pull "${ARTIFACTORY_HUB}/${RPM_CONTAINER_FULLNAME}"
|
|
||||||
docker pull "${ARTIFACTORY_HUB}/${DPKG_CONTAINER_FULLNAME}"
|
|
||||||
# tag/push two labels...one using the current rippled version and one just using "latest"
|
|
||||||
for label in ${rippled_version} latest ; do
|
|
||||||
docker tag \
|
|
||||||
"${ARTIFACTORY_HUB}/${RPM_CONTAINER_FULLNAME}" \
|
|
||||||
"${ARTIFACTORY_HUB}/${RPM_CONTAINER_NAME}:${label}_${CI_COMMIT_REF_SLUG}"
|
|
||||||
docker push \
|
|
||||||
"${ARTIFACTORY_HUB}/${RPM_CONTAINER_NAME}:${label}_${CI_COMMIT_REF_SLUG}"
|
|
||||||
docker tag \
|
|
||||||
"${ARTIFACTORY_HUB}/${DPKG_CONTAINER_FULLNAME}" \
|
|
||||||
"${ARTIFACTORY_HUB}/${DPKG_CONTAINER_NAME}:${label}_${CI_COMMIT_REF_SLUG}"
|
|
||||||
docker push \
|
|
||||||
"${ARTIFACTORY_HUB}/${DPKG_CONTAINER_NAME}:${label}_${CI_COMMIT_REF_SLUG}"
|
|
||||||
done
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
set -ex
|
|
||||||
apt -y update
|
|
||||||
DEBIAN_FRONTEND="noninteractive" apt-get -y install tzdata
|
|
||||||
apt -y install software-properties-common curl git gnupg
|
|
||||||
curl -sk -o rippled-pubkeys.txt "${GIT_SIGN_PUBKEYS_URL}"
|
|
||||||
gpg --import rippled-pubkeys.txt
|
|
||||||
if git verify-commit HEAD; then
|
|
||||||
echo "git commit signature check passed"
|
|
||||||
else
|
|
||||||
echo "git commit signature check failed"
|
|
||||||
git log -n 5 --color \
|
|
||||||
--pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an> [%G?]%Creset' \
|
|
||||||
--abbrev-commit
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
@@ -1,95 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -ex
|
|
||||||
|
|
||||||
# make sure pkg source files are up to date with repo
|
|
||||||
cd /opt/rippled_bld/pkg
|
|
||||||
cp -fpru rippled/Builds/containers/packaging/dpkg/debian/. debian/
|
|
||||||
cp -fpu rippled/Builds/containers/shared/rippled*.service debian/
|
|
||||||
cp -fpu rippled/Builds/containers/shared/update_sources.sh .
|
|
||||||
source update_sources.sh
|
|
||||||
|
|
||||||
# Build the dpkg
|
|
||||||
|
|
||||||
#dpkg uses - as separator, so we need to change our -bN versions to tilde
|
|
||||||
RIPPLED_DPKG_VERSION=$(echo "${RIPPLED_VERSION}" | sed 's!-!~!g')
|
|
||||||
# TODO - decide how to handle the trailing/release
|
|
||||||
# version here (hardcoded to 1). Does it ever need to change?
|
|
||||||
RIPPLED_DPKG_FULL_VERSION="${RIPPLED_DPKG_VERSION}-1"
|
|
||||||
git config --global --add safe.directory /opt/rippled_bld/pkg/rippled
|
|
||||||
cd /opt/rippled_bld/pkg/rippled
|
|
||||||
if [[ -n $(git status --porcelain) ]]; then
|
|
||||||
git status
|
|
||||||
error "Unstaged changes in this repo - please commit first"
|
|
||||||
fi
|
|
||||||
git archive --format tar.gz --prefix rippled-${RIPPLED_DPKG_VERSION}/ -o ../rippled-${RIPPLED_DPKG_VERSION}.tar.gz HEAD
|
|
||||||
cd ..
|
|
||||||
# dpkg debmake would normally create this link, but we do it manually
|
|
||||||
ln -s ./rippled-${RIPPLED_DPKG_VERSION}.tar.gz rippled_${RIPPLED_DPKG_VERSION}.orig.tar.gz
|
|
||||||
tar xvf rippled-${RIPPLED_DPKG_VERSION}.tar.gz
|
|
||||||
cd rippled-${RIPPLED_DPKG_VERSION}
|
|
||||||
cp -pr ../debian .
|
|
||||||
|
|
||||||
# dpkg requires a changelog. We don't currently maintain
|
|
||||||
# a useable one, so let's just fake it with our current version
|
|
||||||
# TODO : not sure if the "unstable" will need to change for
|
|
||||||
# release packages (?)
|
|
||||||
NOWSTR=$(TZ=UTC date -R)
|
|
||||||
cat << CHANGELOG > ./debian/changelog
|
|
||||||
rippled (${RIPPLED_DPKG_FULL_VERSION}) unstable; urgency=low
|
|
||||||
|
|
||||||
* see RELEASENOTES
|
|
||||||
|
|
||||||
-- Ripple Labs Inc. <support@ripple.com> ${NOWSTR}
|
|
||||||
CHANGELOG
|
|
||||||
|
|
||||||
# PATH must be preserved for our more modern cmake in /opt/local
|
|
||||||
# TODO : consider allowing lintian to run in future ?
|
|
||||||
export DH_BUILD_DDEBS=1
|
|
||||||
debuild --no-lintian --preserve-envvar PATH --preserve-env -us -uc
|
|
||||||
rc=$?; if [[ $rc != 0 ]]; then
|
|
||||||
error "error building dpkg"
|
|
||||||
fi
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
# copy artifacts
|
|
||||||
cp rippled-reporting_${RIPPLED_DPKG_FULL_VERSION}_amd64.deb ${PKG_OUTDIR}
|
|
||||||
cp rippled_${RIPPLED_DPKG_FULL_VERSION}_amd64.deb ${PKG_OUTDIR}
|
|
||||||
cp rippled_${RIPPLED_DPKG_FULL_VERSION}.dsc ${PKG_OUTDIR}
|
|
||||||
# dbgsym suffix is ddeb under newer debuild, but just deb under earlier
|
|
||||||
cp rippled-dbgsym_${RIPPLED_DPKG_FULL_VERSION}_amd64.* ${PKG_OUTDIR}
|
|
||||||
cp rippled-reporting-dbgsym_${RIPPLED_DPKG_FULL_VERSION}_amd64.* ${PKG_OUTDIR}
|
|
||||||
cp rippled_${RIPPLED_DPKG_FULL_VERSION}_amd64.changes ${PKG_OUTDIR}
|
|
||||||
cp rippled_${RIPPLED_DPKG_FULL_VERSION}_amd64.build ${PKG_OUTDIR}
|
|
||||||
cp rippled_${RIPPLED_DPKG_VERSION}.orig.tar.gz ${PKG_OUTDIR}
|
|
||||||
cp rippled_${RIPPLED_DPKG_FULL_VERSION}.debian.tar.xz ${PKG_OUTDIR}
|
|
||||||
# buildinfo is only generated by later version of debuild
|
|
||||||
if [ -e rippled_${RIPPLED_DPKG_FULL_VERSION}_amd64.buildinfo ] ; then
|
|
||||||
cp rippled_${RIPPLED_DPKG_FULL_VERSION}_amd64.buildinfo ${PKG_OUTDIR}
|
|
||||||
fi
|
|
||||||
|
|
||||||
cat rippled_${RIPPLED_DPKG_FULL_VERSION}_amd64.changes
|
|
||||||
# extract the text in the .changes file that appears between
|
|
||||||
# Checksums-Sha256: ...
|
|
||||||
# and
|
|
||||||
# Files: ...
|
|
||||||
awk '/Checksums-Sha256:/{hit=1;next}/Files:/{hit=0}hit' \
|
|
||||||
rippled_${RIPPLED_DPKG_VERSION}-1_amd64.changes | \
|
|
||||||
sed -E 's!^[[:space:]]+!!' > shasums
|
|
||||||
DEB_SHA256=$(cat shasums | \
|
|
||||||
grep "rippled_${RIPPLED_DPKG_VERSION}-1_amd64.deb" | cut -d " " -f 1)
|
|
||||||
DBG_SHA256=$(cat shasums | \
|
|
||||||
grep "rippled-dbgsym_${RIPPLED_DPKG_VERSION}-1_amd64.*" | cut -d " " -f 1)
|
|
||||||
REPORTING_DBG_SHA256=$(cat shasums | \
|
|
||||||
grep "rippled-reporting-dbgsym_${RIPPLED_DPKG_VERSION}-1_amd64.*" | cut -d " " -f 1)
|
|
||||||
REPORTING_SHA256=$(cat shasums | \
|
|
||||||
grep "rippled-reporting_${RIPPLED_DPKG_VERSION}-1_amd64.deb" | cut -d " " -f 1)
|
|
||||||
SRC_SHA256=$(cat shasums | \
|
|
||||||
grep "rippled_${RIPPLED_DPKG_VERSION}.orig.tar.gz" | cut -d " " -f 1)
|
|
||||||
echo "deb_sha256=${DEB_SHA256}" >> ${PKG_OUTDIR}/build_vars
|
|
||||||
echo "dbg_sha256=${DBG_SHA256}" >> ${PKG_OUTDIR}/build_vars
|
|
||||||
echo "reporting_sha256=${REPORTING_SHA256}" >> ${PKG_OUTDIR}/build_vars
|
|
||||||
echo "reporting_dbg_sha256=${REPORTING_DBG_SHA256}" >> ${PKG_OUTDIR}/build_vars
|
|
||||||
echo "src_sha256=${SRC_SHA256}" >> ${PKG_OUTDIR}/build_vars
|
|
||||||
echo "rippled_version=${RIPPLED_VERSION}" >> ${PKG_OUTDIR}/build_vars
|
|
||||||
echo "dpkg_version=${RIPPLED_DPKG_VERSION}" >> ${PKG_OUTDIR}/build_vars
|
|
||||||
echo "dpkg_full_version=${RIPPLED_DPKG_FULL_VERSION}" >> ${PKG_OUTDIR}/build_vars
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
rippled daemon
|
|
||||||
|
|
||||||
-- Mike Ellery <mellery451@gmail.com> Tue, 04 Dec 2018 18:19:03 +0000
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
10
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
Source: rippled
|
|
||||||
Section: misc
|
|
||||||
Priority: extra
|
|
||||||
Maintainer: Ripple Labs Inc. <support@ripple.com>
|
|
||||||
Build-Depends: cmake, debhelper (>=9), zlib1g-dev, dh-systemd, ninja-build
|
|
||||||
Standards-Version: 3.9.7
|
|
||||||
Homepage: http://ripple.com/
|
|
||||||
|
|
||||||
Package: rippled
|
|
||||||
Architecture: any
|
|
||||||
Multi-Arch: foreign
|
|
||||||
Depends: ${misc:Depends}, ${shlibs:Depends}
|
|
||||||
Description: rippled daemon
|
|
||||||
|
|
||||||
Package: rippled-reporting
|
|
||||||
Architecture: any
|
|
||||||
Multi-Arch: foreign
|
|
||||||
Depends: ${misc:Depends}, ${shlibs:Depends}
|
|
||||||
Description: rippled reporting daemon
|
|
||||||
@@ -1,86 +0,0 @@
|
|||||||
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
|
||||||
Upstream-Name: rippled
|
|
||||||
Source: https://github.com/ripple/rippled
|
|
||||||
|
|
||||||
Files: *
|
|
||||||
Copyright: 2012-2019 Ripple Labs Inc.
|
|
||||||
|
|
||||||
License: __UNKNOWN__
|
|
||||||
|
|
||||||
The accompanying files under various copyrights.
|
|
||||||
|
|
||||||
Copyright (c) 2012, 2013, 2014 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
|
|
||||||
The accompanying files incorporate work covered by the following copyright
|
|
||||||
and previous license notice:
|
|
||||||
|
|
||||||
Copyright (c) 2011 Arthur Britto, David Schwartz, Jed McCaleb,
|
|
||||||
Vinnie Falco, Bob Way, Eric Lombrozo, Nikolaos D. Bougalis, Howard Hinnant
|
|
||||||
|
|
||||||
Some code from Raw Material Software, Ltd., provided under the terms of the
|
|
||||||
ISC License. See the corresponding source files for more details.
|
|
||||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
|
||||||
Please visit http://www.juce.com
|
|
||||||
|
|
||||||
Some code from ASIO examples:
|
|
||||||
// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
|
|
||||||
//
|
|
||||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
||||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
|
|
||||||
Some code from Bitcoin:
|
|
||||||
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
|
||||||
// Copyright (c) 2011 The Bitcoin developers
|
|
||||||
// Distributed under the MIT/X11 software license, see the accompanying
|
|
||||||
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
|
|
||||||
|
|
||||||
Some code from Tom Wu:
|
|
||||||
This software is covered under the following copyright:
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2003-2005 Tom Wu
|
|
||||||
* All Rights Reserved.
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
|
||||||
* a copy of this software and associated documentation files (the
|
|
||||||
* "Software"), to deal in the Software without restriction, including
|
|
||||||
* without limitation the rights to use, copy, modify, merge, publish,
|
|
||||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
||||||
* permit persons to whom the Software is furnished to do so, subject to
|
|
||||||
* the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be
|
|
||||||
* included in all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
|
|
||||||
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
*
|
|
||||||
* IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
|
|
||||||
* INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER
|
|
||||||
* RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF
|
|
||||||
* THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT
|
|
||||||
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*
|
|
||||||
* In addition, the following condition applies:
|
|
||||||
*
|
|
||||||
* All redistributions must retain an intact copy of this copyright notice
|
|
||||||
* and disclaimer.
|
|
||||||
*/
|
|
||||||
|
|
||||||
Address all questions regarding this license to:
|
|
||||||
|
|
||||||
Tom Wu
|
|
||||||
tjw@cs.Stanford.EDU
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
/var/log/rippled/
|
|
||||||
/var/lib/rippled/
|
|
||||||
/etc/systemd/system/rippled.service.d/
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
README.md
|
|
||||||
LICENSE.md
|
|
||||||
RELEASENOTES.md
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
opt/ripple/include
|
|
||||||
opt/ripple/lib/*.a
|
|
||||||
opt/ripple/lib/cmake/ripple
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
/var/log/rippled-reporting/
|
|
||||||
/var/lib/rippled-reporting/
|
|
||||||
/etc/systemd/system/rippled-reporting.service.d/
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
bld/rippled-reporting/rippled-reporting opt/rippled-reporting/bin
|
|
||||||
cfg/rippled-reporting.cfg opt/rippled-reporting/etc
|
|
||||||
debian/tmp/opt/rippled-reporting/etc/validators.txt opt/rippled-reporting/etc
|
|
||||||
|
|
||||||
opt/rippled-reporting/bin/update-rippled-reporting.sh
|
|
||||||
opt/rippled-reporting/bin/getRippledReportingInfo
|
|
||||||
opt/rippled-reporting/etc/update-rippled-reporting-cron
|
|
||||||
etc/logrotate.d/rippled-reporting
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
opt/rippled-reporting/etc/rippled-reporting.cfg etc/opt/rippled-reporting/rippled-reporting.cfg
|
|
||||||
opt/rippled-reporting/etc/validators.txt etc/opt/rippled-reporting/validators.txt
|
|
||||||
opt/rippled-reporting/bin/rippled-reporting usr/local/bin/rippled-reporting
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
set -e
|
|
||||||
|
|
||||||
USER_NAME=rippled-reporting
|
|
||||||
GROUP_NAME=rippled-reporting
|
|
||||||
case "$1" in
|
|
||||||
configure)
|
|
||||||
id -u $USER_NAME >/dev/null 2>&1 || \
|
|
||||||
adduser --system --quiet \
|
|
||||||
--home /nonexistent --no-create-home \
|
|
||||||
--disabled-password \
|
|
||||||
--group "$GROUP_NAME"
|
|
||||||
chown -R $USER_NAME:$GROUP_NAME /var/log/rippled-reporting/
|
|
||||||
chown -R $USER_NAME:$GROUP_NAME /var/lib/rippled-reporting/
|
|
||||||
chmod 755 /var/log/rippled-reporting/
|
|
||||||
chmod 755 /var/lib/rippled-reporting/
|
|
||||||
chown -R $USER_NAME:$GROUP_NAME /opt/rippled-reporting
|
|
||||||
|
|
||||||
;;
|
|
||||||
|
|
||||||
abort-upgrade|abort-remove|abort-deconfigure)
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
echo "postinst called with unknown argument \`$1'" >&2
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
|
|
||||||
#DEBHELPER#
|
|
||||||
|
|
||||||
exit 0
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
/opt/ripple/etc/rippled.cfg
|
|
||||||
/opt/ripple/etc/validators.txt
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
opt/ripple/bin/rippled
|
|
||||||
opt/ripple/bin/validator-keys
|
|
||||||
opt/ripple/bin/update-rippled.sh
|
|
||||||
opt/ripple/bin/getRippledInfo
|
|
||||||
opt/ripple/etc/rippled.cfg
|
|
||||||
opt/ripple/etc/validators.txt
|
|
||||||
opt/ripple/etc/update-rippled-cron
|
|
||||||
etc/logrotate.d/rippled
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
opt/ripple/etc/rippled.cfg etc/opt/ripple/rippled.cfg
|
|
||||||
opt/ripple/etc/validators.txt etc/opt/ripple/validators.txt
|
|
||||||
opt/ripple/bin/rippled usr/local/bin/rippled
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
set -e
|
|
||||||
|
|
||||||
USER_NAME=rippled
|
|
||||||
GROUP_NAME=rippled
|
|
||||||
case "$1" in
|
|
||||||
configure)
|
|
||||||
id -u $USER_NAME >/dev/null 2>&1 || \
|
|
||||||
adduser --system --quiet \
|
|
||||||
--home /nonexistent --no-create-home \
|
|
||||||
--disabled-password \
|
|
||||||
--group "$GROUP_NAME"
|
|
||||||
chown -R $USER_NAME:$GROUP_NAME /var/log/rippled/
|
|
||||||
chown -R $USER_NAME:$GROUP_NAME /var/lib/rippled/
|
|
||||||
chown -R $USER_NAME:$GROUP_NAME /opt/ripple
|
|
||||||
chmod 755 /var/log/rippled/
|
|
||||||
chmod 755 /var/lib/rippled/
|
|
||||||
chmod 644 /opt/ripple/etc/update-rippled-cron
|
|
||||||
chmod 644 /etc/logrotate.d/rippled
|
|
||||||
chown -R root:$GROUP_NAME /opt/ripple/etc/update-rippled-cron
|
|
||||||
;;
|
|
||||||
|
|
||||||
abort-upgrade|abort-remove|abort-deconfigure)
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
echo "postinst called with unknown argument \`$1'" >&2
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
|
|
||||||
#DEBHELPER#
|
|
||||||
|
|
||||||
exit 0
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
set -e
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
echo "postrm called with unknown argument \`$1'" >&2
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
|
|
||||||
#DEBHELPER#
|
|
||||||
|
|
||||||
exit 0
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
set -e
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
install|upgrade)
|
|
||||||
;;
|
|
||||||
|
|
||||||
abort-upgrade)
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
echo "preinst called with unknown argument \`$1'" >&2
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
|
|
||||||
#DEBHELPER#
|
|
||||||
|
|
||||||
exit 0
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
set -e
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
remove|upgrade|deconfigure)
|
|
||||||
;;
|
|
||||||
|
|
||||||
failed-upgrade)
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
echo "prerm called with unknown argument \`$1'" >&2
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
|
|
||||||
#DEBHELPER#
|
|
||||||
|
|
||||||
exit 0
|
|
||||||
@@ -1,80 +0,0 @@
|
|||||||
#!/usr/bin/make -f
|
|
||||||
export DH_VERBOSE = 1
|
|
||||||
export DH_OPTIONS = -v
|
|
||||||
# debuild sets some warnings that don't work well
|
|
||||||
# for our curent build..so try to remove those flags here:
|
|
||||||
export CFLAGS:=$(subst -Wformat,,$(CFLAGS))
|
|
||||||
export CFLAGS:=$(subst -Werror=format-security,,$(CFLAGS))
|
|
||||||
export CXXFLAGS:=$(subst -Wformat,,$(CXXFLAGS))
|
|
||||||
export CXXFLAGS:=$(subst -Werror=format-security,,$(CXXFLAGS))
|
|
||||||
|
|
||||||
%:
|
|
||||||
dh $@ --with systemd
|
|
||||||
|
|
||||||
override_dh_systemd_start:
|
|
||||||
dh_systemd_start --no-restart-on-upgrade
|
|
||||||
|
|
||||||
override_dh_auto_configure:
|
|
||||||
env
|
|
||||||
rm -rf bld
|
|
||||||
|
|
||||||
conan export external/snappy snappy/1.1.9@
|
|
||||||
|
|
||||||
conan install . \
|
|
||||||
--install-folder bld/rippled \
|
|
||||||
--build missing \
|
|
||||||
--build boost \
|
|
||||||
--build sqlite3 \
|
|
||||||
--settings build_type=Release
|
|
||||||
|
|
||||||
cmake -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake \
|
|
||||||
-G Ninja \
|
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
|
||||||
-DCMAKE_INSTALL_PREFIX=/opt/ripple \
|
|
||||||
-Dstatic=ON \
|
|
||||||
-Dunity=OFF \
|
|
||||||
-DCMAKE_VERBOSE_MAKEFILE=ON \
|
|
||||||
-Dvalidator_keys=ON \
|
|
||||||
-B bld/rippled
|
|
||||||
|
|
||||||
conan install . \
|
|
||||||
--install-folder bld/rippled-reporting \
|
|
||||||
--build missing \
|
|
||||||
--build boost \
|
|
||||||
--build sqlite3 \
|
|
||||||
--build libuv \
|
|
||||||
--settings build_type=Release \
|
|
||||||
--options reporting=True
|
|
||||||
|
|
||||||
cmake -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake \
|
|
||||||
-G Ninja \
|
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
|
||||||
-DCMAKE_INSTALL_PREFIX=/opt/rippled-reporting \
|
|
||||||
-Dstatic=ON \
|
|
||||||
-Dunity=OFF \
|
|
||||||
-DCMAKE_VERBOSE_MAKEFILE=ON \
|
|
||||||
-Dreporting=ON \
|
|
||||||
-B bld/rippled-reporting
|
|
||||||
|
|
||||||
override_dh_auto_build:
|
|
||||||
cmake --build bld/rippled --target rippled --target validator-keys -j${nproc}
|
|
||||||
|
|
||||||
cmake --build bld/rippled-reporting --target rippled -j${nproc}
|
|
||||||
|
|
||||||
override_dh_auto_install:
|
|
||||||
cmake --install bld/rippled --prefix debian/tmp/opt/ripple
|
|
||||||
install -D bld/rippled/validator-keys/validator-keys debian/tmp/opt/ripple/bin/validator-keys
|
|
||||||
install -D Builds/containers/shared/update-rippled.sh debian/tmp/opt/ripple/bin/update-rippled.sh
|
|
||||||
install -D bin/getRippledInfo debian/tmp/opt/ripple/bin/getRippledInfo
|
|
||||||
install -D Builds/containers/shared/update-rippled-cron debian/tmp/opt/ripple/etc/update-rippled-cron
|
|
||||||
install -D Builds/containers/shared/rippled-logrotate debian/tmp/etc/logrotate.d/rippled
|
|
||||||
rm -rf debian/tmp/opt/ripple/lib64/cmake/date
|
|
||||||
|
|
||||||
mkdir -p debian/tmp/opt/rippled-reporting/etc
|
|
||||||
mkdir -p debian/tmp/opt/rippled-reporting/bin
|
|
||||||
cp cfg/validators-example.txt debian/tmp/opt/rippled-reporting/etc/validators.txt
|
|
||||||
|
|
||||||
sed -E 's/rippled?/rippled-reporting/g' Builds/containers/shared/update-rippled.sh > debian/tmp/opt/rippled-reporting/bin/update-rippled-reporting.sh
|
|
||||||
sed -E 's/rippled?/rippled-reporting/g' bin/getRippledInfo > debian/tmp/opt/rippled-reporting/bin/getRippledReportingInfo
|
|
||||||
sed -E 's/rippled?/rippled-reporting/g' Builds/containers/shared/update-rippled-cron > debian/tmp/opt/rippled-reporting/etc/update-rippled-reporting-cron
|
|
||||||
sed -E 's/rippled?/rippled-reporting/g' Builds/containers/shared/rippled-logrotate > debian/tmp/etc/logrotate.d/rippled-reporting
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
3.0 (quilt)
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
#abort-on-upstream-changes
|
|
||||||
#unapply-patches
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
enable rippled-reporting.service
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
enable rippled.service
|
|
||||||
@@ -1,82 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -ex
|
|
||||||
|
|
||||||
cd /opt/rippled_bld/pkg
|
|
||||||
cp -fpu rippled/Builds/containers/packaging/rpm/rippled.spec .
|
|
||||||
cp -fpu rippled/Builds/containers/shared/update_sources.sh .
|
|
||||||
source update_sources.sh
|
|
||||||
|
|
||||||
# Build the rpm
|
|
||||||
|
|
||||||
IFS='-' read -r RIPPLED_RPM_VERSION RELEASE <<< "$RIPPLED_VERSION"
|
|
||||||
export RIPPLED_RPM_VERSION
|
|
||||||
|
|
||||||
RPM_RELEASE=${RPM_RELEASE-1}
|
|
||||||
|
|
||||||
# post-release version
|
|
||||||
if [ "hf" = "$(echo "$RELEASE" | cut -c -2)" ]; then
|
|
||||||
RPM_RELEASE="${RPM_RELEASE}.${RELEASE}"
|
|
||||||
# pre-release version (-b or -rc)
|
|
||||||
elif [[ $RELEASE ]]; then
|
|
||||||
RPM_RELEASE="0.${RPM_RELEASE}.${RELEASE}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
export RPM_RELEASE
|
|
||||||
|
|
||||||
if [[ $RPM_PATCH ]]; then
|
|
||||||
RPM_PATCH=".${RPM_PATCH}"
|
|
||||||
export RPM_PATCH
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd /opt/rippled_bld/pkg/rippled
|
|
||||||
|
|
||||||
if [[ -n $(git status --porcelain) ]]; then
|
|
||||||
git status
|
|
||||||
error "Unstaged changes in this repo - please commit first"
|
|
||||||
fi
|
|
||||||
|
|
||||||
git archive --format tar.gz --prefix rippled/ -o ../rpmbuild/SOURCES/rippled.tar.gz HEAD
|
|
||||||
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
source /opt/rh/devtoolset-11/enable
|
|
||||||
|
|
||||||
rpmbuild --define "_topdir ${PWD}/rpmbuild" -ba rippled.spec
|
|
||||||
|
|
||||||
rc=$?; if [[ $rc != 0 ]]; then
|
|
||||||
error "error building rpm"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Make a tar of the rpm and source rpm
|
|
||||||
RPM_VERSION_RELEASE=$(rpm -qp --qf='%{NAME}-%{VERSION}-%{RELEASE}' ./rpmbuild/RPMS/x86_64/rippled-[0-9]*.rpm)
|
|
||||||
tar_file=$RPM_VERSION_RELEASE.tar.gz
|
|
||||||
|
|
||||||
cp ./rpmbuild/RPMS/x86_64/* ${PKG_OUTDIR}
|
|
||||||
cp ./rpmbuild/SRPMS/* ${PKG_OUTDIR}
|
|
||||||
|
|
||||||
RPM_MD5SUM=$(rpm -q --queryformat '%{SIGMD5}\n' -p ./rpmbuild/RPMS/x86_64/rippled-[0-9]*.rpm 2>/dev/null)
|
|
||||||
DBG_MD5SUM=$(rpm -q --queryformat '%{SIGMD5}\n' -p ./rpmbuild/RPMS/x86_64/rippled-debuginfo*.rpm 2>/dev/null)
|
|
||||||
DEV_MD5SUM=$(rpm -q --queryformat '%{SIGMD5}\n' -p ./rpmbuild/RPMS/x86_64/rippled-devel*.rpm 2>/dev/null)
|
|
||||||
REP_MD5SUM=$(rpm -q --queryformat '%{SIGMD5}\n' -p ./rpmbuild/RPMS/x86_64/rippled-reporting*.rpm 2>/dev/null)
|
|
||||||
SRC_MD5SUM=$(rpm -q --queryformat '%{SIGMD5}\n' -p ./rpmbuild/SRPMS/*.rpm 2>/dev/null)
|
|
||||||
|
|
||||||
RPM_SHA256="$(sha256sum ./rpmbuild/RPMS/x86_64/rippled-[0-9]*.rpm | awk '{ print $1}')"
|
|
||||||
DBG_SHA256="$(sha256sum ./rpmbuild/RPMS/x86_64/rippled-debuginfo*.rpm | awk '{ print $1}')"
|
|
||||||
REP_SHA256="$(sha256sum ./rpmbuild/RPMS/x86_64/rippled-reporting*.rpm | awk '{ print $1}')"
|
|
||||||
DEV_SHA256="$(sha256sum ./rpmbuild/RPMS/x86_64/rippled-devel*.rpm | awk '{ print $1}')"
|
|
||||||
SRC_SHA256="$(sha256sum ./rpmbuild/SRPMS/*.rpm | awk '{ print $1}')"
|
|
||||||
|
|
||||||
echo "rpm_md5sum=$RPM_MD5SUM" > ${PKG_OUTDIR}/build_vars
|
|
||||||
echo "rep_md5sum=$REP_MD5SUM" >> ${PKG_OUTDIR}/build_vars
|
|
||||||
echo "dbg_md5sum=$DBG_MD5SUM" >> ${PKG_OUTDIR}/build_vars
|
|
||||||
echo "dev_md5sum=$DEV_MD5SUM" >> ${PKG_OUTDIR}/build_vars
|
|
||||||
echo "src_md5sum=$SRC_MD5SUM" >> ${PKG_OUTDIR}/build_vars
|
|
||||||
echo "rpm_sha256=$RPM_SHA256" >> ${PKG_OUTDIR}/build_vars
|
|
||||||
echo "rep_sha256=$REP_SHA256" >> ${PKG_OUTDIR}/build_vars
|
|
||||||
echo "dbg_sha256=$DBG_SHA256" >> ${PKG_OUTDIR}/build_vars
|
|
||||||
echo "dev_sha256=$DEV_SHA256" >> ${PKG_OUTDIR}/build_vars
|
|
||||||
echo "src_sha256=$SRC_SHA256" >> ${PKG_OUTDIR}/build_vars
|
|
||||||
echo "rippled_version=$RIPPLED_VERSION" >> ${PKG_OUTDIR}/build_vars
|
|
||||||
echo "rpm_version=$RIPPLED_RPM_VERSION" >> ${PKG_OUTDIR}/build_vars
|
|
||||||
echo "rpm_file_name=$tar_file" >> ${PKG_OUTDIR}/build_vars
|
|
||||||
echo "rpm_version_release=$RPM_VERSION_RELEASE" >> ${PKG_OUTDIR}/build_vars
|
|
||||||
@@ -1,236 +0,0 @@
|
|||||||
%define rippled_version %(echo $RIPPLED_RPM_VERSION)
|
|
||||||
%define rpm_release %(echo $RPM_RELEASE)
|
|
||||||
%define rpm_patch %(echo $RPM_PATCH)
|
|
||||||
%define _prefix /opt/ripple
|
|
||||||
|
|
||||||
Name: rippled
|
|
||||||
# Dashes in Version extensions must be converted to underscores
|
|
||||||
Version: %{rippled_version}
|
|
||||||
Release: %{rpm_release}%{?dist}%{rpm_patch}
|
|
||||||
Summary: rippled daemon
|
|
||||||
|
|
||||||
License: MIT
|
|
||||||
URL: http://ripple.com/
|
|
||||||
Source0: rippled.tar.gz
|
|
||||||
|
|
||||||
BuildRequires: cmake zlib-static ninja-build
|
|
||||||
|
|
||||||
%description
|
|
||||||
rippled
|
|
||||||
|
|
||||||
%package devel
|
|
||||||
Summary: Files for development of applications using xrpl core library
|
|
||||||
Group: Development/Libraries
|
|
||||||
Requires: zlib-static
|
|
||||||
|
|
||||||
%description devel
|
|
||||||
core library for development of standalone applications that sign transactions.
|
|
||||||
|
|
||||||
%package reporting
|
|
||||||
Summary: Reporting Server for rippled
|
|
||||||
|
|
||||||
%description reporting
|
|
||||||
History server for XRP Ledger
|
|
||||||
|
|
||||||
%prep
|
|
||||||
%setup -c -n rippled
|
|
||||||
|
|
||||||
%build
|
|
||||||
rm -rf ~/.conan/profiles/default
|
|
||||||
|
|
||||||
cp /opt/libcstd/libstdc++.so.6.0.22 /usr/lib64
|
|
||||||
cp /opt/libcstd/libstdc++.so.6.0.22 /lib64
|
|
||||||
ln -sf /usr/lib64/libstdc++.so.6.0.22 /usr/lib64/libstdc++.so.6
|
|
||||||
ln -sf /lib64/libstdc++.so.6.0.22 /usr/lib64/libstdc++.so.6
|
|
||||||
|
|
||||||
source /opt/rh/rh-python38/enable
|
|
||||||
pip install "conan<2"
|
|
||||||
conan profile new default --detect
|
|
||||||
conan profile update settings.compiler.libcxx=libstdc++11 default
|
|
||||||
conan profile update settings.compiler.cppstd=20 default
|
|
||||||
|
|
||||||
cd rippled
|
|
||||||
|
|
||||||
mkdir -p bld.rippled
|
|
||||||
conan export external/snappy snappy/1.1.9@
|
|
||||||
|
|
||||||
pushd bld.rippled
|
|
||||||
conan install .. \
|
|
||||||
--settings build_type=Release \
|
|
||||||
--output-folder . \
|
|
||||||
--build missing
|
|
||||||
|
|
||||||
cmake -G Ninja \
|
|
||||||
-DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake \
|
|
||||||
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
|
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
|
||||||
-Dunity=OFF \
|
|
||||||
-Dstatic=ON \
|
|
||||||
-Dvalidator_keys=ON \
|
|
||||||
-DCMAKE_VERBOSE_MAKEFILE=ON \
|
|
||||||
..
|
|
||||||
|
|
||||||
cmake --build . --parallel $(nproc) --target rippled --target validator-keys
|
|
||||||
popd
|
|
||||||
|
|
||||||
mkdir -p bld.rippled-reporting
|
|
||||||
pushd bld.rippled-reporting
|
|
||||||
|
|
||||||
conan install .. \
|
|
||||||
--settings build_type=Release \
|
|
||||||
--output-folder . \
|
|
||||||
--build missing \
|
|
||||||
--settings compiler.cppstd=17 \
|
|
||||||
--options reporting=True
|
|
||||||
|
|
||||||
cmake -G Ninja \
|
|
||||||
-DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake \
|
|
||||||
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
|
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
|
||||||
-Dunity=OFF \
|
|
||||||
-Dstatic=ON \
|
|
||||||
-Dvalidator_keys=ON \
|
|
||||||
-Dreporting=ON \
|
|
||||||
-DCMAKE_VERBOSE_MAKEFILE=ON \
|
|
||||||
..
|
|
||||||
|
|
||||||
cmake --build . --parallel $(nproc) --target rippled
|
|
||||||
|
|
||||||
%pre
|
|
||||||
test -e /etc/pki/tls || { mkdir -p /etc/pki; ln -s /usr/lib/ssl /etc/pki/tls; }
|
|
||||||
|
|
||||||
%install
|
|
||||||
rm -rf $RPM_BUILD_ROOT
|
|
||||||
DESTDIR=$RPM_BUILD_ROOT cmake --build rippled/bld.rippled --target install #-- -v
|
|
||||||
mkdir -p $RPM_BUILD_ROOT
|
|
||||||
rm -rf ${RPM_BUILD_ROOT}/%{_prefix}/lib64/
|
|
||||||
install -d ${RPM_BUILD_ROOT}/etc/opt/ripple
|
|
||||||
install -d ${RPM_BUILD_ROOT}/usr/local/bin
|
|
||||||
|
|
||||||
install -D ./rippled/cfg/rippled-example.cfg ${RPM_BUILD_ROOT}/%{_prefix}/etc/rippled.cfg
|
|
||||||
install -D ./rippled/cfg/validators-example.txt ${RPM_BUILD_ROOT}/%{_prefix}/etc/validators.txt
|
|
||||||
|
|
||||||
ln -sf %{_prefix}/etc/rippled.cfg ${RPM_BUILD_ROOT}/etc/opt/ripple/rippled.cfg
|
|
||||||
ln -sf %{_prefix}/etc/validators.txt ${RPM_BUILD_ROOT}/etc/opt/ripple/validators.txt
|
|
||||||
ln -sf %{_prefix}/bin/rippled ${RPM_BUILD_ROOT}/usr/local/bin/rippled
|
|
||||||
install -D rippled/bld.rippled/validator-keys/validator-keys ${RPM_BUILD_ROOT}%{_bindir}/validator-keys
|
|
||||||
install -D ./rippled/Builds/containers/shared/rippled.service ${RPM_BUILD_ROOT}/usr/lib/systemd/system/rippled.service
|
|
||||||
install -D ./rippled/Builds/containers/packaging/rpm/50-rippled.preset ${RPM_BUILD_ROOT}/usr/lib/systemd/system-preset/50-rippled.preset
|
|
||||||
install -D ./rippled/Builds/containers/shared/update-rippled.sh ${RPM_BUILD_ROOT}%{_bindir}/update-rippled.sh
|
|
||||||
install -D ./rippled/bin/getRippledInfo ${RPM_BUILD_ROOT}%{_bindir}/getRippledInfo
|
|
||||||
install -D ./rippled/Builds/containers/shared/update-rippled-cron ${RPM_BUILD_ROOT}%{_prefix}/etc/update-rippled-cron
|
|
||||||
install -D ./rippled/Builds/containers/shared/rippled-logrotate ${RPM_BUILD_ROOT}/etc/logrotate.d/rippled
|
|
||||||
install -d $RPM_BUILD_ROOT/var/log/rippled
|
|
||||||
install -d $RPM_BUILD_ROOT/var/lib/rippled
|
|
||||||
|
|
||||||
# reporting mode
|
|
||||||
%define _prefix /opt/rippled-reporting
|
|
||||||
mkdir -p ${RPM_BUILD_ROOT}/etc/opt/rippled-reporting/
|
|
||||||
install -D rippled/bld.rippled-reporting/rippled-reporting ${RPM_BUILD_ROOT}%{_bindir}/rippled-reporting
|
|
||||||
install -D ./rippled/cfg/rippled-reporting.cfg ${RPM_BUILD_ROOT}%{_prefix}/etc/rippled-reporting.cfg
|
|
||||||
install -D ./rippled/cfg/validators-example.txt ${RPM_BUILD_ROOT}%{_prefix}/etc/validators.txt
|
|
||||||
install -D ./rippled/Builds/containers/packaging/rpm/50-rippled-reporting.preset ${RPM_BUILD_ROOT}/usr/lib/systemd/system-preset/50-rippled-reporting.preset
|
|
||||||
ln -s %{_prefix}/bin/rippled-reporting ${RPM_BUILD_ROOT}/usr/local/bin/rippled-reporting
|
|
||||||
ln -s %{_prefix}/etc/rippled-reporting.cfg ${RPM_BUILD_ROOT}/etc/opt/rippled-reporting/rippled-reporting.cfg
|
|
||||||
ln -s %{_prefix}/etc/validators.txt ${RPM_BUILD_ROOT}/etc/opt/rippled-reporting/validators.txt
|
|
||||||
install -d $RPM_BUILD_ROOT/var/log/rippled-reporting
|
|
||||||
install -d $RPM_BUILD_ROOT/var/lib/rippled-reporting
|
|
||||||
install -D ./rippled/Builds/containers/shared/rippled-reporting.service ${RPM_BUILD_ROOT}/usr/lib/systemd/system/rippled-reporting.service
|
|
||||||
sed -E 's/rippled?/rippled-reporting/g' ./rippled/Builds/containers/shared/update-rippled.sh > ${RPM_BUILD_ROOT}%{_bindir}/update-rippled-reporting.sh
|
|
||||||
sed -E 's/rippled?/rippled-reporting/g' ./rippled/bin/getRippledInfo > ${RPM_BUILD_ROOT}%{_bindir}/getRippledReportingInfo
|
|
||||||
sed -E 's/rippled?/rippled-reporting/g' ./rippled/Builds/containers/shared/update-rippled-cron > ${RPM_BUILD_ROOT}%{_prefix}/etc/update-rippled-reporting-cron
|
|
||||||
sed -E 's/rippled?/rippled-reporting/g' ./rippled/Builds/containers/shared/rippled-logrotate > ${RPM_BUILD_ROOT}/etc/logrotate.d/rippled-reporting
|
|
||||||
|
|
||||||
|
|
||||||
%post
|
|
||||||
%define _prefix /opt/ripple
|
|
||||||
USER_NAME=rippled
|
|
||||||
GROUP_NAME=rippled
|
|
||||||
|
|
||||||
getent passwd $USER_NAME &>/dev/null || useradd $USER_NAME
|
|
||||||
getent group $GROUP_NAME &>/dev/null || groupadd $GROUP_NAME
|
|
||||||
|
|
||||||
chown -R $USER_NAME:$GROUP_NAME /var/log/rippled/
|
|
||||||
chown -R $USER_NAME:$GROUP_NAME /var/lib/rippled/
|
|
||||||
chown -R $USER_NAME:$GROUP_NAME %{_prefix}/
|
|
||||||
|
|
||||||
chmod 755 /var/log/rippled/
|
|
||||||
chmod 755 /var/lib/rippled/
|
|
||||||
|
|
||||||
chmod 644 %{_prefix}/etc/update-rippled-cron
|
|
||||||
chmod 644 /etc/logrotate.d/rippled
|
|
||||||
chown -R root:$GROUP_NAME %{_prefix}/etc/update-rippled-cron
|
|
||||||
|
|
||||||
%post reporting
|
|
||||||
%define _prefix /opt/rippled-reporting
|
|
||||||
USER_NAME=rippled-reporting
|
|
||||||
GROUP_NAME=rippled-reporting
|
|
||||||
|
|
||||||
getent passwd $USER_NAME &>/dev/null || useradd -r $USER_NAME
|
|
||||||
getent group $GROUP_NAME &>/dev/null || groupadd $GROUP_NAME
|
|
||||||
|
|
||||||
chown -R $USER_NAME:$GROUP_NAME /var/log/rippled-reporting/
|
|
||||||
chown -R $USER_NAME:$GROUP_NAME /var/lib/rippled-reporting/
|
|
||||||
chown -R $USER_NAME:$GROUP_NAME %{_prefix}/
|
|
||||||
|
|
||||||
chmod 755 /var/log/rippled-reporting/
|
|
||||||
chmod 755 /var/lib/rippled-reporting/
|
|
||||||
chmod -x /usr/lib/systemd/system/rippled-reporting.service
|
|
||||||
|
|
||||||
|
|
||||||
%files
|
|
||||||
%define _prefix /opt/ripple
|
|
||||||
%doc rippled/README.md rippled/LICENSE.md
|
|
||||||
%{_bindir}/rippled
|
|
||||||
/usr/local/bin/rippled
|
|
||||||
%{_bindir}/update-rippled.sh
|
|
||||||
%{_bindir}/getRippledInfo
|
|
||||||
%{_prefix}/etc/update-rippled-cron
|
|
||||||
%{_bindir}/validator-keys
|
|
||||||
%config(noreplace) %{_prefix}/etc/rippled.cfg
|
|
||||||
%config(noreplace) /etc/opt/ripple/rippled.cfg
|
|
||||||
%config(noreplace) %{_prefix}/etc/validators.txt
|
|
||||||
%config(noreplace) /etc/opt/ripple/validators.txt
|
|
||||||
%config(noreplace) /etc/logrotate.d/rippled
|
|
||||||
%config(noreplace) /usr/lib/systemd/system/rippled.service
|
|
||||||
%config(noreplace) /usr/lib/systemd/system-preset/50-rippled.preset
|
|
||||||
|
|
||||||
%dir /var/log/rippled/
|
|
||||||
%dir /var/lib/rippled/
|
|
||||||
|
|
||||||
%files devel
|
|
||||||
%{_prefix}/include
|
|
||||||
%{_prefix}/lib/*.a
|
|
||||||
%{_prefix}/lib/cmake/ripple
|
|
||||||
|
|
||||||
%files reporting
|
|
||||||
%define _prefix /opt/rippled-reporting
|
|
||||||
%doc rippled/README.md rippled/LICENSE.md
|
|
||||||
|
|
||||||
%{_bindir}/rippled-reporting
|
|
||||||
/usr/local/bin/rippled-reporting
|
|
||||||
%config(noreplace) /etc/opt/rippled-reporting/rippled-reporting.cfg
|
|
||||||
%config(noreplace) %{_prefix}/etc/rippled-reporting.cfg
|
|
||||||
%config(noreplace) %{_prefix}/etc/validators.txt
|
|
||||||
%config(noreplace) /etc/opt/rippled-reporting/validators.txt
|
|
||||||
%config(noreplace) /usr/lib/systemd/system/rippled-reporting.service
|
|
||||||
%config(noreplace) /usr/lib/systemd/system-preset/50-rippled-reporting.preset
|
|
||||||
%dir /var/log/rippled-reporting/
|
|
||||||
%dir /var/lib/rippled-reporting/
|
|
||||||
%{_bindir}/update-rippled-reporting.sh
|
|
||||||
%{_bindir}/getRippledReportingInfo
|
|
||||||
%{_prefix}/etc/update-rippled-reporting-cron
|
|
||||||
%config(noreplace) /etc/logrotate.d/rippled-reporting
|
|
||||||
|
|
||||||
%changelog
|
|
||||||
* Wed Aug 28 2019 Mike Ellery <mellery451@gmail.com>
|
|
||||||
- Switch to subproject build for validator-keys
|
|
||||||
|
|
||||||
* Wed May 15 2019 Mike Ellery <mellery451@gmail.com>
|
|
||||||
- Make validator-keys use local rippled build for core lib
|
|
||||||
|
|
||||||
* Wed Aug 01 2018 Mike Ellery <mellery451@gmail.com>
|
|
||||||
- add devel package for signing library
|
|
||||||
|
|
||||||
* Thu Jun 02 2016 Brandon Wilson <bwilson@ripple.com>
|
|
||||||
- Install validators.txt
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
IFS=. read cm_maj cm_min cm_rel <<<"$1"
|
|
||||||
: ${cm_rel:-0}
|
|
||||||
CMAKE_ROOT=${2:-"${HOME}/cmake"}
|
|
||||||
|
|
||||||
function cmake_version ()
|
|
||||||
{
|
|
||||||
if [[ -d ${CMAKE_ROOT} ]] ; then
|
|
||||||
local perms=$(test $(uname) = "Linux" && echo "/111" || echo "+111")
|
|
||||||
local installed=$(find ${CMAKE_ROOT} -perm ${perms} -type f -name cmake)
|
|
||||||
if [[ "${installed}" != "" ]] ; then
|
|
||||||
echo "$(${installed} --version | head -1)"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
installed=$(cmake_version)
|
|
||||||
if [[ "${installed}" != "" && ${installed} =~ ${cm_maj}.${cm_min}.${cm_rel} ]] ; then
|
|
||||||
echo "cmake already installed: ${installed}"
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
# From CMake 20+ "Linux" is lowercase so using `uname` won't create be the correct path
|
|
||||||
if [ ${cm_min} -gt 19 ]; then
|
|
||||||
linux="linux"
|
|
||||||
else
|
|
||||||
linux=$(uname)
|
|
||||||
fi
|
|
||||||
pkgname="cmake-${cm_maj}.${cm_min}.${cm_rel}-${linux}-x86_64.tar.gz"
|
|
||||||
tmppkg="/tmp/cmake.tar.gz"
|
|
||||||
wget --quiet https://cmake.org/files/v${cm_maj}.${cm_min}/${pkgname} -O ${tmppkg}
|
|
||||||
mkdir -p ${CMAKE_ROOT}
|
|
||||||
cd ${CMAKE_ROOT}
|
|
||||||
tar --strip-components 1 -xf ${tmppkg}
|
|
||||||
rm -f ${tmppkg}
|
|
||||||
echo "installed: $(cmake_version)"
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
/var/log/rippled/*.log {
|
|
||||||
daily
|
|
||||||
minsize 200M
|
|
||||||
rotate 7
|
|
||||||
nocreate
|
|
||||||
missingok
|
|
||||||
notifempty
|
|
||||||
compress
|
|
||||||
compresscmd /usr/bin/nice
|
|
||||||
compressoptions -n19 ionice -c3 gzip
|
|
||||||
compressext .gz
|
|
||||||
postrotate
|
|
||||||
/opt/ripple/bin/rippled --conf /opt/ripple/etc/rippled.cfg logrotate
|
|
||||||
endscript
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=Ripple Daemon
|
|
||||||
After=network-online.target
|
|
||||||
Wants=network-online.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=simple
|
|
||||||
ExecStart=/opt/rippled-reporting/bin/rippled-reporting --silent --conf /etc/opt/rippled-reporting/rippled-reporting.cfg
|
|
||||||
Restart=on-failure
|
|
||||||
User=rippled-reporting
|
|
||||||
Group=rippled-reporting
|
|
||||||
LimitNOFILE=65536
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=Ripple Daemon
|
|
||||||
After=network-online.target
|
|
||||||
Wants=network-online.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=simple
|
|
||||||
ExecStart=/opt/ripple/bin/rippled --net --silent --conf /etc/opt/ripple/rippled.cfg
|
|
||||||
Restart=on-failure
|
|
||||||
User=rippled
|
|
||||||
Group=rippled
|
|
||||||
LimitNOFILE=65536
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
# For automatic updates, symlink this file to /etc/cron.d/
|
|
||||||
# Do not remove the newline at the end of this cron script
|
|
||||||
|
|
||||||
# bash required for use of RANDOM below.
|
|
||||||
SHELL=/bin/bash
|
|
||||||
PATH=/sbin;/bin;/usr/sbin;/usr/bin
|
|
||||||
|
|
||||||
# invoke check/update script with random delay up to 59 mins
|
|
||||||
0 * * * * root sleep $((RANDOM*3540/32768)) && /opt/ripple/bin/update-rippled.sh
|
|
||||||
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# auto-update script for rippled daemon
|
|
||||||
|
|
||||||
# Check for sudo/root permissions
|
|
||||||
if [[ $(id -u) -ne 0 ]] ; then
|
|
||||||
echo "This update script must be run as root or sudo"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
LOCKDIR=/tmp/rippleupdate.lock
|
|
||||||
UPDATELOG=/var/log/rippled/update.log
|
|
||||||
|
|
||||||
function cleanup {
|
|
||||||
# If this directory isn't removed, future updates will fail.
|
|
||||||
rmdir $LOCKDIR
|
|
||||||
}
|
|
||||||
|
|
||||||
# Use mkdir to check if process is already running. mkdir is atomic, as against file create.
|
|
||||||
if ! mkdir $LOCKDIR 2>/dev/null; then
|
|
||||||
echo $(date -u) "lockdir exists - won't proceed." >> $UPDATELOG
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
trap cleanup EXIT
|
|
||||||
|
|
||||||
source /etc/os-release
|
|
||||||
can_update=false
|
|
||||||
|
|
||||||
if [[ "$ID" == "ubuntu" || "$ID" == "debian" ]] ; then
|
|
||||||
# Silent update
|
|
||||||
apt-get update -qq
|
|
||||||
|
|
||||||
# The next line is an "awk"ward way to check if the package needs to be updated.
|
|
||||||
RIPPLE=$(apt-get install -s --only-upgrade rippled | awk '/^Inst/ { print $2 }')
|
|
||||||
test "$RIPPLE" == "rippled" && can_update=true
|
|
||||||
|
|
||||||
function apply_update {
|
|
||||||
apt-get install rippled -qq
|
|
||||||
}
|
|
||||||
elif [[ "$ID" == "fedora" || "$ID" == "centos" || "$ID" == "rhel" || "$ID" == "scientific" ]] ; then
|
|
||||||
RIPPLE_REPO=${RIPPLE_REPO-stable}
|
|
||||||
yum --disablerepo=* --enablerepo=ripple-$RIPPLE_REPO clean expire-cache
|
|
||||||
|
|
||||||
yum check-update -q --enablerepo=ripple-$RIPPLE_REPO rippled || can_update=true
|
|
||||||
|
|
||||||
function apply_update {
|
|
||||||
yum update -y --enablerepo=ripple-$RIPPLE_REPO rippled
|
|
||||||
}
|
|
||||||
else
|
|
||||||
echo "unrecognized distro!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Do the actual update and restart the service after reloading systemctl daemon.
|
|
||||||
if [ "$can_update" = true ] ; then
|
|
||||||
exec 3>&1 1>>${UPDATELOG} 2>&1
|
|
||||||
set -e
|
|
||||||
apply_update
|
|
||||||
systemctl daemon-reload
|
|
||||||
systemctl restart rippled.service
|
|
||||||
echo $(date -u) "rippled daemon updated."
|
|
||||||
else
|
|
||||||
echo $(date -u) "no updates available" >> $UPDATELOG
|
|
||||||
fi
|
|
||||||
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
function error {
|
|
||||||
echo $1
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
cd /opt/rippled_bld/pkg/rippled
|
|
||||||
export RIPPLED_VERSION=$(egrep -i -o "\b(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-[0-9a-z\-]+(\.[0-9a-z\-]+)*)?(\+[0-9a-z\-]+(\.[0-9a-z\-]+)*)?\b" src/ripple/protocol/impl/BuildInfo.cpp)
|
|
||||||
|
|
||||||
: ${PKG_OUTDIR:=/opt/rippled_bld/pkg/out}
|
|
||||||
export PKG_OUTDIR
|
|
||||||
if [ ! -d ${PKG_OUTDIR} ]; then
|
|
||||||
error "${PKG_OUTDIR} is not mounted"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -x ${OPENSSL_ROOT}/bin/openssl ]; then
|
|
||||||
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${OPENSSL_ROOT}/lib ${OPENSSL_ROOT}/bin/openssl version -a
|
|
||||||
fi
|
|
||||||
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
ARG DIST_TAG=18.04
|
|
||||||
FROM ubuntu:$DIST_TAG
|
|
||||||
ARG GIT_COMMIT=unknown
|
|
||||||
ARG CI_USE=false
|
|
||||||
LABEL git-commit=$GIT_COMMIT
|
|
||||||
|
|
||||||
WORKDIR /root
|
|
||||||
COPY ubuntu-builder/ubuntu_setup.sh .
|
|
||||||
RUN ./ubuntu_setup.sh && rm ubuntu_setup.sh
|
|
||||||
|
|
||||||
RUN mkdir -m 777 -p /opt/rippled_bld/pkg/
|
|
||||||
WORKDIR /opt/rippled_bld/pkg
|
|
||||||
|
|
||||||
COPY packaging/dpkg/build_dpkg.sh ./
|
|
||||||
CMD ./build_dpkg.sh
|
|
||||||
@@ -1,76 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -o errexit
|
|
||||||
set -o nounset
|
|
||||||
set -o xtrace
|
|
||||||
|
|
||||||
# Parameters
|
|
||||||
|
|
||||||
gcc_version=${GCC_VERSION:-10}
|
|
||||||
cmake_version=${CMAKE_VERSION:-3.25.1}
|
|
||||||
conan_version=${CONAN_VERSION:-1.59}
|
|
||||||
|
|
||||||
apt update
|
|
||||||
# Iteratively build the list of packages to install so that we can interleave
|
|
||||||
# the lines with comments explaining their inclusion.
|
|
||||||
dependencies=''
|
|
||||||
# - to identify the Ubuntu version
|
|
||||||
dependencies+=' lsb-release'
|
|
||||||
# - for add-apt-repository
|
|
||||||
dependencies+=' software-properties-common'
|
|
||||||
# - to download CMake
|
|
||||||
dependencies+=' curl'
|
|
||||||
# - to build CMake
|
|
||||||
dependencies+=' libssl-dev'
|
|
||||||
# - Python headers for Boost.Python
|
|
||||||
dependencies+=' python3-dev'
|
|
||||||
# - to install Conan
|
|
||||||
dependencies+=' python3-pip'
|
|
||||||
# - to download rippled
|
|
||||||
dependencies+=' git'
|
|
||||||
# - CMake generators (but not CMake itself)
|
|
||||||
dependencies+=' make ninja-build'
|
|
||||||
apt install --yes ${dependencies}
|
|
||||||
|
|
||||||
add-apt-repository --yes ppa:ubuntu-toolchain-r/test
|
|
||||||
apt install --yes gcc-${gcc_version} g++-${gcc_version} \
|
|
||||||
debhelper debmake debsums gnupg dh-buildinfo dh-make dh-systemd cmake \
|
|
||||||
ninja-build zlib1g-dev make cmake ninja-build autoconf automake \
|
|
||||||
pkg-config apt-transport-https
|
|
||||||
|
|
||||||
# Give us nice unversioned aliases for gcc and company.
|
|
||||||
update-alternatives --install \
|
|
||||||
/usr/bin/gcc gcc /usr/bin/gcc-${gcc_version} 100 \
|
|
||||||
--slave /usr/bin/g++ g++ /usr/bin/g++-${gcc_version} \
|
|
||||||
--slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-${gcc_version} \
|
|
||||||
--slave /usr/bin/gcc-nm gcc-nm /usr/bin/gcc-nm-${gcc_version} \
|
|
||||||
--slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-${gcc_version} \
|
|
||||||
--slave /usr/bin/gcov gcov /usr/bin/gcov-${gcc_version} \
|
|
||||||
--slave /usr/bin/gcov-tool gcov-tool /usr/bin/gcov-dump-${gcc_version} \
|
|
||||||
--slave /usr/bin/gcov-dump gcov-dump /usr/bin/gcov-tool-${gcc_version}
|
|
||||||
update-alternatives --auto gcc
|
|
||||||
|
|
||||||
# Download and unpack CMake.
|
|
||||||
cmake_slug="cmake-${cmake_version}"
|
|
||||||
curl --location --remote-name \
|
|
||||||
"https://github.com/Kitware/CMake/releases/download/v${cmake_version}/${cmake_slug}.tar.gz"
|
|
||||||
tar xzf ${cmake_slug}.tar.gz
|
|
||||||
rm ${cmake_slug}.tar.gz
|
|
||||||
|
|
||||||
# Build and install CMake.
|
|
||||||
cd ${cmake_slug}
|
|
||||||
./bootstrap --parallel=$(nproc)
|
|
||||||
make --jobs $(nproc)
|
|
||||||
make install
|
|
||||||
cd ..
|
|
||||||
rm --recursive --force ${cmake_slug}
|
|
||||||
|
|
||||||
# Install Conan.
|
|
||||||
pip3 install conan==${conan_version}
|
|
||||||
|
|
||||||
conan profile new --detect gcc
|
|
||||||
conan profile update settings.compiler=gcc gcc
|
|
||||||
conan profile update settings.compiler.version=${gcc_version} gcc
|
|
||||||
conan profile update settings.compiler.libcxx=libstdc++11 gcc
|
|
||||||
conan profile update env.CC=/usr/bin/gcc gcc
|
|
||||||
conan profile update env.CXX=/usr/bin/g++ gcc
|
|
||||||
@@ -25,28 +25,28 @@ more dependencies listed later.
|
|||||||
**tl;dr:** The modules listed first are more independent than the modules
|
**tl;dr:** The modules listed first are more independent than the modules
|
||||||
listed later.
|
listed later.
|
||||||
|
|
||||||
| Level / Tier | Module(s) |
|
| Level / Tier | Module(s) |
|
||||||
|--------------|-----------------------------------------------|
|
| ------------ | -------------------------------------------------------------------------------------------------------- |
|
||||||
| 01 | ripple/beast ripple/unity
|
| 01 | ripple/beast ripple/unity |
|
||||||
| 02 | ripple/basics
|
| 02 | ripple/basics |
|
||||||
| 03 | ripple/json ripple/crypto
|
| 03 | ripple/json ripple/crypto |
|
||||||
| 04 | ripple/protocol
|
| 04 | ripple/protocol |
|
||||||
| 05 | ripple/core ripple/conditions ripple/consensus ripple/resource ripple/server
|
| 05 | ripple/core ripple/conditions ripple/consensus ripple/resource ripple/server |
|
||||||
| 06 | ripple/peerfinder ripple/ledger ripple/nodestore ripple/net
|
| 06 | ripple/peerfinder ripple/ledger ripple/nodestore ripple/net |
|
||||||
| 07 | ripple/shamap ripple/overlay
|
| 07 | ripple/shamap ripple/overlay |
|
||||||
| 08 | ripple/app
|
| 08 | ripple/app |
|
||||||
| 09 | ripple/rpc
|
| 09 | ripple/rpc |
|
||||||
| 10 | ripple/perflog
|
| 10 | ripple/perflog |
|
||||||
| 11 | test/jtx test/beast test/csf
|
| 11 | test/jtx test/beast test/csf |
|
||||||
| 12 | test/unit_test
|
| 12 | test/unit_test |
|
||||||
| 13 | test/crypto test/conditions test/json test/resource test/shamap test/peerfinder test/basics test/overlay
|
| 13 | test/crypto test/conditions test/json test/resource test/shamap test/peerfinder test/basics test/overlay |
|
||||||
| 14 | test
|
| 14 | test |
|
||||||
| 15 | test/net test/protocol test/ledger test/consensus test/core test/server test/nodestore
|
| 15 | test/net test/protocol test/ledger test/consensus test/core test/server test/nodestore |
|
||||||
| 16 | test/rpc test/app
|
| 16 | test/rpc test/app |
|
||||||
|
|
||||||
(Note that `test` levelization is *much* less important and *much* less
|
(Note that `test` levelization is _much_ less important and _much_ less
|
||||||
strictly enforced than `ripple` levelization, other than the requirement
|
strictly enforced than `ripple` levelization, other than the requirement
|
||||||
that `test` code should *never* be included in `ripple` code.)
|
that `test` code should _never_ be included in `ripple` code.)
|
||||||
|
|
||||||
## Validation
|
## Validation
|
||||||
|
|
||||||
@@ -59,48 +59,48 @@ the rippled source. The only caveat is that it runs much slower
|
|||||||
under Windows than in Linux. It hasn't yet been tested under MacOS.
|
under Windows than in Linux. It hasn't yet been tested under MacOS.
|
||||||
It generates many files of [results](results):
|
It generates many files of [results](results):
|
||||||
|
|
||||||
* `rawincludes.txt`: The raw dump of the `#includes`
|
- `rawincludes.txt`: The raw dump of the `#includes`
|
||||||
* `paths.txt`: A second dump grouping the source module
|
- `paths.txt`: A second dump grouping the source module
|
||||||
to the destination module, deduped, and with frequency counts.
|
to the destination module, deduped, and with frequency counts.
|
||||||
* `includes/`: A directory where each file represents a module and
|
- `includes/`: A directory where each file represents a module and
|
||||||
contains a list of modules and counts that the module _includes_.
|
contains a list of modules and counts that the module _includes_.
|
||||||
* `includedby/`: Similar to `includes/`, but the other way around. Each
|
- `includedby/`: Similar to `includes/`, but the other way around. Each
|
||||||
file represents a module and contains a list of modules and counts
|
file represents a module and contains a list of modules and counts
|
||||||
that _include_ the module.
|
that _include_ the module.
|
||||||
* [`loops.txt`](results/loops.txt): A list of direct loops detected
|
- [`loops.txt`](results/loops.txt): A list of direct loops detected
|
||||||
between modules as they actually exist, as opposed to how they are
|
between modules as they actually exist, as opposed to how they are
|
||||||
desired as described above. In a perfect repo, this file will be
|
desired as described above. In a perfect repo, this file will be
|
||||||
empty.
|
empty.
|
||||||
This file is committed to the repo, and is used by the [levelization
|
This file is committed to the repo, and is used by the [levelization
|
||||||
Github workflow](../../.github/workflows/levelization.yml) to validate
|
Github workflow](../../.github/workflows/levelization.yml) to validate
|
||||||
that nothing changed.
|
that nothing changed.
|
||||||
* [`ordering.txt`](results/ordering.txt): A list showing relationships
|
- [`ordering.txt`](results/ordering.txt): A list showing relationships
|
||||||
between modules where there are no loops as they actually exist, as
|
between modules where there are no loops as they actually exist, as
|
||||||
opposed to how they are desired as described above.
|
opposed to how they are desired as described above.
|
||||||
This file is committed to the repo, and is used by the [levelization
|
This file is committed to the repo, and is used by the [levelization
|
||||||
Github workflow](../../.github/workflows/levelization.yml) to validate
|
Github workflow](../../.github/workflows/levelization.yml) to validate
|
||||||
that nothing changed.
|
that nothing changed.
|
||||||
* [`levelization.yml`](../../.github/workflows/levelization.yml)
|
- [`levelization.yml`](../../.github/workflows/levelization.yml)
|
||||||
Github Actions workflow to test that levelization loops haven't
|
Github Actions workflow to test that levelization loops haven't
|
||||||
changed. Unfortunately, if changes are detected, it can't tell if
|
changed. Unfortunately, if changes are detected, it can't tell if
|
||||||
they are improvements or not, so if you have resolved any issues or
|
they are improvements or not, so if you have resolved any issues or
|
||||||
done anything else to improve levelization, run `levelization.sh`,
|
done anything else to improve levelization, run `levelization.sh`,
|
||||||
and commit the updated results.
|
and commit the updated results.
|
||||||
|
|
||||||
The `loops.txt` and `ordering.txt` files relate the modules
|
The `loops.txt` and `ordering.txt` files relate the modules
|
||||||
using comparison signs, which indicate the number of times each
|
using comparison signs, which indicate the number of times each
|
||||||
module is included in the other.
|
module is included in the other.
|
||||||
|
|
||||||
* `A > B` means that A should probably be at a higher level than B,
|
- `A > B` means that A should probably be at a higher level than B,
|
||||||
because B is included in A significantly more than A is included in B.
|
because B is included in A significantly more than A is included in B.
|
||||||
These results can be included in both `loops.txt` and `ordering.txt`.
|
These results can be included in both `loops.txt` and `ordering.txt`.
|
||||||
Because `ordering.txt`only includes relationships where B is not
|
Because `ordering.txt`only includes relationships where B is not
|
||||||
included in A at all, it will only include these types of results.
|
included in A at all, it will only include these types of results.
|
||||||
* `A ~= B` means that A and B are included in each other a different
|
- `A ~= B` means that A and B are included in each other a different
|
||||||
number of times, but the values are so close that the script can't
|
number of times, but the values are so close that the script can't
|
||||||
definitively say that one should be above the other. These results
|
definitively say that one should be above the other. These results
|
||||||
will only be included in `loops.txt`.
|
will only be included in `loops.txt`.
|
||||||
* `A == B` means that A and B include each other the same number of
|
- `A == B` means that A and B include each other the same number of
|
||||||
times, so the script has no clue which should be higher. These results
|
times, so the script has no clue which should be higher. These results
|
||||||
will only be included in `loops.txt`.
|
will only be included in `loops.txt`.
|
||||||
|
|
||||||
@@ -110,5 +110,5 @@ get those details locally.
|
|||||||
|
|
||||||
1. Run `levelization.sh`
|
1. Run `levelization.sh`
|
||||||
2. Grep the modules in `paths.txt`.
|
2. Grep the modules in `paths.txt`.
|
||||||
* For example, if a cycle is found `A ~= B`, simply `grep -w
|
- For example, if a cycle is found `A ~= B`, simply `grep -w
|
||||||
A Builds/levelization/results/paths.txt | grep -w B`
|
A Builds/levelization/results/paths.txt | grep -w B`
|
||||||
|
|||||||
@@ -13,12 +13,15 @@ then
|
|||||||
git clean -ix
|
git clean -ix
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Ensure all sorting is ASCII-order consistently across platforms.
|
||||||
|
export LANG=C
|
||||||
|
|
||||||
rm -rfv results
|
rm -rfv results
|
||||||
mkdir results
|
mkdir results
|
||||||
includes="$( pwd )/results/rawincludes.txt"
|
includes="$( pwd )/results/rawincludes.txt"
|
||||||
pushd ../..
|
pushd ../..
|
||||||
echo Raw includes:
|
echo Raw includes:
|
||||||
grep -r '#include.*/.*\.h' src/ripple/ src/test/ | \
|
grep -r '^[ ]*#include.*/.*\.h' include src | \
|
||||||
grep -v boost | tee ${includes}
|
grep -v boost | tee ${includes}
|
||||||
popd
|
popd
|
||||||
pushd results
|
pushd results
|
||||||
|
|||||||
@@ -1,51 +1,33 @@
|
|||||||
Loop: ripple.app ripple.core
|
|
||||||
ripple.app > ripple.core
|
|
||||||
|
|
||||||
Loop: ripple.app ripple.ledger
|
|
||||||
ripple.app > ripple.ledger
|
|
||||||
|
|
||||||
Loop: ripple.app ripple.net
|
|
||||||
ripple.app > ripple.net
|
|
||||||
|
|
||||||
Loop: ripple.app ripple.nodestore
|
|
||||||
ripple.app > ripple.nodestore
|
|
||||||
|
|
||||||
Loop: ripple.app ripple.overlay
|
|
||||||
ripple.overlay ~= ripple.app
|
|
||||||
|
|
||||||
Loop: ripple.app ripple.peerfinder
|
|
||||||
ripple.app > ripple.peerfinder
|
|
||||||
|
|
||||||
Loop: ripple.app ripple.rpc
|
|
||||||
ripple.rpc > ripple.app
|
|
||||||
|
|
||||||
Loop: ripple.app ripple.shamap
|
|
||||||
ripple.app > ripple.shamap
|
|
||||||
|
|
||||||
Loop: ripple.basics ripple.core
|
|
||||||
ripple.core > ripple.basics
|
|
||||||
|
|
||||||
Loop: ripple.basics ripple.json
|
|
||||||
ripple.json ~= ripple.basics
|
|
||||||
|
|
||||||
Loop: ripple.basics ripple.protocol
|
|
||||||
ripple.protocol > ripple.basics
|
|
||||||
|
|
||||||
Loop: ripple.core ripple.net
|
|
||||||
ripple.net > ripple.core
|
|
||||||
|
|
||||||
Loop: ripple.net ripple.rpc
|
|
||||||
ripple.rpc > ripple.net
|
|
||||||
|
|
||||||
Loop: ripple.nodestore ripple.overlay
|
|
||||||
ripple.overlay ~= ripple.nodestore
|
|
||||||
|
|
||||||
Loop: ripple.overlay ripple.rpc
|
|
||||||
ripple.rpc ~= ripple.overlay
|
|
||||||
|
|
||||||
Loop: test.jtx test.toplevel
|
Loop: test.jtx test.toplevel
|
||||||
test.toplevel > test.jtx
|
test.toplevel > test.jtx
|
||||||
|
|
||||||
Loop: test.jtx test.unit_test
|
Loop: test.jtx test.unit_test
|
||||||
test.unit_test == test.jtx
|
test.unit_test == test.jtx
|
||||||
|
|
||||||
|
Loop: xrpld.app xrpld.core
|
||||||
|
xrpld.app > xrpld.core
|
||||||
|
|
||||||
|
Loop: xrpld.app xrpld.ledger
|
||||||
|
xrpld.app > xrpld.ledger
|
||||||
|
|
||||||
|
Loop: xrpld.app xrpld.overlay
|
||||||
|
xrpld.overlay > xrpld.app
|
||||||
|
|
||||||
|
Loop: xrpld.app xrpld.peerfinder
|
||||||
|
xrpld.peerfinder ~= xrpld.app
|
||||||
|
|
||||||
|
Loop: xrpld.app xrpld.rpc
|
||||||
|
xrpld.rpc > xrpld.app
|
||||||
|
|
||||||
|
Loop: xrpld.app xrpld.shamap
|
||||||
|
xrpld.app > xrpld.shamap
|
||||||
|
|
||||||
|
Loop: xrpld.core xrpld.perflog
|
||||||
|
xrpld.perflog == xrpld.core
|
||||||
|
|
||||||
|
Loop: xrpld.overlay xrpld.rpc
|
||||||
|
xrpld.rpc ~= xrpld.overlay
|
||||||
|
|
||||||
|
Loop: xrpld.perflog xrpld.rpc
|
||||||
|
xrpld.rpc ~= xrpld.perflog
|
||||||
|
|
||||||
|
|||||||
@@ -1,228 +1,209 @@
|
|||||||
ripple.app > ripple.basics
|
libxrpl.basics > xrpl.basics
|
||||||
ripple.app > ripple.beast
|
libxrpl.crypto > xrpl.basics
|
||||||
ripple.app > ripple.conditions
|
libxrpl.json > xrpl.basics
|
||||||
ripple.app > ripple.consensus
|
libxrpl.json > xrpl.json
|
||||||
ripple.app > ripple.crypto
|
libxrpl.net > xrpl.basics
|
||||||
ripple.app > ripple.json
|
libxrpl.net > xrpl.net
|
||||||
ripple.app > ripple.protocol
|
libxrpl.protocol > xrpl.basics
|
||||||
ripple.app > ripple.resource
|
libxrpl.protocol > xrpl.json
|
||||||
ripple.app > test.unit_test
|
libxrpl.protocol > xrpl.protocol
|
||||||
ripple.basics > ripple.beast
|
libxrpl.resource > xrpl.basics
|
||||||
ripple.conditions > ripple.basics
|
libxrpl.resource > xrpl.json
|
||||||
ripple.conditions > ripple.protocol
|
libxrpl.resource > xrpl.resource
|
||||||
ripple.consensus > ripple.basics
|
libxrpl.server > xrpl.basics
|
||||||
ripple.consensus > ripple.beast
|
libxrpl.server > xrpl.json
|
||||||
ripple.consensus > ripple.json
|
libxrpl.server > xrpl.protocol
|
||||||
ripple.consensus > ripple.protocol
|
libxrpl.server > xrpl.server
|
||||||
ripple.core > ripple.beast
|
libxrpl.telemetry > xrpl.basics
|
||||||
ripple.core > ripple.json
|
libxrpl.telemetry > xrpl.json
|
||||||
ripple.core > ripple.protocol
|
libxrpl.telemetry > xrpl.telemetry
|
||||||
ripple.crypto > ripple.basics
|
|
||||||
ripple.json > ripple.beast
|
|
||||||
ripple.ledger > ripple.basics
|
|
||||||
ripple.ledger > ripple.beast
|
|
||||||
ripple.ledger > ripple.core
|
|
||||||
ripple.ledger > ripple.json
|
|
||||||
ripple.ledger > ripple.protocol
|
|
||||||
ripple.net > ripple.basics
|
|
||||||
ripple.net > ripple.beast
|
|
||||||
ripple.net > ripple.json
|
|
||||||
ripple.net > ripple.protocol
|
|
||||||
ripple.net > ripple.resource
|
|
||||||
ripple.nodestore > ripple.basics
|
|
||||||
ripple.nodestore > ripple.beast
|
|
||||||
ripple.nodestore > ripple.core
|
|
||||||
ripple.nodestore > ripple.json
|
|
||||||
ripple.nodestore > ripple.protocol
|
|
||||||
ripple.nodestore > ripple.unity
|
|
||||||
ripple.overlay > ripple.basics
|
|
||||||
ripple.overlay > ripple.beast
|
|
||||||
ripple.overlay > ripple.core
|
|
||||||
ripple.overlay > ripple.json
|
|
||||||
ripple.overlay > ripple.peerfinder
|
|
||||||
ripple.overlay > ripple.protocol
|
|
||||||
ripple.overlay > ripple.resource
|
|
||||||
ripple.overlay > ripple.server
|
|
||||||
ripple.peerfinder > ripple.basics
|
|
||||||
ripple.peerfinder > ripple.beast
|
|
||||||
ripple.peerfinder > ripple.core
|
|
||||||
ripple.peerfinder > ripple.protocol
|
|
||||||
ripple.perflog > ripple.basics
|
|
||||||
ripple.perflog > ripple.beast
|
|
||||||
ripple.perflog > ripple.core
|
|
||||||
ripple.perflog > ripple.json
|
|
||||||
ripple.perflog > ripple.nodestore
|
|
||||||
ripple.perflog > ripple.protocol
|
|
||||||
ripple.perflog > ripple.rpc
|
|
||||||
ripple.protocol > ripple.beast
|
|
||||||
ripple.protocol > ripple.crypto
|
|
||||||
ripple.protocol > ripple.json
|
|
||||||
ripple.resource > ripple.basics
|
|
||||||
ripple.resource > ripple.beast
|
|
||||||
ripple.resource > ripple.json
|
|
||||||
ripple.resource > ripple.protocol
|
|
||||||
ripple.rpc > ripple.basics
|
|
||||||
ripple.rpc > ripple.beast
|
|
||||||
ripple.rpc > ripple.core
|
|
||||||
ripple.rpc > ripple.crypto
|
|
||||||
ripple.rpc > ripple.json
|
|
||||||
ripple.rpc > ripple.ledger
|
|
||||||
ripple.rpc > ripple.nodestore
|
|
||||||
ripple.rpc > ripple.protocol
|
|
||||||
ripple.rpc > ripple.resource
|
|
||||||
ripple.rpc > ripple.server
|
|
||||||
ripple.rpc > ripple.shamap
|
|
||||||
ripple.server > ripple.basics
|
|
||||||
ripple.server > ripple.beast
|
|
||||||
ripple.server > ripple.crypto
|
|
||||||
ripple.server > ripple.json
|
|
||||||
ripple.server > ripple.protocol
|
|
||||||
ripple.shamap > ripple.basics
|
|
||||||
ripple.shamap > ripple.beast
|
|
||||||
ripple.shamap > ripple.crypto
|
|
||||||
ripple.shamap > ripple.nodestore
|
|
||||||
ripple.shamap > ripple.protocol
|
|
||||||
test.app > ripple.app
|
|
||||||
test.app > ripple.basics
|
|
||||||
test.app > ripple.beast
|
|
||||||
test.app > ripple.core
|
|
||||||
test.app > ripple.json
|
|
||||||
test.app > ripple.ledger
|
|
||||||
test.app > ripple.overlay
|
|
||||||
test.app > ripple.protocol
|
|
||||||
test.app > ripple.resource
|
|
||||||
test.app > ripple.rpc
|
|
||||||
test.app > test.jtx
|
test.app > test.jtx
|
||||||
test.app > test.rpc
|
test.app > test.rpc
|
||||||
test.app > test.toplevel
|
test.app > test.toplevel
|
||||||
test.app > test.unit_test
|
test.app > test.unit_test
|
||||||
test.basics > ripple.basics
|
test.app > xrpl.basics
|
||||||
test.basics > ripple.beast
|
test.app > xrpld.app
|
||||||
test.basics > ripple.json
|
test.app > xrpld.core
|
||||||
test.basics > ripple.protocol
|
test.app > xrpld.ledger
|
||||||
test.basics > ripple.rpc
|
test.app > xrpld.nodestore
|
||||||
|
test.app > xrpld.overlay
|
||||||
|
test.app > xrpld.rpc
|
||||||
|
test.app > xrpl.json
|
||||||
|
test.app > xrpl.protocol
|
||||||
|
test.app > xrpl.resource
|
||||||
test.basics > test.jtx
|
test.basics > test.jtx
|
||||||
test.basics > test.unit_test
|
test.basics > test.unit_test
|
||||||
test.beast > ripple.basics
|
test.basics > xrpl.basics
|
||||||
test.beast > ripple.beast
|
test.basics > xrpld.perflog
|
||||||
test.conditions > ripple.basics
|
test.basics > xrpld.rpc
|
||||||
test.conditions > ripple.beast
|
test.basics > xrpl.json
|
||||||
test.conditions > ripple.conditions
|
test.basics > xrpl.protocol
|
||||||
test.consensus > ripple.app
|
test.beast > xrpl.basics
|
||||||
test.consensus > ripple.basics
|
test.conditions > xrpl.basics
|
||||||
test.consensus > ripple.beast
|
test.conditions > xrpld.conditions
|
||||||
test.consensus > ripple.consensus
|
|
||||||
test.consensus > ripple.ledger
|
|
||||||
test.consensus > test.csf
|
test.consensus > test.csf
|
||||||
test.consensus > test.toplevel
|
test.consensus > test.toplevel
|
||||||
test.consensus > test.unit_test
|
test.consensus > test.unit_test
|
||||||
test.core > ripple.basics
|
test.consensus > xrpl.basics
|
||||||
test.core > ripple.beast
|
test.consensus > xrpld.app
|
||||||
test.core > ripple.core
|
test.consensus > xrpld.consensus
|
||||||
test.core > ripple.crypto
|
test.consensus > xrpld.ledger
|
||||||
test.core > ripple.json
|
test.consensus > xrpl.json
|
||||||
test.core > ripple.server
|
|
||||||
test.core > test.jtx
|
test.core > test.jtx
|
||||||
test.core > test.toplevel
|
test.core > test.toplevel
|
||||||
test.core > test.unit_test
|
test.core > test.unit_test
|
||||||
test.csf > ripple.basics
|
test.core > xrpl.basics
|
||||||
test.csf > ripple.beast
|
test.core > xrpld.core
|
||||||
test.csf > ripple.consensus
|
test.core > xrpld.perflog
|
||||||
test.csf > ripple.json
|
test.core > xrpl.json
|
||||||
test.csf > ripple.protocol
|
test.core > xrpl.server
|
||||||
test.json > ripple.beast
|
test.csf > xrpl.basics
|
||||||
test.json > ripple.json
|
test.csf > xrpld.consensus
|
||||||
|
test.csf > xrpl.json
|
||||||
|
test.csf > xrpl.protocol
|
||||||
|
test.csf > xrpl.telemetry
|
||||||
test.json > test.jtx
|
test.json > test.jtx
|
||||||
test.jtx > ripple.app
|
test.json > xrpl.json
|
||||||
test.jtx > ripple.basics
|
test.jtx > xrpl.basics
|
||||||
test.jtx > ripple.beast
|
test.jtx > xrpld.app
|
||||||
test.jtx > ripple.consensus
|
test.jtx > xrpld.core
|
||||||
test.jtx > ripple.core
|
test.jtx > xrpld.ledger
|
||||||
test.jtx > ripple.json
|
test.jtx > xrpld.rpc
|
||||||
test.jtx > ripple.ledger
|
test.jtx > xrpl.json
|
||||||
test.jtx > ripple.net
|
test.jtx > xrpl.net
|
||||||
test.jtx > ripple.protocol
|
test.jtx > xrpl.protocol
|
||||||
test.jtx > ripple.server
|
test.jtx > xrpl.resource
|
||||||
test.ledger > ripple.app
|
test.jtx > xrpl.server
|
||||||
test.ledger > ripple.basics
|
|
||||||
test.ledger > ripple.beast
|
|
||||||
test.ledger > ripple.core
|
|
||||||
test.ledger > ripple.ledger
|
|
||||||
test.ledger > ripple.protocol
|
|
||||||
test.ledger > test.jtx
|
test.ledger > test.jtx
|
||||||
test.ledger > test.toplevel
|
test.ledger > test.toplevel
|
||||||
test.net > ripple.net
|
test.ledger > xrpl.basics
|
||||||
test.net > test.jtx
|
test.ledger > xrpld.app
|
||||||
test.net > test.toplevel
|
test.ledger > xrpld.core
|
||||||
test.net > test.unit_test
|
test.ledger > xrpld.ledger
|
||||||
test.nodestore > ripple.app
|
test.ledger > xrpl.protocol
|
||||||
test.nodestore > ripple.basics
|
|
||||||
test.nodestore > ripple.beast
|
|
||||||
test.nodestore > ripple.core
|
|
||||||
test.nodestore > ripple.nodestore
|
|
||||||
test.nodestore > ripple.protocol
|
|
||||||
test.nodestore > ripple.unity
|
|
||||||
test.nodestore > test.jtx
|
test.nodestore > test.jtx
|
||||||
test.nodestore > test.toplevel
|
test.nodestore > test.toplevel
|
||||||
test.nodestore > test.unit_test
|
test.nodestore > test.unit_test
|
||||||
test.overlay > ripple.app
|
test.nodestore > xrpl.basics
|
||||||
test.overlay > ripple.basics
|
test.nodestore > xrpld.core
|
||||||
test.overlay > ripple.beast
|
test.nodestore > xrpld.nodestore
|
||||||
test.overlay > ripple.core
|
test.nodestore > xrpld.unity
|
||||||
test.overlay > ripple.overlay
|
|
||||||
test.overlay > ripple.peerfinder
|
|
||||||
test.overlay > ripple.protocol
|
|
||||||
test.overlay > ripple.shamap
|
|
||||||
test.overlay > test.jtx
|
test.overlay > test.jtx
|
||||||
|
test.overlay > test.toplevel
|
||||||
test.overlay > test.unit_test
|
test.overlay > test.unit_test
|
||||||
test.peerfinder > ripple.basics
|
test.overlay > xrpl.basics
|
||||||
test.peerfinder > ripple.beast
|
test.overlay > xrpld.app
|
||||||
test.peerfinder > ripple.core
|
test.overlay > xrpld.overlay
|
||||||
test.peerfinder > ripple.peerfinder
|
test.overlay > xrpld.peerfinder
|
||||||
test.peerfinder > ripple.protocol
|
test.overlay > xrpld.shamap
|
||||||
|
test.overlay > xrpl.protocol
|
||||||
test.peerfinder > test.beast
|
test.peerfinder > test.beast
|
||||||
test.peerfinder > test.unit_test
|
test.peerfinder > test.unit_test
|
||||||
test.protocol > ripple.basics
|
test.peerfinder > xrpl.basics
|
||||||
test.protocol > ripple.beast
|
test.peerfinder > xrpld.core
|
||||||
test.protocol > ripple.crypto
|
test.peerfinder > xrpld.peerfinder
|
||||||
test.protocol > ripple.json
|
test.peerfinder > xrpl.protocol
|
||||||
test.protocol > ripple.protocol
|
|
||||||
test.protocol > test.toplevel
|
test.protocol > test.toplevel
|
||||||
test.resource > ripple.basics
|
test.protocol > xrpl.basics
|
||||||
test.resource > ripple.beast
|
test.protocol > xrpl.json
|
||||||
test.resource > ripple.resource
|
test.protocol > xrpl.protocol
|
||||||
test.resource > test.unit_test
|
test.resource > test.unit_test
|
||||||
test.rpc > ripple.app
|
test.resource > xrpl.basics
|
||||||
test.rpc > ripple.basics
|
test.resource > xrpl.resource
|
||||||
test.rpc > ripple.beast
|
|
||||||
test.rpc > ripple.core
|
|
||||||
test.rpc > ripple.json
|
|
||||||
test.rpc > ripple.net
|
|
||||||
test.rpc > ripple.nodestore
|
|
||||||
test.rpc > ripple.overlay
|
|
||||||
test.rpc > ripple.protocol
|
|
||||||
test.rpc > ripple.resource
|
|
||||||
test.rpc > ripple.rpc
|
|
||||||
test.rpc > test.jtx
|
test.rpc > test.jtx
|
||||||
test.rpc > test.nodestore
|
|
||||||
test.rpc > test.toplevel
|
test.rpc > test.toplevel
|
||||||
test.server > ripple.app
|
test.rpc > xrpl.basics
|
||||||
test.server > ripple.basics
|
test.rpc > xrpld.app
|
||||||
test.server > ripple.beast
|
test.rpc > xrpld.core
|
||||||
test.server > ripple.core
|
test.rpc > xrpld.overlay
|
||||||
test.server > ripple.json
|
test.rpc > xrpld.rpc
|
||||||
test.server > ripple.rpc
|
test.rpc > xrpl.json
|
||||||
test.server > ripple.server
|
test.rpc > xrpl.protocol
|
||||||
|
test.rpc > xrpl.resource
|
||||||
test.server > test.jtx
|
test.server > test.jtx
|
||||||
test.server > test.toplevel
|
test.server > test.toplevel
|
||||||
test.server > test.unit_test
|
test.server > test.unit_test
|
||||||
test.shamap > ripple.basics
|
test.server > xrpl.basics
|
||||||
test.shamap > ripple.beast
|
test.server > xrpld.app
|
||||||
test.shamap > ripple.nodestore
|
test.server > xrpld.core
|
||||||
test.shamap > ripple.protocol
|
test.server > xrpld.rpc
|
||||||
test.shamap > ripple.shamap
|
test.server > xrpl.json
|
||||||
|
test.server > xrpl.server
|
||||||
test.shamap > test.unit_test
|
test.shamap > test.unit_test
|
||||||
test.toplevel > ripple.json
|
test.shamap > xrpl.basics
|
||||||
|
test.shamap > xrpld.nodestore
|
||||||
|
test.shamap > xrpld.shamap
|
||||||
|
test.shamap > xrpl.protocol
|
||||||
test.toplevel > test.csf
|
test.toplevel > test.csf
|
||||||
test.unit_test > ripple.basics
|
test.toplevel > xrpl.json
|
||||||
test.unit_test > ripple.beast
|
test.unit_test > xrpl.basics
|
||||||
|
tests.libxrpl > xrpl.basics
|
||||||
|
tests.libxrpl > xrpl.json
|
||||||
|
tests.libxrpl > xrpl.telemetry
|
||||||
|
xrpl.json > xrpl.basics
|
||||||
|
xrpl.net > xrpl.basics
|
||||||
|
xrpl.protocol > xrpl.basics
|
||||||
|
xrpl.protocol > xrpl.json
|
||||||
|
xrpl.resource > xrpl.basics
|
||||||
|
xrpl.resource > xrpl.json
|
||||||
|
xrpl.resource > xrpl.protocol
|
||||||
|
xrpl.resource > xrpl.telemetry
|
||||||
|
xrpl.server > xrpl.basics
|
||||||
|
xrpl.server > xrpl.json
|
||||||
|
xrpl.server > xrpl.protocol
|
||||||
|
xrpl.server > xrpl.telemetry
|
||||||
|
xrpl.telemetry > xrpl.json
|
||||||
|
xrpld.app > test.unit_test
|
||||||
|
xrpld.app > xrpl.basics
|
||||||
|
xrpld.app > xrpld.conditions
|
||||||
|
xrpld.app > xrpld.consensus
|
||||||
|
xrpld.app > xrpld.nodestore
|
||||||
|
xrpld.app > xrpld.perflog
|
||||||
|
xrpld.app > xrpl.json
|
||||||
|
xrpld.app > xrpl.net
|
||||||
|
xrpld.app > xrpl.protocol
|
||||||
|
xrpld.app > xrpl.resource
|
||||||
|
xrpld.app > xrpl.telemetry
|
||||||
|
xrpld.conditions > xrpl.basics
|
||||||
|
xrpld.conditions > xrpl.protocol
|
||||||
|
xrpld.consensus > xrpl.basics
|
||||||
|
xrpld.consensus > xrpl.json
|
||||||
|
xrpld.consensus > xrpl.protocol
|
||||||
|
xrpld.core > xrpl.basics
|
||||||
|
xrpld.core > xrpl.json
|
||||||
|
xrpld.core > xrpl.net
|
||||||
|
xrpld.core > xrpl.protocol
|
||||||
|
xrpld.core > xrpl.telemetry
|
||||||
|
xrpld.ledger > xrpl.basics
|
||||||
|
xrpld.ledger > xrpl.json
|
||||||
|
xrpld.ledger > xrpl.protocol
|
||||||
|
xrpld.nodestore > xrpl.basics
|
||||||
|
xrpld.nodestore > xrpld.core
|
||||||
|
xrpld.nodestore > xrpld.unity
|
||||||
|
xrpld.nodestore > xrpl.json
|
||||||
|
xrpld.nodestore > xrpl.protocol
|
||||||
|
xrpld.overlay > xrpl.basics
|
||||||
|
xrpld.overlay > xrpld.core
|
||||||
|
xrpld.overlay > xrpld.peerfinder
|
||||||
|
xrpld.overlay > xrpld.perflog
|
||||||
|
xrpld.overlay > xrpl.json
|
||||||
|
xrpld.overlay > xrpl.protocol
|
||||||
|
xrpld.overlay > xrpl.resource
|
||||||
|
xrpld.overlay > xrpl.server
|
||||||
|
xrpld.peerfinder > xrpl.basics
|
||||||
|
xrpld.peerfinder > xrpld.core
|
||||||
|
xrpld.peerfinder > xrpl.protocol
|
||||||
|
xrpld.perflog > xrpl.basics
|
||||||
|
xrpld.perflog > xrpl.json
|
||||||
|
xrpld.rpc > xrpl.basics
|
||||||
|
xrpld.rpc > xrpld.core
|
||||||
|
xrpld.rpc > xrpld.ledger
|
||||||
|
xrpld.rpc > xrpld.nodestore
|
||||||
|
xrpld.rpc > xrpl.json
|
||||||
|
xrpld.rpc > xrpl.net
|
||||||
|
xrpld.rpc > xrpl.protocol
|
||||||
|
xrpld.rpc > xrpl.resource
|
||||||
|
xrpld.rpc > xrpl.server
|
||||||
|
xrpld.shamap > xrpl.basics
|
||||||
|
xrpld.shamap > xrpld.nodestore
|
||||||
|
xrpld.shamap > xrpl.protocol
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
[Build instructions are currently located in `BUILD.md`](../../BUILD.md)
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
[Build instructions are currently located in `BUILD.md`](../../BUILD.md)
|
|
||||||
@@ -9,23 +9,43 @@ endif()
|
|||||||
|
|
||||||
# Fix "unrecognized escape" issues when passing CMAKE_MODULE_PATH on Windows.
|
# Fix "unrecognized escape" issues when passing CMAKE_MODULE_PATH on Windows.
|
||||||
file(TO_CMAKE_PATH "${CMAKE_MODULE_PATH}" CMAKE_MODULE_PATH)
|
file(TO_CMAKE_PATH "${CMAKE_MODULE_PATH}" CMAKE_MODULE_PATH)
|
||||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/Builds/CMake")
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||||
|
|
||||||
project(rippled)
|
project(xrpl)
|
||||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||||
set(CMAKE_CXX_STANDARD 20)
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
|
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||||
|
# GCC-specific fixes
|
||||||
|
add_compile_options(-Wno-unknown-pragmas -Wno-subobject-linkage)
|
||||||
|
# -Wno-subobject-linkage can be removed when we upgrade GCC version to at least 13.3
|
||||||
|
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||||
|
# Clang-specific fixes
|
||||||
|
add_compile_options(-Wno-unknown-warning-option) # Ignore unknown warning options
|
||||||
|
elseif(MSVC)
|
||||||
|
# MSVC-specific fixes
|
||||||
|
add_compile_options(/wd4068) # Ignore unknown pragmas
|
||||||
|
endif()
|
||||||
|
|
||||||
# make GIT_COMMIT_HASH define available to all sources
|
# make GIT_COMMIT_HASH define available to all sources
|
||||||
find_package(Git)
|
find_package(Git)
|
||||||
if(Git_FOUND)
|
if(Git_FOUND)
|
||||||
execute_process(COMMAND ${GIT_EXECUTABLE} describe --always --abbrev=40
|
execute_process(COMMAND ${GIT_EXECUTABLE} --git-dir=${CMAKE_CURRENT_SOURCE_DIR}/.git rev-parse HEAD
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE gch)
|
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE gch)
|
||||||
if(gch)
|
if(gch)
|
||||||
set(GIT_COMMIT_HASH "${gch}")
|
set(GIT_COMMIT_HASH "${gch}")
|
||||||
message(STATUS gch: ${GIT_COMMIT_HASH})
|
message(STATUS gch: ${GIT_COMMIT_HASH})
|
||||||
add_definitions(-DGIT_COMMIT_HASH="${GIT_COMMIT_HASH}")
|
add_definitions(-DGIT_COMMIT_HASH="${GIT_COMMIT_HASH}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
execute_process(COMMAND ${GIT_EXECUTABLE} --git-dir=${CMAKE_CURRENT_SOURCE_DIR}/.git rev-parse --abbrev-ref HEAD
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE gb)
|
||||||
|
if(gb)
|
||||||
|
set(GIT_BRANCH "${gb}")
|
||||||
|
message(STATUS gb: ${GIT_BRANCH})
|
||||||
|
add_definitions(-DGIT_BRANCH="${GIT_BRANCH}")
|
||||||
|
endif()
|
||||||
endif() #git
|
endif() #git
|
||||||
|
|
||||||
if(thread_safety_analysis)
|
if(thread_safety_analysis)
|
||||||
@@ -38,7 +58,6 @@ include (CheckCXXCompilerFlag)
|
|||||||
include (FetchContent)
|
include (FetchContent)
|
||||||
include (ExternalProject)
|
include (ExternalProject)
|
||||||
include (CMakeFuncs) # must come *after* ExternalProject b/c it overrides one function in EP
|
include (CMakeFuncs) # must come *after* ExternalProject b/c it overrides one function in EP
|
||||||
include (ProcessorCount)
|
|
||||||
if (target)
|
if (target)
|
||||||
message (FATAL_ERROR "The target option has been removed - use native cmake options to control build")
|
message (FATAL_ERROR "The target option has been removed - use native cmake options to control build")
|
||||||
endif ()
|
endif ()
|
||||||
@@ -46,7 +65,6 @@ endif ()
|
|||||||
include(RippledSanity)
|
include(RippledSanity)
|
||||||
include(RippledVersion)
|
include(RippledVersion)
|
||||||
include(RippledSettings)
|
include(RippledSettings)
|
||||||
include(RippledRelease)
|
|
||||||
# this check has to remain in the top-level cmake
|
# this check has to remain in the top-level cmake
|
||||||
# because of the early return statement
|
# because of the early return statement
|
||||||
if (packages_only)
|
if (packages_only)
|
||||||
@@ -71,8 +89,17 @@ find_package(OpenSSL 1.1.1 REQUIRED)
|
|||||||
set_target_properties(OpenSSL::SSL PROPERTIES
|
set_target_properties(OpenSSL::SSL PROPERTIES
|
||||||
INTERFACE_COMPILE_DEFINITIONS OPENSSL_NO_SSL2
|
INTERFACE_COMPILE_DEFINITIONS OPENSSL_NO_SSL2
|
||||||
)
|
)
|
||||||
add_subdirectory(src/secp256k1)
|
set(SECP256K1_INSTALL TRUE)
|
||||||
add_subdirectory(src/ed25519-donna)
|
set(SECP256K1_BUILD_BENCHMARK FALSE)
|
||||||
|
set(SECP256K1_BUILD_TESTS FALSE)
|
||||||
|
set(SECP256K1_BUILD_EXHAUSTIVE_TESTS FALSE)
|
||||||
|
set(SECP256K1_BUILD_CTIME_TESTS FALSE)
|
||||||
|
set(SECP256K1_BUILD_EXAMPLES FALSE)
|
||||||
|
add_subdirectory(external/secp256k1)
|
||||||
|
add_library(secp256k1::secp256k1 ALIAS secp256k1)
|
||||||
|
add_subdirectory(external/ed25519-donna)
|
||||||
|
add_subdirectory(external/antithesis-sdk)
|
||||||
|
find_package(gRPC REQUIRED)
|
||||||
find_package(lz4 REQUIRED)
|
find_package(lz4 REQUIRED)
|
||||||
# Target names with :: are not allowed in a generator expression.
|
# Target names with :: are not allowed in a generator expression.
|
||||||
# We need to pull the include directories and imported location properties
|
# We need to pull the include directories and imported location properties
|
||||||
@@ -80,7 +107,6 @@ find_package(lz4 REQUIRED)
|
|||||||
find_package(LibArchive REQUIRED)
|
find_package(LibArchive REQUIRED)
|
||||||
find_package(SOCI REQUIRED)
|
find_package(SOCI REQUIRED)
|
||||||
find_package(SQLite3 REQUIRED)
|
find_package(SQLite3 REQUIRED)
|
||||||
find_package(Snappy REQUIRED)
|
|
||||||
|
|
||||||
option(rocksdb "Enable RocksDB" ON)
|
option(rocksdb "Enable RocksDB" ON)
|
||||||
if(rocksdb)
|
if(rocksdb)
|
||||||
@@ -93,36 +119,38 @@ endif()
|
|||||||
|
|
||||||
find_package(nudb REQUIRED)
|
find_package(nudb REQUIRED)
|
||||||
find_package(date REQUIRED)
|
find_package(date REQUIRED)
|
||||||
include(deps/Protobuf)
|
find_package(xxHash REQUIRED)
|
||||||
include(deps/gRPC)
|
|
||||||
|
|
||||||
target_link_libraries(ripple_libs INTERFACE
|
target_link_libraries(ripple_libs INTERFACE
|
||||||
ed25519::ed25519
|
ed25519::ed25519
|
||||||
LibArchive::LibArchive
|
|
||||||
lz4::lz4
|
lz4::lz4
|
||||||
nudb::core
|
|
||||||
OpenSSL::Crypto
|
OpenSSL::Crypto
|
||||||
OpenSSL::SSL
|
OpenSSL::SSL
|
||||||
Ripple::grpc_pbufs
|
|
||||||
Ripple::pbufs
|
|
||||||
secp256k1::secp256k1
|
secp256k1::secp256k1
|
||||||
soci::soci
|
soci::soci
|
||||||
SQLite::SQLite3
|
SQLite::SQLite3
|
||||||
)
|
)
|
||||||
|
|
||||||
if(reporting)
|
# Work around changes to Conan recipe for now.
|
||||||
find_package(cassandra-cpp-driver REQUIRED)
|
if(TARGET nudb::core)
|
||||||
find_package(PostgreSQL REQUIRED)
|
set(nudb nudb::core)
|
||||||
target_link_libraries(ripple_libs INTERFACE
|
elseif(TARGET NuDB::nudb)
|
||||||
cassandra-cpp-driver::cassandra-cpp-driver
|
set(nudb NuDB::nudb)
|
||||||
PostgreSQL::PostgreSQL
|
else()
|
||||||
)
|
message(FATAL_ERROR "unknown nudb target")
|
||||||
|
endif()
|
||||||
|
target_link_libraries(ripple_libs INTERFACE ${nudb})
|
||||||
|
|
||||||
|
if(coverage)
|
||||||
|
include(RippledCov)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
###
|
set(PROJECT_EXPORT_SET RippleExports)
|
||||||
|
|
||||||
include(RippledCore)
|
include(RippledCore)
|
||||||
include(RippledInstall)
|
include(RippledInstall)
|
||||||
include(RippledCov)
|
|
||||||
include(RippledMultiConfig)
|
|
||||||
include(RippledValidatorKeys)
|
include(RippledValidatorKeys)
|
||||||
|
|
||||||
|
if(tests)
|
||||||
|
include(CTest)
|
||||||
|
add_subdirectory(src/tests/libxrpl)
|
||||||
|
endif()
|
||||||
|
|||||||
1043
CONTRIBUTING.md
1043
CONTRIBUTING.md
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
|||||||
ISC License
|
ISC License
|
||||||
|
|
||||||
Copyright (c) 2011, Arthur Britto, David Schwartz, Jed McCaleb, Vinnie Falco, Bob Way, Eric Lombrozo, Nikolaos D. Bougalis, Howard Hinnant.
|
Copyright (c) 2011, Arthur Britto, David Schwartz, Jed McCaleb, Vinnie Falco, Bob Way, Eric Lombrozo, Nikolaos D. Bougalis, Howard Hinnant.
|
||||||
Copyright (c) 2012-2020, the XRP Ledger developers.
|
Copyright (c) 2012-2020, the XRP Ledger developers.
|
||||||
@@ -14,4 +14,3 @@ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
|
|||||||
29
README.md
29
README.md
@@ -1,16 +1,23 @@
|
|||||||
|
[](https://codecov.io/gh/XRPLF/rippled)
|
||||||
|
|
||||||
# The XRP Ledger
|
# The XRP Ledger
|
||||||
|
|
||||||
The [XRP Ledger](https://xrpl.org/) is a decentralized cryptographic ledger powered by a network of peer-to-peer nodes. The XRP Ledger uses a novel Byzantine Fault Tolerant consensus algorithm to settle and record transactions in a secure distributed database without a central operator.
|
The [XRP Ledger](https://xrpl.org/) is a decentralized cryptographic ledger powered by a network of peer-to-peer nodes. The XRP Ledger uses a novel Byzantine Fault Tolerant consensus algorithm to settle and record transactions in a secure distributed database without a central operator.
|
||||||
|
|
||||||
## XRP
|
## XRP
|
||||||
[XRP](https://xrpl.org/xrp.html) is a public, counterparty-free asset native to the XRP Ledger, and is designed to bridge the many different currencies in use worldwide. XRP is traded on the open-market and is available for anyone to access. The XRP Ledger was created in 2012 with a finite supply of 100 billion units of XRP. Its creators gifted 80 billion XRP to a company, now called [Ripple](https://ripple.com/), to develop the XRP Ledger and its ecosystem. Ripple uses XRP to help build the Internet of Value, ushering in a world in which money moves as fast and efficiently as information does today.
|
|
||||||
|
[XRP](https://xrpl.org/xrp.html) is a public, counterparty-free asset native to the XRP Ledger, and is designed to bridge the many different currencies in use worldwide. XRP is traded on the open-market and is available for anyone to access. The XRP Ledger was created in 2012 with a finite supply of 100 billion units of XRP.
|
||||||
|
|
||||||
## rippled
|
## rippled
|
||||||
The server software that powers the XRP Ledger is called `rippled` and is available in this repository under the permissive [ISC open-source license](LICENSE.md). The `rippled` server software is written primarily in C++ and runs on a variety of platforms. The `rippled` server software can run in several modes depending on its [configuration](https://xrpl.org/rippled-server-modes.html).
|
|
||||||
|
The server software that powers the XRP Ledger is called `rippled` and is available in this repository under the permissive [ISC open-source license](LICENSE.md). The `rippled` server software is written primarily in C++ and runs on a variety of platforms. The `rippled` server software can run in several modes depending on its [configuration](https://xrpl.org/rippled-server-modes.html).
|
||||||
|
|
||||||
|
If you are interested in running an **API Server** (including a **Full History Server**), take a look at [Clio](https://github.com/XRPLF/clio). (rippled Reporting Mode has been replaced by Clio.)
|
||||||
|
|
||||||
### Build from Source
|
### Build from Source
|
||||||
|
|
||||||
* [Read the build instructions in `BUILD.md`](BUILD.md)
|
- [Read the build instructions in `BUILD.md`](BUILD.md)
|
||||||
|
- If you encounter any issues, please [open an issue](https://github.com/XRPLF/rippled/issues)
|
||||||
|
|
||||||
## Key Features of the XRP Ledger
|
## Key Features of the XRP Ledger
|
||||||
|
|
||||||
@@ -30,7 +37,6 @@ The server software that powers the XRP Ledger is called `rippled` and is availa
|
|||||||
[Modern Features for Smart Contracts]: https://xrpl.org/xrp-ledger-overview.html#modern-features-for-smart-contracts
|
[Modern Features for Smart Contracts]: https://xrpl.org/xrp-ledger-overview.html#modern-features-for-smart-contracts
|
||||||
[On-Ledger Decentralized Exchange]: https://xrpl.org/xrp-ledger-overview.html#on-ledger-decentralized-exchange
|
[On-Ledger Decentralized Exchange]: https://xrpl.org/xrp-ledger-overview.html#on-ledger-decentralized-exchange
|
||||||
|
|
||||||
|
|
||||||
## Source Code
|
## Source Code
|
||||||
|
|
||||||
Here are some good places to start learning the source code:
|
Here are some good places to start learning the source code:
|
||||||
@@ -42,7 +48,7 @@ Here are some good places to start learning the source code:
|
|||||||
### Repository Contents
|
### Repository Contents
|
||||||
|
|
||||||
| Folder | Contents |
|
| Folder | Contents |
|
||||||
|:-----------|:-------------------------------------------------|
|
| :--------- | :----------------------------------------------- |
|
||||||
| `./bin` | Scripts and data files for Ripple integrators. |
|
| `./bin` | Scripts and data files for Ripple integrators. |
|
||||||
| `./Builds` | Platform-specific guides for building `rippled`. |
|
| `./Builds` | Platform-specific guides for building `rippled`. |
|
||||||
| `./docs` | Source documentation files and doxygen config. |
|
| `./docs` | Source documentation files and doxygen config. |
|
||||||
@@ -52,11 +58,14 @@ Here are some good places to start learning the source code:
|
|||||||
Some of the directories under `src` are external repositories included using
|
Some of the directories under `src` are external repositories included using
|
||||||
git-subtree. See those directories' README files for more details.
|
git-subtree. See those directories' README files for more details.
|
||||||
|
|
||||||
|
## Additional Documentation
|
||||||
|
|
||||||
|
- [XRP Ledger Dev Portal](https://xrpl.org/)
|
||||||
|
- [Setup and Installation](https://xrpl.org/install-rippled.html)
|
||||||
|
- [Source Documentation (Doxygen)](https://xrplf.github.io/rippled/)
|
||||||
|
|
||||||
## See Also
|
## See Also
|
||||||
|
|
||||||
* [XRP Ledger Dev Portal](https://xrpl.org/)
|
- [Clio API Server for the XRP Ledger](https://github.com/XRPLF/clio)
|
||||||
* [Setup and Installation](https://xrpl.org/install-rippled.html)
|
- [Mailing List for Release Announcements](https://groups.google.com/g/ripple-server)
|
||||||
* [Source Documentation (Doxygen)](https://xrplf.github.io/rippled/)
|
- [Learn more about the XRP Ledger (YouTube)](https://www.youtube.com/playlist?list=PLJQ55Tj1hIVZtJ_JdTvSum2qMTsedWkNi)
|
||||||
* [Mailing List for Release Announcements](https://groups.google.com/g/ripple-server)
|
|
||||||
* [Learn more about the XRP Ledger (YouTube)](https://www.youtube.com/playlist?list=PLJQ55Tj1hIVZtJ_JdTvSum2qMTsedWkNi)
|
|
||||||
|
|||||||
3722
RELEASENOTES.md
3722
RELEASENOTES.md
File diff suppressed because it is too large
Load Diff
26
SECURITY.md
26
SECURITY.md
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
For more details on operating an XRP Ledger server securely, please visit https://xrpl.org/manage-the-rippled-server.html.
|
For more details on operating an XRP Ledger server securely, please visit https://xrpl.org/manage-the-rippled-server.html.
|
||||||
|
|
||||||
|
|
||||||
# Security Policy
|
# Security Policy
|
||||||
|
|
||||||
## Supported Versions
|
## Supported Versions
|
||||||
@@ -37,7 +36,7 @@ Your report should include the following:
|
|||||||
- The steps to reproduce the vulnerability;
|
- The steps to reproduce the vulnerability;
|
||||||
- Any other relevant details or artifacts, including code, scripts or patches.
|
- Any other relevant details or artifacts, including code, scripts or patches.
|
||||||
|
|
||||||
In your mail, please describe of the issue or the potential threat; if possible, please include a "repro" (code that can reproduce the issue) or describe the best way to reproduce and replicate the issue. Please make your report as extensive as possible.
|
In your email, please describe the issue or potential threat. If possible, include a "repro" (code that can reproduce the issue) or describe the best way to reproduce and replicate the issue. Please make your report as detailed and comprehensive as possible.
|
||||||
|
|
||||||
For more information on responsible disclosure, please read this [Wikipedia article](https://en.wikipedia.org/wiki/Responsible_disclosure).
|
For more information on responsible disclosure, please read this [Wikipedia article](https://en.wikipedia.org/wiki/Responsible_disclosure).
|
||||||
|
|
||||||
@@ -60,15 +59,15 @@ While we commit to responding with 24 hours of your initial report with our tria
|
|||||||
|
|
||||||
## Bug Bounty Program
|
## Bug Bounty Program
|
||||||
|
|
||||||
[Ripple](https://ripple.com) is generously sponsoring a bug bounty program for vulnerabilities in [`rippled`](https://github.com/ripple/rippled) (and other related projects, like [`ripple-lib`](https://github.com/ripple/ripple-lib)).
|
[Ripple](https://ripple.com) is generously sponsoring a bug bounty program for vulnerabilities in [`rippled`](https://github.com/XRPLF/rippled) (and other related projects, like [`xrpl.js`](https://github.com/XRPLF/xrpl.js), [`xrpl-py`](https://github.com/XRPLF/xrpl-py), [`xrpl4j`](https://github.com/XRPLF/xrpl4j)).
|
||||||
|
|
||||||
This program allows us to recognize and reward individuals or groups that identify and report bugs. In summary, order to qualify for a bounty, the bug must be:
|
This program allows us to recognize and reward individuals or groups that identify and report bugs. In summary, in order to qualify for a bounty, the bug must be:
|
||||||
|
|
||||||
1. **In scope**. Only bugs in software under the scope of the program qualify. Currently, that means `rippled` and `ripple-lib`.
|
1. **In scope**. Only bugs in software under the scope of the program qualify. Currently, that means `rippled`, `xrpl.js`, `xrpl-py`, `xrpl4j`.
|
||||||
2. **Relevant**. A security issue, posing a danger to user funds, privacy or the operation of the XRP Ledger.
|
2. **Relevant**. A security issue, posing a danger to user funds, privacy, or the operation of the XRP Ledger.
|
||||||
3. **Original and previously unknown**. Bugs that are already known and discussed in public do not qualify. Previously reported bugs, even if publicly unknown, are not eligible.
|
3. **Original and previously unknown**. Bugs that are already known and discussed in public do not qualify. Previously reported bugs, even if publicly unknown, are not eligible.
|
||||||
4. **Specific**. We welcome general security advice or recommendations, but we cannot pay bounties for that.
|
4. **Specific**. We welcome general security advice or recommendations, but we cannot pay bounties for that.
|
||||||
5. **Fixable**. There has to be something we can do to permanently fix the problem. Note that bugs in other people’s software may still qualify in some cases. For example, if you find a bug in a library that we use which can compromises the security of software that is in scope and we can get it fixed, you may qualify for a bounty.
|
5. **Fixable**. There has to be something we can do to permanently fix the problem. Note that bugs in other people’s software may still qualify in some cases. For example, if you find a bug in a library that we use which can compromise the security of software that is in scope and we can get it fixed, you may qualify for a bounty.
|
||||||
6. **Unused**. If you use the exploit to attack the XRP Ledger, you do not qualify for a bounty. If you report a vulnerability used in an ongoing or past attack and there is specific, concrete evidence that suggests you are the attacker we reserve the right not to pay a bounty.
|
6. **Unused**. If you use the exploit to attack the XRP Ledger, you do not qualify for a bounty. If you report a vulnerability used in an ongoing or past attack and there is specific, concrete evidence that suggests you are the attacker we reserve the right not to pay a bounty.
|
||||||
|
|
||||||
The amount paid varies dramatically. Vulnerabilities that are harmless on their own, but could form part of a critical exploit will usually receive a bounty. Full-blown exploits can receive much higher bounties. Please don’t hold back partial vulnerabilities while trying to construct a full-blown exploit. We will pay a bounty to anyone who reports a complete chain of vulnerabilities even if they have reported each component of the exploit separately and those vulnerabilities have been fixed in the meantime. However, to qualify for a the full bounty, you must to have been the first to report each of the partial exploits.
|
The amount paid varies dramatically. Vulnerabilities that are harmless on their own, but could form part of a critical exploit will usually receive a bounty. Full-blown exploits can receive much higher bounties. Please don’t hold back partial vulnerabilities while trying to construct a full-blown exploit. We will pay a bounty to anyone who reports a complete chain of vulnerabilities even if they have reported each component of the exploit separately and those vulnerabilities have been fixed in the meantime. However, to qualify for a the full bounty, you must to have been the first to report each of the partial exploits.
|
||||||
@@ -77,13 +76,14 @@ The amount paid varies dramatically. Vulnerabilities that are harmless on their
|
|||||||
|
|
||||||
To report a qualifying bug, please send a detailed report to:
|
To report a qualifying bug, please send a detailed report to:
|
||||||
|
|
||||||
|Email Address|bugs@ripple.com |
|
| Email Address | bugs@ripple.com |
|
||||||
|:-----------:|:----------------------------------------------------|
|
| :-----------: | :-------------------------------------------------- |
|
||||||
|Short Key ID | `0xC57929BE` |
|
| Short Key ID | `0xC57929BE` |
|
||||||
|Long Key ID | `0xCD49A0AFC57929BE` |
|
| Long Key ID | `0xCD49A0AFC57929BE` |
|
||||||
|Fingerprint | `24E6 3B02 37E0 FA9C 5E96 8974 CD49 A0AF C579 29BE` |
|
| Fingerprint | `24E6 3B02 37E0 FA9C 5E96 8974 CD49 A0AF C579 29BE` |
|
||||||
|
|
||||||
|
The full PGP key for this address, which is also available on several key servers (e.g. on [keyserver.ubuntu.com](https://keyserver.ubuntu.com)), is:
|
||||||
|
|
||||||
The full PGP key for this address, which is also available on several key servers (e.g. on [keys.gnupg.net](https://keys.gnupg.net)), is:
|
|
||||||
```
|
```
|
||||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||||
mQINBFUwGHYBEAC0wpGpBPkd8W1UdQjg9+cEFzeIEJRaoZoeuJD8mofwI5Ejnjdt
|
mQINBFUwGHYBEAC0wpGpBPkd8W1UdQjg9+cEFzeIEJRaoZoeuJD8mofwI5Ejnjdt
|
||||||
|
|||||||
470
bin/browser.js
470
bin/browser.js
@@ -1,470 +0,0 @@
|
|||||||
#!/usr/bin/node
|
|
||||||
//
|
|
||||||
// ledger?l=L
|
|
||||||
// transaction?h=H
|
|
||||||
// ledger_entry?l=L&h=H
|
|
||||||
// account?l=L&a=A
|
|
||||||
// directory?l=L&dir_root=H&i=I
|
|
||||||
// directory?l=L&o=A&i=I // owner directory
|
|
||||||
// offer?l=L&offer=H
|
|
||||||
// offer?l=L&account=A&i=I
|
|
||||||
// ripple_state=l=L&a=A&b=A&c=C
|
|
||||||
// account_lines?l=L&a=A
|
|
||||||
//
|
|
||||||
// A=address
|
|
||||||
// C=currency 3 letter code
|
|
||||||
// H=hash
|
|
||||||
// I=index
|
|
||||||
// L=current | closed | validated | index | hash
|
|
||||||
//
|
|
||||||
|
|
||||||
var async = require("async");
|
|
||||||
var extend = require("extend");
|
|
||||||
var http = require("http");
|
|
||||||
var url = require("url");
|
|
||||||
|
|
||||||
var Remote = require("ripple-lib").Remote;
|
|
||||||
|
|
||||||
var program = process.argv[1];
|
|
||||||
|
|
||||||
var httpd_response = function (res, opts) {
|
|
||||||
var self=this;
|
|
||||||
|
|
||||||
res.statusCode = opts.statusCode;
|
|
||||||
res.end(
|
|
||||||
"<HTML>"
|
|
||||||
+ "<HEAD><TITLE>Title</TITLE></HEAD>"
|
|
||||||
+ "<BODY BACKGROUND=\"#FFFFFF\">"
|
|
||||||
+ "State:" + self.state
|
|
||||||
+ "<UL>"
|
|
||||||
+ "<LI><A HREF=\"/\">home</A>"
|
|
||||||
+ "<LI>" + html_link('r4EM4gBQfr1QgQLXSPF4r7h84qE9mb6iCC')
|
|
||||||
// + "<LI><A HREF=\""+test+"\">rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh</A>"
|
|
||||||
+ "<LI><A HREF=\"/ledger\">ledger</A>"
|
|
||||||
+ "</UL>"
|
|
||||||
+ (opts.body || '')
|
|
||||||
+ '<HR><PRE>'
|
|
||||||
+ (opts.url || '')
|
|
||||||
+ '</PRE>'
|
|
||||||
+ "</BODY>"
|
|
||||||
+ "</HTML>"
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
var html_link = function (generic) {
|
|
||||||
return '<A HREF="' + build_uri({ type: 'account', account: generic}) + '">' + generic + '</A>';
|
|
||||||
};
|
|
||||||
|
|
||||||
// Build a link to a type.
|
|
||||||
var build_uri = function (params, opts) {
|
|
||||||
var c;
|
|
||||||
|
|
||||||
if (params.type === 'account') {
|
|
||||||
c = {
|
|
||||||
pathname: 'account',
|
|
||||||
query: {
|
|
||||||
l: params.ledger,
|
|
||||||
a: params.account,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
} else if (params.type === 'ledger') {
|
|
||||||
c = {
|
|
||||||
pathname: 'ledger',
|
|
||||||
query: {
|
|
||||||
l: params.ledger,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
} else if (params.type === 'transaction') {
|
|
||||||
c = {
|
|
||||||
pathname: 'transaction',
|
|
||||||
query: {
|
|
||||||
h: params.hash,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
c = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
opts = opts || {};
|
|
||||||
|
|
||||||
c.protocol = "http";
|
|
||||||
c.hostname = opts.hostname || self.base.hostname;
|
|
||||||
c.port = opts.port || self.base.port;
|
|
||||||
|
|
||||||
return url.format(c);
|
|
||||||
};
|
|
||||||
|
|
||||||
var build_link = function (item, link) {
|
|
||||||
console.log(link);
|
|
||||||
return "<A HREF=" + link + ">" + item + "</A>";
|
|
||||||
};
|
|
||||||
|
|
||||||
var rewrite_field = function (type, obj, field, opts) {
|
|
||||||
if (field in obj) {
|
|
||||||
obj[field] = rewrite_type(type, obj[field], opts);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
var rewrite_type = function (type, obj, opts) {
|
|
||||||
if ('amount' === type) {
|
|
||||||
if ('string' === typeof obj) {
|
|
||||||
// XRP.
|
|
||||||
return '<B>' + obj + '</B>';
|
|
||||||
|
|
||||||
} else {
|
|
||||||
rewrite_field('address', obj, 'issuer', opts);
|
|
||||||
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
return build_link(
|
|
||||||
obj,
|
|
||||||
build_uri({
|
|
||||||
type: 'account',
|
|
||||||
account: obj
|
|
||||||
}, opts)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if ('address' === type) {
|
|
||||||
return build_link(
|
|
||||||
obj,
|
|
||||||
build_uri({
|
|
||||||
type: 'account',
|
|
||||||
account: obj
|
|
||||||
}, opts)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else if ('ledger' === type) {
|
|
||||||
return build_link(
|
|
||||||
obj,
|
|
||||||
build_uri({
|
|
||||||
type: 'ledger',
|
|
||||||
ledger: obj,
|
|
||||||
}, opts)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else if ('node' === type) {
|
|
||||||
// A node
|
|
||||||
if ('PreviousTxnID' in obj)
|
|
||||||
obj.PreviousTxnID = rewrite_type('transaction', obj.PreviousTxnID, opts);
|
|
||||||
|
|
||||||
if ('Offer' === obj.LedgerEntryType) {
|
|
||||||
if ('NewFields' in obj) {
|
|
||||||
if ('TakerGets' in obj.NewFields)
|
|
||||||
obj.NewFields.TakerGets = rewrite_type('amount', obj.NewFields.TakerGets, opts);
|
|
||||||
|
|
||||||
if ('TakerPays' in obj.NewFields)
|
|
||||||
obj.NewFields.TakerPays = rewrite_type('amount', obj.NewFields.TakerPays, opts);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
obj.LedgerEntryType = '<B>' + obj.LedgerEntryType + '</B>';
|
|
||||||
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
else if ('transaction' === type) {
|
|
||||||
// Reference to a transaction.
|
|
||||||
return build_link(
|
|
||||||
obj,
|
|
||||||
build_uri({
|
|
||||||
type: 'transaction',
|
|
||||||
hash: obj
|
|
||||||
}, opts)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 'ERROR: ' + type;
|
|
||||||
};
|
|
||||||
|
|
||||||
var rewrite_object = function (obj, opts) {
|
|
||||||
var out = extend({}, obj);
|
|
||||||
|
|
||||||
rewrite_field('address', out, 'Account', opts);
|
|
||||||
|
|
||||||
rewrite_field('ledger', out, 'parent_hash', opts);
|
|
||||||
rewrite_field('ledger', out, 'ledger_index', opts);
|
|
||||||
rewrite_field('ledger', out, 'ledger_current_index', opts);
|
|
||||||
rewrite_field('ledger', out, 'ledger_hash', opts);
|
|
||||||
|
|
||||||
if ('ledger' in obj) {
|
|
||||||
// It's a ledger header.
|
|
||||||
out.ledger = rewrite_object(out.ledger, opts);
|
|
||||||
|
|
||||||
if ('ledger_hash' in out.ledger)
|
|
||||||
out.ledger.ledger_hash = '<B>' + out.ledger.ledger_hash + '</B>';
|
|
||||||
|
|
||||||
delete out.ledger.hash;
|
|
||||||
delete out.ledger.totalCoins;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ('TransactionType' in obj) {
|
|
||||||
// It's a transaction.
|
|
||||||
out.TransactionType = '<B>' + obj.TransactionType + '</B>';
|
|
||||||
|
|
||||||
rewrite_field('amount', out, 'TakerGets', opts);
|
|
||||||
rewrite_field('amount', out, 'TakerPays', opts);
|
|
||||||
rewrite_field('ledger', out, 'inLedger', opts);
|
|
||||||
|
|
||||||
out.meta.AffectedNodes = out.meta.AffectedNodes.map(function (node) {
|
|
||||||
var kind = 'CreatedNode' in node
|
|
||||||
? 'CreatedNode'
|
|
||||||
: 'ModifiedNode' in node
|
|
||||||
? 'ModifiedNode'
|
|
||||||
: 'DeletedNode' in node
|
|
||||||
? 'DeletedNode'
|
|
||||||
: undefined;
|
|
||||||
|
|
||||||
if (kind) {
|
|
||||||
node[kind] = rewrite_type('node', node[kind], opts);
|
|
||||||
}
|
|
||||||
return node;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else if ('node' in obj && 'LedgerEntryType' in obj.node) {
|
|
||||||
// Its a ledger entry.
|
|
||||||
|
|
||||||
if (obj.node.LedgerEntryType === 'AccountRoot') {
|
|
||||||
rewrite_field('address', out.node, 'Account', opts);
|
|
||||||
rewrite_field('transaction', out.node, 'PreviousTxnID', opts);
|
|
||||||
rewrite_field('ledger', out.node, 'PreviousTxnLgrSeq', opts);
|
|
||||||
}
|
|
||||||
|
|
||||||
out.node.LedgerEntryType = '<B>' + out.node.LedgerEntryType + '</B>';
|
|
||||||
}
|
|
||||||
|
|
||||||
return out;
|
|
||||||
};
|
|
||||||
|
|
||||||
var augment_object = function (obj, opts, done) {
|
|
||||||
if (obj.node.LedgerEntryType == 'AccountRoot') {
|
|
||||||
var tx_hash = obj.node.PreviousTxnID;
|
|
||||||
var tx_ledger = obj.node.PreviousTxnLgrSeq;
|
|
||||||
|
|
||||||
obj.history = [];
|
|
||||||
|
|
||||||
async.whilst(
|
|
||||||
function () { return tx_hash; },
|
|
||||||
function (callback) {
|
|
||||||
// console.log("augment_object: request: %s %s", tx_hash, tx_ledger);
|
|
||||||
opts.remote.request_tx(tx_hash)
|
|
||||||
.on('success', function (m) {
|
|
||||||
tx_hash = undefined;
|
|
||||||
tx_ledger = undefined;
|
|
||||||
|
|
||||||
//console.log("augment_object: ", JSON.stringify(m));
|
|
||||||
m.meta.AffectedNodes.filter(function(n) {
|
|
||||||
// console.log("augment_object: ", JSON.stringify(n));
|
|
||||||
// if (n.ModifiedNode)
|
|
||||||
// console.log("augment_object: %s %s %s %s %s %s/%s", 'ModifiedNode' in n, n.ModifiedNode && (n.ModifiedNode.LedgerEntryType === 'AccountRoot'), n.ModifiedNode && n.ModifiedNode.FinalFields && (n.ModifiedNode.FinalFields.Account === obj.node.Account), Object.keys(n)[0], n.ModifiedNode && (n.ModifiedNode.LedgerEntryType), obj.node.Account, n.ModifiedNode && n.ModifiedNode.FinalFields && n.ModifiedNode.FinalFields.Account);
|
|
||||||
// if ('ModifiedNode' in n && n.ModifiedNode.LedgerEntryType === 'AccountRoot')
|
|
||||||
// {
|
|
||||||
// console.log("***: ", JSON.stringify(m));
|
|
||||||
// console.log("***: ", JSON.stringify(n));
|
|
||||||
// }
|
|
||||||
return 'ModifiedNode' in n
|
|
||||||
&& n.ModifiedNode.LedgerEntryType === 'AccountRoot'
|
|
||||||
&& n.ModifiedNode.FinalFields
|
|
||||||
&& n.ModifiedNode.FinalFields.Account === obj.node.Account;
|
|
||||||
})
|
|
||||||
.forEach(function (n) {
|
|
||||||
tx_hash = n.ModifiedNode.PreviousTxnID;
|
|
||||||
tx_ledger = n.ModifiedNode.PreviousTxnLgrSeq;
|
|
||||||
|
|
||||||
obj.history.push({
|
|
||||||
tx_hash: tx_hash,
|
|
||||||
tx_ledger: tx_ledger
|
|
||||||
});
|
|
||||||
console.log("augment_object: next: %s %s", tx_hash, tx_ledger);
|
|
||||||
});
|
|
||||||
|
|
||||||
callback();
|
|
||||||
})
|
|
||||||
.on('error', function (m) {
|
|
||||||
callback(m);
|
|
||||||
})
|
|
||||||
.request();
|
|
||||||
},
|
|
||||||
function (err) {
|
|
||||||
if (err) {
|
|
||||||
done();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
async.forEach(obj.history, function (o, callback) {
|
|
||||||
opts.remote.request_account_info(obj.node.Account)
|
|
||||||
.ledger_index(o.tx_ledger)
|
|
||||||
.on('success', function (m) {
|
|
||||||
//console.log("augment_object: ", JSON.stringify(m));
|
|
||||||
o.Balance = m.account_data.Balance;
|
|
||||||
// o.account_data = m.account_data;
|
|
||||||
callback();
|
|
||||||
})
|
|
||||||
.on('error', function (m) {
|
|
||||||
o.error = m;
|
|
||||||
callback();
|
|
||||||
})
|
|
||||||
.request();
|
|
||||||
},
|
|
||||||
function (err) {
|
|
||||||
done(err);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
done();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
if (process.argv.length < 4 || process.argv.length > 7) {
|
|
||||||
console.log("Usage: %s ws_ip ws_port [<ip> [<port> [<start>]]]", program);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
var ws_ip = process.argv[2];
|
|
||||||
var ws_port = process.argv[3];
|
|
||||||
var ip = process.argv.length > 4 ? process.argv[4] : "127.0.0.1";
|
|
||||||
var port = process.argv.length > 5 ? process.argv[5] : "8080";
|
|
||||||
|
|
||||||
// console.log("START");
|
|
||||||
var self = this;
|
|
||||||
|
|
||||||
var remote = (new Remote({
|
|
||||||
websocket_ip: ws_ip,
|
|
||||||
websocket_port: ws_port,
|
|
||||||
trace: false
|
|
||||||
}))
|
|
||||||
.on('state', function (m) {
|
|
||||||
console.log("STATE: %s", m);
|
|
||||||
|
|
||||||
self.state = m;
|
|
||||||
})
|
|
||||||
// .once('ledger_closed', callback)
|
|
||||||
.connect()
|
|
||||||
;
|
|
||||||
|
|
||||||
self.base = {
|
|
||||||
hostname: ip,
|
|
||||||
port: port,
|
|
||||||
remote: remote,
|
|
||||||
};
|
|
||||||
|
|
||||||
// console.log("SERVE");
|
|
||||||
var server = http.createServer(function (req, res) {
|
|
||||||
var input = "";
|
|
||||||
|
|
||||||
req.setEncoding();
|
|
||||||
|
|
||||||
req.on('data', function (buffer) {
|
|
||||||
// console.log("DATA: %s", buffer);
|
|
||||||
input = input + buffer;
|
|
||||||
});
|
|
||||||
|
|
||||||
req.on('end', function () {
|
|
||||||
// console.log("URL: %s", req.url);
|
|
||||||
// console.log("HEADERS: %s", JSON.stringify(req.headers, undefined, 2));
|
|
||||||
|
|
||||||
var _parsed = url.parse(req.url, true);
|
|
||||||
var _url = JSON.stringify(_parsed, undefined, 2);
|
|
||||||
|
|
||||||
// console.log("HEADERS: %s", JSON.stringify(_parsed, undefined, 2));
|
|
||||||
if (_parsed.pathname === "/account") {
|
|
||||||
var request = remote
|
|
||||||
.request_ledger_entry('account_root')
|
|
||||||
.ledger_index(-1)
|
|
||||||
.account_root(_parsed.query.a)
|
|
||||||
.on('success', function (m) {
|
|
||||||
// console.log("account_root: %s", JSON.stringify(m, undefined, 2));
|
|
||||||
|
|
||||||
augment_object(m, self.base, function() {
|
|
||||||
httpd_response(res,
|
|
||||||
{
|
|
||||||
statusCode: 200,
|
|
||||||
url: _url,
|
|
||||||
body: "<PRE>"
|
|
||||||
+ JSON.stringify(rewrite_object(m, self.base), undefined, 2)
|
|
||||||
+ "</PRE>"
|
|
||||||
});
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.request();
|
|
||||||
|
|
||||||
} else if (_parsed.pathname === "/ledger") {
|
|
||||||
var request = remote
|
|
||||||
.request_ledger(undefined, { expand: true, transactions: true })
|
|
||||||
.on('success', function (m) {
|
|
||||||
// console.log("Ledger: %s", JSON.stringify(m, undefined, 2));
|
|
||||||
|
|
||||||
httpd_response(res,
|
|
||||||
{
|
|
||||||
statusCode: 200,
|
|
||||||
url: _url,
|
|
||||||
body: "<PRE>"
|
|
||||||
+ JSON.stringify(rewrite_object(m, self.base), undefined, 2)
|
|
||||||
+"</PRE>"
|
|
||||||
});
|
|
||||||
})
|
|
||||||
|
|
||||||
if (_parsed.query.l && _parsed.query.l.length === 64) {
|
|
||||||
request.ledger_hash(_parsed.query.l);
|
|
||||||
}
|
|
||||||
else if (_parsed.query.l) {
|
|
||||||
request.ledger_index(Number(_parsed.query.l));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
request.ledger_index(-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
request.request();
|
|
||||||
|
|
||||||
} else if (_parsed.pathname === "/transaction") {
|
|
||||||
var request = remote
|
|
||||||
.request_tx(_parsed.query.h)
|
|
||||||
// .request_transaction_entry(_parsed.query.h)
|
|
||||||
// .ledger_select(_parsed.query.l)
|
|
||||||
.on('success', function (m) {
|
|
||||||
// console.log("transaction: %s", JSON.stringify(m, undefined, 2));
|
|
||||||
|
|
||||||
httpd_response(res,
|
|
||||||
{
|
|
||||||
statusCode: 200,
|
|
||||||
url: _url,
|
|
||||||
body: "<PRE>"
|
|
||||||
+ JSON.stringify(rewrite_object(m, self.base), undefined, 2)
|
|
||||||
+"</PRE>"
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.on('error', function (m) {
|
|
||||||
httpd_response(res,
|
|
||||||
{
|
|
||||||
statusCode: 200,
|
|
||||||
url: _url,
|
|
||||||
body: "<PRE>"
|
|
||||||
+ 'ERROR: ' + JSON.stringify(m, undefined, 2)
|
|
||||||
+"</PRE>"
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.request();
|
|
||||||
|
|
||||||
} else {
|
|
||||||
var test = build_uri({
|
|
||||||
type: 'account',
|
|
||||||
ledger: 'closed',
|
|
||||||
account: 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh',
|
|
||||||
}, self.base);
|
|
||||||
|
|
||||||
httpd_response(res,
|
|
||||||
{
|
|
||||||
statusCode: req.url === "/" ? 200 : 404,
|
|
||||||
url: _url,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
server.listen(port, ip, undefined,
|
|
||||||
function () {
|
|
||||||
console.log("Listening at: http://%s:%s", ip, port);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// vim:sw=2:sts=2:ts=8:et
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
In this directory are two scripts, `build.sh` and `test.sh` used for building
|
|
||||||
and testing rippled.
|
|
||||||
|
|
||||||
(For now, they assume Bash and Linux. Once I get Windows containers for
|
|
||||||
testing, I'll try them there, but if Bash is not available, then they will
|
|
||||||
soon be joined by PowerShell scripts `build.ps` and `test.ps`.)
|
|
||||||
|
|
||||||
We don't want these scripts to require arcane invocations that can only be
|
|
||||||
pieced together from within a CI configuration. We want something that humans
|
|
||||||
can easily invoke, read, and understand, for when we eventually have to test
|
|
||||||
and debug them interactively. That means:
|
|
||||||
|
|
||||||
(1) They should work with no arguments.
|
|
||||||
(2) They should document their arguments.
|
|
||||||
(3) They should expand short arguments into long arguments.
|
|
||||||
|
|
||||||
While we want to provide options for common use cases, we don't need to offer
|
|
||||||
the kitchen sink. We can rightfully expect users with esoteric, complicated
|
|
||||||
needs to write their own scripts.
|
|
||||||
|
|
||||||
To make argument-handling easy for us, the implementers, we can just take all
|
|
||||||
arguments from environment variables. They have the nice advantage that every
|
|
||||||
command-line uses named arguments. For the benefit of us and our users, we
|
|
||||||
document those variables at the top of each script.
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user