[lbry] misc: rename btcd to lbcd
Currently, we're only focus on the changes that are visible in run time, such as executable name, config files/dirs, errors and hint messages. And wire messages exchanged in network. btc{d,ctl,wallet} lbc{d,ctl,wallet}
This commit is contained in:
parent
31ce21deb6
commit
b7d3e11250
29 changed files with 87 additions and 85 deletions
|
@ -38,4 +38,4 @@ VOLUME ["/root/.btcd"]
|
|||
|
||||
EXPOSE 8333 8334
|
||||
|
||||
ENTRYPOINT ["btcd"]
|
||||
ENTRYPOINT ["lbcd"]
|
||||
|
|
|
@ -183,7 +183,7 @@ func (m *medianTime) AddTimeSample(sourceID string, timeVal time.Time) {
|
|||
// Warn if none of the time samples are close.
|
||||
if !remoteHasCloseTime {
|
||||
log.Warnf("Please check your date and time " +
|
||||
"are correct! btcd will not work " +
|
||||
"are correct! lbcd will not work " +
|
||||
"properly with an invalid time")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ const (
|
|||
)
|
||||
|
||||
var (
|
||||
btcdHomeDir = btcutil.AppDataDir("btcd", false)
|
||||
btcdHomeDir = btcutil.AppDataDir("lbcd", false)
|
||||
defaultDataDir = filepath.Join(btcdHomeDir, "data")
|
||||
knownDbTypes = database.SupportedDrivers()
|
||||
activeNetParams = &chaincfg.MainNetParams
|
||||
|
@ -35,7 +35,7 @@ var (
|
|||
// See loadConfig for details on the configuration load process.
|
||||
type config struct {
|
||||
AddrIndex bool `long:"addrindex" description:"Build a full address-based transaction index which makes the searchrawtransactions RPC available"`
|
||||
DataDir string `short:"b" long:"datadir" description:"Location of the btcd data directory"`
|
||||
DataDir string `short:"b" long:"datadir" description:"Location of the lbcd data directory"`
|
||||
DbType string `long:"dbtype" description:"Database backend to use for the Block Chain"`
|
||||
InFile string `short:"i" long:"infile" description:"File containing the block(s)"`
|
||||
Progress int `short:"p" long:"progress" description:"Show a progress message each time this number of seconds have passed -- Use 0 to disable progress announcements"`
|
||||
|
@ -67,7 +67,7 @@ func validDbType(dbType string) bool {
|
|||
}
|
||||
|
||||
// netName returns the name used when referring to a bitcoin network. At the
|
||||
// time of writing, btcd currently places blocks for testnet version 3 in the
|
||||
// time of writing, lbcd currently places blocks for testnet version 3 in the
|
||||
// data and log directory "testnet", which does not match the Name field of the
|
||||
// chaincfg parameters. This function can be used to override this directory name
|
||||
// as "testnet" when the passed active network matches wire.TestNet3.
|
||||
|
|
|
@ -25,7 +25,7 @@ const (
|
|||
)
|
||||
|
||||
var (
|
||||
btcdHomeDir = btcutil.AppDataDir("btcd", false)
|
||||
btcdHomeDir = btcutil.AppDataDir("lbcd", false)
|
||||
defaultDataDir = filepath.Join(btcdHomeDir, "data")
|
||||
knownDbTypes = database.SupportedDrivers()
|
||||
activeNetParams = &chaincfg.MainNetParams
|
||||
|
@ -35,7 +35,7 @@ var (
|
|||
//
|
||||
// See loadConfig for details on the configuration load process.
|
||||
type config struct {
|
||||
DataDir string `short:"b" long:"datadir" description:"Location of the btcd data directory"`
|
||||
DataDir string `short:"b" long:"datadir" description:"Location of the lbcd data directory"`
|
||||
DbType string `long:"dbtype" description:"Database backend to use for the Block Chain"`
|
||||
UseGoOutput bool `short:"g" long:"gooutput" description:"Display the candidates using Go syntax that is ready to insert into the btcchain checkpoint list"`
|
||||
NumCandidates int `short:"n" long:"numcandidates" description:"Max num of checkpoint candidates to show {1-20}"`
|
||||
|
@ -56,7 +56,7 @@ func validDbType(dbType string) bool {
|
|||
}
|
||||
|
||||
// netName returns the name used when referring to a bitcoin network. At the
|
||||
// time of writing, btcd currently places blocks for testnet version 3 in the
|
||||
// time of writing, lbcd currently places blocks for testnet version 3 in the
|
||||
// data and log directory "testnet", which does not match the Name field of the
|
||||
// chaincfg parameters. This function can be used to override this directory name
|
||||
// as "testnet" when the passed active network matches wire.TestNet3.
|
||||
|
|
|
@ -27,10 +27,10 @@ const (
|
|||
)
|
||||
|
||||
var (
|
||||
btcdHomeDir = btcutil.AppDataDir("btcd", false)
|
||||
btcctlHomeDir = btcutil.AppDataDir("btcctl", false)
|
||||
btcwalletHomeDir = btcutil.AppDataDir("btcwallet", false)
|
||||
defaultConfigFile = filepath.Join(btcctlHomeDir, "btcctl.conf")
|
||||
btcdHomeDir = btcutil.AppDataDir("lbcd", false)
|
||||
btcctlHomeDir = btcutil.AppDataDir("lbcctl", false)
|
||||
btcwalletHomeDir = btcutil.AppDataDir("lbcwallet", false)
|
||||
defaultConfigFile = filepath.Join(btcctlHomeDir, "lbcctl.conf")
|
||||
defaultRPCServer = "localhost"
|
||||
defaultRPCCertFile = filepath.Join(btcdHomeDir, "rpc.cert")
|
||||
defaultWalletCertFile = filepath.Join(btcwalletHomeDir, "rpc.cert")
|
||||
|
@ -231,9 +231,9 @@ func loadConfig() (*config, []string, error) {
|
|||
// Use config file for RPC server to create default btcctl config
|
||||
var serverConfigPath string
|
||||
if preCfg.Wallet {
|
||||
serverConfigPath = filepath.Join(btcwalletHomeDir, "btcwallet.conf")
|
||||
serverConfigPath = filepath.Join(btcwalletHomeDir, "lbcwallet.conf")
|
||||
} else {
|
||||
serverConfigPath = filepath.Join(btcdHomeDir, "btcd.conf")
|
||||
serverConfigPath = filepath.Join(btcdHomeDir, "lbcd.conf")
|
||||
}
|
||||
|
||||
err := createDefaultConfigFile(preCfg.ConfigFile, serverConfigPath)
|
16
config.go
16
config.go
|
@ -35,11 +35,11 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
defaultConfigFilename = "btcd.conf"
|
||||
defaultConfigFilename = "lbcd.conf"
|
||||
defaultDataDirname = "data"
|
||||
defaultLogLevel = "info"
|
||||
defaultLogDirname = "logs"
|
||||
defaultLogFilename = "btcd.log"
|
||||
defaultLogFilename = "lbcd.log"
|
||||
defaultMaxPeers = 125
|
||||
defaultBanDuration = time.Hour * 24
|
||||
defaultBanThreshold = 100
|
||||
|
@ -62,13 +62,13 @@ const (
|
|||
defaultMaxOrphanTransactions = 100
|
||||
defaultMaxOrphanTxSize = 100000
|
||||
defaultSigCacheMaxSize = 100000
|
||||
sampleConfigFilename = "sample-btcd.conf"
|
||||
sampleConfigFilename = "sample-lbcd.conf"
|
||||
defaultTxIndex = false
|
||||
defaultAddrIndex = false
|
||||
)
|
||||
|
||||
var (
|
||||
defaultHomeDir = btcutil.AppDataDir("btcd", false)
|
||||
defaultHomeDir = btcutil.AppDataDir("lbcd", false)
|
||||
defaultConfigFile = filepath.Join(defaultHomeDir, defaultConfigFilename)
|
||||
defaultDataDir = filepath.Join(defaultHomeDir, defaultDataDirname)
|
||||
knownDbTypes = database.SupportedDrivers()
|
||||
|
@ -97,8 +97,8 @@ type config struct {
|
|||
AddCheckpoints []string `long:"addcheckpoint" description:"Add a custom checkpoint. Format: '<height>:<hash>'"`
|
||||
AddPeers []string `short:"a" long:"addpeer" description:"Add a peer to connect with at startup"`
|
||||
AddrIndex bool `long:"addrindex" description:"Maintain a full address-based transaction index which makes the searchrawtransactions RPC available"`
|
||||
AgentBlacklist []string `long:"agentblacklist" description:"A comma separated list of user-agent substrings which will cause btcd to reject any peers whose user-agent contains any of the blacklisted substrings."`
|
||||
AgentWhitelist []string `long:"agentwhitelist" description:"A comma separated list of user-agent substrings which will cause btcd to require all peers' user-agents to contain one of the whitelisted substrings. The blacklist is applied before the blacklist, and an empty whitelist will allow all agents that do not fail the blacklist."`
|
||||
AgentBlacklist []string `long:"agentblacklist" description:"A comma separated list of user-agent substrings which will cause lbcd to reject any peers whose user-agent contains any of the blacklisted substrings."`
|
||||
AgentWhitelist []string `long:"agentwhitelist" description:"A comma separated list of user-agent substrings which will cause lbcd to require all peers' user-agents to contain one of the whitelisted substrings. The blacklist is applied before the blacklist, and an empty whitelist will allow all agents that do not fail the blacklist."`
|
||||
BanDuration time.Duration `long:"banduration" description:"How long to ban misbehaving peers. Valid time units are {s, m, h}. Minimum 1 second"`
|
||||
BanThreshold uint32 `long:"banthreshold" description:"Maximum allowed ban score before disconnecting and banning misbehaving peers."`
|
||||
BlockMaxSize uint32 `long:"blockmaxsize" description:"Maximum block size in bytes to be used when creating a block"`
|
||||
|
@ -405,7 +405,7 @@ func newConfigParser(cfg *config, so *serviceOptions, options flags.Options) *fl
|
|||
// 3) Load configuration file overwriting defaults with any specified options
|
||||
// 4) Parse CLI options and overwrite/add any specified options
|
||||
//
|
||||
// The above results in btcd functioning properly without any config settings
|
||||
// The above results in lbcd functioning properly without any config settings
|
||||
// while still allowing the user to override settings with config files and
|
||||
// command line options. Command line options always take precedence.
|
||||
func loadConfig() (*config, []string, error) {
|
||||
|
@ -1134,7 +1134,7 @@ func loadConfig() (*config, []string, error) {
|
|||
return &cfg, remainingArgs, nil
|
||||
}
|
||||
|
||||
// createDefaultConfig copies the file sample-btcd.conf to the given destination path,
|
||||
// createDefaultConfig copies the file sample-lbcd.conf to the given destination path,
|
||||
// and populates it with some randomly generated RPC username and password.
|
||||
func createDefaultConfigFile(destinationPath string) error {
|
||||
// Create the destination directory if it does not exists
|
||||
|
|
|
@ -20,16 +20,16 @@ func TestCreateDefaultConfigFile(t *testing.T) {
|
|||
if !ok {
|
||||
t.Fatalf("Failed finding config file path")
|
||||
}
|
||||
sampleConfigFile := filepath.Join(filepath.Dir(path), "sample-btcd.conf")
|
||||
sampleConfigFile := filepath.Join(filepath.Dir(path), "sample-lbcd.conf")
|
||||
|
||||
// Setup a temporary directory
|
||||
tmpDir, err := ioutil.TempDir("", "btcd")
|
||||
tmpDir, err := ioutil.TempDir("", "lbcd")
|
||||
if err != nil {
|
||||
t.Fatalf("Failed creating a temporary directory: %v", err)
|
||||
}
|
||||
testpath := filepath.Join(tmpDir, "test.conf")
|
||||
|
||||
// copy config file to location of btcd binary
|
||||
// copy config file to location of lbcd binary
|
||||
data, err := ioutil.ReadFile(sampleConfigFile)
|
||||
if err != nil {
|
||||
t.Fatalf("Failed reading sample config file: %v", err)
|
||||
|
@ -38,7 +38,7 @@ func TestCreateDefaultConfigFile(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatalf("Failed obtaining app path: %v", err)
|
||||
}
|
||||
tmpConfigFile := filepath.Join(appPath, "sample-btcd.conf")
|
||||
tmpConfigFile := filepath.Join(appPath, "sample-lbcd.conf")
|
||||
err = ioutil.WriteFile(tmpConfigFile, data, 0644)
|
||||
if err != nil {
|
||||
t.Fatalf("Failed copying sample config file: %v", err)
|
||||
|
|
|
@ -18,7 +18,7 @@ import (
|
|||
)
|
||||
|
||||
var (
|
||||
btcdHomeDir = btcutil.AppDataDir("btcd", false)
|
||||
btcdHomeDir = btcutil.AppDataDir("lbcd", false)
|
||||
knownDbTypes = database.SupportedDrivers()
|
||||
activeNetParams = &chaincfg.MainNetParams
|
||||
|
||||
|
@ -31,7 +31,7 @@ var (
|
|||
|
||||
// config defines the global configuration options.
|
||||
type config struct {
|
||||
DataDir string `short:"b" long:"datadir" description:"Location of the btcd data directory"`
|
||||
DataDir string `short:"b" long:"datadir" description:"Location of the lbcd data directory"`
|
||||
DbType string `long:"dbtype" description:"Database backend to use for the Block Chain"`
|
||||
RegressionTest bool `long:"regtest" description:"Use the regression test network"`
|
||||
SimNet bool `long:"simnet" description:"Use the simulation test network"`
|
||||
|
@ -60,7 +60,7 @@ func validDbType(dbType string) bool {
|
|||
}
|
||||
|
||||
// netName returns the name used when referring to a bitcoin network. At the
|
||||
// time of writing, btcd currently places blocks for testnet version 3 in the
|
||||
// time of writing, lbcd currently places blocks for testnet version 3 in the
|
||||
// data and log directory "testnet", which does not match the Name field of the
|
||||
// chaincfg parameters. This function can be used to override this directory name
|
||||
// as "testnet" when the passed active network matches wire.TestNet3.
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
Package ffldb implements a driver for the database package that uses leveldb
|
||||
for the backing metadata and flat files for block storage.
|
||||
|
||||
This driver is the recommended driver for use with btcd. It makes use leveldb
|
||||
This driver is the recommended driver for use with lbcd. It makes use leveldb
|
||||
for the metadata, flat files for block storage, and checksums in key areas to
|
||||
ensure data integrity.
|
||||
|
||||
|
|
10
doc.go
10
doc.go
|
@ -3,22 +3,22 @@
|
|||
// license that can be found in the LICENSE file.
|
||||
|
||||
/*
|
||||
btcd is a full-node bitcoin implementation written in Go.
|
||||
lbcd is a full-node bitcoin implementation written in Go.
|
||||
|
||||
The default options are sane for most users. This means btcd will work 'out of
|
||||
The default options are sane for most users. This means lbcd will work 'out of
|
||||
the box' for most users. However, there are also a wide variety of flags that
|
||||
can be used to control it.
|
||||
|
||||
The following section provides a usage overview which enumerates the flags. An
|
||||
interesting point to note is that the long form of all of these options
|
||||
(except -C) can be specified in a configuration file that is automatically
|
||||
parsed when btcd starts up. By default, the configuration file is located at
|
||||
~/.btcd/btcd.conf on POSIX-style operating systems and %LOCALAPPDATA%\btcd\btcd.conf
|
||||
parsed when lbcd starts up. By default, the configuration file is located at
|
||||
~/.lbcd/lbcd.conf on POSIX-style operating systems and %LOCALAPPDATA%\lbcd\lbcd.conf
|
||||
on Windows. The -C (--configfile) flag, as shown below, can be used to override
|
||||
this location.
|
||||
|
||||
Usage:
|
||||
btcd [OPTIONS]
|
||||
lbcd [OPTIONS]
|
||||
|
||||
Application Options:
|
||||
--addcheckpoint= Add a custom checkpoint. Format:
|
||||
|
|
|
@ -65,9 +65,11 @@ html_theme = 'sphinx_rtd_theme'
|
|||
html_static_path = ['_static']
|
||||
|
||||
# app setup hook
|
||||
|
||||
|
||||
def setup(app):
|
||||
app.add_config_value('recommonmark_config', {
|
||||
#'url_resolver': lambda url: github_doc_root + url,
|
||||
# 'url_resolver': lambda url: github_doc_root + url,
|
||||
'auto_toc_tree_section': 'Contents',
|
||||
'enable_math': False,
|
||||
'enable_inline_math': False,
|
||||
|
|
|
@ -1107,7 +1107,7 @@ func main() {
|
|||
// Load the certificate for the TLS connection which is automatically
|
||||
// generated by btcd when it starts the RPC server and doesn't already
|
||||
// have one.
|
||||
btcdHomeDir := btcutil.AppDataDir("btcd", false)
|
||||
btcdHomeDir := btcutil.AppDataDir("lbcd", false)
|
||||
certs, err := ioutil.ReadFile(filepath.Join(btcdHomeDir, "rpc.cert"))
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
|
@ -1171,7 +1171,7 @@ func main() {
|
|||
// Load the certificate for the TLS connection which is automatically
|
||||
// generated by btcd when it starts the RPC server and doesn't already
|
||||
// have one.
|
||||
btcdHomeDir := btcutil.AppDataDir("btcd", false)
|
||||
btcdHomeDir := btcutil.AppDataDir("lbcd", false)
|
||||
certs, err := ioutil.ReadFile(filepath.Join(btcdHomeDir, "rpc.cert"))
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
|
@ -1274,7 +1274,7 @@ func main() {
|
|||
// Load the certificate for the TLS connection which is automatically
|
||||
// generated by btcd when it starts the RPC server and doesn't already
|
||||
// have one.
|
||||
btcdHomeDir := btcutil.AppDataDir("btcd", false)
|
||||
btcdHomeDir := btcutil.AppDataDir("lbcd", false)
|
||||
certs, err := ioutil.ReadFile(filepath.Join(btcdHomeDir, "rpc.cert"))
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
|
|
|
@ -44,16 +44,16 @@ func btcdExecutablePath() (string, error) {
|
|||
}
|
||||
|
||||
// Build btcd and output an executable in a static temp path.
|
||||
outputPath := filepath.Join(testDir, "btcd")
|
||||
outputPath := filepath.Join(testDir, "lbcd")
|
||||
if runtime.GOOS == "windows" {
|
||||
outputPath += ".exe"
|
||||
}
|
||||
cmd := exec.Command(
|
||||
"go", "build", "-o", outputPath, "github.com/btcsuite/btcd",
|
||||
"go", "build", "-o", outputPath, "github.com/btcsuite/lbcd",
|
||||
)
|
||||
err = cmd.Run()
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("Failed to build btcd: %v", err)
|
||||
return "", fmt.Errorf("Failed to build lbcd: %v", err)
|
||||
}
|
||||
|
||||
// Save executable path so future calls do not recompile.
|
||||
|
|
|
@ -51,7 +51,7 @@ func newConfig(prefix, certFile, keyFile string, extra []string,
|
|||
var err error
|
||||
btcdPath, err = btcdExecutablePath()
|
||||
if err != nil {
|
||||
btcdPath = "btcd"
|
||||
btcdPath = "lbcd"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -531,7 +531,7 @@ func generateListeningAddresses() (string, string) {
|
|||
|
||||
// baseDir is the directory path of the temp directory for all rpctest files.
|
||||
func baseDir() (string, error) {
|
||||
dirPath := filepath.Join(os.TempDir(), "btcd", "rpctest")
|
||||
dirPath := filepath.Join(os.TempDir(), "lbcd", "rpctest")
|
||||
err := os.MkdirAll(dirPath, 0755)
|
||||
return dirPath, err
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ const (
|
|||
// CoinbaseFlags is added to the coinbase script of a generated block
|
||||
// and is used to monitor BIP16 support as well as blocks that are
|
||||
// generated via btcd.
|
||||
CoinbaseFlags = "/P2SH/btcd/"
|
||||
CoinbaseFlags = "/P2SH/lbcd/"
|
||||
)
|
||||
|
||||
// TxDesc is a descriptor about a transaction in a transaction source along with
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
# Use of this source code is governed by an ISC
|
||||
# license that can be found in the LICENSE file.
|
||||
|
||||
# Simple bash script to build basic btcd tools for all the platforms we support
|
||||
# Simple bash script to build basic lbcd tools for all the platforms we support
|
||||
# with the golang cross-compiler.
|
||||
|
||||
set -e
|
||||
|
@ -22,7 +22,7 @@ fi
|
|||
go mod vendor
|
||||
tar -cvzf vendor.tar.gz vendor
|
||||
|
||||
PACKAGE=btcd
|
||||
PACKAGE=lbcd
|
||||
MAINDIR=$PACKAGE-$TAG
|
||||
mkdir -p $MAINDIR
|
||||
|
||||
|
@ -36,9 +36,9 @@ gzip -f $PACKAGESRC > "$PACKAGESRC.gz"
|
|||
|
||||
cd $MAINDIR
|
||||
|
||||
# If BTCDBUILDSYS is set the default list is ignored. Useful to release
|
||||
# If LBCDBUILDSYS is set the default list is ignored. Useful to release
|
||||
# for a subset of systems/architectures.
|
||||
SYS=${BTCDBUILDSYS:-"
|
||||
SYS=${LBCDBUILDSYS:-"
|
||||
darwin-amd64
|
||||
dragonfly-amd64
|
||||
freebsd-386
|
||||
|
@ -72,7 +72,7 @@ SYS=${BTCDBUILDSYS:-"
|
|||
|
||||
# Use the first element of $GOPATH in the case where GOPATH is a list
|
||||
# (something that is totally allowed).
|
||||
PKG="github.com/btcsuite/btcd"
|
||||
PKG="github.com/lbryio/lbcd"
|
||||
COMMIT=$(git describe --abbrev=40 --dirty)
|
||||
|
||||
for i in $SYS; do
|
||||
|
@ -92,8 +92,8 @@ for i in $SYS; do
|
|||
cd $PACKAGE-$i-$TAG
|
||||
|
||||
echo "Building:" $OS $ARCH $ARM
|
||||
env CGO_ENABLED=0 GOOS=$OS GOARCH=$ARCH GOARM=$ARM go build -v -trimpath -ldflags="-s -w -buildid=" github.com/btcsuite/btcd
|
||||
env CGO_ENABLED=0 GOOS=$OS GOARCH=$ARCH GOARM=$ARM go build -v -trimpath -ldflags="-s -w -buildid=" github.com/btcsuite/btcd/cmd/btcctl
|
||||
env CGO_ENABLED=0 GOOS=$OS GOARCH=$ARCH GOARM=$ARM go build -v -trimpath -ldflags="-s -w -buildid=" github.com/lbryio/lbcd
|
||||
env CGO_ENABLED=0 GOOS=$OS GOARCH=$ARCH GOARM=$ARM go build -v -trimpath -ldflags="-s -w -buildid=" github.com/lbryio/lbcd/cmd/lbcctl
|
||||
cd ..
|
||||
|
||||
if [[ $OS = "windows" ]]; then
|
||||
|
|
|
@ -32,7 +32,7 @@ func main() {
|
|||
}
|
||||
|
||||
// Connect to local btcd RPC server using websockets.
|
||||
btcdHomeDir := btcutil.AppDataDir("btcd", false)
|
||||
btcdHomeDir := btcutil.AppDataDir("lbcd", false)
|
||||
certs, err := ioutil.ReadFile(filepath.Join(btcdHomeDir, "rpc.cert"))
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
|
|
|
@ -27,8 +27,8 @@ func main() {
|
|||
},
|
||||
}
|
||||
|
||||
// Connect to local btcwallet RPC server using websockets.
|
||||
certHomeDir := btcutil.AppDataDir("btcwallet", false)
|
||||
// Connect to local lbcwallet RPC server using websockets.
|
||||
certHomeDir := btcutil.AppDataDir("lbcwallet", false)
|
||||
certs, err := ioutil.ReadFile(filepath.Join(certHomeDir, "rpc.cert"))
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
|
|
|
@ -118,8 +118,8 @@ const (
|
|||
// 0.19.0.
|
||||
BitcoindPost19
|
||||
|
||||
// Btcd represents a catch-all btcd version.
|
||||
Btcd
|
||||
// Lbcd represents a catch-all lbcd version.
|
||||
Lbcd
|
||||
)
|
||||
|
||||
// Client represents a Bitcoin RPC client which allows easy access to the
|
||||
|
@ -1588,8 +1588,8 @@ func (c *Client) BackendVersion() (BackendVersion, error) {
|
|||
switch err := err.(type) {
|
||||
// Parse the btcd version and cache it.
|
||||
case nil:
|
||||
log.Debugf("Detected btcd version: %v", info.Version)
|
||||
version := Btcd
|
||||
log.Debugf("Detected lbcd version: %v", info.Version)
|
||||
version := Lbcd
|
||||
c.backendVersion = &version
|
||||
return *c.backendVersion, nil
|
||||
|
||||
|
@ -1597,12 +1597,12 @@ func (c *Client) BackendVersion() (BackendVersion, error) {
|
|||
// we actually ran into an error.
|
||||
case *btcjson.RPCError:
|
||||
if err.Code != btcjson.ErrRPCMethodNotFound.Code {
|
||||
return 0, fmt.Errorf("unable to detect btcd version: "+
|
||||
return 0, fmt.Errorf("unable to detect lbcd version: "+
|
||||
"%v", err)
|
||||
}
|
||||
|
||||
default:
|
||||
return 0, fmt.Errorf("unable to detect btcd version: %v", err)
|
||||
return 0, fmt.Errorf("unable to detect lbcd version: %v", err)
|
||||
}
|
||||
|
||||
// Since the GetInfo method was not found, we assume the client is
|
||||
|
|
|
@ -419,7 +419,7 @@ func (c *Client) handleNotification(ntfn *rawNotification) {
|
|||
|
||||
connected, err := parseBtcdConnectedNtfnParams(ntfn.Params)
|
||||
if err != nil {
|
||||
log.Warnf("Received invalid btcd connected "+
|
||||
log.Warnf("Received invalid lbcd connected "+
|
||||
"notification: %v", err)
|
||||
return
|
||||
}
|
||||
|
|
|
@ -3530,7 +3530,7 @@ func handleStop(s *rpcServer, cmd interface{}, closeChan <-chan struct{}) (inter
|
|||
case s.requestProcessShutdown <- struct{}{}:
|
||||
default:
|
||||
}
|
||||
return "btcd stopping.", nil
|
||||
return "lbcd stopping.", nil
|
||||
}
|
||||
|
||||
// handleSubmitBlock implements the submitblock command.
|
||||
|
@ -3738,7 +3738,7 @@ func handleVerifyMessage(s *rpcServer, cmd interface{}, closeChan <-chan struct{
|
|||
// NOTE: This is a btcsuite extension ported from github.com/decred/dcrd.
|
||||
func handleVersion(s *rpcServer, cmd interface{}, closeChan <-chan struct{}) (interface{}, error) {
|
||||
result := map[string]btcjson.VersionResult{
|
||||
"btcdjsonrpcapi": {
|
||||
"lbcdjsonrpcapi": {
|
||||
VersionString: jsonrpcSemverString,
|
||||
Major: jsonrpcSemverMajor,
|
||||
Minor: jsonrpcSemverMinor,
|
||||
|
@ -4332,7 +4332,7 @@ func (s *rpcServer) jsonRPCRead(w http.ResponseWriter, r *http.Request, isAdmin
|
|||
|
||||
// jsonAuthFail sends a message back to the client if the http auth is rejected.
|
||||
func jsonAuthFail(w http.ResponseWriter) {
|
||||
w.Header().Add("WWW-Authenticate", `Basic realm="btcd RPC"`)
|
||||
w.Header().Add("WWW-Authenticate", `Basic realm="lbcd RPC"`)
|
||||
http.Error(w, "401 Unauthorized.", http.StatusUnauthorized)
|
||||
}
|
||||
|
||||
|
@ -4413,7 +4413,7 @@ func (s *rpcServer) Start() {
|
|||
func genCertPair(certFile, keyFile string) error {
|
||||
rpcsLog.Infof("Generating TLS certificates...")
|
||||
|
||||
org := "btcd autogenerated cert"
|
||||
org := "lbcd autogenerated cert"
|
||||
validUntil := time.Now().Add(10 * 365 * 24 * time.Hour)
|
||||
cert, key, err := btcutil.NewTLSCertPair(org, validUntil, nil)
|
||||
if err != nil {
|
||||
|
|
|
@ -565,7 +565,7 @@ var helpDescsEnUS = map[string]string{
|
|||
// SendRawTransactionCmd help.
|
||||
"sendrawtransaction--synopsis": "Submits the serialized, hex-encoded transaction to the local peer and relays it to the network.",
|
||||
"sendrawtransaction-hextx": "Serialized, hex-encoded signed transaction",
|
||||
"sendrawtransaction-feesetting": "Whether or not to allow insanely high fees in bitcoind < v0.19.0 or the max fee rate for bitcoind v0.19.0 and later (btcd does not yet implement this parameter, so it has no effect)",
|
||||
"sendrawtransaction-feesetting": "Whether or not to allow insanely high fees in bitcoind < v0.19.0 or the max fee rate for bitcoind v0.19.0 and later (lbcd does not yet implement this parameter, so it has no effect)",
|
||||
"sendrawtransaction--result0": "The hash of the transaction",
|
||||
"allowhighfeesormaxfeerate-value": "Either the boolean value for the allowhighfees parameter in bitcoind < v0.19.0 or the numerical value for the maxfeerate field in bitcoind v0.19.0 and later",
|
||||
|
||||
|
@ -581,8 +581,8 @@ var helpDescsEnUS = map[string]string{
|
|||
"signmessagewithprivkey--result0": "The signature of the message encoded in base 64",
|
||||
|
||||
// StopCmd help.
|
||||
"stop--synopsis": "Shutdown btcd.",
|
||||
"stop--result0": "The string 'btcd stopping.'",
|
||||
"stop--synopsis": "Shutdown lbcd.",
|
||||
"stop--result0": "The string 'lbcd stopping.'",
|
||||
|
||||
// SubmitBlockOptions help.
|
||||
"submitblockoptions-workid": "This parameter is currently ignored",
|
||||
|
@ -610,7 +610,7 @@ var helpDescsEnUS = map[string]string{
|
|||
// VerifyChainCmd help.
|
||||
"verifychain--synopsis": "Verifies the block chain database.\n" +
|
||||
"The actual checks performed by the checklevel parameter are implementation specific.\n" +
|
||||
"For btcd this is:\n" +
|
||||
"For lbcd this is:\n" +
|
||||
"checklevel=0 - Look up each block and ensure it can be loaded from the database.\n" +
|
||||
"checklevel=1 - Perform basic context-free sanity checks on each block.",
|
||||
"verifychain-checklevel": "How thorough the block verification is",
|
||||
|
@ -657,7 +657,7 @@ var helpDescsEnUS = map[string]string{
|
|||
"outpoint-index": "The index of the outpoint",
|
||||
|
||||
// NotifySpentCmd help.
|
||||
"notifyspent--synopsis": "Send a redeemingtx notification when a transaction spending an outpoint appears in mempool (if relayed to this btcd instance) and when such a transaction first appears in a newly-attached block.",
|
||||
"notifyspent--synopsis": "Send a redeemingtx notification when a transaction spending an outpoint appears in mempool (if relayed to this lbcd instance) and when such a transaction first appears in a newly-attached block.",
|
||||
"notifyspent-outpoints": "List of transaction outpoints to monitor.",
|
||||
|
||||
// StopNotifySpentCmd help.
|
||||
|
|
|
@ -6,12 +6,12 @@
|
|||
|
||||
; The directory to store data such as the block chain and peer addresses. The
|
||||
; block chain takes several GB, so this location must have a lot of free space.
|
||||
; The default is ~/.btcd/data on POSIX OSes, $LOCALAPPDATA/Btcd/data on Windows,
|
||||
; ~/Library/Application Support/Btcd/data on Mac OS, and $home/btcd/data on
|
||||
; The default is ~/.lbcd/data on POSIX OSes, $LOCALAPPDATA/Lbcd/data on Windows,
|
||||
; ~/Library/Application Support/Lbcd/data on Mac OS, and $home/lbcd/data on
|
||||
; Plan9. Environment variables are expanded so they may be used. NOTE: Windows
|
||||
; environment variables are typically %VARIABLE%, but they must be accessed with
|
||||
; $VARIABLE here. Also, ~ is expanded to $LOCALAPPDATA on Windows.
|
||||
; datadir=~/.btcd/data
|
||||
; datadir=~/.lbcd/data
|
||||
|
||||
|
||||
; ------------------------------------------------------------------------------
|
||||
|
@ -52,7 +52,7 @@
|
|||
; upnp=1
|
||||
|
||||
; Specify the external IP addresses your node is listening on. One address per
|
||||
; line. btcd will not contact 3rd-party sites to obtain external ip addresses.
|
||||
; line. lbcd will not contact 3rd-party sites to obtain external ip addresses.
|
||||
; This means if you are behind NAT, your node will not be able to advertise a
|
||||
; reachable address unless you specify it here or enable the 'upnp' option (and
|
||||
; have a supported device).
|
||||
|
@ -64,7 +64,7 @@
|
|||
;
|
||||
; Only one of the following two options, 'addpeer' and 'connect', may be
|
||||
; specified. Both allow you to specify peers that you want to stay connected
|
||||
; with, but the behavior is slightly different. By default, btcd will query DNS
|
||||
; with, but the behavior is slightly different. By default, lbcd will query DNS
|
||||
; to find peers to connect to, so unless you have a specific reason such as
|
||||
; those described below, you probably won't need to modify anything here.
|
||||
;
|
||||
|
@ -121,7 +121,7 @@
|
|||
; whitelist=192.168.0.0/24
|
||||
; whitelist=fd00::/16
|
||||
|
||||
; Disable DNS seeding for peers. By default, when btcd starts, it will use
|
||||
; Disable DNS seeding for peers. By default, when lbcd starts, it will use
|
||||
; DNS to query for available peers to connect with.
|
||||
; nodnsseed=1
|
||||
|
||||
|
@ -172,7 +172,7 @@
|
|||
|
||||
; ------------------------------------------------------------------------------
|
||||
; RPC server options - The following options control the built-in RPC server
|
||||
; which is used to control and query information from a running btcd process.
|
||||
; which is used to control and query information from a running lbcd process.
|
||||
;
|
||||
; NOTE: The RPC server is disabled by default if rpcuser AND rpcpass, or
|
||||
; rpclimituser AND rpclimitpass, are not specified.
|
||||
|
@ -335,7 +335,7 @@
|
|||
; Debug logging level.
|
||||
; Valid levels are {trace, debug, info, warn, error, critical}
|
||||
; You may also specify <subsystem>=<level>,<subsystem2>=<level>,... to set
|
||||
; log level for individual subsystems. Use btcd --debuglevel=show to list
|
||||
; log level for individual subsystems. Use lbcd --debuglevel=show to list
|
||||
; available subsystems.
|
||||
; debuglevel=info
|
||||
|
|
@ -2530,7 +2530,7 @@ out:
|
|||
// listen port?
|
||||
// XXX this assumes timeout is in seconds.
|
||||
listenPort, err := s.nat.AddPortMapping("tcp", int(lport), int(lport),
|
||||
"btcd listen port", 20*60)
|
||||
"lbcd listen port", 20*60)
|
||||
if err != nil {
|
||||
srvrLog.Warnf("can't add UPnP port mapping: %v", err)
|
||||
}
|
||||
|
|
10
upgrade.go
10
upgrade.go
|
@ -35,13 +35,13 @@ func oldBtcdHomeDir() string {
|
|||
// Search for Windows APPDATA first. This won't exist on POSIX OSes.
|
||||
appData := os.Getenv("APPDATA")
|
||||
if appData != "" {
|
||||
return filepath.Join(appData, "btcd")
|
||||
return filepath.Join(appData, "lbcd")
|
||||
}
|
||||
|
||||
// Fall back to standard HOME directory that works for most POSIX OSes.
|
||||
home := os.Getenv("HOME")
|
||||
if home != "" {
|
||||
return filepath.Join(home, ".btcd")
|
||||
return filepath.Join(home, ".lbcd")
|
||||
}
|
||||
|
||||
// In the worst case, use the current directory.
|
||||
|
@ -96,9 +96,9 @@ func upgradeDBPaths() error {
|
|||
// respective networks. Check for the old database and update it to the
|
||||
// new path introduced with version 0.2.0 accordingly.
|
||||
oldDbRoot := filepath.Join(oldBtcdHomeDir(), "db")
|
||||
upgradeDBPathNet(filepath.Join(oldDbRoot, "btcd.db"), "mainnet")
|
||||
upgradeDBPathNet(filepath.Join(oldDbRoot, "btcd_testnet.db"), "testnet")
|
||||
upgradeDBPathNet(filepath.Join(oldDbRoot, "btcd_regtest.db"), "regtest")
|
||||
upgradeDBPathNet(filepath.Join(oldDbRoot, "lbcd.db"), "mainnet")
|
||||
upgradeDBPathNet(filepath.Join(oldDbRoot, "lbcd_testnet.db"), "testnet")
|
||||
upgradeDBPathNet(filepath.Join(oldDbRoot, "lbcd_regtest.db"), "regtest")
|
||||
|
||||
// Remove the old db directory.
|
||||
return os.RemoveAll(oldDbRoot)
|
||||
|
|
Loading…
Reference in a new issue