Skip to content

Commit 1f4e178

Browse files
KleeTaurusliuchengxu
authored andcommitted
fix some minor issues for this tutorial (#14)
* fix misspelling issue for hask(hash) * keep output message accordance with source code * fix misspelling issue for bolddb(boltdb) * fix translation issue for satoshis <-> BTC conversion
1 parent 2ff9aa9 commit 1f4e178

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

content/part-1/basic-prototype.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,15 +195,15 @@ $ cd src
195195
$ make
196196
==> Go build
197197
==> Running
198-
Prev hash:
198+
Prev. hash:
199199
Data: Genesis Block
200200
Hash: 4693b71eee96760de4b0f051083376dcbed2f0711a44294ee5fd42fbeacc9579
201201

202-
Prev hash: 4693b71eee96760de4b0f051083376dcbed2f0711a44294ee5fd42fbeacc9579
202+
Prev. hash: 4693b71eee96760de4b0f051083376dcbed2f0711a44294ee5fd42fbeacc9579
203203
Data: Send 1 BTC to Ivan
204204
Hash: 839380a2d0af1dc4686f16ade5423fecdc5f287db9322d9e18adcb4071e7c8ff
205205

206-
Prev hash: 839380a2d0af1dc4686f16ade5423fecdc5f287db9322d9e18adcb4071e7c8ff
206+
Prev. hash: 839380a2d0af1dc4686f16ade5423fecdc5f287db9322d9e18adcb4071e7c8ff
207207
Data: Send 2 more BTC to Ivan
208208
Hash: b38052a029bd2b1b9d4bb478af45b4c88605e99bc64e49031ba06d21ad4b0b38
209209
```

content/part-3/persistence-and-cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Bolt 使用键值存储,这意味着它没有像 SQL RDBMS (MySQL,PostgreS
3232

3333
需要注意的一个事情是,Bolt 数据库没有数据类型:键和值都是字节数组(byte array)。鉴于需要在里面存储 Go 的结构(准确来说,也就是存储**Block(块)**),我们需要对它们进行序列化,也就说,实现一个从 Go struct 转换到一个 byte array 的机制,同时还可以从一个 byte array 再转换回 Go struct。虽然我们将会使用  [encoding/gob](https://golang.org/pkg/encoding/gob/)  来完成这一目标,但实际上也可以选择使用 **JSON**, **XML**, **Protocol Buffers** 等等。之所以选择使用 **encoding/gob**, 是因为它很简单,而且是 Go 标准库的一部分。
3434

35-
虽然 BoldDB 的作者出于个人原因已经不在对其维护(见[README](https://github.com/boltdb/bolt/commit/fa5367d20c994db73282594be0146ab221657943)), 不过关系不大,它已经足够稳定了,况且也有活跃的 fork:[coreos/bblot](https://github.com/coreos/bbolt)
35+
虽然 BoltDB 的作者出于个人原因已经不在对其维护(见[README](https://github.com/boltdb/bolt/commit/fa5367d20c994db73282594be0146ab221657943)), 不过关系不大,它已经足够稳定了,况且也有活跃的 fork:[coreos/bblot](https://github.com/coreos/bbolt)
3636

3737
## 数据库结构
3838

content/part-4/transactions-1.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ type TXOutput struct {
5555

5656
实际上,正是输出里面存储了“币”(注意,也就是上面的 `Value` 字段)。而这里的存储,指的是用一个数学难题对输出进行锁定,这个难题被存储在 `ScriptPubKey` 里面。在内部,比特币使用了一个叫做 *Script* 的脚本语言,用它来定义锁定和解锁输出的逻辑。虽然这个语言相当的原始(这是为了避免潜在的黑客攻击和滥用而有意为之),并不复杂,但是我们也并不会在这里讨论它的细节。你可以在[这里](https://en.bitcoin.it/wiki/Script) 找到详细解释。
5757

58-
>在比特币中,`value` 字段存储的是 *satoshi* 的数量,而不是 BTC 的数量。一个 *satoshi* 等于一百万分之一的 BTC(0.00000001 BTC),这也是比特币里面最小的货币单位(就像是 1 分的硬币)。
58+
>在比特币中,`value` 字段存储的是 *satoshi* 的数量,而不是 BTC 的数量。一个 *satoshi* 等于一亿分之一的 BTC(0.00000001 BTC),这也是比特币里面最小的货币单位(就像是 1 分的硬币)。
5959
6060
由于还没有实现地址(address),所以目前我们会避免涉及逻辑相关的完整脚本。`ScriptPubKey` 将会存储一个任意的字符串(用户定义的钱包地址)。
6161

0 commit comments

Comments
 (0)