Commit Graph

115 Commits

Author SHA1 Message Date
Aditya Kulkarni 994e8a05f2 Merge 'upstream/master' 2022-06-07 09:44:48 -05:00
Larry Ruane ba1b931986 add --sync-from-height command-line option
This causes lightwalletd to discard cached blocks at the given height
and beyond. This in turn causes it to re-fetch those blocks from zcashd.
It's similar to --redownload, except that option discards all blocks
(equivalent to --sync-from-height 0, but the existing --redownload is
retained for compatibility).

This is mostly intended for testing. It's sometimes useful to force the
node to (re)sync some recent blocks, but redownloading all of them takes
around an hour.
2022-05-24 15:17:38 -05:00
Steven Smith ab4c0fef70 Add support to GetTreeState to return Orchard final state 2022-05-10 23:21:26 -06:00
Aditya Kulkarni e146dbf5c2 Fix mempool issue 2022-04-07 10:20:01 -05:00
Larry Ruane 83bb19918f restore gRPC GetMempoolTx
This was removed as part of PR #358 (commit "remove gRPC GetMempoolTx")
but should not have been, so it's being restored.
2021-12-09 15:26:55 -07:00
adityapk00 33d3d53d34 Verify rawtx 2021-09-07 14:25:20 -06:00
Larry Ruane 4f00783f48 remove gRPC GetMempoolTx
This RPC has never been used, and is now superceded by GetMempoolStream.
2021-07-29 13:47:53 -06:00
Larry Ruane 503b9b256b modifications to adityapk00 mempool streaming API
This commit is based on adityapk00 streaming mempool interface but
avoids using goroutines, which are difficult to reason about.

Co-authored-by: Aditya Kulkarni <adityapk@gmail.com>
2021-07-29 13:47:53 -06:00
Aditya Kulkarni c3e1b98d4f Mempool Streaming API 2021-07-29 13:47:53 -06:00
Aditya Kulkarni db02bf40b9 Cleanup logging 2021-07-28 19:34:41 -07:00
Larry Ruane 3f669c3d19 added unit test 2021-07-26 23:20:05 -06:00
Aditya Kulkarni 39179a9721 Return hashes from getlatestblock 2021-07-26 23:20:05 -06:00
Aditya Kulkarni 1b485256a3 Return hashes with getlatestblock 2021-07-26 13:11:02 -07:00
adityapk00 d461c18785
Mempool (#10)
* mempool streaming

* Fix deadlock

* return correct height

* Add mempool stream timeout

* buffer channel

* Mempool API

* comment
2021-07-14 14:46:20 -07:00
adityapk00 41ebe0e04b
Prices (#9)
* Prices API

* Add current prices

* Historical prices persist

* Add mutexs

* multiple providers

* Handle startup

* Edge case where historical price is requested for current

* fix median edge case

* Don't return too old last price

* bug fixes

* price metrics and logging

* warnings
2021-05-18 09:26:55 -07:00
Larry Ruane 4e561f2cfd add darksidewallet support for GetAddressUtxos
Add a new darksidewallet gRPC to add a utxo that can be returned by the
production GetAddressUtxos, for example:

grpcurl -plaintext -d '{"address":"t1g1HQJuwDoStGrYYLj8VhLu1J5igd8TNXV","txid":"1zjB42Z7FtwRZOBNMlTubCgx9l3dsZSqXxmWpuZXJto=","script": "dqkU8saQsCVS4mNwcByoGCtfOaHFaCiIrA==","valueZat": "3010000","height": "686773"}' localhost:9067 cash.z.wallet.sdk.rpc.DarksideStreamer/AddAddressUtxo

Then the following returns this entry:

grpcurl -plaintext -d '{"startHeight":0,"maxEntries":2,"addresses":["t1g1HQJuwDoStGrYYLj8VhLu1J5igd8TNXV"]}' localhost:9067 cash.z.wallet.sdk.rpc.CompactTxStreamer/GetAddressUtxos

You can also clear the list of entries:

grpcurl -plaintext localhost:9067 cash.z.wallet.sdk.rpc.DarksideStreamer/ClearAddressUtxo
2021-04-26 11:42:03 -06:00
Aditya Kulkarni 2941299202 Fix metrics 2021-04-21 11:58:24 -07:00
Aditya Kulkarni d28a129df9 Handle Params downloads on the HTTP server 2021-04-21 10:40:39 -07:00
adityapk00 7ff8513186 Zecwallet latency logging 2021-04-20 10:40:36 -07:00
adityapk00 cac5873ecd Add metrics 2021-04-20 10:32:41 -07:00
adityapk00 f05fef2762 Merge fixes 2021-04-19 13:46:14 -07:00
adityapk00 0605b33e39 Merge 2021-04-19 13:38:25 -07:00
Larry Ruane dcad72ed25 generalize GetAddressUtxos to accept taddr list 2021-04-08 11:22:12 -06:00
Larry Ruane 17c47cfebe call checkTaddress() for each given taddress 2021-03-08 12:25:02 -07:00
Larry Ruane 824cb8dc8e check SplitN() return value to prevent indexing beyond end of slice 2021-03-08 12:25:02 -07:00
Larry Ruane ad739ce055 allow Ping testing grpc only if explicitly enabled 2021-03-08 12:25:02 -07:00
Larry Ruane 86a76a96cb check txid (hash0 length argument, must be 64 2021-03-08 11:23:05 -07:00
Larry Ruane 22dda4a28d check all json.Unmarshal() error returns 2021-03-08 11:14:48 -07:00
Larry Ruane d9d12998b2 remove error logging that client requests can cause 2021-03-08 10:51:31 -07:00
Larry Ruane 82045d493a fix GetTaddressBalance (json problem) 2021-01-15 14:05:27 -07:00
Larry Ruane 97d57395b2 fix GetTaddressTxids() 2021-01-12 16:18:29 -07:00
Larry Ruane acca1a7c80 Update protoc grpc toolchain to latest
I installed the latest toolchain according to:
https://grpc.io/docs/languages/go/quickstart/

I updated the protoc command line arguments in Makefile based on
that quickstart guide, then I ran: make update-grpc

This has set the tool version (which you can see at the top of
any .pb.go file) to:

protoc-gen-go v1.25.0
protoc        v3.14.0
2021-01-05 18:20:10 -07:00
Dimitris Apostolou b450634ab7 Fix typos 2020-12-21 13:03:41 -07:00
Larry Ruane 33e7312218 add zcashd versioning to GetLightdInfo result 2020-12-03 22:55:08 -07:00
Larry Ruane 1712bde1bc add gRPC GetAddressUtxos 2020-10-28 13:09:59 -06:00
Larry Ruane c66521335f add GetTreeState gRPC (for checkpoints) 2020-10-28 12:55:38 -06:00
Larry Ruane 20105167b8 GetBlockRange, GetTaddressTxids segfault: add checking for nil (null) arguments 2020-10-07 15:38:47 -06:00
Larry Ruane 063287888f add more version information to GetLightdInfo result 2020-10-06 10:03:37 -06:00
Larry Ruane 1906e1d1eb fix GetTransaction (broken in "add GetMempool()" commit) 2020-10-06 09:36:22 -06:00
Larry Ruane ac1bf8481c refactor Reverse(), no functional changes 2020-09-14 10:31:17 -06:00
Larry Ruane 7381129740 add GetMempoolTx() 2020-09-10 14:01:01 -06:00
Larry Ruane 6aa9bdfc40 refactor GetTaddressBalance* functions to eliminate duplicated code 2020-08-19 13:05:23 -06:00
Larry Ruane 4443b64071 rename GetAddress* to GetTAddress* (review) 2020-08-19 13:05:23 -06:00
Larry Ruane dda62f948c Modification requested by review
- renamed GetAddressBalance to GetAddressBalanceStream
- changed GetAddressBalance argument to repeated (string) rather than
streaming
- rename balance field to valueZat (consistent with zcashd)
2020-08-19 13:05:23 -06:00
Larry Ruane 97840c8ec7 add GetAddressBalance gRPC 2020-08-19 13:05:23 -06:00
Aditya Kulkarni e640edf40c Improve errors 2020-06-28 09:59:45 -07:00
Aditya Kulkarni fc8ebbcc0f Test getaddresstxids structure 2020-06-28 06:59:24 -07:00
Aditya Kulkarni 2682075dae Log only if respose was returned 2020-06-24 10:47:24 -07:00
Ben Wilson 63f01502e8 Added option to provide Zcashd RPC parameters from flags 2020-06-08 09:03:21 -04:00
Larry Ruane f72a6d8eba add error check to StageBlocksStream 2020-05-29 10:36:34 -06:00