Commit Graph

424 Commits

Author SHA1 Message Date
Larry Ruane 98585ae464 add MempoolStream unit test 2021-07-29 13:45:06 -06:00
Larry Ruane cd98e6a14b Refactor mock Sleep, add mock Now time function
Instead of the Sleep function pointer being a standalong global
variable, move it into a new Time struct, and add a Now function
pointer, so that time.Now() can be mocked. Time.Now() isn't used yet.
This will be cleaner if we need to mock more time-related functions in
the future.
2021-07-29 13:45:06 -06:00
Larry Ruane 3cede7ce5e remove gRPC GetMempoolTx
This RPC has never been used, and is now superceded by GetMempoolStream.
2021-07-29 13:45:06 -06:00
Larry Ruane 2b4f3e6f9b 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:45:06 -06:00
Aditya Kulkarni 5e13c60d59 Mempool Streaming API 2021-07-29 13:45:06 -06: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
Larry Ruane a4cc08b89e GetBlockRange: allow start < end, return blocks in reverse order 2021-05-18 15:38:26 -06: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
Larry Ruane dcad72ed25 generalize GetAddressUtxos to accept taddr list 2021-04-08 11:22:12 -06:00
Larry Ruane d292bfaea5 update to latest go, protobufs, grpc toolchain
Should be no functional differences. This patch was generated by
installing the latest tools and running `make update-grpc`.
2021-04-07 12:58:01 -06:00
Larry Ruane 0995e130f4 eliminate genblocks compile warning
testtools/genblocks/main.go:91:74: conversion from int to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)
https://github.com/golang/go/issues/32479
2021-04-07 10:45:46 -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 5c5c4b882f check disk write return values 2021-03-08 11:21:33 -07:00
Larry Ruane 22dda4a28d check all json.Unmarshal() error returns 2021-03-08 11:14:48 -07:00
Larry Ruane c7c5da1fda don't log method names to stderr unless --grpc-logging-insecure 2021-03-08 11:12:26 -07:00
Larry Ruane d9d12998b2 remove error logging that client requests can cause 2021-03-08 10:51:31 -07:00
Larry Ruane a69537cf2b restore coinbase height check
The reason that it had to be disabled has gone away. This provides more
security by ensuring that the blocks we receive from zcashd are valid.
2021-01-15 16:49:22 -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 d7f35f2713 fix database file location bug introduced by PR320
PR 320 introduced a bug that causes the `blocks` and `lengths` database
files to be located one directory level higher than it they should be.

The bug doesn't cause any functional problem, it only makes the
lightwalletd do more work (re-download the block cache), and it also
makes it not possible to switch between testnet and mainnet.

This patch locates the database files back where they belong.
2021-01-11 12:19:51 -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
Ben Wilson 0e0cdcc8ef Update docs/docker-run.md
Co-authored-by: Larry Ruane <larry@z.cash>
2020-11-16 17:20:25 -07:00
Ben Wilson 993437d880 Added a simple docker run example doc 2020-11-16 17:20:25 -07:00
Larry Ruane 05c51935ad fix pullblocks.sh for macOS 2020-11-04 08:25:14 -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
Ben Wilson 68836ee627
Merge pull request #302 from zcash/tekton-use-catalog-tasks
Update Tekton pipeline to reference upstream tasks
2020-09-09 15:54:49 -04:00
Ben Wilson 39107e0ac6
Merge branch 'master' into tekton-use-catalog-tasks 2020-09-09 15:39:11 -04:00
Taylor Hornby c7f040c849
Merge pull request #303 from defuse/update-readme-warnings
Make README warnings more accurate
2020-09-08 09:33:10 -06:00
Taylor Hornby b9b16ae9c9 Make README warnings more accurate 2020-09-03 17:08:18 -06:00
Ben Wilson a5b9e954f7 Added serviceaccount for tekton 2020-08-31 09:55:32 -04:00
Ben Wilson e5c7f50a11 Update Tekton pipeline to reference upstream tasks 2020-08-31 09:48:13 -04: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
Ben Wilson 5054cec121
Merge pull request #287 from zcash/tekton-docker-build-on-tags
Added Tekton definitions for docker tag builds
2020-07-01 13:01:49 -04:00
Ben Wilson 36efb1b8fe
Merge branch 'master' into tekton-docker-build-on-tags 2020-07-01 12:57:17 -04:00
Larry Ruane 1c6d8a46f7 gracefully handle syncing zcashd (no REORG) 2020-06-26 08:35:35 -06:00