You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+24-25
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,15 @@
1
1
# Blockbook Contributor Guide
2
2
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
4
4
is done by Trezor developers in order to keep Blockbook compatible with Trezor.
5
5
6
6
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
8
8
an issue and discuss your request with Blockbook maintainers.
9
9
10
10
## Development environment
11
11
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
13
13
[document](/docs/build.md).
14
14
15
15
## How can I contribute?
@@ -25,44 +25,43 @@ updates. Do not leave random "+1" or "I have this too" comments, as they only cl
25
25
resolving it. However, if you have ways to reproduce the issue or have additional information that may help resolving
26
26
the issue, please leave a comment.
27
27
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).
30
29
31
30
Also include the steps required to reproduce the problem if possible and applicable. This information will help us
32
31
review and fix your issue faster. When sending lengthy log-files, consider posting them as a gist
33
32
(https://gist.github.com).
34
33
35
34
### Adding coin support
36
35
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.
39
39
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).
41
42
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.
45
44
46
45
#### Add coin definition
47
46
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
49
48
configuration, Blockbook and back-end package definition and build metadata. Since Blockbook supports only single
50
49
coin index per running instance, every coin (including testnet) must have single definition file.
51
50
52
51
All options of coin definition are described in [config.md](/docs/config.md).
53
52
54
53
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
56
55
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
58
57
`go run build/templates/generate.go coin`, where *coin* is name of definition file without .json extension. Files are
59
58
generated to *build/pkg-defs* directory.
60
59
61
60
Good examples of coin configuration are
62
61
[*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.
64
63
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
66
65
about coin in section *coin* – name, alias etc. Then update port information in *port* section. We keep port series as
67
66
listed in [the port registry](/docs/ports.md). Select next port numbers in the series. Port numbers must be unique across all
68
67
port definitions.
@@ -109,15 +108,15 @@ different concept than Bitcoin.
109
108
110
109
##### BlockChain interface
111
110
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.
114
113
115
114
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
117
116
inherited methods during initialization. However it is common practice override fields of embedded structure in factory
118
117
method.
119
118
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
121
120
and parser objects.
122
121
123
122
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).
136
135
Configuration passed to factory method is coin specific. For types that embed *btc.BitcoinRPC,* configuration must
137
136
contain at least fields referred in *btc.Configuration* ([btc/bitcoinrpc.go](/bchain/coins/btc/bitcoinrpc.go)).
138
137
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
140
139
create & initialize it. It is much more robust than simple struct composition.
141
140
142
141
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).
146
145
Type that implements *bchain.BlockChainParser* interface ensures parsing and conversions of block chain data. It is
147
146
initialized by *bchain.BlockChain* during initialization.
148
147
149
-
There are several groups of methods defined in *bchian.BlockChainParser*:
148
+
There are several groups of methods defined in *bchain.BlockChainParser*:
150
149
151
150
**GetAddrDescFromVout* and *GetAddrDescFromAddress* – Convert transaction addresses to *Address Descriptor* that is used as database ID.
152
151
Most of coins use output script as *Address Descriptor*.
@@ -168,9 +167,9 @@ different approach for address representation than Bitcoin.
168
167
169
168
#### Add tests
170
169
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).
173
172
174
173
#### Deploy public server
175
174
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.
Copy file name to clipboardExpand all lines: README.md
+10-13
Original file line number
Diff line number
Diff line change
@@ -6,19 +6,19 @@
6
6
7
7
**Blockbook** is back-end service for Trezor wallet. Main features of **Blockbook** are:
8
8
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
14
14
- scripts for easy creation of debian packages for backend and blockbook
15
15
16
16
## Build and installation instructions
17
17
18
18
Officially supported platform is **Debian Linux** and **AMD64** architecture.
19
19
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
22
22
recommended.
23
23
24
24
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).
29
29
30
30
# Implemented coins
31
31
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:
0 commit comments