Fix typos

This commit is contained in:
Dimitris Apostolou 2020-12-20 23:33:43 +02:00 committed by Larry Ruane
parent 33e7312218
commit b450634ab7
11 changed files with 38 additions and 48 deletions

View File

@ -11,7 +11,7 @@ This document describes the standard workflows and terminology for developers at
Before continuing, please ensure you have an existing GitHub or GitLab account. If not, visit [GitHub](https://github.com) or [GitLab](https://gitlab.com) to create an account. Before continuing, please ensure you have an existing GitHub or GitLab account. If not, visit [GitHub](https://github.com) or [GitLab](https://gitlab.com) to create an account.
## Fork Repository ## Fork Repository
This step assumes you are starting with a new GitHub/GitLab environment. If you have already forked the Lightwalletd repository, please continue to [Create Branch] section. Otherwise, open up a terminal and issue the below commands: This step assumes you are starting with a new GitHub/GitLab environment. If you have already forked the lightwalletd repository, please continue to [Create Branch] section. Otherwise, open up a terminal and issue the below commands:
Note: Please replace `your_username`, with your actual GitHub username Note: Please replace `your_username`, with your actual GitHub username
@ -43,10 +43,10 @@ After issuing the above commands, your `.git/config` file should look similar to
fetch = +refs/heads/*:refs/remotes/upstream/* fetch = +refs/heads/*:refs/remotes/upstream/*
pushurl = DISABLED pushurl = DISABLED
``` ```
This setup provides a single cloned environment to develop for Lightwalletd. There are alternative methods using multiple clones, but this document does not cover that process. This setup provides a single cloned environment to develop for lightwalletd. There are alternative methods using multiple clones, but this document does not cover that process.
## Create Branch ## Create Branch
While working on the Lightwalletd project, you are going to have bugs, features, and ideas to work on. Branching exists to aid these different tasks while you write code. Below are some conventions of branching at Zcash: While working on the lightwalletd project, you are going to have bugs, features, and ideas to work on. Branching exists to aid these different tasks while you write code. Below are some conventions of branching at Zcash:
1. `master` branch is **ALWAYS** deployable 1. `master` branch is **ALWAYS** deployable
2. Branch names **MUST** be descriptive: 2. Branch names **MUST** be descriptive:
@ -57,14 +57,14 @@ To create a new branch (assuming you are in `lightwalletd` directory):
```bash ```bash
git checkout -b [new_branch_name] git checkout -b [new_branch_name]
``` ```
Note: Even though you have created a new branch, until you `git push` this local branch, it will not show up in your Lightwalletd fork on GitHub (e.g. https://github.com/your_username/lightwalletd) Note: Even though you have created a new branch, until you `git push` this local branch, it will not show up in your lightwalletd fork on GitHub (e.g. https://github.com/your_username/lightwalletd)
To checkout an existing branch (assuming you are in `lightwalletd` directory): To checkout an existing branch (assuming you are in `lightwalletd` directory):
```bash ```bash
git checkout [existing_branch_name] git checkout [existing_branch_name]
``` ```
If you are fixing a bug or implementing a new feature, you likely will want to create a new branch. If you are reviewing code or working on existing branches, you likely will checkout an existing branch. To view the list of current Lightwalletd GitHub issues, click [here](https://github.com/zcash/lightwalletd/issues). If you are fixing a bug or implementing a new feature, you likely will want to create a new branch. If you are reviewing code or working on existing branches, you likely will checkout an existing branch. To view the list of current lightwalletd GitHub issues, click [here](https://github.com/zcash/lightwalletd/issues).
## Make & Commit Changes ## Make & Commit Changes
If you have created a new branch or checked out an existing one, it is time to make changes to your local source code. Below are some formalities for commits: If you have created a new branch or checked out an existing one, it is time to make changes to your local source code. Below are some formalities for commits:

View File

@ -2,7 +2,7 @@
# File: Dockerfile # File: Dockerfile
# Author: mdr0id # Author: mdr0id
# Date: 9/3/2019 # Date: 9/3/2019
# Description: Used for devs that have not built zcash or lightwalletd on # Description: Used for devs that have not built zcashd or lightwalletd on
# on existing system # on existing system
# USAGE: # USAGE:
# #
@ -15,10 +15,10 @@
# First you need to get zcashd sync to current height on testnet, from outside container: # First you need to get zcashd sync to current height on testnet, from outside container:
# make docker_img_run_zcashd # make docker_img_run_zcashd
# #
# Sometimes you need to manually start zcashd for the first time, from insdie the container: # Sometimes you need to manually start zcashd for the first time, from inside the container:
# zcashd -printtoconsole # zcashd -printtoconsole
# #
# Once the block height is atleast 280,000 you can go ahead and start lightwalletd # Once the block height is at least 280,000 you can go ahead and start lightwalletd
# make docker_img_run_lightwalletd_insecure_server # make docker_img_run_lightwalletd_insecure_server
# #
# If you need a random bash session in the container, use: # If you need a random bash session in the container, use:

View File

@ -4,7 +4,7 @@
# Security Disclaimer # Security Disclaimer
Lightwalletd is under active development, some features are more stable than lightwalletd is under active development, some features are more stable than
others. The code has not been subjected to a thorough review by an external others. The code has not been subjected to a thorough review by an external
auditor, and recent code changes have not yet received security review from auditor, and recent code changes have not yet received security review from
Electric Coin Company's security team. Electric Coin Company's security team.
@ -12,7 +12,7 @@ Electric Coin Company's security team.
Developers should familiarize themselves with the [wallet app threat Developers should familiarize themselves with the [wallet app threat
model](https://zcash.readthedocs.io/en/latest/rtd_pages/wallet_threat_model.html), model](https://zcash.readthedocs.io/en/latest/rtd_pages/wallet_threat_model.html),
since it contains important information about the security and privacy since it contains important information about the security and privacy
limitations of light wallets that use Lightwalletd. limitations of light wallets that use lightwalletd.
--- ---
@ -111,7 +111,7 @@ Example using server binary built from Makefile:
## Block cache ## Block cache
Lightwalletd caches all blocks from Sapling activation up to the lightwalletd caches all blocks from Sapling activation up to the
most recent block, which takes about an hour the first time you run most recent block, which takes about an hour the first time you run
lightwalletd. During this syncing, lightwalletd is fully available, lightwalletd. During this syncing, lightwalletd is fully available,
but block fetches are slower until the download completes. but block fetches are slower until the download completes.
@ -121,7 +121,7 @@ because the blocks are cached in local files (by default, within
`/var/lib/lightwalletd/db`; you can specify a different location using `/var/lib/lightwalletd/db`; you can specify a different location using
the `--data-dir` command-line option). the `--data-dir` command-line option).
Lightwalletd checks the consistency of these files at startup and during lightwalletd checks the consistency of these files at startup and during
operation as these files may be damaged by, for example, an unclean shutdown. operation as these files may be damaged by, for example, an unclean shutdown.
If the server detects corruption, it will automatically re-downloading blocks If the server detects corruption, it will automatically re-downloading blocks
from `zcashd` from that height, requiring up to an hour again (no manual from `zcashd` from that height, requiring up to an hour again (no manual
@ -133,7 +133,7 @@ nature of the corruption.
## Darksidewalletd & Testing ## Darksidewalletd & Testing
Lightwalletd now supports a mode that enables integration testing of itself and lightwalletd now supports a mode that enables integration testing of itself and
wallets that connect to it. See the [darksidewalletd wallets that connect to it. See the [darksidewalletd
docs](docs/darksidewalletd.md) for more information. docs](docs/darksidewalletd.md) for more information.

View File

@ -1,7 +1,7 @@
# Intro to darksidewalletd # Intro to darksidewalletd
Darksidewalletd is a feature included in lightwalletd, enabled by the Darksidewalletd is a feature included in lightwalletd, enabled by the
`--darkside-very-insecure` flag, which can serve arbitrary blocks to a zcash `--darkside-very-insecure` flag, which can serve arbitrary blocks to a Zcash
light client wallet. This is useful for security and reorg testing. It includes light client wallet. This is useful for security and reorg testing. It includes
a minimally-functional mock zcashd which comes with a gRPC API for controlling a minimally-functional mock zcashd which comes with a gRPC API for controlling
which blocks it will serve. which blocks it will serve.

View File

@ -3,7 +3,7 @@ Docker images are available on Docker Hub at [electriccoinco/lightwalletd](https
## Using command line options ## Using command line options
Already have a zcash node running with an exposed RPC endpoint? Already have a Zcash node running with an exposed RPC endpoint?
Try the docker container with command lines flags like: Try the docker container with command lines flags like:
``` ```
@ -78,4 +78,4 @@ docker run --rm \
## Using docker-compose for a full stack ## Using docker-compose for a full stack
Don't have an existing zcash node? Check out the [docker-compose](./docker-compose-setup.md) for examples of multi-container usage. Don't have an existing Zcash node? Check out the [docker-compose](./docker-compose-setup.md) for examples of multi-container usage.

View File

@ -1318,7 +1318,7 @@ into a specified block on the next ApplyStaged().</p></td>
<td>data</td> <td>data</td>
<td><a href="#bytes">bytes</a></td> <td><a href="#bytes">bytes</a></td>
<td></td> <td></td>
<td><p>exact data returned by zcash &#39;getrawtransaction&#39; </p></td> <td><p>exact data returned by Zcash &#39;getrawtransaction&#39; </p></td>
</tr> </tr>
<tr> <tr>
@ -1398,7 +1398,7 @@ into a specified block on the next ApplyStaged().</p></td>
<h3 id="cash.z.wallet.sdk.rpc.TreeState">TreeState</h3> <h3 id="cash.z.wallet.sdk.rpc.TreeState">TreeState</h3>
<p>The TreeState is derived from the zcash z_gettreestate rpc.</p> <p>The TreeState is derived from the Zcash z_gettreestate rpc.</p>
<table class="field-table"> <table class="field-table">
@ -1533,7 +1533,7 @@ into a specified block on the next ApplyStaged().</p></td>
<td>SendTransaction</td> <td>SendTransaction</td>
<td><a href="#cash.z.wallet.sdk.rpc.RawTransaction">RawTransaction</a></td> <td><a href="#cash.z.wallet.sdk.rpc.RawTransaction">RawTransaction</a></td>
<td><a href="#cash.z.wallet.sdk.rpc.SendResponse">SendResponse</a></td> <td><a href="#cash.z.wallet.sdk.rpc.SendResponse">SendResponse</a></td>
<td><p>Submit the given transaction to the zcash network</p></td> <td><p>Submit the given transaction to the Zcash network</p></td>
</tr> </tr>
<tr> <tr>
@ -1577,7 +1577,7 @@ in the exclude list that don&#39;t exist in the mempool are ignored.</p></td>
<td><a href="#cash.z.wallet.sdk.rpc.BlockID">BlockID</a></td> <td><a href="#cash.z.wallet.sdk.rpc.BlockID">BlockID</a></td>
<td><a href="#cash.z.wallet.sdk.rpc.TreeState">TreeState</a></td> <td><a href="#cash.z.wallet.sdk.rpc.TreeState">TreeState</a></td>
<td><p>GetTreeState returns the note commitment tree state corresponding to the given block. <td><p>GetTreeState returns the note commitment tree state corresponding to the given block.
See section 3.7 of the zcash protocol specification. It returns several other useful See section 3.7 of the Zcash protocol specification. It returns several other useful
values also (even though they can be obtained using GetBlock). values also (even though they can be obtained using GetBlock).
The block can be specified by either height or hash.</p></td> The block can be specified by either height or hash.</p></td>
</tr> </tr>

View File

@ -170,14 +170,14 @@ func (s *lwdStreamer) GetBlockRange(span *walletrpc.BlockRange, resp walletrpc.C
} }
// GetTreeState returns the note commitment tree state corresponding to the given block. // GetTreeState returns the note commitment tree state corresponding to the given block.
// See section 3.7 of the zcash protocol specification. It returns several other useful // See section 3.7 of the Zcash protocol specification. It returns several other useful
// values also (even though they can be obtained using GetBlock). // values also (even though they can be obtained using GetBlock).
// The block can be specified by either height or hash. // The block can be specified by either height or hash.
func (s *lwdStreamer) GetTreeState(ctx context.Context, id *walletrpc.BlockID) (*walletrpc.TreeState, error) { func (s *lwdStreamer) GetTreeState(ctx context.Context, id *walletrpc.BlockID) (*walletrpc.TreeState, error) {
if id.Height == 0 && id.Hash == nil { if id.Height == 0 && id.Hash == nil {
return nil, errors.New("request for unspecified identifier") return nil, errors.New("request for unspecified identifier")
} }
// The zcash z_gettreestate rpc accepts either a block height or block hash // The Zcash z_gettreestate rpc accepts either a block height or block hash
params := make([]json.RawMessage, 1) params := make([]json.RawMessage, 1)
var hashJSON []byte var hashJSON []byte
if id.Height > 0 { if id.Height > 0 {

View File

@ -97,12 +97,12 @@ func TestBlockParser(t *testing.T) {
t.Error("Unexpected number of transactions") t.Error("Unexpected number of transactions")
} }
if block.HasSaplingTransactions() { if block.HasSaplingTransactions() {
t.Error("Unexpected Saping tx") t.Error("Unexpected Sapling tx")
break break
} }
for txindex, tx := range block.Transactions() { for txindex, tx := range block.Transactions() {
if tx.HasSaplingElements() { if tx.HasSaplingElements() {
t.Error("Unexpected Saping tx") t.Error("Unexpected Sapling tx")
break break
} }
expectedHash := txhashes[blockindex][txindex%len(txhashes[blockindex])] expectedHash := txhashes[blockindex][txindex%len(txhashes[blockindex])]

View File

@ -4,15 +4,14 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.25.0 // protoc-gen-go v1.25.0-devel
// protoc v3.11.0 // protoc v3.14.0
// source: darkside.proto // source: darkside.proto
package walletrpc package walletrpc
import ( import (
context "context" context "context"
proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc" grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes" codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status" status "google.golang.org/grpc/status"
@ -29,10 +28,6 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
) )
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
type DarksideMetaState struct { type DarksideMetaState struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache

View File

@ -4,15 +4,14 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.25.0 // protoc-gen-go v1.25.0-devel
// protoc v3.11.0 // protoc v3.14.0
// source: service.proto // source: service.proto
package walletrpc package walletrpc
import ( import (
context "context" context "context"
proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc" grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes" codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status" status "google.golang.org/grpc/status"
@ -29,10 +28,6 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
) )
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
// A BlockID message contains identifiers to select a block: a height or a // A BlockID message contains identifiers to select a block: a height or a
// hash. Specification by hash is not implemented, but may be in the future. // hash. Specification by hash is not implemented, but may be in the future.
type BlockID struct { type BlockID struct {
@ -220,7 +215,7 @@ type RawTransaction struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` // exact data returned by zcash 'getrawtransaction' Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` // exact data returned by Zcash 'getrawtransaction'
Height uint64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` // height that the transaction was mined (or -1) Height uint64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` // height that the transaction was mined (or -1)
} }
@ -912,7 +907,7 @@ func (x *Exclude) GetTxid() [][]byte {
return nil return nil
} }
// The TreeState is derived from the zcash z_gettreestate rpc. // The TreeState is derived from the Zcash z_gettreestate rpc.
type TreeState struct { type TreeState struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
@ -1742,7 +1737,7 @@ type CompactTxStreamerClient interface {
GetBlockRange(ctx context.Context, in *BlockRange, opts ...grpc.CallOption) (CompactTxStreamer_GetBlockRangeClient, error) GetBlockRange(ctx context.Context, in *BlockRange, opts ...grpc.CallOption) (CompactTxStreamer_GetBlockRangeClient, error)
// Return the requested full (not compact) transaction (as from zcashd) // Return the requested full (not compact) transaction (as from zcashd)
GetTransaction(ctx context.Context, in *TxFilter, opts ...grpc.CallOption) (*RawTransaction, error) GetTransaction(ctx context.Context, in *TxFilter, opts ...grpc.CallOption) (*RawTransaction, error)
// Submit the given transaction to the zcash network // Submit the given transaction to the Zcash network
SendTransaction(ctx context.Context, in *RawTransaction, opts ...grpc.CallOption) (*SendResponse, error) SendTransaction(ctx context.Context, in *RawTransaction, opts ...grpc.CallOption) (*SendResponse, error)
// Return the txids corresponding to the given t-address within the given block range // Return the txids corresponding to the given t-address within the given block range
GetTaddressTxids(ctx context.Context, in *TransparentAddressBlockFilter, opts ...grpc.CallOption) (CompactTxStreamer_GetTaddressTxidsClient, error) GetTaddressTxids(ctx context.Context, in *TransparentAddressBlockFilter, opts ...grpc.CallOption) (CompactTxStreamer_GetTaddressTxidsClient, error)
@ -1759,7 +1754,7 @@ type CompactTxStreamerClient interface {
// in the exclude list that don't exist in the mempool are ignored. // in the exclude list that don't exist in the mempool are ignored.
GetMempoolTx(ctx context.Context, in *Exclude, opts ...grpc.CallOption) (CompactTxStreamer_GetMempoolTxClient, error) GetMempoolTx(ctx context.Context, in *Exclude, opts ...grpc.CallOption) (CompactTxStreamer_GetMempoolTxClient, error)
// GetTreeState returns the note commitment tree state corresponding to the given block. // GetTreeState returns the note commitment tree state corresponding to the given block.
// See section 3.7 of the zcash protocol specification. It returns several other useful // See section 3.7 of the Zcash protocol specification. It returns several other useful
// values also (even though they can be obtained using GetBlock). // values also (even though they can be obtained using GetBlock).
// The block can be specified by either height or hash. // The block can be specified by either height or hash.
GetTreeState(ctx context.Context, in *BlockID, opts ...grpc.CallOption) (*TreeState, error) GetTreeState(ctx context.Context, in *BlockID, opts ...grpc.CallOption) (*TreeState, error)
@ -2032,7 +2027,7 @@ type CompactTxStreamerServer interface {
GetBlockRange(*BlockRange, CompactTxStreamer_GetBlockRangeServer) error GetBlockRange(*BlockRange, CompactTxStreamer_GetBlockRangeServer) error
// Return the requested full (not compact) transaction (as from zcashd) // Return the requested full (not compact) transaction (as from zcashd)
GetTransaction(context.Context, *TxFilter) (*RawTransaction, error) GetTransaction(context.Context, *TxFilter) (*RawTransaction, error)
// Submit the given transaction to the zcash network // Submit the given transaction to the Zcash network
SendTransaction(context.Context, *RawTransaction) (*SendResponse, error) SendTransaction(context.Context, *RawTransaction) (*SendResponse, error)
// Return the txids corresponding to the given t-address within the given block range // Return the txids corresponding to the given t-address within the given block range
GetTaddressTxids(*TransparentAddressBlockFilter, CompactTxStreamer_GetTaddressTxidsServer) error GetTaddressTxids(*TransparentAddressBlockFilter, CompactTxStreamer_GetTaddressTxidsServer) error
@ -2049,7 +2044,7 @@ type CompactTxStreamerServer interface {
// in the exclude list that don't exist in the mempool are ignored. // in the exclude list that don't exist in the mempool are ignored.
GetMempoolTx(*Exclude, CompactTxStreamer_GetMempoolTxServer) error GetMempoolTx(*Exclude, CompactTxStreamer_GetMempoolTxServer) error
// GetTreeState returns the note commitment tree state corresponding to the given block. // GetTreeState returns the note commitment tree state corresponding to the given block.
// See section 3.7 of the zcash protocol specification. It returns several other useful // See section 3.7 of the Zcash protocol specification. It returns several other useful
// values also (even though they can be obtained using GetBlock). // values also (even though they can be obtained using GetBlock).
// The block can be specified by either height or hash. // The block can be specified by either height or hash.
GetTreeState(context.Context, *BlockID) (*TreeState, error) GetTreeState(context.Context, *BlockID) (*TreeState, error)

View File

@ -34,7 +34,7 @@ message TxFilter {
// RawTransaction contains the complete transaction data. It also optionally includes // RawTransaction contains the complete transaction data. It also optionally includes
// the block height in which the transaction was included. // the block height in which the transaction was included.
message RawTransaction { message RawTransaction {
bytes data = 1; // exact data returned by zcash 'getrawtransaction' bytes data = 1; // exact data returned by Zcash 'getrawtransaction'
uint64 height = 2; // height that the transaction was mined (or -1) uint64 height = 2; // height that the transaction was mined (or -1)
} }
@ -107,7 +107,7 @@ message Exclude {
repeated bytes txid = 1; repeated bytes txid = 1;
} }
// The TreeState is derived from the zcash z_gettreestate rpc. // The TreeState is derived from the Zcash z_gettreestate rpc.
message TreeState { message TreeState {
string network = 1; // "main" or "test" string network = 1; // "main" or "test"
uint64 height = 2; uint64 height = 2;
@ -142,7 +142,7 @@ service CompactTxStreamer {
// Return the requested full (not compact) transaction (as from zcashd) // Return the requested full (not compact) transaction (as from zcashd)
rpc GetTransaction(TxFilter) returns (RawTransaction) {} rpc GetTransaction(TxFilter) returns (RawTransaction) {}
// Submit the given transaction to the zcash network // Submit the given transaction to the Zcash network
rpc SendTransaction(RawTransaction) returns (SendResponse) {} rpc SendTransaction(RawTransaction) returns (SendResponse) {}
// Return the txids corresponding to the given t-address within the given block range // Return the txids corresponding to the given t-address within the given block range
@ -162,7 +162,7 @@ service CompactTxStreamer {
rpc GetMempoolTx(Exclude) returns (stream CompactTx) {} rpc GetMempoolTx(Exclude) returns (stream CompactTx) {}
// GetTreeState returns the note commitment tree state corresponding to the given block. // GetTreeState returns the note commitment tree state corresponding to the given block.
// See section 3.7 of the zcash protocol specification. It returns several other useful // See section 3.7 of the Zcash protocol specification. It returns several other useful
// values also (even though they can be obtained using GetBlock). // values also (even though they can be obtained using GetBlock).
// The block can be specified by either height or hash. // The block can be specified by either height or hash.
rpc GetTreeState(BlockID) returns (TreeState) {} rpc GetTreeState(BlockID) returns (TreeState) {}