Commit Graph

12264 Commits

Author SHA1 Message Date
TomZ 5f071d9ef7 Request indexer for version and display 2020-09-14 23:02:52 +02:00
TomZ 8b2c928fae Fix comment confusion (add 'not') 2020-09-14 22:48:03 +02:00
TomZ 352644fc05 [REST] Make transaction/details also fetch from mempool
This uses the new MempoolSearch api in order to allow the REST API to
fetch and display transaction data which has not been confirmed yet.
2020-09-14 15:30:51 +02:00
TomZ fcc3b094ef [API] Improve featureset of MempoolSearch
The mempool search now shares its serialization code with the blockchain
transaction fetcher, allowing all the filtering and include flags to work
here too.
This also fixes several bugs and reverts the mempool API change.
Additionally I return the FirstSeenTime for each mempool entry.

There is a slight API breakage in the LiveTransactions service, which as
far as I know is still unused outside of Flowee.
These enum values changed:
Api::LiveTransactions::
  Transaction   20 =>  25
  UnspentState  23 => 26
  OutputScript  24 => 23

The reason for this change is to have the Blockchain namespace in
sync with the LiveTransactions namespace for similar features.
2020-09-14 15:27:15 +02:00
TomZ 3cf670497d minor; remove comment 2020-09-11 18:54:21 +02:00
TomZ b2e39b4ae6 Introduce new Job type matching the new SearchMempool API message 2020-09-11 18:54:21 +02:00
TomZ 88028c3c77 Make flags be initialized faster
This fixes a regression which caused the hub on startup to not get any
validation flags until a new block was added to the chain.
2020-09-11 18:54:21 +02:00
TomZ 6fb9310007 Avoid work
When a block header is rejected before it has been added to the header-
chain, we don't have to update the header-chain.
2020-09-11 18:54:21 +02:00
TomZ db9a80f8eb [API] Add support to query the mempool
This allows a search based on TxId or output-script-hash for
mempool transactions.
We include double spend proof info when available in the reply
2020-09-11 14:07:14 +02:00
TomZ 8642143089 [REST] Add support for POST version of sendTx. 2020-09-09 18:47:25 +02:00
TomZ bf921a4267 [REST] Add sendRawTransaction GET support. 2020-09-09 14:52:50 +02:00
TomZ 3b562b00e5 Include for the namespace 2020-09-09 11:46:06 +02:00
TomZ e423a70975 Implement rawtransactions/getRawTransaction (GET) 2020-09-08 20:29:54 +02:00
TomZ 4d3b243870 Make POST requests work much more reliably
It now checks after the header has been parsed if we need to wait longer
before the POST data has all arrived and schedule that if needed.
2020-09-08 18:38:46 +02:00
TomZ 01c288d6e8 fixlet 2020-09-08 14:25:00 +02:00
TomZ ef1d14d6e6 Add various tests
Also return a json with an error when something went wrong with a
call and separate the self-documentation part out to avoid mixing
them up.
No dev wants to get a html page when they expected JSON...
2020-09-07 20:31:08 +02:00
TomZ b1ef8e5588 Make restService more self-documenting 2020-09-07 14:15:48 +02:00
TomZ 7bb8236b84 Add more tests for the REST apis
and also fix some bugs it found.
2020-09-03 17:07:24 +02:00
TomZ c4ced98c4e Add address/utxo GET test 2020-09-03 17:03:36 +02:00
TomZ 67f0535607 Squashed commit of the following:
commit f1c09cbbdf228cefbfbd339567ba337083e93e52
Author: TomZ <tomz@freedommail.ch>
Date:   Wed Sep 2 13:56:38 2020 +0200

    Fix sorting in address/utxo call

commit c61b03b05de04c9d53c6fdf413dd1b6d33dc17f6
Author: TomZ <tomz@freedommail.ch>
Date:   Wed Sep 2 13:03:43 2020 +0200

    Also catch missing services for more complex searches

    We did catch it on 'start()' which may not actually use a service that
    was missing and only in a followup would the missing service be used.
    So also catch the exception for missing service on the other event
    handling methods.

    This means that we now show a nice "setup needed" message to client when
    a call is done that is not supported because of missing backing service.

commit fbcfe60c7d21b309e9c827dd927de0e196d7f5b6
Author: TomZ <tomz@freedommail.ch>
Date:   Tue Sep 1 16:03:19 2020 +0200

    Also use the complex UTXO lookup to do callbacks.

commit d948225ae7786aa6b62ff9355c2d768a85569642
Author: TomZ <tomz@freedommail.ch>
Date:   Tue Sep 1 15:47:48 2020 +0200

    Add address/utxo call.

commit cbc4695d4abae1404afe03f34b10427e48f819ae
Author: TomZ <tomz@freedommail.ch>
Date:   Tue Sep 1 14:34:31 2020 +0200

    Add address/details API call

    This mostly implements the API call to list an address.

commit 1d215032af09551e2b3eda314c072a200e5fb37a
Author: TomZ <tomz@freedommail.ch>
Date:   Tue Sep 1 14:30:26 2020 +0200

    Fix warnings

    This fixes warnings from the compiler and the linter.

commit b61e7dd42222537b456a79e14439a0d36007e8d7
Author: TomZ <tomz@freedommail.ch>
Date:   Tue Sep 1 14:27:27 2020 +0200

    Blockchain::Search: Clean a little and fix bugs

    This follows the API docs on the utxoLookup() callback and we indeed
    return back the blockheight/etc parameters even if the utxo is already
    spent (represented by unspent=false).

commit 7ec3ebf937d7f2fb6a7a18f21d2e8b645db6fe3e
Author: TomZ <tomz@freedommail.ch>
Date:   Mon Aug 31 12:24:18 2020 +0200

    Fixes and move to v2 url

commit 32b8018af805ce068da7d3e149add66a90c92264
Author: TomZ <tomz@freedommail.ch>
Date:   Mon Aug 31 11:29:35 2020 +0200

    Build the rest service

commit c386adff9d28a0f844916019602ea0032bbc360a
Author: TomZ <tomz@freedommail.ch>
Date:   Sun Aug 30 19:24:29 2020 +0200

    Cleanup old code and make vin work

commit 5b88457863892ff8391e42a7eff61cd243851b41
Author: TomZ <tomz@freedommail.ch>
Date:   Sun Aug 30 18:42:41 2020 +0200

    Output addresses.

commit 46c2ce680409c38f1a67730e23cde942db2ecc46
Author: TomZ <tomz@freedommail.ch>
Date:   Sun Aug 30 17:51:03 2020 +0200

    Make tx-refs easier for the Blockchain::Search

commit b0591b5a6b57e2eb7022db7b7a351c694220e5ad
Author: TomZ <tomz@freedommail.ch>
Date:   Fri Aug 28 18:28:48 2020 +0200

    Make printing of tx work better

commit d337ac91ad4ab9eeb768695c639dcbbbcc463837
Author: TomZ <tomz@freedommail.ch>
Date:   Fri Aug 28 15:46:04 2020 +0200

    Make rest service show a nice help for setup.

commit 5997ff1fa06bd1a6b51ead93eef094a5561fdb53
Author: TomZ <tomz@freedommail.ch>
Date:   Wed Aug 26 17:43:09 2020 +0200

    Parse the json automatically.

commit 5ed7d6e53761828e2e385e085f44d530449b0b3b
Author: TomZ <tomz@freedommail.ch>
Date:   Wed Aug 26 13:07:04 2020 +0200

    Start project rest-service.
2020-09-02 14:58:09 +02:00
TomZ c7aee5efa9 Prevent incorrect usage and double delete
This only applies to the case where the MessageBuilder was used without
an external pool, but lets make sure the code is robust for even that
case.
2020-09-02 13:54:45 +02:00
TomZ 939bbbb2b6 Also in the error message; parrot headers back. 2020-09-02 13:54:41 +02:00
TomZ dc51b85c10 Fix usage-after-delete.
It is unsafe to de-reference an iterator after 'erasing' it.
2020-09-02 13:54:37 +02:00
TomZ 713697525a A network buffer maximum size of 6MB sounds fine for a server.
This is for the connection to the hub/indexer, so not for the incoming
clients.
Increasing the size allows much larger traffic without delay.
2020-09-02 13:47:32 +02:00
TomZ 1355c03f63 Fix warnings
This fixes warnings from the compiler and the linter.
2020-09-02 13:47:07 +02:00
TomZ df1f8c153e Merge remote-tracking branch 'gitlab/master' into master 2020-09-02 13:30:30 +02:00
Tom Zander 7a878dec48 Merge branch 'slpindexer' into 'master'
Found a spentdb / enabled option in the source code. Added to readme.

See merge request FloweeTheHub/thehub!17
2020-09-02 09:01:31 +00:00
justBCHit 95221aa584 Found a spentdb / enabled option in the source code. It is in the docker
information, but not in the "regular" docs. Enabling it works and
creates a 'spent' directory.
2020-08-30 23:35:31 +02:00
TomZ dce928921f Minor docs updates for log file creation. 2020-08-28 15:46:32 +02:00
TomZ f4f22693dc Enable better setup help for webcore-proxy
When we notice a missing backing service we now throw an exception
and on the html handler we push a setup.html file which has helpful
setup information.
2020-08-28 15:46:26 +02:00
TomZ 370abe4c1e Follow several code-check suggestions
Also print a line explaining which file the logs go to in case there
is no config.
2020-08-26 14:08:03 +02:00
TomZ c7818acaeb Minor cleanups and clarifications 2020-08-26 13:10:46 +02:00
TomZ 3921acaa6c Merge branch 'master' of gitlab:thehub 2020-08-26 11:38:02 +02:00
TomZ b39d8f512a Merge remote-tracking branch 'gitlab/master' into master 2020-08-26 10:29:21 +02:00
TomZ 917304b198 Don't return bool from main() 2020-08-26 09:36:11 +02:00
TomZ de10e383be Avoid warning about missing case value 2020-08-26 09:28:49 +02:00
TomZ 23f44439dd Use spaces consistently 2020-08-26 09:28:28 +02:00
TomZ 3a1c6b8fd6 Avoid comment in comment warning 2020-08-26 08:56:59 +02:00
TomZ 07b11a00b6 Make help output more logical 2020-08-24 18:17:39 +02:00
Tom Zander 469f3b27c6 Merge MR 16 into 'master'
Update README

See merge request FloweeTheHub/thehub!16
2020-08-23 21:07:26 +00:00
justBCHit 45fb281fd4 Update README 2020-08-23 19:54:46 +00:00
TomZ 7e59d0c242 Remove loud log message 2020-08-16 14:53:13 +02:00
TomZ 9673a19179 Merge branch '2020.05' 2020-08-16 12:35:39 +02:00
TomZ 127f675bd5 Add logging primitives. 2020-08-16 12:35:33 +02:00
TomZ dcf40f9161 Upgrade test to use qtestlib 2020-08-16 12:35:33 +02:00
TomZ acd142a0e6 Fix logic wrt signed/unsigned
The typedef was an unsigned type, and comparisons failed.
2020.05.1
2020-08-16 12:22:00 +02:00
TomZ 679374e923 Revert chain-switching idea
It becomes messy due to the usage of the compact form on block headers.
2020-08-16 12:03:19 +02:00
TomZ ac6b4934f2 Fix off-by-one in isStandard
Our max tx size has always been 100KB, the implementation rejected 100KB
and above, though.
This follows the major clients doing ths same.
2020-08-16 12:03:12 +02:00
TomZ b621cf96d2 Merge branch '2020.05' 2020-08-13 18:29:31 +02:00
TomZ 750bd23b27 Work around badly picked default variable value.
A not yet saved file has file-index zero, which is valid...
Also check this state and allow deletion of rev zero.
2020-08-13 18:28:43 +02:00