GithubHelp home page GithubHelp logo

datadir not used for RPC cert+key about dcrd HOT 7 CLOSED

decred avatar decred commented on July 20, 2024
datadir not used for RPC cert+key

from dcrd.

Comments (7)

jcvernaleo avatar jcvernaleo commented on July 20, 2024

@chappjc Nice catch. It looks like this is behavior we inherited from btcd so I'll do a PR with a fix there and then get it in dcrd.

from dcrd.

davecgh avatar davecgh commented on July 20, 2024

I agree that ideally the behavior should be consistent, but I disagree that dcrd should be changed.

The RPC cert/key are not in any way tied to the blockchain data. There are specific options (--rpccert and --rpckey) to deal with changing their paths.

In addition to having nothing to do with data (which is referring to blockchain data and associated indexes, stake pool, etc), moving them with the data directory would mean they are no longer in the default location for dcrwallet and dcrctl to find which means they would also have to overridden there as well making things more complicated. The reason for moving the data directory is because the block chain data is huge and therefore often needs a separate disk.

I wasn't aware that btcwallet/dcrwallet had that behavior, but as just described, I think that behavior is incorrect.

from dcrd.

chappjc avatar chappjc commented on July 20, 2024

Then why is the default to put the block chain data and the RPC cert/key in the same folder? Simplicity, presumably.

If dcrwallet is changed to match dcrd, that would add new complexity as you'd have to specify cert locations when starting dcrd. I already expect to specify these locations when using dcrctl and dcrwallet if I've specified a non-default datadir (for either daemon).

I believe that if you are using --datadir, you almost certainly want to put the cert+key somewhere other than the default folder. When I use dcrwallet --datadir [custom_wallet_dir] ... it nicely finds the wallet's cert+key where I want it, away from the default folder, and that's also where I point dcrctl for the cert when issuing wallet commands. If dcrwallet changes, an extra switch is required to specify the wallet's cert+key location, probably the same as datadir.

When it comes to dcrctl, I already have to use -c, --rpccert when issuing a command to the wallet . I don't think it's too much to ask to use dcrwallet --cafile to point to your custom dcrd datadir.

from dcrd.

jrick avatar jrick commented on July 20, 2024

The issue here is that wallet's --datadir doesn't match dcrd's --datadir. wallet's represents ~/.dcrwallet/, while dcrd's represents ~/.dcrd/data/ (on unix obviously) which is used for blockchain data, not all application data. The reason that option is configurable is because you may want to put blockchain data on another partition with more storage.

dcrd does not save the rpc cert/key in the datadir, so changing those options to make them relative to the datadir is incorrect.

Either wallet's option should be renamed and dcrd gets a new option to match it, or dcrd's --datadir gets renamed to something more specific (perhaps --blockdatadir).

from dcrd.

davecgh avatar davecgh commented on July 20, 2024

The only reason you have to specify -c on dcrctl is precisely because dcrwallet is doing the wrong thing and moving the RPC cert/key away from the home directory when --datadir is specified. As the name implies, --datadir should move the wallet data, not the RPC server credentials that have nothing to do with the wallet's database.

from dcrd.

chappjc avatar chappjc commented on July 20, 2024

@davecgh OK, the RPC server creds are not "data". I concede your point.

But if dcrwallet is changed, I need to reconfigure things to have 2 wallets listening on 2 different ports, which is pretty simple with datadir working the way is presently does. Then again, they could both use the same credentials.

@jrick I vote to rename wallet's option and give dcrd a new option to match. Internally, dcrd calls the parent of the data directory dcrdHomeDir (where rpc.cert and rpc.key reside), so perhaps something along those lines. But dcrd's --datadir could also be renamed to --blockdatadir, as you suggested.

from dcrd.

alexlyp avatar alexlyp commented on July 20, 2024

Sounds like this was resolved with #109
Closing

from dcrd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.