Fix linting issues
This commit is contained in:
parent
ae4cb2fb64
commit
e143215288
@ -1,11 +1,11 @@
|
||||
# Blockbook Contributor Guide
|
||||
|
||||
Blockbook is back-end service for Trezor wallet. Although it is open source, the design and development of the core packages
|
||||
is done by Trezor developers in order to keep Blockbook compatible with Trezor.
|
||||
Blockbook is a back-end service for the Trezor wallet. Although it is open source, the design and development of the core packages
|
||||
is done by the Trezor developers to keep Blockbook compatible with Trezor.
|
||||
|
||||
Bug fixes and support for new coins are welcome. **Please take note that non-fixing pull requests that change base
|
||||
packages or another coin code will not be accepted.** If you have a need to change some of the existing code, please file
|
||||
an issue and discuss your request with Blockbook maintainers.
|
||||
Bug fixes and support for new coins are welcome. **Please take note that pull requests that are not fixes and that change base
|
||||
packages or another coin code will not be accepted.** If you need a change in the existing core code, please file
|
||||
an issue and discuss your request with the Blockbook maintainers.
|
||||
|
||||
## Development environment
|
||||
|
||||
@ -16,8 +16,8 @@ Instructions to set up your development environment and build Blockbook are desc
|
||||
|
||||
### Reporting bugs
|
||||
|
||||
A great way to contribute to the project is to send a detailed report when you encounter an issue. We always appreciate
|
||||
a well-written, thorough bug report, and will thank you for it!
|
||||
A great way to contribute to the project is to send a detailed report when you encounter a problem. We always appreciate
|
||||
a well-written and thorough bug report, and we'll be grateful for it!
|
||||
|
||||
Check that [our issue database](https://github.com/trezor/blockbook/issues) doesn't already include that problem or
|
||||
suggestion before submitting an issue. If you find a match, you can use the "subscribe" button to get notified on
|
||||
|
||||
11
README.md
11
README.md
@ -5,10 +5,10 @@
|
||||
**Blockbook** is back-end service for Trezor wallet. Main features of **Blockbook** are:
|
||||
|
||||
- index of addresses and address balances of the connected block chain
|
||||
- fast searches in the indexes
|
||||
- fast index search
|
||||
- simple blockchain explorer
|
||||
- websocket, API and legacy Bitcore Insight compatible socket.io interfaces
|
||||
- support of multiple coins (Bitcoin and Ethereum type), with easy extensibility for other coins
|
||||
- support of multiple coins (Bitcoin and Ethereum type) with easy extensibility to other coins
|
||||
- scripts for easy creation of debian packages for backend and blockbook
|
||||
|
||||
## Build and installation instructions
|
||||
@ -51,7 +51,8 @@ Please add your experience to this [issue](https://github.com/trezor/blockbook/i
|
||||
|
||||
#### Error `internalState: database is in inconsistent state and cannot be used`
|
||||
|
||||
Blockbook was killed during the initial import, most commonly by OOM killer. By default, Blockbook performs the initial import in bulk import mode, which for performance reasons does not store all the data immediately to the database. If Blockbook is killed during this phase, the database is left in an inconsistent state.
|
||||
Blockbook was killed during the initial import, most commonly by OOM killer.
|
||||
By default, Blockbook performs the initial import in bulk import mode, which for performance reasons does not store all data immediately to the database. If Blockbook is killed during this phase, the database is left in an inconsistent state.
|
||||
|
||||
See above how to reduce the memory footprint, delete the database files and run the import again.
|
||||
|
||||
@ -67,9 +68,9 @@ Your coin's block/transaction data may not be compatible with `BitcoinParser` `P
|
||||
|
||||
#### Cannot build Blockbook using `go build` command
|
||||
|
||||
When building Blockbook, I get error `not enough arguments in call to _Cfunc_rocksdb_approximate_sizes`.
|
||||
When building Blockbook I get error `not enough arguments in call to _Cfunc_rocksdb_approximate_sizes`.
|
||||
|
||||
RocksDB version 6.16.0 changed the API in backward incompatible way. It is necessary to build Blockbook with the tag `rocksdb_6_16`, which fixes the compatibility issue. The correct way to build Blockbook is:
|
||||
RocksDB version 6.16.0 changed the API in a backwards incompatible way. It is necessary to build Blockbook with the `rocksdb_6_16` tag to fix the compatibility problem. The correct way to build Blockbook is:
|
||||
|
||||
```
|
||||
go build -tags rocksdb_6_16
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package api
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package bchain
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package bch
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package bellcoin
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package bitcore
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package bitzeny
|
||||
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
//go:build unittest
|
||||
// +build unittest
|
||||
|
||||
package btc
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package btg
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package dash
|
||||
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
//go:build unittest
|
||||
// +build unittest
|
||||
|
||||
package dcr
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package deeponion
|
||||
|
||||
|
||||
@ -6,14 +6,14 @@ import (
|
||||
"github.com/trezor/blockbook/bchain/coins/btc"
|
||||
)
|
||||
|
||||
// network constants
|
||||
const (
|
||||
// MainnetMagic is mainnet network constant
|
||||
MainnetMagic wire.BitcoinNet = 0xdab6c3fa
|
||||
TestnetMagic wire.BitcoinNet = 0xddbdc8fd
|
||||
)
|
||||
|
||||
// parser parameters
|
||||
var (
|
||||
// MainNetParams are parser parameters for mainnet
|
||||
MainNetParams chaincfg.Params
|
||||
TestNetParams chaincfg.Params
|
||||
)
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package digibyte
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package divi
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package dogecoin
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package eth
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package eth
|
||||
|
||||
|
||||
@ -159,7 +159,7 @@ func (p *FiroParser) ParseBlock(b []byte) (*bchain.Block, error) {
|
||||
}
|
||||
|
||||
// then ProgPow or MTP header
|
||||
if(isProgPow(header, p.Params.Net == TestnetMagic)){
|
||||
if isProgPow(header, p.Params.Net == TestnetMagic) {
|
||||
progPowHeader := ProgPowBlockHeader{}
|
||||
|
||||
// header
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package firo
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package flo
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package fujicoin
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package gamecredits
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package grs
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package koto
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package liquid
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package litecoin
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package monacoin
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package monetaryunit
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package myriad
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package namecoin
|
||||
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
//go:build unittest
|
||||
// +build unittest
|
||||
|
||||
package nuls
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package omotenashicoin
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package pivx
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package polis
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package qtum
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package ravencoin
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package ritocoin
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package snowgem
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package trezarcoin
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package unobtanium
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package vertcoin
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package viacoin
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package vipstarcoin
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package zec
|
||||
|
||||
|
||||
@ -15,6 +15,7 @@ type ZCashRPC struct {
|
||||
*btc.BitcoinRPC
|
||||
}
|
||||
|
||||
// ResGetBlockChainInfo is a response to GetChainInfo request
|
||||
type ResGetBlockChainInfo struct {
|
||||
Error *bchain.RPCError `json:"error"`
|
||||
Result struct {
|
||||
@ -72,6 +73,7 @@ func (z *ZCashRPC) Initialize() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetChainInfo return info about the blockchain
|
||||
func (z *ZCashRPC) GetChainInfo() (*bchain.ChainInfo, error) {
|
||||
chainInfo := ResGetBlockChainInfo{}
|
||||
err := z.Call(&btc.CmdGetBlockChainInfo{Method: "getblockchaininfo"}, &chainInfo)
|
||||
|
||||
@ -12,6 +12,7 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// Config contains the structure of the config
|
||||
type Config struct {
|
||||
Coin struct {
|
||||
Name string `json:"name"`
|
||||
@ -108,6 +109,7 @@ func generateRPCAuth(user, pass string) (string, error) {
|
||||
return out.String(), nil
|
||||
}
|
||||
|
||||
// ParseTemplate parses the template
|
||||
func (c *Config) ParseTemplate() *template.Template {
|
||||
templates := map[string]string{
|
||||
"IPC.RPCURLTemplate": c.IPC.RPCURLTemplate,
|
||||
@ -134,6 +136,7 @@ func (c *Config) ParseTemplate() *template.Template {
|
||||
return t
|
||||
}
|
||||
|
||||
// LoadConfig loads the config files
|
||||
func LoadConfig(configsDir, coin string) (*Config, error) {
|
||||
config := new(Config)
|
||||
|
||||
@ -191,6 +194,7 @@ func isEmpty(config *Config, target string) bool {
|
||||
}
|
||||
}
|
||||
|
||||
// GeneratePackageDefinitions generate the package definitions from the config
|
||||
func GeneratePackageDefinitions(config *Config, templateDir, outputDir string) error {
|
||||
templ := config.ParseTemplate()
|
||||
|
||||
@ -276,12 +280,7 @@ func writeTemplate(path string, info os.FileInfo, templ *template.Template, conf
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
err = templ.ExecuteTemplate(f, "main", config)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
return templ.ExecuteTemplate(f, "main", config)
|
||||
}
|
||||
|
||||
func writeBackendServerConfigFile(config *Config, outputDir string) error {
|
||||
@ -318,7 +317,7 @@ func writeBackendClientConfigFile(config *Config, outputDir string) error {
|
||||
|
||||
if config.Backend.ClientConfigFile == "" {
|
||||
return nil
|
||||
} else {
|
||||
}
|
||||
in, err := os.Open(filepath.Join(outputDir, "backend/config", config.Backend.ClientConfigFile))
|
||||
if err != nil {
|
||||
return err
|
||||
@ -326,10 +325,5 @@ func writeBackendClientConfigFile(config *Config, outputDir string) error {
|
||||
defer in.Close()
|
||||
|
||||
_, err = io.Copy(out, in)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package common
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package db
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package db
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build integration
|
||||
//go:build integration
|
||||
|
||||
package db
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build unittest
|
||||
//go:build unittest
|
||||
|
||||
package fiat
|
||||
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
//go:build unittest
|
||||
// +build unittest
|
||||
|
||||
package server
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build integration
|
||||
//go:build integration
|
||||
|
||||
package server
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build integration
|
||||
//go:build integration
|
||||
|
||||
package tests
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build integration
|
||||
//go:build integration
|
||||
|
||||
package tests
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build integration
|
||||
//go:build integration
|
||||
|
||||
package rpc
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build integration
|
||||
//go:build integration
|
||||
|
||||
package sync
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build integration
|
||||
//go:build integration
|
||||
|
||||
package sync
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build integration
|
||||
//go:build integration
|
||||
|
||||
package sync
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build integration
|
||||
//go:build integration
|
||||
|
||||
package sync
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user