Commit Graph

424 Commits

Author SHA1 Message Date
Larry Ruane 2f0b2054ba Fix transaction staging
The following works:

grpcurl -plaintext -d '{"saplingActivation": 663150,"branchID": "bad", "chainName":"x"}' localhost:9067 cash.z.wallet.sdk.rpc.DarksideStreamer/Reset
grpcurl -plaintext -d '{"height":663150,"nonce":5,"count":3}' localhost:9067 cash.z.wallet.sdk.rpc.DarksideStreamer/StageBlocksCreate
grpcurl -plaintext -d '{"height":663152,"url":"https://raw.githubusercontent.com/zcash-hackworks/darksidewalletd-test-data/master/transactions/t-shielded-spend"}' localhost:9067 cash.z.wallet.sdk.rpc.DarksideStreamer/StageTransactions
grpcurl -plaintext -d '{"height":663152}' localhost:9067 cash.z.wallet.sdk.rpc.DarksideStreamer/ApplyStaged
grpcurl -plaintext -d '{"height":663152}' localhost:9067 cash.z.wallet.sdk.rpc.CompactTxStreamer/GetBlock
(shows the block with one transaction)
2020-05-21 11:48:03 -06:00
Larry Ruane 7ac1a3f983 small improvements to transaction stuff, small fixes 2020-05-21 11:48:03 -06:00
Larry Ruane 3defdcd1ee Improve error handling 2020-05-21 11:48:03 -06:00
Larry Ruane 6ddd894a96 change vendor string from ECC DarkWalletD to ECC DarksideWalletD 2020-05-21 11:48:03 -06:00
Larry Ruane f8794dbe05 update submitblocks.sh, return an error if GetBlock height is too low, instead of crashing 2020-05-21 11:48:03 -06:00
Larry Ruane 39348100a9 fix StageTransactions, vendor = ECC LightWalletD 2020-05-21 11:48:03 -06:00
Larry Ruane ebccd74447 forgot to run make 2020-05-21 11:48:03 -06:00
Larry Ruane 391e886afc better error handling, remove unused DarksideTx 2020-05-21 11:48:03 -06:00
Larry Ruane 7420d565a8 don't special-case darkside in SendTransaction, just use the mock rpc handler 2020-05-21 11:48:03 -06:00
Larry Ruane 3bada32bee fixes on last commit, especially StageBlocksCreate 2020-05-21 11:48:03 -06:00
Larry Ruane f1e793796f implement staging, not well tested 2020-05-21 11:48:03 -06:00
Larry Ruane 52ac837370 New "staging" api (StageBlocks, StageTransactions, ApplyStaged)
Also remove the initial block load (all blocks will come from the
Staging APIs), but there is still more to do (this does not even
start up correctly) but darkside.proto is correct, we believe.
2020-05-21 11:48:03 -06:00
Larry Ruane c8ee805933 remove Blockchaininfo json type assertions, no functional change 2020-05-21 11:48:03 -06:00
Larry Ruane 38d71a8f1d don't sleep 1s for reorg, wait 2s for new blocks 2020-05-21 11:48:03 -06:00
Larry Ruane d7e1005523 DarksideAddBlock(): remove generation of correct prevhash 2020-05-21 11:48:03 -06:00
Larry Ruane 9371f984ae GetBlockRange: don't pass mutex in channel (linter warning) 2020-05-21 11:48:03 -06:00
Larry Ruane 22d5c97e7f SetBlocksURL: replace curl with http client 2020-05-21 11:48:03 -06:00
Larry Ruane d08d8980a8 add support for gRPC GetTransaction() (mined tx) 2020-05-21 11:48:03 -06:00
Larry Ruane e3aca9bec7 review comment: 30-minute shutdown improvement
Safer to shutdown darksidewalletd directly after 30 minutes, instead
of waiting for a zcashd rpc to occur (darksideRawRequest());
also using a goroutine is simpler.
2020-05-21 11:48:03 -06:00
Larry Ruane 5e37f408e3 address review comments 2020-05-21 11:48:03 -06:00
Larry Ruane 86fd87404b add darkside SetMetaState, SetBlocksURL for reorg testing 2020-05-21 11:48:03 -06:00
zancas c14c5bc163
fix incorrect README 2020-05-20 20:21:19 -06:00
Linda Lee 1b0a2d8d57
Merge pull request #247 from zcash/add-darksidewalletd-docs
Add initial darksidewalletd docs
2020-04-29 16:30:31 -05:00
Taylor Hornby 5d769e3011 Make darksidewalletd doc improvements 2020-04-29 15:09:25 -06:00
Taylor Hornby 50b866e9bf Add initial darksidewalletd docs
Co-authored-by: Linda Lee <linda@z.cash>
2020-04-27 14:49:47 -06:00
Larry Ruane f4d5d8e4b2 if corruption detected, save db files for analysis 2020-04-24 16:55:47 -06:00
Larry Ruane c10659e977 fix CI failure (ReplaceAll() is too new) 2020-04-24 16:55:47 -06:00
Larry Ruane c2a6306ce5 Misc cleanups and fixes
- improved corruption recovery (don't back up by just 1 block at a time)
- move darksidewallet gRPCs to their own .proto file
- this force-push removes my commits for reorg testing using SetState
2020-04-24 16:55:47 -06:00
Larry Ruane f57e589752 update testdata/default-darkside-blocks coinbase height
Follow-on to previous commit. Without this change,
darksidewalletd detects corruption, example:

{..."CORRUPTION detected in db blocks-cache files, height 1000..."}

Steps to recreate default-darkside-blocks:
$ mkdir blocks
$ touch blocks/{1000,1001,1002,1003,1004,1005}.txt
$ go run cmd/genblocks/main.go >testdata/default-darkside-blocks
2020-04-24 16:55:47 -06:00
Taylor Hornby 35e627066c Fix coinbase height in block generation tool 2020-04-24 16:55:47 -06:00
Larry Ruane 8974cd1586 fix merge conflicts while rebasing onto file-cache branch 2020-04-24 16:55:47 -06:00
Taylor Hornby ccb7211712 Add scripts to assist with controlling darksidewalletd 2020-04-24 16:55:47 -06:00
Taylor Hornby d258ee75b0 Rename Evil to Darkside, because writing tests isn't evil 2020-04-24 16:55:47 -06:00
Taylor Hornby 673a9635fc Run gofmt on server/main.go and common/darkside.go 2020-04-24 16:55:47 -06:00
Taylor Hornby d55d9b1c64 Add tool for generating fake blockchains 2020-04-24 16:55:47 -06:00
Taylor Hornby 1a93b8d97c Add darksidewalletd mode for reorg testing. 2020-04-24 16:55:47 -06:00
Larry Ruane 3873a4d895 mutex.Lock during c.recoverFromCorruption() 2020-04-23 00:25:14 -06:00
Ben Wilson 38658548f2
Merge branch 'master' into ben/Dockerfile-lightwalletd-volume 2020-04-21 08:59:15 -04:00
Larry Ruane 1d11751e4e update README 2020-04-13 22:22:44 -06:00
Ben Wilson b35ee20c6c Fix Dockerfile args and added lightwalled volume 2020-04-13 14:34:54 -04:00
Ben Wilson d49d7e9bf0
Merge pull request #227 from zcash/ben/tekton-ci-dockerbuild
Added tekton for Docker image build
2020-04-13 13:07:42 -04:00
Ben Wilson b92ec8e4ef
Merge branch 'master' into ben/tekton-ci-dockerbuild 2020-04-13 12:56:37 -04:00
Ben Wilson f53b20925b
Merge pull request #236 from zcash/ben-prometheus-metrics-merge
Add http endpoint and prometheus metrics framework, take 2
2020-04-13 12:43:53 -04:00
Larry Ruane 2a915b7223 ran make update-grpc 2020-04-09 10:57:38 -06:00
Ben Wilson 25afaeae5c Added back logging interceptor for non-tls, fixed version on startup 2020-04-09 10:27:08 -06:00
Ben Wilson bf68d46bc9 revert unintended docker/zcash.conf change 2020-04-09 10:27:08 -06:00
Ben Wilson 999c00a666 Moved HTTP endpoint startup to a fucntion 2020-04-09 10:27:08 -06:00
Ben Wilson ce99950565 Update http handler 2020-04-09 10:26:42 -06:00
Larry Ruane 1ff6ea4091 move block cache from memory to files 2020-04-08 18:10:50 -06:00
Larry Ruane f4ad7146d6 finish documenting gRPC api: methods, arguments, return values 2020-04-06 11:14:14 -06:00