github.com/decred/dcrlnd@v0.7.6/docs/operation_modes.md (about) 1 # dcrlnd Operation Modes 2 3 `dcrlnd` supports multiple operation modes. The choices are: 4 5 - Chain Operations 6 - through dcrd 7 - through the underlying wallet 8 - On-Chain Wallet Operations 9 - using embedded wallet 10 - using remote wallet 11 12 13 The following table lists the trade-offs for each combination: 14 15 | Combination | Characteristcs | 16 | --- | --- | 17 | dcrd + embedded wallet | - Safest for on-chain ops <br> - Fastest on-chain sync <br> - 2 daemons to maintain <br> - Best for standalone hubs | 18 | dcrd + remote wallet | - Safest for on-chain ops <br> - No additional seeds to manage <br> - 3 daemons to maintain <br> - Hardest to setup <br> - Useful when user already maintains hot wallet | 19 | spv + embedded wallet | - Simplest to setup <br> - Slower on-chain sync <br> - 1 daemon to maintain | 20 | spv + remote wallet | - No additional seeds to manange <br> - 2 daemons to maintain <br> - Useful for integrating into existing setups (e.g. Decrediton) | 21 22 The following sections detail what the choices imply. After that, sample config 23 files are provided for the different combinations. 24 25 ## Chain Operations: dcrd vs wallet 26 27 `dcrlnd` requires access to the Decred P2P network in order to perform its 28 on-chain duties (open and close channels, detect force closures, send and 29 receive on-chain funds, etc). 30 31 Using an underlying `dcrd` instance is the safest option here, since it ensures 32 `dcrlnd` has access to a completely valid chain and mempool. 33 34 It's also the fastest option, given that the the wallet syncs faster when 35 running in RPC mode (either the embedded one or a remote wallet). 36 37 The drawback of using a `dcrd` instance is having to also maintain it as an 38 online service and to ensure `dcrlnd` always has access to it. 39 40 When operating an always-on `dcrlnd` hub node, it's the recommended chain sync 41 option. 42 43 The advantage of using the wallet itself (possibly in SPV mode) for chain 44 operations is that it simplifies the setup a bit and removes the need to 45 maintain another service online. 46 47 ## Wallet Operations: embedded vs remote 48 49 `dcrlnd` also requies access to a `dcrwallet` instance in order to perform its 50 on-chain wallet operations (signing transactions, funding and withdrawing funds 51 from channels, etc). 52 53 When running in embedded wallet mode, `dcrlnd` creates its own internal instance 54 of `dcrwallet` and manages its operation directly. This simplifies the 55 deployment by avoiding the need to run and maintain a separate `dcrwallet` 56 service running, but has the drawback that the user needs to maintain an 57 additional seed: the seed to the on-chain side of `dcrlnd`'s operations. 58 59 Using a remote wallet is useful when the user already maintains an online, hot 60 wallet due to other reasons (for example due to continuously running 61 stakeshuffle sessions, solo voting or something else). This is also useful for 62 integrating to other applications (such as Decrediton) where the user already 63 has a wallet. 64 65 Note that it's **strongly** recommended to use a **separate**, **dedicated** 66 account to LN operations when connecting to an already running wallet to avoid 67 `dcrlnd` operations interfering with standard wallet usage (and vice-versa). 68 69 70 ## Sample Configs 71 72 The following are the absolute minimum configuration necessary to run each 73 combination. Additional config (such as `testnet = 1`) might be necessary 74 according to the specific use case. 75 76 ### dcrd + Embedded Wallet 77 78 ```ini 79 [Application Options] 80 81 node = dcrd 82 83 [Dcrd] 84 85 dcrd.rpchost = localhost 86 dcrd.rpcuser = USER 87 dcrd.rpcpass = PASSWORD 88 dcrd.rpccert = ~/.dcrd/rpc.cert 89 ``` 90 91 ### spv + Embedded Wallet 92 93 ```ini 94 [Application Options] 95 96 node = "dcrw" 97 98 [dcrwallet] 99 100 dcrwallet.spv = 1 101 102 ``` 103 104 105 ### Remote Wallet 106 107 This is applicable to a wallet that runs both in RPC and SPV mode, since it's 108 the wallet that is going to determine how the sync happens. 109 110 Chain operations always happen through the wallet. See the [Remote Dcrwallet 111 Mode](./remote_dcrwallet.md) doc for additional info on setting up this mode of 112 operation. 113 114 ```ini 115 [Application Options] 116 117 node = dcrw 118 119 [dcrwallet] 120 121 dcrwallet.grpchost = 127.0.0.1:19221 122 dcrwallet.certpath = ~/.dcrwallet/rpc.cert 123 dcrwallet.accountnumber = 1 124 dcrwallet.clientkeypath = /path/to/client-ca.key 125 dcrwallet.clientcertpath = /path/to/client-ca.cert 126 127 ```