Roman Zeyde
e0c877126e
Run 'cargo fmt'
6 years ago
Lawrence Nahum
9be0a79a16
update rust-elements to 78c1e29809b7420041b1259711f0a2934211a0d3 from master
6 years ago
Nadav Ivgi
b631e3fae2
Allow looking up transactions via scripthash
This adds the following new endpoints:
- GET /scripthash/:scripthash
- GET /scripthash/:scripthash/txs
- GET /scripthash/:scripthash/utxo
(cherry picked from commit 16891ae00e
)
6 years ago
Nadav Ivgi
acc9441cf9
Update README
6 years ago
Nadav Ivgi
e2ecc0cbe9
Fix typo
(cherry picked from commit ce2aef30a5
)
6 years ago
Nadav Ivgi
0b329e3ef7
Run 'cargo +stable fmt --all'
6 years ago
Nadav Ivgi
58dd5cfb9e
Implement optional light resource mode
When the --light cli arg is specified, the indexer doesn't store transactions,
block meta data (tx count, size and weight) and the blockhash=>txids map.
Fallbacks that use the bitcoind rpc to fetch information when the extended
indexes are unavailable was implemented in Query for load_txn, get_block_meta
and get_block_txids.
This saves up around 250GB of storage, at the cost of more expensive lookups
and more reliance on bitcoind.
To reduce memory and CPU costs, the --disable-prevout parameter can be
specified to disable attaching previous output information to inputs.
This significantly reduces the amount of transaction lookups, at the
cost of missing inputs amounts/addresses and transaction fees.
This commit also introduces db versioning and a compatibility field that
requires users to reindex the db after switching networks or changing light mode.
(cherry picked from commit ae51519d35
)
6 years ago
Roman Zeyde
866e01667c
Remove electrs-related examples
Today, their functionality can be achieved by the main binary (`electrs`).
(cherry picked from commit 80a1d83b15
)
6 years ago
Roman Zeyde
31d5a4c6e8
Add simple pre-commit hook for running 'cargo fmt'
Inspired by https://github.com/mimblewimble/grin/pull/110
(cherry picked from commit 9e7bd29087
)
6 years ago
Nadav Ivgi
0a51b0e2ab
Run 'cargo +stable fmt --all'
6 years ago
Nadav Ivgi
35d43a01ff
Use MEMPOOL_HEIGHT instead of 0, follow up to ae2e8a7996f072f2e073fa51f07d7aca9e0e21b4
(and rename the misnamed "out" to "spend")
(cherry picked from commit a329272054
)
6 years ago
Roman Zeyde
c904c0e543
Add latency histogram metrics to query.rs
(cherry picked from commit a492fb83ab
)
6 years ago
Nadav Ivgi
de4326e6f4
Run 'cargo +stable fmt --all'
6 years ago
Roman Zeyde
92e21d892c
Sort transaction history by descending confirmation height
Now unconfirmed txns use u32::max_value as their height.
Also, remove Electrum-specific hash from query module.
(cherry picked from commit 953abaf330
)
6 years ago
Roman Zeyde
0b3f2d7c1b
Use u32::max_value() for mempool transactions' height at mempool.rs
So mempool transactions will appear at the end of the scripthash status:
https://electrumx.readthedocs.io/en/latest/protocol-basics.html#status
(cherry picked from commit cf2e79e7db
)
6 years ago
Roman Zeyde
3ab452fa51
Use u32 internally for transaction height (instead of usize)
(cherry picked from commit 3f2e3ed106
)
6 years ago
Roman Zeyde
678630038b
Remove unused TransactionCache
(cherry picked from commit a31e828976
)
6 years ago
Roman Zeyde
08322b2144
Drop Electrum JSON-RPC support
It can be re-added later as a separate crate.
(cherry picked from commit e02e57d916
)
6 years ago
Nadav Ivgi
e718eeaf4a
Match Electrum's merkle proof format
Not the format we need, but at least its a known format
(cherry picked from commit 9067911215991993d593bd18d9c94b9d21e32fbf)
(cherry picked from commit dde87da6f0
)
6 years ago
Lawrence Nahum
bdfb1030c9
use correct default rpc port for liquidd
6 years ago
Roman Zeyde
ff32483a09
Run 'cargo +stable fmt --all'
6 years ago
Roman Zeyde
b2829e7ac3
Update rust-bitcoin to 0.15.1 and re-generate Cargo.lock
Also update `elements` dependency to support latest rust-bitcoin:
5f4531fb30
6 years ago
Nadav Ivgi
324ff289c2
Fix transaction ordering
(cherry picked from commit fbc5ed63fa
)
6 years ago
Nadav Ivgi
d2e2c940e0
Expose the block version and merkle root
(cherry picked from commit 8fba51c5f2
)
6 years ago
Nadav Ivgi
c6d7ae938f
Change query.get_merkle_proof() to take the block hash
(cherry picked from commit 79d00326a4
)
6 years ago
Nadav Ivgi
8d3189a76d
Use new blockhash=>txids index to fetch block txs
So that GET /block/:hash/txs won't depend on bitcoind.
(cherry picked from commit 004552e086
)
6 years ago
Nadav Ivgi
ffa6e080b5
Implement GET /tx/:txid/merkle-proof
This required keeping a map of blockhash=>txids in our database,
so that we don't need to query bitcoind for it.
GET /block/:hash/txids was also added along the way, based on the
new indexes.
Future work: make /block/:hash/txs use the new index as well.
This is the last endpoint still involving bitcoind.
(cherry picked from commit 32e96c137d
)
6 years ago
Nadav Ivgi
3abba23a92
Reduce to 25 txs per page
(cherry picked from commit 56f5a8ea1e
)
6 years ago
Nadav Ivgi
8efbc671b7
Always return status in /tx/:txid
(cherry picked from commit 64fdc164dd
)
6 years ago
Nadav Ivgi
69578f32c0
Add Cache-Control header based on confirmation depth
(cherry picked from commit bc4fb7e9e3
)
6 years ago
Nadav Ivgi
d0772322bc
Add --http-addr option to configure the HTTP server listen address/port
(cherry picked from commit 681ff1a0fe
)
6 years ago
Nadav Ivgi
73306f3445
Grammar
(cherry picked from commit 46ec3b9a7b
)
6 years ago
Nadav Ivgi
a328d93ff1
Remove unused imports
6 years ago
Nadav Ivgi
ce2dc91eda
Refactor API paths and formats
6 years ago
Nadav Ivgi
e82c904f26
Fix typo
6 years ago
Nadav Ivgi
1e2dbec653
Don't encode p2pk addresses
6 years ago
Nadav Ivgi
5da0c64f00
Format inflation_keys in whole numbers, see https://github.com/ElementsProject/rust-elements/issues/7
6 years ago
Nadav Ivgi
b3c4537601
Remove CORS
6 years ago
Nadav Ivgi
266d94401b
Add asset to GET /address/:addr/utxo
6 years ago
Nadav Ivgi
3953423833
Add issuance details to txin
6 years ago
Nadav Ivgi
d26b152901
Don't error for addresses with too many txs, return a valid response with no txs info instead
(cherry picked from commit 2f7793ffa1
)
6 years ago
Nadav Ivgi
24b9435b43
Error handling refactoringg
- Introduce HttpError (replaces StringError)
- Return errors as Err()
- Hide internal errors, explicitly define which errors should be user-visible
(cherry picked from commit a8c0501b15
)
6 years ago
Nadav Ivgi
2149bb6123
Don't send Access-Control-Allow-Origin
will be added by reverse proxies as needed
(cherry picked from commit 97df9fb955
)
6 years ago
Nadav Ivgi
71b7780482
Accept verificationprogress if its close to 1
6 years ago
Nadav Ivgi
b486c4ddc4
Wait for bitcoind to fully sync-up (verificationprogress==1) before starting the HTTP server
6 years ago
Nadav Ivgi
2d7b3f7945
Implement Liquid address encoding, refs #57
6 years ago
Nadav Ivgi
33397c21bb
Add parent chain configuration
Used for verifying the genesis hash of peg-out requests,
and for encoding peg-out addresses.
6 years ago
Nadav Ivgi
7534bff544
Don't load spending txs of unspendable outputs
6 years ago
Nadav Ivgi
7b45b48447
Parse and expose peg-out information
6 years ago
Nadav Ivgi
b60e4037b1
Only fetch as many txids as needed in order to know that there are too many.
And increase the limit to 100.
(cherry picked from commit 83a6c40b0c65c3af5e049a5a61cabf937ebb98ad)
6 years ago