github.com/decred/dcrlnd@v0.7.6/lnrpc/walletrpc/config_active.go (about)

     1  //go:build !no_walletrpc
     2  // +build !no_walletrpc
     3  
     4  package walletrpc
     5  
     6  import (
     7  	"github.com/decred/dcrd/chaincfg/v3"
     8  	"github.com/decred/dcrlnd/keychain"
     9  	"github.com/decred/dcrlnd/lnwallet"
    10  	"github.com/decred/dcrlnd/lnwallet/chainfee"
    11  	"github.com/decred/dcrlnd/macaroons"
    12  	"github.com/decred/dcrlnd/sweep"
    13  )
    14  
    15  const (
    16  	// SubServerName is the name of the sub rpc server. We'll use this name
    17  	// to register ourselves, and we also require that the main
    18  	// SubServerConfigDispatcher instance recognize as the name of our
    19  	SubServerName = "WalletKitRPC"
    20  )
    21  
    22  // Config is the primary configuration struct for the WalletKit RPC server. It
    23  // contains all the items required for the signer rpc server to carry out its
    24  // duties. The fields with struct tags are meant to be parsed as normal
    25  // configuration options, while if able to be populated, the latter fields MUST
    26  // also be specified.
    27  type Config struct {
    28  	// WalletKitMacPath is the path for the signer macaroon. If unspecified
    29  	// then we assume that the macaroon will be found under the network
    30  	// directory, named DefaultWalletKitMacFilename.
    31  	WalletKitMacPath string `long:"walletkitmacaroonpath" description:"Path to the wallet kit macaroon"`
    32  
    33  	// NetworkDir is the main network directory wherein the signer rpc
    34  	// server will find the macaroon named DefaultWalletKitMacFilename.
    35  	NetworkDir string
    36  
    37  	// MacService is the main macaroon service that we'll use to handle
    38  	// authentication for the signer rpc server.
    39  	MacService *macaroons.Service
    40  
    41  	// FeeEstimator is an instance of the primary fee estimator instance
    42  	// the WalletKit will use to respond to fee estimation requests.
    43  	FeeEstimator chainfee.Estimator
    44  
    45  	// Wallet is the primary wallet that the WalletKit will use to proxy
    46  	// any relevant requests to.
    47  	Wallet lnwallet.WalletController
    48  
    49  	// CoinSelectionLocker allows the caller to perform an operation, which
    50  	// is synchronized with all coin selection attempts. This can be used
    51  	// when an operation requires that all coin selection operations cease
    52  	// forward progress. Think of this as an exclusive lock on coin
    53  	// selection operations.
    54  	CoinSelectionLocker sweep.CoinSelectionLocker
    55  
    56  	// KeyRing is an interface that the WalletKit will use to derive any
    57  	// keys due to incoming client requests.
    58  	KeyRing keychain.KeyRing
    59  
    60  	// Sweeper is the central batching engine of lnd. It is responsible for
    61  	// sweeping inputs in batches back into the wallet.
    62  	Sweeper *sweep.UtxoSweeper
    63  
    64  	// Chain is an interface that the WalletKit will use to determine state
    65  	// about the backing chain of the wallet.
    66  	Chain lnwallet.BlockChainIO
    67  
    68  	// ChainParams are the parameters of the wallet's backing chain.
    69  	ChainParams *chaincfg.Params
    70  }