mirror of
https://github.com/LBRYFoundation/lbcd.git
synced 2025-08-23 17:47:24 +00:00
[lbry] misc: rename btc{d,ctl,wallet} chain{d,ctl,wallet}
Currently, we only change the places where they impact runtime. Mostly are filenames or paths for executables and databases. Docs and other textual changes will be updated later to reduce conflicts when we rebase. rename
This commit is contained in:
parent
4f422e29cf
commit
0636c889f5
15 changed files with 32 additions and 32 deletions
|
@ -38,4 +38,4 @@ VOLUME ["/root/.btcd"]
|
||||||
|
|
||||||
EXPOSE 8333 8334
|
EXPOSE 8333 8334
|
||||||
|
|
||||||
ENTRYPOINT ["btcd"]
|
ENTRYPOINT ["chain"]
|
||||||
|
|
|
@ -24,7 +24,7 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
btcdHomeDir = btcutil.AppDataDir("btcd", false)
|
btcdHomeDir = btcutil.AppDataDir("chain", false)
|
||||||
defaultDataDir = filepath.Join(btcdHomeDir, "data")
|
defaultDataDir = filepath.Join(btcdHomeDir, "data")
|
||||||
knownDbTypes = database.SupportedDrivers()
|
knownDbTypes = database.SupportedDrivers()
|
||||||
activeNetParams = &chaincfg.MainNetParams
|
activeNetParams = &chaincfg.MainNetParams
|
||||||
|
|
|
@ -27,10 +27,10 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
btcdHomeDir = btcutil.AppDataDir("btcd", false)
|
btcdHomeDir = btcutil.AppDataDir("chain", false)
|
||||||
btcctlHomeDir = btcutil.AppDataDir("btcctl", false)
|
btcctlHomeDir = btcutil.AppDataDir("chainctl", false)
|
||||||
btcwalletHomeDir = btcutil.AppDataDir("btcwallet", false)
|
btcwalletHomeDir = btcutil.AppDataDir("chainwallet", false)
|
||||||
defaultConfigFile = filepath.Join(btcctlHomeDir, "btcctl.conf")
|
defaultConfigFile = filepath.Join(btcctlHomeDir, "chainctl.conf")
|
||||||
defaultRPCServer = "localhost"
|
defaultRPCServer = "localhost"
|
||||||
defaultRPCCertFile = filepath.Join(btcdHomeDir, "rpc.cert")
|
defaultRPCCertFile = filepath.Join(btcdHomeDir, "rpc.cert")
|
||||||
defaultWalletCertFile = filepath.Join(btcwalletHomeDir, "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
|
// Use config file for RPC server to create default btcctl config
|
||||||
var serverConfigPath string
|
var serverConfigPath string
|
||||||
if preCfg.Wallet {
|
if preCfg.Wallet {
|
||||||
serverConfigPath = filepath.Join(btcwalletHomeDir, "btcwallet.conf")
|
serverConfigPath = filepath.Join(btcwalletHomeDir, "chainwallet.conf")
|
||||||
} else {
|
} else {
|
||||||
serverConfigPath = filepath.Join(btcdHomeDir, "btcd.conf")
|
serverConfigPath = filepath.Join(btcdHomeDir, "chain.conf")
|
||||||
}
|
}
|
||||||
|
|
||||||
err := createDefaultConfigFile(preCfg.ConfigFile, serverConfigPath)
|
err := createDefaultConfigFile(preCfg.ConfigFile, serverConfigPath)
|
||||||
|
|
|
@ -25,7 +25,7 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
btcdHomeDir = btcutil.AppDataDir("btcd", false)
|
btcdHomeDir = btcutil.AppDataDir("chain", false)
|
||||||
defaultDataDir = filepath.Join(btcdHomeDir, "data")
|
defaultDataDir = filepath.Join(btcdHomeDir, "data")
|
||||||
knownDbTypes = database.SupportedDrivers()
|
knownDbTypes = database.SupportedDrivers()
|
||||||
activeNetParams = &chaincfg.MainNetParams
|
activeNetParams = &chaincfg.MainNetParams
|
||||||
|
|
|
@ -35,11 +35,11 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
defaultConfigFilename = "btcd.conf"
|
defaultConfigFilename = "chain.conf"
|
||||||
defaultDataDirname = "data"
|
defaultDataDirname = "data"
|
||||||
defaultLogLevel = "info"
|
defaultLogLevel = "info"
|
||||||
defaultLogDirname = "logs"
|
defaultLogDirname = "logs"
|
||||||
defaultLogFilename = "btcd.log"
|
defaultLogFilename = "chain.log"
|
||||||
defaultMaxPeers = 125
|
defaultMaxPeers = 125
|
||||||
defaultBanDuration = time.Hour * 24
|
defaultBanDuration = time.Hour * 24
|
||||||
defaultBanThreshold = 100
|
defaultBanThreshold = 100
|
||||||
|
@ -62,13 +62,13 @@ const (
|
||||||
defaultMaxOrphanTransactions = 100
|
defaultMaxOrphanTransactions = 100
|
||||||
defaultMaxOrphanTxSize = 100000
|
defaultMaxOrphanTxSize = 100000
|
||||||
defaultSigCacheMaxSize = 100000
|
defaultSigCacheMaxSize = 100000
|
||||||
sampleConfigFilename = "sample-btcd.conf"
|
sampleConfigFilename = "sample-chain.conf"
|
||||||
defaultTxIndex = false
|
defaultTxIndex = false
|
||||||
defaultAddrIndex = false
|
defaultAddrIndex = false
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
defaultHomeDir = btcutil.AppDataDir("btcd", false)
|
defaultHomeDir = btcutil.AppDataDir("chain", false)
|
||||||
defaultConfigFile = filepath.Join(defaultHomeDir, defaultConfigFilename)
|
defaultConfigFile = filepath.Join(defaultHomeDir, defaultConfigFilename)
|
||||||
defaultDataDir = filepath.Join(defaultHomeDir, defaultDataDirname)
|
defaultDataDir = filepath.Join(defaultHomeDir, defaultDataDirname)
|
||||||
knownDbTypes = database.SupportedDrivers()
|
knownDbTypes = database.SupportedDrivers()
|
||||||
|
|
|
@ -20,16 +20,16 @@ func TestCreateDefaultConfigFile(t *testing.T) {
|
||||||
if !ok {
|
if !ok {
|
||||||
t.Fatalf("Failed finding config file path")
|
t.Fatalf("Failed finding config file path")
|
||||||
}
|
}
|
||||||
sampleConfigFile := filepath.Join(filepath.Dir(path), "sample-btcd.conf")
|
sampleConfigFile := filepath.Join(filepath.Dir(path), "sample-chain.conf")
|
||||||
|
|
||||||
// Setup a temporary directory
|
// Setup a temporary directory
|
||||||
tmpDir, err := ioutil.TempDir("", "btcd")
|
tmpDir, err := ioutil.TempDir("", "chain")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Failed creating a temporary directory: %v", err)
|
t.Fatalf("Failed creating a temporary directory: %v", err)
|
||||||
}
|
}
|
||||||
testpath := filepath.Join(tmpDir, "test.conf")
|
testpath := filepath.Join(tmpDir, "test.conf")
|
||||||
|
|
||||||
// copy config file to location of btcd binary
|
// copy config file to location of chain binary
|
||||||
data, err := ioutil.ReadFile(sampleConfigFile)
|
data, err := ioutil.ReadFile(sampleConfigFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Failed reading sample config file: %v", err)
|
t.Fatalf("Failed reading sample config file: %v", err)
|
||||||
|
@ -38,7 +38,7 @@ func TestCreateDefaultConfigFile(t *testing.T) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Failed obtaining app path: %v", err)
|
t.Fatalf("Failed obtaining app path: %v", err)
|
||||||
}
|
}
|
||||||
tmpConfigFile := filepath.Join(appPath, "sample-btcd.conf")
|
tmpConfigFile := filepath.Join(appPath, "sample-chain.conf")
|
||||||
err = ioutil.WriteFile(tmpConfigFile, data, 0644)
|
err = ioutil.WriteFile(tmpConfigFile, data, 0644)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Failed copying sample config file: %v", err)
|
t.Fatalf("Failed copying sample config file: %v", err)
|
||||||
|
|
|
@ -18,7 +18,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
btcdHomeDir = btcutil.AppDataDir("btcd", false)
|
btcdHomeDir = btcutil.AppDataDir("chain", false)
|
||||||
knownDbTypes = database.SupportedDrivers()
|
knownDbTypes = database.SupportedDrivers()
|
||||||
activeNetParams = &chaincfg.MainNetParams
|
activeNetParams = &chaincfg.MainNetParams
|
||||||
|
|
||||||
|
|
|
@ -1107,7 +1107,7 @@ func main() {
|
||||||
// Load the certificate for the TLS connection which is automatically
|
// Load the certificate for the TLS connection which is automatically
|
||||||
// generated by btcd when it starts the RPC server and doesn't already
|
// generated by btcd when it starts the RPC server and doesn't already
|
||||||
// have one.
|
// have one.
|
||||||
btcdHomeDir := btcutil.AppDataDir("btcd", false)
|
btcdHomeDir := btcutil.AppDataDir("chain", false)
|
||||||
certs, err := ioutil.ReadFile(filepath.Join(btcdHomeDir, "rpc.cert"))
|
certs, err := ioutil.ReadFile(filepath.Join(btcdHomeDir, "rpc.cert"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
|
@ -1171,7 +1171,7 @@ func main() {
|
||||||
// Load the certificate for the TLS connection which is automatically
|
// Load the certificate for the TLS connection which is automatically
|
||||||
// generated by btcd when it starts the RPC server and doesn't already
|
// generated by btcd when it starts the RPC server and doesn't already
|
||||||
// have one.
|
// have one.
|
||||||
btcdHomeDir := btcutil.AppDataDir("btcd", false)
|
btcdHomeDir := btcutil.AppDataDir("chain", false)
|
||||||
certs, err := ioutil.ReadFile(filepath.Join(btcdHomeDir, "rpc.cert"))
|
certs, err := ioutil.ReadFile(filepath.Join(btcdHomeDir, "rpc.cert"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
|
@ -1274,7 +1274,7 @@ func main() {
|
||||||
// Load the certificate for the TLS connection which is automatically
|
// Load the certificate for the TLS connection which is automatically
|
||||||
// generated by btcd when it starts the RPC server and doesn't already
|
// generated by btcd when it starts the RPC server and doesn't already
|
||||||
// have one.
|
// have one.
|
||||||
btcdHomeDir := btcutil.AppDataDir("btcd", false)
|
btcdHomeDir := btcutil.AppDataDir("chain", false)
|
||||||
certs, err := ioutil.ReadFile(filepath.Join(btcdHomeDir, "rpc.cert"))
|
certs, err := ioutil.ReadFile(filepath.Join(btcdHomeDir, "rpc.cert"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
|
|
|
@ -44,7 +44,7 @@ func btcdExecutablePath() (string, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build btcd and output an executable in a static temp path.
|
// Build btcd and output an executable in a static temp path.
|
||||||
outputPath := filepath.Join(testDir, "btcd")
|
outputPath := filepath.Join(testDir, "chain")
|
||||||
if runtime.GOOS == "windows" {
|
if runtime.GOOS == "windows" {
|
||||||
outputPath += ".exe"
|
outputPath += ".exe"
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ func newConfig(prefix, certFile, keyFile string, extra []string,
|
||||||
var err error
|
var err error
|
||||||
btcdPath, err = btcdExecutablePath()
|
btcdPath, err = btcdExecutablePath()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
btcdPath = "btcd"
|
btcdPath = "chain"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -531,7 +531,7 @@ func generateListeningAddresses() (string, string) {
|
||||||
|
|
||||||
// baseDir is the directory path of the temp directory for all rpctest files.
|
// baseDir is the directory path of the temp directory for all rpctest files.
|
||||||
func baseDir() (string, error) {
|
func baseDir() (string, error) {
|
||||||
dirPath := filepath.Join(os.TempDir(), "btcd", "rpctest")
|
dirPath := filepath.Join(os.TempDir(), "chain", "rpctest")
|
||||||
err := os.MkdirAll(dirPath, 0755)
|
err := os.MkdirAll(dirPath, 0755)
|
||||||
return dirPath, err
|
return dirPath, err
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Connect to local btcd RPC server using websockets.
|
// Connect to local btcd RPC server using websockets.
|
||||||
btcdHomeDir := btcutil.AppDataDir("btcd", false)
|
btcdHomeDir := btcutil.AppDataDir("chain", false)
|
||||||
certs, err := ioutil.ReadFile(filepath.Join(btcdHomeDir, "rpc.cert"))
|
certs, err := ioutil.ReadFile(filepath.Join(btcdHomeDir, "rpc.cert"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
|
|
|
@ -27,8 +27,8 @@ func main() {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// Connect to local btcwallet RPC server using websockets.
|
// Connect to local chainwallet RPC server using websockets.
|
||||||
certHomeDir := btcutil.AppDataDir("btcwallet", false)
|
certHomeDir := btcutil.AppDataDir("chainwallet", false)
|
||||||
certs, err := ioutil.ReadFile(filepath.Join(certHomeDir, "rpc.cert"))
|
certs, err := ioutil.ReadFile(filepath.Join(certHomeDir, "rpc.cert"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(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.
|
// Search for Windows APPDATA first. This won't exist on POSIX OSes.
|
||||||
appData := os.Getenv("APPDATA")
|
appData := os.Getenv("APPDATA")
|
||||||
if appData != "" {
|
if appData != "" {
|
||||||
return filepath.Join(appData, "btcd")
|
return filepath.Join(appData, "chain")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fall back to standard HOME directory that works for most POSIX OSes.
|
// Fall back to standard HOME directory that works for most POSIX OSes.
|
||||||
home := os.Getenv("HOME")
|
home := os.Getenv("HOME")
|
||||||
if home != "" {
|
if home != "" {
|
||||||
return filepath.Join(home, ".btcd")
|
return filepath.Join(home, ".chain")
|
||||||
}
|
}
|
||||||
|
|
||||||
// In the worst case, use the current directory.
|
// 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
|
// respective networks. Check for the old database and update it to the
|
||||||
// new path introduced with version 0.2.0 accordingly.
|
// new path introduced with version 0.2.0 accordingly.
|
||||||
oldDbRoot := filepath.Join(oldBtcdHomeDir(), "db")
|
oldDbRoot := filepath.Join(oldBtcdHomeDir(), "db")
|
||||||
upgradeDBPathNet(filepath.Join(oldDbRoot, "btcd.db"), "mainnet")
|
upgradeDBPathNet(filepath.Join(oldDbRoot, "chain.db"), "mainnet")
|
||||||
upgradeDBPathNet(filepath.Join(oldDbRoot, "btcd_testnet.db"), "testnet")
|
upgradeDBPathNet(filepath.Join(oldDbRoot, "chain_testnet.db"), "testnet")
|
||||||
upgradeDBPathNet(filepath.Join(oldDbRoot, "btcd_regtest.db"), "regtest")
|
upgradeDBPathNet(filepath.Join(oldDbRoot, "chain_regtest.db"), "regtest")
|
||||||
|
|
||||||
// Remove the old db directory.
|
// Remove the old db directory.
|
||||||
return os.RemoveAll(oldDbRoot)
|
return os.RemoveAll(oldDbRoot)
|
||||||
|
|
Loading…
Add table
Reference in a new issue