-
public final class DarksideStreamerGrpc.DarksideStreamerFutureStub extends AbstractFutureStub<DarksideStreamerGrpc.DarksideStreamerFutureStub>
A stub to allow clients to do ListenableFuture-style rpc calls to service DarksideStreamer.
Darksidewalletd maintains two staging areas, blocks and transactions. The Stage*() gRPCs add items to the staging area; ApplyStaged() "applies" everything in the staging area to the working (operational) state that the mock zcashd serves; transactions are placed into their corresponding blocks (by height).
-
-
Method Summary
Modifier and Type Method Description ListenableFuture<Service.Empty>reset(Darkside.DarksideMetaState request)Reset reverts all darksidewalletd state (active block range, latest height, staged blocks and transactions) and lightwalletd state (cache) to empty, the same as the initial state. This occurs synchronously and instantaneously; no reorg happens in lightwalletd. This is good to do before each independent test so that no state leaks from one test to another. Also sets (some of) the values returned by GetLightdInfo(). The Sapling activation height specified here must be where the block range starts.ListenableFuture<Service.Empty>stageBlocks(Darkside.DarksideBlocksURL request)StageBlocks is the same as StageBlocksStream() except the blocks are fetched from the given URL. Blocks are one per line, hex-encoded (not JSON).ListenableFuture<Service.Empty>stageBlocksCreate(Darkside.DarksideEmptyBlocks request)StageBlocksCreate is like the previous two, except it creates 'count' empty blocks at consecutive heights starting at height 'height'. The 'nonce' is part of the header, so it contributes to the block hash; this lets you create identical blocks (same transactions and height), but with different hashes.ListenableFuture<Service.Empty>stageTransactions(Darkside.DarksideTransactionsURL request)StageTransactions is the same except the transactions are fetched from the given url. They are all staged into the block at the given height. Staging transactions to different heights requires multiple calls.ListenableFuture<Service.Empty>applyStaged(Darkside.DarksideHeight request)ApplyStaged iterates the list of blocks that were staged by the StageBlocks*() gRPCs, in the order they were staged, and "merges" each into the active, working blocks list that the mock zcashd is presenting to lightwalletd. Even as each block is applied, the active list can't have gaps; if the active block range is 1000-1006, and the staged block range is 1003-1004, the resulting range is 1000-1004, with 1000-1002 unchanged, blocks 1003-1004 from the new range, and 1005-1006 dropped. After merging all blocks, ApplyStaged() appends staged transactions (in the order received) into each one's corresponding (by height) block The staging area is then cleared. The argument specifies the latest block height that mock zcashd reports (i.e. what's returned by GetLatestBlock). Note that ApplyStaged() can also be used to simply advance the latest block height presented by mock zcashd. That is, there doesn't need to be anything in the staging area.ListenableFuture<Service.Empty>clearIncomingTransactions(Service.Empty request)Clear the incoming transaction pool.ListenableFuture<Service.Empty>addAddressUtxo(Service.GetAddressUtxosReply request)Add a GetAddressUtxosReply entry to be returned by GetAddressUtxos(). There is no staging or applying for these, very simple.ListenableFuture<Service.Empty>clearAddressUtxo(Service.Empty request)Clear the list of GetAddressUtxos entries (can't fail)ListenableFuture<Service.Empty>addTreeState(Service.TreeState request)Adds a GetTreeState to the tree state cacheListenableFuture<Service.Empty>removeTreeState(Service.BlockID request)Removes a GetTreeState for the given height from cache if present (can't fail)ListenableFuture<Service.Empty>clearAllTreeStates(Service.Empty request)Clear the list of GetTreeStates entries (can't fail)-
Methods inherited from class io.grpc.stub.AbstractFutureStub
newStub -
Methods inherited from class io.grpc.stub.AbstractStub
getCallOptions, getChannel, withCallCredentials, withChannel, withCompression, withDeadline, withDeadlineAfter, withExecutor, withInterceptors, withMaxInboundMessageSize, withMaxOutboundMessageSize, withOnReadyThreshold, withOption, withWaitForReady -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
reset
ListenableFuture<Service.Empty> reset(Darkside.DarksideMetaState request)
Reset reverts all darksidewalletd state (active block range, latest height, staged blocks and transactions) and lightwalletd state (cache) to empty, the same as the initial state. This occurs synchronously and instantaneously; no reorg happens in lightwalletd. This is good to do before each independent test so that no state leaks from one test to another. Also sets (some of) the values returned by GetLightdInfo(). The Sapling activation height specified here must be where the block range starts.
-
stageBlocks
ListenableFuture<Service.Empty> stageBlocks(Darkside.DarksideBlocksURL request)
StageBlocks is the same as StageBlocksStream() except the blocks are fetched from the given URL. Blocks are one per line, hex-encoded (not JSON).
-
stageBlocksCreate
ListenableFuture<Service.Empty> stageBlocksCreate(Darkside.DarksideEmptyBlocks request)
StageBlocksCreate is like the previous two, except it creates 'count' empty blocks at consecutive heights starting at height 'height'. The 'nonce' is part of the header, so it contributes to the block hash; this lets you create identical blocks (same transactions and height), but with different hashes.
-
stageTransactions
ListenableFuture<Service.Empty> stageTransactions(Darkside.DarksideTransactionsURL request)
StageTransactions is the same except the transactions are fetched from the given url. They are all staged into the block at the given height. Staging transactions to different heights requires multiple calls.
-
applyStaged
ListenableFuture<Service.Empty> applyStaged(Darkside.DarksideHeight request)
ApplyStaged iterates the list of blocks that were staged by the StageBlocks*() gRPCs, in the order they were staged, and "merges" each into the active, working blocks list that the mock zcashd is presenting to lightwalletd. Even as each block is applied, the active list can't have gaps; if the active block range is 1000-1006, and the staged block range is 1003-1004, the resulting range is 1000-1004, with 1000-1002 unchanged, blocks 1003-1004 from the new range, and 1005-1006 dropped. After merging all blocks, ApplyStaged() appends staged transactions (in the order received) into each one's corresponding (by height) block The staging area is then cleared. The argument specifies the latest block height that mock zcashd reports (i.e. what's returned by GetLatestBlock). Note that ApplyStaged() can also be used to simply advance the latest block height presented by mock zcashd. That is, there doesn't need to be anything in the staging area.
-
clearIncomingTransactions
ListenableFuture<Service.Empty> clearIncomingTransactions(Service.Empty request)
Clear the incoming transaction pool.
-
addAddressUtxo
ListenableFuture<Service.Empty> addAddressUtxo(Service.GetAddressUtxosReply request)
Add a GetAddressUtxosReply entry to be returned by GetAddressUtxos(). There is no staging or applying for these, very simple.
-
clearAddressUtxo
ListenableFuture<Service.Empty> clearAddressUtxo(Service.Empty request)
Clear the list of GetAddressUtxos entries (can't fail)
-
addTreeState
ListenableFuture<Service.Empty> addTreeState(Service.TreeState request)
Adds a GetTreeState to the tree state cache
-
removeTreeState
ListenableFuture<Service.Empty> removeTreeState(Service.BlockID request)
Removes a GetTreeState for the given height from cache if present (can't fail)
-
clearAllTreeStates
ListenableFuture<Service.Empty> clearAllTreeStates(Service.Empty request)
Clear the list of GetTreeStates entries (can't fail)
-
-
-
-