Skip to content

Commit be99005

Browse files
tilenflareLukaAvbreht
authored andcommitted
Update parameters for the latest framework specifications
1 parent 0395e63 commit be99005

File tree

6 files changed

+33
-24
lines changed

6 files changed

+33
-24
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,16 @@ Provide a `.toml` config file with the following fields (mostly self explanatory
4040

4141
```toml
4242
[db]
43-
username = "username"
44-
password = "password"
43+
username = "username" # can be specified with env DB_USERNAME
44+
password = "password" # can be specified with env DB_PASSWORD
4545
db_name = "flare_xrp_indexer"
4646
port = 5432
4747
drop_table_at_start = false
48+
history_drop = 3600 # delete all historic data in database older than this value, in seconds
49+
history_drop_frequency = 600 # frequency of history drops, in seconds
4850

4951
[indexer]
52+
confirmations = 1 # number of confirmed blocks before the data is included in the DB
5053
max_block_range = 100 # size of a batch to be repeatedly queried and saved in a dataset
5154
max_concurrency = 10 # number of concurrent processes querying data from the RPC node
5255
start_block_number = 780000
@@ -55,7 +58,8 @@ start_block_number = 780000
5558
url = "https://s.altnet.rippletest.net:51234"
5659

5760
[timeout]
58-
timeout_millis = 1000
61+
request_timeout_millis = 3000 # timeout requests to the chain and the dataset
62+
backoff_max_elapsed_time_seconds = 300 # maximum time between retries
5963

6064
[logger]
6165
level = "DEBUG"

config.example.toml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
[db]
2-
username = "username"
3-
password = "password"
2+
username = "username" # can be specified with env DB_USERNAME
3+
password = "password" # can be specified with env DB_PASSWORD
44
db_name = "flare_xrp_indexer"
55
port = 5432
66
drop_table_at_start = false
7+
history_drop = 3600
8+
history_drop_frequency = 600
79

810
[indexer]
9-
confirmations = 0
11+
confirmations = 1
1012
max_block_range = 100
1113
max_concurrency = 10
1214
start_block_number = 780000
@@ -15,7 +17,8 @@ start_block_number = 780000
1517
url = "https://s.altnet.rippletest.net:51234"
1618

1719
[timeout]
18-
timeout_millis = 3000
20+
request_timeout_millis = 3000
21+
backoff_max_elapsed_time_seconds = 300
1922

2023
[logger]
2124
level = "DEBUG"

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require (
66
github.com/bradleyjkemp/cupaloy v2.3.0+incompatible
77
github.com/ethereum/go-ethereum v1.13.15
88
github.com/flare-foundation/go-flare-common v0.1.4
9-
github.com/flare-foundation/verifier-indexer-framework v0.0.0-20241119152438-3009437a61fa
9+
github.com/flare-foundation/verifier-indexer-framework v0.0.2-0.20241205095200-c7bd102cb88a
1010
github.com/pkg/errors v0.9.1
1111
github.com/stretchr/testify v1.9.0
1212
)

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ github.com/ethereum/go-ethereum v1.13.15 h1:U7sSGYGo4SPjP6iNIifNoyIAiNjrmQkz6EwQ
2323
github.com/ethereum/go-ethereum v1.13.15/go.mod h1:TN8ZiHrdJwSe8Cb6x+p0hs5CxhJZPbqB7hHkaUXcmIU=
2424
github.com/flare-foundation/go-flare-common v0.1.4 h1:h/Xn56QkFwKhBjBkfpWG0qfPoHcez+OJHXbplRE+Q9g=
2525
github.com/flare-foundation/go-flare-common v0.1.4/go.mod h1:Pb1OAtNe8jNsD2fh6syJD6kVdqxAAXWESTGgd7uQlME=
26-
github.com/flare-foundation/verifier-indexer-framework v0.0.0-20241119152438-3009437a61fa h1:sbgPnA3OG73xEba4Tc3ekji2hpWBH2UwyJMz/i23pXU=
27-
github.com/flare-foundation/verifier-indexer-framework v0.0.0-20241119152438-3009437a61fa/go.mod h1:Ae/btCPhOtXEWf8Ua9V90mArNV5XPErUusDm/dgelSA=
26+
github.com/flare-foundation/verifier-indexer-framework v0.0.2-0.20241205095200-c7bd102cb88a h1:emHRp5TYgAeicX/nCqPa5ngG7ggK7KaGrvk4wiglb4s=
27+
github.com/flare-foundation/verifier-indexer-framework v0.0.2-0.20241205095200-c7bd102cb88a/go.mod h1:Ae/btCPhOtXEWf8Ua9V90mArNV5XPErUusDm/dgelSA=
2828
github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU=
2929
github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E=
3030
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=

internal/xrp/.snapshots/TestGetBlockResult

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
(*indexer.BlockResult[github.com/flare-foundation/verifier-xrp-indexer/internal/xrp.Block,github.com/flare-foundation/verifier-xrp-indexer/internal/xrp.Transaction])({
22
Block: (xrp.Block) {
3-
Hash: (string) (len=64) "E6ED42458DE170A4D95544561C7DF715C3A808EAD9A3D1D669D187366FE568F6",
3+
Hash: (string) (len=64) "e6ed42458de170a4d95544561c7df715c3a808ead9a3d1d669d187366fe568f6",
44
BlockNumber: (uint64) 1725668,
55
Timestamp: (uint64) 1729687561,
66
Transactions: (uint64) 10
77
},
88
Transactions: ([]xrp.Transaction) (len=10) {
99
(xrp.Transaction) {
10-
Hash: (string) (len=64) "1F572E746A69EDDE0C134824491567CC438CFB18A40AA0FD321E8143E70E9064",
10+
Hash: (string) (len=64) "1f572e746a69edde0c134824491567cc438cfb18a40aa0fd321e8143e70e9064",
1111
BlockNumber: (uint64) 1725668,
1212
Timestamp: (uint64) 1729687561,
1313
PaymentReference: (string) "",
@@ -16,7 +16,7 @@
1616
SourceAddressesRoot: (string) (len=64) "674fa9a46079864ce1744486bd1a7069794c8aade76b2d0424c4e716fba4f4ef"
1717
},
1818
(xrp.Transaction) {
19-
Hash: (string) (len=64) "53040EB07116518D9866E3E6DE504AA718F162B19A441E80C5045F68492B385B",
19+
Hash: (string) (len=64) "53040eb07116518d9866e3e6de504aa718f162b19a441e80c5045f68492b385b",
2020
BlockNumber: (uint64) 1725668,
2121
Timestamp: (uint64) 1729687561,
2222
PaymentReference: (string) (len=64) "4642505266410001000000000000000000000000000000000000000003873226",
@@ -25,7 +25,7 @@
2525
SourceAddressesRoot: (string) (len=64) "7c7efcd5e28a5f7b9b5ade3dd16008deaae30e3588d854be8e0dff1cad3c5aa0"
2626
},
2727
(xrp.Transaction) {
28-
Hash: (string) (len=64) "6A460D8C7919608C1D10883C6D9AD9D48C9E82B7058969039D94F42C7CFE49BF",
28+
Hash: (string) (len=64) "6a460d8c7919608c1d10883c6d9ad9d48c9e82b7058969039d94f42c7cfe49bf",
2929
BlockNumber: (uint64) 1725668,
3030
Timestamp: (uint64) 1729687561,
3131
PaymentReference: (string) "",
@@ -34,7 +34,7 @@
3434
SourceAddressesRoot: (string) (len=64) "cdbdabb5f4dbb023c42a28a0c63ec021e55727f4e9b67f94b8ce06de5c35083f"
3535
},
3636
(xrp.Transaction) {
37-
Hash: (string) (len=64) "7037BD4D653C5483D412AEED02A2A50FEB7E3BD09772D0E0B6810F1F2672B380",
37+
Hash: (string) (len=64) "7037bd4d653c5483d412aeed02a2a50feb7e3bd09772d0e0b6810f1f2672b380",
3838
BlockNumber: (uint64) 1725668,
3939
Timestamp: (uint64) 1729687561,
4040
PaymentReference: (string) "",
@@ -43,7 +43,7 @@
4343
SourceAddressesRoot: (string) (len=64) "cdbdabb5f4dbb023c42a28a0c63ec021e55727f4e9b67f94b8ce06de5c35083f"
4444
},
4545
(xrp.Transaction) {
46-
Hash: (string) (len=64) "98153FDC7732DBF5AEF5D4A25FDCDE7025C1BACA87C31F77CB3EB42FFE01DC26",
46+
Hash: (string) (len=64) "98153fdc7732dbf5aef5d4a25fdcde7025c1baca87c31f77cb3eb42ffe01dc26",
4747
BlockNumber: (uint64) 1725668,
4848
Timestamp: (uint64) 1729687561,
4949
PaymentReference: (string) "",
@@ -52,7 +52,7 @@
5252
SourceAddressesRoot: (string) (len=64) "8c34c34226d18c85760e46134cf55cb6d27441965cf011fedf9ae28066be4937"
5353
},
5454
(xrp.Transaction) {
55-
Hash: (string) (len=64) "C20EA5FA520614F0CFA5DC95616B9F208CD3E7697DDBDC28D472AA8EA091C76C",
55+
Hash: (string) (len=64) "c20ea5fa520614f0cfa5dc95616b9f208cd3e7697ddbdc28d472aa8ea091c76c",
5656
BlockNumber: (uint64) 1725668,
5757
Timestamp: (uint64) 1729687561,
5858
PaymentReference: (string) "",
@@ -61,7 +61,7 @@
6161
SourceAddressesRoot: (string) (len=64) "cdbdabb5f4dbb023c42a28a0c63ec021e55727f4e9b67f94b8ce06de5c35083f"
6262
},
6363
(xrp.Transaction) {
64-
Hash: (string) (len=64) "C462C4C3468CC77A4D7A8449E25270C07E082AF2DCD10A80CE5AD9CF5DEC5BC3",
64+
Hash: (string) (len=64) "c462c4c3468cc77a4d7a8449e25270c07e082af2dcd10a80ce5ad9cf5dec5bc3",
6565
BlockNumber: (uint64) 1725668,
6666
Timestamp: (uint64) 1729687561,
6767
PaymentReference: (string) "",
@@ -70,7 +70,7 @@
7070
SourceAddressesRoot: (string) (len=64) "2f6bb581d3ce812e08de495969f68c6f4cb9b92a4d99a99ca73c549c29765a1e"
7171
},
7272
(xrp.Transaction) {
73-
Hash: (string) (len=64) "D15CC4342C0D8F52C8B0F93853A36FB60A761D57E5A7D23F180D26469C4BA0EE",
73+
Hash: (string) (len=64) "d15cc4342c0d8f52c8b0f93853a36fb60a761d57e5a7d23f180d26469c4ba0ee",
7474
BlockNumber: (uint64) 1725668,
7575
Timestamp: (uint64) 1729687561,
7676
PaymentReference: (string) "",
@@ -79,7 +79,7 @@
7979
SourceAddressesRoot: (string) (len=64) "cd5c2a00f2921749dd0f8bc843db27142c99249b25abda93dca4535e6782e34b"
8080
},
8181
(xrp.Transaction) {
82-
Hash: (string) (len=64) "EA19D984C082532B6D09F8E8EBE73A2D136C49C4F3E922C6CDDB9CE739B33E7F",
82+
Hash: (string) (len=64) "ea19d984c082532b6d09f8e8ebe73a2d136c49c4f3e922c6cddb9ce739b33e7f",
8383
BlockNumber: (uint64) 1725668,
8484
Timestamp: (uint64) 1729687561,
8585
PaymentReference: (string) "",
@@ -88,7 +88,7 @@
8888
SourceAddressesRoot: (string) (len=64) "69166bb9a9f9194e3b2c2089d943c0f74e56f627fb52ab4aedd4315bf26cac70"
8989
},
9090
(xrp.Transaction) {
91-
Hash: (string) (len=64) "EAD932C22AE5B0573B3D8B16CA5D6AE4736BDFA3A1467EA9AE5ED8084406B8E9",
91+
Hash: (string) (len=64) "ead932c22ae5b0573b3d8b16ca5d6ae4736bdfa3a1467ea9ae5ed8084406b8e9",
9292
BlockNumber: (uint64) 1725668,
9393
Timestamp: (uint64) 1729687561,
9494
PaymentReference: (string) "",

tests/config_test.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ username = "username"
33
password = "password"
44
db_name = "flare_xrp_indexer"
55
port = 5432
6-
drop_table_at_start = true
6+
drop_table_at_start = false
77
history_drop = 3600
8+
history_drop_frequency = 600
89

910
[indexer]
10-
confirmations = 0
11+
confirmations = 1
1112
max_block_range = 100
1213
max_concurrency = 10
1314
start_block_number = 700000
@@ -16,7 +17,8 @@ start_block_number = 700000
1617
url = "https://s.altnet.rippletest.net:51234"
1718

1819
[timeout]
19-
timeout_millis = 3000
20+
request_timeout_millis = 3000
21+
backoff_max_elapsed_time_seconds = 300
2022

2123
[logger]
2224
level = "DEBUG"

0 commit comments

Comments
 (0)