Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sampleconfig: Use embed with external files. #3185

Merged
merged 1 commit into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ func createDefaultConfigFile(destPath string, authType string) error {
return err
}

cfg := sampleconfig.FileContents()
cfg := sampleconfig.Dcrd()

// Set a randomized rpcuser and rpcpass if the authorization type is basic.
if authType == authTypeBasic {
Expand Down
10 changes: 5 additions & 5 deletions sampleconfig/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ sampleconfig
[![ISC License](https://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org)
[![Doc](https://img.shields.io/badge/doc-reference-blue.svg)](https://pkg.go.dev/github.com/decred/dcrd/sampleconfig)

Package sampleconfig provides a single function that returns the contents of
the sample configuration file for dcrd. This is provided for tools that perform
automatic configuration and would like to ensure the generated configuration
file not only includes the specifically configured values, but also provides
samples of other configuration options.
Package sampleconfig provides functions that return the contents of sample
configuration files for dcrd and dcrctl. This is provided for tools that
perform automatic configuration and would like to ensure the generated
configuration files not only include the specifically configured values, but
also provides samples of other configuration options.

## Installation and Updating

Expand Down
39 changes: 39 additions & 0 deletions sampleconfig/sample-dcrctl.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[Application Options]

; ------------------------------------------------------------------------------
; Network settings
; ------------------------------------------------------------------------------

; Use testnet (cannot be used with simnet=1).
; testnet=1

; Use simnet (cannot be used with testnet=1).
; simnet=1

; The duration of inactivity before a peer is timed out.
; Valid time units are {s,m,h}. Minimum 15 seconds.
; peeridletimeout=120s


; ------------------------------------------------------------------------------
; RPC client settings
; ------------------------------------------------------------------------------

; Connect via a SOCKS5 proxy.
; proxy=127.0.0.1:9050
; proxyuser=
; proxypass=

; Username and password to authenticate connections to a Decred RPC server
; (usually dcrd or dcrwallet)
; rpcuser=
; rpcpass=

; RPC server to connect to
; rpcserver=localhost

; Wallet RPC server to connect to
; walletrpcserver=localhost

; RPC server certificate chain file for validation
; rpccert=~/.dcrd/rpc.cert
Loading