Skip to content

Commit e27821f

Browse files
committed
Update documentation to match version 0.2.0
1 parent 499d654 commit e27821f

File tree

4 files changed

+102
-65
lines changed

4 files changed

+102
-65
lines changed

CONTRIBUTING.md

+24-25
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# Blockbook Contributor Guide
22

3-
Blockbook is back-end service for Trezor wallet. Although it is open source, design and development of core packages
3+
Blockbook is back-end service for Trezor wallet. Although it is open source, the design and development of the core packages
44
is done by Trezor developers in order to keep Blockbook compatible with Trezor.
55

66
Bug fixes and support for new coins are welcome. Please take note that non-fixing pull requests that change base
7-
packages or another coin code will not be accepted. If you will have to change some of existing code, please file
7+
packages or another coin code will not be accepted. If you have a need to change some of the existing code, please file
88
an issue and discuss your request with Blockbook maintainers.
99

1010
## Development environment
1111

12-
Instructions to set up your development environment and build Blockbook are described in separated
12+
Instructions to set up your development environment and build Blockbook are described in a separate
1313
[document](/docs/build.md).
1414

1515
## How can I contribute?
@@ -25,44 +25,43 @@ updates. Do not leave random "+1" or "I have this too" comments, as they only cl
2525
resolving it. However, if you have ways to reproduce the issue or have additional information that may help resolving
2626
the issue, please leave a comment.
2727

28-
Include information about Blockbook instance which is exposed at internal HTTP port. Ports are listed in
29-
[port registry](/docs/ports.md). For example execute `curl -k https://localhost:9030` for Bitcoin.
28+
Include information about the Blockbook instance, which is shown at the Blockbook status page or returned by API call. For example execute `curl -k https://<server name>:<public port>/api` to get JSON containing details about Blockbook and Backend installation. Ports are listed in the [port registry](/docs/ports.md).
3029

3130
Also include the steps required to reproduce the problem if possible and applicable. This information will help us
3231
review and fix your issue faster. When sending lengthy log-files, consider posting them as a gist
3332
(https://gist.github.com).
3433

3534
### Adding coin support
3635

37-
Trezor harware wallet supports over 500 coins, see https://trezor.io/coins/. You are free to add support for any of
38-
them to Blockbook. Actually implemented coins are listed [here](/docs/ports.md).
36+
> **Important notice**: Although we are happy for support of new coins, we do not have enough capacity to run them all
37+
> on our infrastructure. We run Blockbook instances only for selected number of coins. If you want to have Blockbook
38+
> instance for your coin, you will have to deploy it to your own server.
3939
40-
You should follow few steps bellow to get smooth merge of your PR.
40+
Trezor harware wallet supports over 500 coins, see https://trezor.io/coins/. You are free to add support for any of
41+
them to Blockbook. Currently implemented coins are listed [here](/docs/ports.md).
4142

42-
> Although we are happy for support of new coins we have not enough capacity to run them all on our infrastructure.
43-
> Actually we can run Blockbook instances only for coins supported by Trezor wallet. If you want to have Blockbook
44-
> instance for your coin, you will have to deploy your own server.
43+
You should follow the steps below to get smooth merge of your PR.
4544

4645
#### Add coin definition
4746

48-
Coin definitions are stored in JSON files in *configs/coins* directory. They are single source of Blockbook
47+
Coin definitions are stored in JSON files in *configs/coins* directory. They are the single source of Blockbook
4948
configuration, Blockbook and back-end package definition and build metadata. Since Blockbook supports only single
5049
coin index per running instance, every coin (including testnet) must have single definition file.
5150

5251
All options of coin definition are described in [config.md](/docs/config.md).
5352

5453
Because most of coins are fork of Bitcoin and they have similar way to install and configure their daemon, we use
55-
templates to generate package definition and configuration files during build process. Similarly, there templates for Blockbook
54+
templates to generate package definition and configuration files during build process. Similarly, there are templates for Blockbook
5655
package. Templates are filled with data from coin definition. Although normally all package definitions are generated automatically
57-
during the build process, sometimes there is a reason to see them. You can create them by calling
56+
during the build process, sometimes there is a reason to check what was generated. You can create them by calling
5857
`go run build/templates/generate.go coin`, where *coin* is name of definition file without .json extension. Files are
5958
generated to *build/pkg-defs* directory.
6059

6160
Good examples of coin configuration are
6261
[*configs/coins/bitcoin.json*](configs/coins/bitcoin.json) and
63-
[*configs/coins/ethereum.json*](configs/coins/ethereum.json) for Bitcoin-like coins and different coins, respectively.
62+
[*configs/coins/ethereum.json*](configs/coins/ethereum.json) for Bitcoin type coins and Ethereum type coins, respectively.
6463

65-
Usually you have to update only few options that differ from Bitcoin definition. At first there is base information
64+
Usually you have to update only a few options that differ from the Bitcoin definition. At first there is base information
6665
about coin in section *coin* – name, alias etc. Then update port information in *port* section. We keep port series as
6766
listed in [the port registry](/docs/ports.md). Select next port numbers in the series. Port numbers must be unique across all
6867
port definitions.
@@ -109,15 +108,15 @@ different concept than Bitcoin.
109108

110109
##### BlockChain interface
111110

112-
Type that implements *bchain.BlockChain* interface ensures communication with block chain network. Because
113-
it calls node RPCs it usually has suffix RPC.
111+
Type that implements *bchain.BlockChain* interface ensures communication with the block chain network. Because
112+
it calls node RPCs, it usually has suffix RPC.
114113

115114
Initialization of object is separated into two stages. At first there is called factory method (details described
116-
in next section) and then *bchain.BlockChain.Initialize()* method. Separated initialization method allows you call
115+
in the next section) and then *bchain.BlockChain.Initialize()* method. Separated initialization method allows you call
117116
inherited methods during initialization. However it is common practice override fields of embedded structure in factory
118117
method.
119118

120-
During initialization, there is usually loaded chain information, registered message queue callback and created mempool
119+
Initialization routine usually loads chain information, registers message queue callback and creates mempool
121120
and parser objects.
122121

123122
BitcoinRPC uses *btc.RPCMarshaller* ([btc/codec.go](/bchain/coins/btc/codec.go)) in order to distinguish API version of
@@ -136,7 +135,7 @@ must correspond to *coin.name* in coin definition file (see above).
136135
Configuration passed to factory method is coin specific. For types that embed *btc.BitcoinRPC,* configuration must
137136
contain at least fields referred in *btc.Configuration* ([btc/bitcoinrpc.go](/bchain/coins/btc/bitcoinrpc.go)).
138137

139-
For types that embed base struct it is common practise call factory method of embedded type in order to
138+
For types that embed base struct it is common practice to call factory method of the embedded type in order to
140139
create & initialize it. It is much more robust than simple struct composition.
141140

142141
For example see [zec/zcashrpc.go](/bchain/coins/zec/zcashrpc.go).
@@ -146,7 +145,7 @@ For example see [zec/zcashrpc.go](/bchain/coins/zec/zcashrpc.go).
146145
Type that implements *bchain.BlockChainParser* interface ensures parsing and conversions of block chain data. It is
147146
initialized by *bchain.BlockChain* during initialization.
148147

149-
There are several groups of methods defined in *bchian.BlockChainParser*:
148+
There are several groups of methods defined in *bchain.BlockChainParser*:
150149

151150
* *GetAddrDescFromVout* and *GetAddrDescFromAddress* – Convert transaction addresses to *Address Descriptor* that is used as database ID.
152151
Most of coins use output script as *Address Descriptor*.
@@ -168,9 +167,9 @@ different approach for address representation than Bitcoin.
168167

169168
#### Add tests
170169

171-
Add unit tests and integration tests. PR without passing tests won't be accepted.
172-
Tests are described [here](/docs/testing.md).
170+
Add unit tests and integration tests. **Pull requests without passing tests will not be accepted**.
171+
How to implement tests is described [here](/docs/testing.md).
173172

174173
#### Deploy public server
175174

176-
Deploy Blockbook server on public IP address. Blockbook maintainers will check implementation before merging.
175+
Deploy Blockbook server on public IP address. Blockbook maintainers will check your implementation before merging.

README.md

+10-13
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@
66
77
**Blockbook** is back-end service for Trezor wallet. Main features of **Blockbook** are:
88

9-
- create missing indexes in the blockchain - index of addresses and address balances
10-
- allow fast searches in the index of addresses
11-
- implement parts Insight socket.io interface as required by Trezor wallet
12-
- support of multiple coins
13-
- simple blockchain explorer for implemented coins
9+
- index of addresses and address balances of the connected block chain
10+
- fast searches in the indexes
11+
- simple blockchain explorer
12+
- websocket, API and legacy Bitcore Insight compatible socket.io interfaces
13+
- support of multiple coins (Bitcoin and Ethereum type), with easy extensibility for other coins
1414
- scripts for easy creation of debian packages for backend and blockbook
1515

1616
## Build and installation instructions
1717

1818
Officially supported platform is **Debian Linux** and **AMD64** architecture.
1919

20-
Memory and disk requirements for initial synchronization of **Bitcoin mainnet** are around 32 GB RAM and over 150 GB of disk size. After initial synchronization, fully synchronized instance takes around 10 GB RAM.
21-
Other coins should have lower requirements depending on size of their block chain. Note that fast SSD disks are highly
20+
Memory and disk requirements for initial synchronization of **Bitcoin mainnet** are around 32 GB RAM and over 160 GB of disk space. After initial synchronization, fully synchronized instance uses about 10 GB RAM.
21+
Other coins should have lower requirements, depending on the size of their block chain. Note that fast SSD disks are highly
2222
recommended.
2323

2424
User installation guide is [here](https://wiki.trezor.io/User_manual:Running_a_local_instance_of_Trezor_Wallet_backend_(Blockbook)).
@@ -29,14 +29,11 @@ Contribution guide is [here](CONTRIBUTING.md).
2929

3030
# Implemented coins
3131

32-
The most significant coins implemented by Blockbook are:
33-
- Bitcoin, Bcash, Bgold, ZCash, Dash, Litecoin
34-
35-
Incomplete, experimental support is for:
36-
- Ethereum, Ethereum Classic
32+
Blockbook currently supports over 20 coins, among them:
33+
- Bitcoin, Litecoin, Bitcoin Cash, Bgold, ZCash, Dash, Ethereum, Ethereum Classic
3734

3835
Testnets for some coins are also supported, for example:
39-
- Bitcoin Testnet, Bcash Testnet, ZCash Testnet, Ethereum Testnet Ropsten
36+
- Bitcoin Testnet, Bitcoin Cash Testnet, ZCash Testnet, Ethereum Testnet Ropsten
4037

4138
List of all implemented coins is in [the registry of ports](/docs/ports.md).
4239

docs/config.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ Good examples of coin configuration are
7575
Exception is *addnode* key that contains list of nodes that is expanded as addnode=item lines.
7676

7777
* `blockbook` – Definition of Blockbook package, configuration and service.
78-
* `package_name` – Name of package. See convention note in [build guide](/docs/build.md#on-naming-conventions-and-versioning).
79-
* `system_user` – User used to run Blockbook service. See convention note in [build guide](/docs/build.md#on-naming-conventions-and-versioning).
78+
* `package_name` – Name of package. See convention note in the [build guide](/docs/build.md#on-naming-conventions-and-versioning).
79+
* `system_user` – User used to run Blockbook service. See convention note in the [build guide](/docs/build.md#on-naming-conventions-and-versioning).
8080
* `internal_binding_template` – Template for *-internal* parameter. See note on templates below.
8181
* `public_binding_template` – Template for *-public* parameter. See note on templates below.
8282
* `explorer_url` – URL of blockchain explorer. Leave empty for internal explorer.
@@ -108,8 +108,8 @@ as well. Note that dot at the beginning is mandatory. Go template syntax is full
108108
Since Blockbook is an open-source project and we don't prevent anybody from running independent instances, it is possible
109109
to alter built-in text that is specific for Trezor. Text fields that could be updated are:
110110

111-
* about – A note about instance shown on the Application status page and returned by an API.
112-
* tos – A link to Terms of service shown as the footer on the Explorer pages.
111+
* [about](/build/text/about) – A note about instance shown on the Application status page and returned by an API.
112+
* [tos_link](/build/text/tos_link) – A link to Terms of service shown as the footer on the Explorer pages.
113113

114114
Text data are stored as plain text files in *build/text* directory and are embedded to binary during build. A change of
115115
theese files is mean for a private purpose and PRs that would update them won't be accepted.

0 commit comments

Comments
 (0)