input-output-hk / daedalus

The open source cryptocurrency wallet for ada, built to grow with the community
https://daedaluswallet.io/
Apache License 2.0
1.23k stars 297 forks source link

How do I change the storage directory? #605

Closed Prillan closed 2 years ago

Prillan commented 6 years ago

I don't want it to consume my remaining disk space on my SSD, how can I change the storage directory to something other than %APPDATA%?

This is actually preventing me from trying Cardano.

smukherj1 commented 6 years ago

I found a workaround if you are using the Windows 64-bit client. Note: This is a workaround and it involves tinkering with the launcher command. Please don't hold me accountable if you lose your tokens or any other data.

First turn off Daedalus if it's running. Go to your Daedalus installation directory and look for the file called "daedalus.bat". In the line after -n --db-path ^ change -n "%APPDATA%\Daedalus\DB Wallet 1.0" ^ to wherever you want to store your blocks.

Start Daedalus. It should start downloading blocks from 0% to the new directory.

Obviously this is an ugly hack and can break with a new Daedalus version but it works for 1.0.3769 Windows 64-bit.

cleverca22 commented 6 years ago

the automatic updates will also revert such a change when they happen

test-in-prod commented 6 years ago

A workaround I found is to create a NTFS directory link to another disk. Backup your appdata directory of course, then follow instructions to create your own.

smukherj1 commented 6 years ago

Yeah I like the symlink idea better than mine :) Would really prefer an official solution though in case updates also change the names of data directories

test-in-prod commented 6 years ago

595 seems to be a similar problem.

realuser commented 6 years ago

+1:"This is actually preventing me from trying Cardano."

snowkidind commented 6 years ago

+10

i have tried to get daedalus installed on my mac pro with a 250 gig hard drive that costs 1500 dollars to replace with a larger one. In the ten free gigs i have on that machine, daedalus didnt even get the entire blockchain loaded before it filled it up.

I have 40 hard drives but i cannot point daedalus to any of them because it links to stupid system drive

this is a real issue, please fix it.

xjmzx commented 6 years ago

Yes. Managing data on one's own machine is both expected and desirable. Any thoughts from deveopers would be appreciated

rdlrt commented 6 years ago

While I understand the need of the location for blockcain data to be user selectable, the private wallet needs to be in user profile directory to keep it secure with multiple users that can log on to a system. For short term, you can create a simple batch/shell script (windows example below):

just create a new file and call it 'daedalus.bat' open it in notepad and paste below (replace with desired path): set AppData=D: cd /D "C:\Program Files\Daedalus" cardano-launcher.exe save the file double click on it Note that this would mean your profile folder for Daedalus is created in D: , you might want to restrict permissions to the folder

weaver299 commented 6 years ago

I've been using the Daedalus wallet on a Macbook, but the blockchain is taking too much storage on the SSD. I'd like to move it to an external drive.

I've just been trying Cardano out, and am not significantly personally invested in it. I might just transfer my ADA back to Binance and sell it if I have to commit all this SSD space to the blockchain...

thanks for listening...

rdlrt commented 6 years ago

if I have to commit all this SSD space to the blockchain...

You have multiple options now. If you dont need to run a full node, you can simply switch to one of the light wallets: https://cardanowiki.info/wiki/Comparison_of_Ada_wallets_and_exchanges

nikolaglumac commented 5 years ago

This feature is not yet supported but there are plans to add support in the future.

weaver299 commented 5 years ago

Why are the issues being closed if this feature is not implemented, but is planned for the future? Is there another, canonical, issue for this?

weaver299 commented 5 years ago

I see other issue tickets tagged "feature-request" which are not closed... should this not be treated the same as those?

nikolaglumac commented 5 years ago

Yes, you are right - sorry about that - there were many duplicates and I forgot to leave one open. Will leave your's open πŸ‘

weaver299 commented 5 years ago

Okay, thanks.. I feel better now. :)

nikolaglumac commented 5 years ago

Fear not - even if the issue has remained closed we would not forget about this feature request :) It is on our todo list!

BrendanJ commented 4 years ago

Any ETA?

nikolaglumac commented 4 years ago

Hi @BrendanJ,

Unfortunately, there is no clear date at the moment. The team is fully focused on the upcoming Byron Reboot and Shelley releases.

Thank you for your patience and understanding!

garyhussey commented 4 years ago

Is this on the roadmap yet? Cardano is about to go Mainnet and this is still a problem. I mean... most people can manage a config file... just move the damn variable somewhere we can change it - config.json perhaps? We're not asking for an interface... just the option to put our database somewhere it's not going to eat primary resources.

rdlrt commented 4 years ago

@nikolaglumac - Unfortunately, I have to agree, not sure why a basic option as this isnt part of installer prompt to select (users are only talking about blockchain directory - previously DB-1.0, now chain, not wallet folders) , and is not doable/needs time to be added to priority. Its been more than 25 months since this issue was opened. Suggesting workarounds feels suboptimal.

@garyhussey - the workaround users have been using is on forum here (via symlinks), tho note that the profile folder name is now Daedalus Mainnet instead of Daedalus.

nikolaglumac commented 4 years ago

@disassembler can you help us out here please?

garyhussey commented 4 years ago

@rdlrt, thank you for the link. I've searched all over the place for something other than the symlink + re-installation method.

rdlrt commented 4 years ago

Hi @garyhussey , Only reason I dont suggest updating config files is because an update could overwrite them and add duplication of directories. Until its an option available natively, using a symlink or custom profile keeps it available across updates.

garyhussey commented 4 years ago

@rdlrt, I agree for any configuration files in the app root folder, but the config.json file is in the APPDATA directory. I'd assumed that it was user specific settings that were not over-written by updates. I could be wrong, I've not had an opportunity to make myself familiar with the build process yet.

wrapperband commented 4 years ago

Please - can you fix this very serious issue, it's being going on a long time and causes users extreme time effort. It surely is trivial to add changing the database directory, or should be....... It is not right to use excuses like use a light weight wallet. If you want us to use symlink - make the help say how to do it (in linux). I am now stuck with no space on my main disk, because Daedelus only installs on home disk. This may have already caused my data loss and has already caused me a number of hours work trying to change the directory like most other main crypto wallets.

wrapperband commented 4 years ago

Just as an Update - I've tested the symlink fix and was finally able to create a link to the copied mainnet directory-

Not an expert on symlinks (please tell me if this is wrong) but the Daedalus program does not now start with a symlink in Ubuntu/Linux. So that fix doesn't work.

KudretBayram commented 3 years ago

Just writing to add a little more weight to this. It's a real issue, let's get it done please.

nikolaglumac commented 3 years ago

@KudretBayram we will do our best to get this implemented as soon as possible. Thank you for your patience! πŸ™

nikolaglumac commented 3 years ago

This feature is not yet implemented but this is a workaround that might help you:

  1. Close Daedalus
  2. Open the state directory: Instructions
  3. Copy the "chain" directory to a different drive
  4. Create a shortcut with the same name "chain" to that new location and place it in the state directory (where "chain" directory was previously)
  5. Run Daedalus

This will free your C drive significantly since the "chain" directory makes 90% of state directory size.

KudretBayram commented 3 years ago

Thanks Nicola, I appreciate your time in responding to this thread. Good idea. I tried it (on a MAC) and received the following error:

"Cardano Node Crashed"

nikolaglumac commented 3 years ago

@gnpf @ManusMcCole @mioriohk can you please try this out and post results for all 3 platforms please πŸ™

miorsufianiohk commented 3 years ago

Hello everyone. Hope everybody is well πŸ‘

In order to create symlink on Daedalus chain folder, for all three platforms (Windows, Mac and Linux), please follow these steps: Note: Replace <username> with your own username

  1. Stop Daedalus

  2. Find the chain folder according to your chosen platform. Normally located at: For Windows: "C:\Users\<username>\AppData\Roaming\Daedalus Mainnet\chain"

    For Mac: β€œ/Users/<username>/Library/Application\ Support/Daedalus\ Mainnet/β€œ

    For Linux: β€œ/home/<username>/.local/share/Daedalus/mainnet”

    1. Then move the β€œchain” folder and its entire content to your desired location. I moved mine into β€œDownloads” folder.

    2. After that do the following: For Windows: a) Run the command prompt as an administrator b) At the prompt, type -> mklink /d "C:\Users\<username>\AppData\Roaming\Daedalus Mainnet\chain" "C:\Users\<username>\Downloads\chain"

      For Mac: a) Open a terminal window b) At the prompt, type -> ln -s /Users/<username>/Downloads/chain /Users/<username>/Library/Application\ Support/Daedalus\ Mainnet/

      For Linux: a) Open a terminal window b) At the prompt, type -> ln -s /home/<username>/Downloads/chain /home/<username>/.local/share/Daedalus/mainnet

    3. Restart Daedalus

If you have any question, please let me know. Thank you. πŸ™

KudretBayram commented 3 years ago

This appears to have worked! Thank you.

Morgorth commented 3 years ago

there is now an option to change it. Daedalus Diagnostic > Daedalus State Directory

nikolaglumac commented 3 years ago

@Morgorth that is a view only option. You can not change that value.

CantTouchDis commented 3 years ago

I tried to change the chain directory in the same way miorsufianiohk explained in: his post but it did not work as expected. What happened instead is that a new directory with the path of the link was created in my /tmp folder. (I assume this is caused by the path I linked to being on a different SSD)

After that I just changed the home volume in the exec command in .local/bin/daedalus-mainnet from

... -m /home:/home ...

to

... -m [MyDaedalusDirectory]:/home ...

This worked for me

Sebastix commented 3 years ago

I tried to change the chain directory in the same way miorsufianiohk explained in: his post but it did not work as expected. What happened instead is that a new directory with the path of the link was created in my /tmp folder. (I assume this is caused by the path I linked to being on a different SSD)

Same happens here (Linux - Lubuntu OS).

@CantTouchDis Can you give an example of a path you used for [MyDaedalusDirectory] ?

CantTouchDis commented 3 years ago

In my case it was something like /media/Samsung1TB/daedalus but it could be any path

Once you start daedalus this directory will be used by nix as home folder.

bauschp@mycomputer:/media/Samsung1TB/daedalus$ tree -aL 2 bauschp/
bauschp/
β”œβ”€β”€ .cache
β”‚Β Β  └── fontconfig
β”œβ”€β”€ .config
β”‚Β Β  β”œβ”€β”€ Daedalus Mainnet
β”‚Β Β  └── Electron
β”œβ”€β”€ .local
β”‚Β Β  └── share
└── .pki
    └── nssdb

9 directories, 0 files

I would just use that as a workaround for now until there is an option to store the chain in a separate directory

greg-fischer commented 3 years ago

Ok so I first thought this was working, but it was causing a resync of the chain after moving and symlinking, which is annoying on a slow connection. But after checking files in use with "lsof", its not even touching the external filesystem I link to. It's creating it in /tmp! The symlink is pointing to the correct destination. I'm on Ubuntu, btw.

This should be configurable to the user, even if in a config file. It should also not force a resync from scratch when moved. And... if the software is ignoring links in anyway, stop it! Don't translate that path! If I want to symlink, honor it!

Sorry if I'm a little grumpy. I keep running into software lately that ignore symlinks and get the canonical path to use instead, which is extremely frustrating for linux users who have been managing things like this for years.

I don't have room on /root or /home for multiple blockchains of 10's for GB's in size.

Does Daedalus ask for install destination on Linux? I can't remember if it did, but I could just reinstall if that would work.

I'm also trying to set DAEDALUS_DIR in .bashrc and XDG_DATA_HOME in an attempt to get the installer to redirect the destination to another filesystem other than $HOME. It's not working. Is there any way to install Daedalus on another filesystem or custom directory on linux?

Update; I've attempted something like this, which doesn't work either: export HOME=/home-ext/greg; ./daedalus-installer.bin; export HOME=/home/greg; The output looks ok, but it's not. Nix will instead install everything under /tmp/nix/home-ext/greg.

Attempting install using sudo: puts all under /root.

Just a hunch, but this seems to be an issue from the need to use Nix builds. (not judging, but why nix?). There must be a way to tell Nix to use an install path or environment variable? Basically there's no way for me to install Daedalus on linux unless I want to fill my /home dir or use a profile with path on another filesystem.

weaver299 commented 3 years ago

Agree with @greg-fischer ... this is a deeply frustrating situation and is honestly really undermining my confidence in the project, if something like where the blockchain data is stored can't be configured. This seems like a minimum-viable-product feature... if this hasn't been implemented for years, what does that say about the software quality of this project.

Symlinking as described in this ticket is not working for me either. Pop!_OS 20.10 (basically Ubuntu).

CantTouchDis commented 3 years ago

@greg-fischer have you tried my solution from https://github.com/input-output-hk/daedalus/issues/605#issuecomment-794107731 ? this worked for me and I put it on a different ssd

greg-fischer commented 3 years ago

@greg-fischer have you tried my solution from #605 (comment) ? this worked for me and I put it on a different ssd

OH I see! That's what I was looking for. I'll test that later. I read your post before but probably skimmed too quickly because I just wasn't following it. (until now :) thanks! I'll report back!

greg-fischer commented 3 years ago

Sorry @CantTouchDis but this is not working for me. It always runs from /tmp. I tried doing the symlink for just the chain folder. Then tried several different options for the -m /home:/home option, it always runs in /tmp.

I have an external home folder: /home-ext/greg (my $HOME is /home/greg - the above is just for things like a blockchain that's huge and don't need backed up!) In here I created/rsynced the same .local/share/Daedalus/mainnet/* directories, then I linked just the chain folder. ln -s /home-ext/greg/.local/share/Daedalus/mainnet/chain /home/greg/.local/share/Daedalus/mainnet/chain

The symlink is there and works correctly. I then changed the file: /home/greg/.local/bin/daedalus-mainnet Changed -m /home:/home to -m /home-ext:/home

Still goes to /tmp. This is all after I removed Daedalus and installed fresh again.

I tried several options for /home: -m /home-ext/greg:/home -m /home-ext/greg/daedalus:/home -m /home-ext:/home -m /home-ext/greg/.local/share/Daedalus/mainnet:/home

I know you posted that nix looks for that as your home folder, but I assume it appends your username, so I think this would be the right option: -m /home-ext:/home

I have full permission in /home-ext/greg.

One thing I am just now wondering is if Daedalus needs to be installed with sudo or not. I installed as myself, no sudo. Didn't get any errors and it launches.

EDIT: Just wanted to note that I'm running Ubuntu 20.04 on ZFS. /home-ext is also ZFS. Not sure this matters.

nikolaglumac commented 3 years ago

@dmitrii-gaico @miorsufianiohk can you please assist us here?

miorsufianiohk commented 3 years ago

Hi @greg-fischer ,

I hope that you are well. Could I check that you have followed the instruction written here?

Kind regards, Mior

greg-fischer commented 3 years ago

Thanks for the help @miorsufianiohk

I just read through that.

Is this the "chain" folder to symlink? β€œ/home//.local/share/Daedalus/mainnet” Or is this it? β€œ/home//.local/share/Daedalus/mainnet/chain”

So I tried this first: β€œ/home/greg/.local/share/Daedalus/mainnet” is a symlink to > β€œ/home-ext/greg/daedalus/mainnet”

greg@thardus:~$ cd .local/share/Daedalus
greg@thardus:~/.local/share/Daedalus$ ls -la
total 4
drwxrwxr-x  2 greg greg   21 Jun 29 03:04 .
drwx------ 21 greg greg 4096 Jun 29 03:01 ..
lrwxrwxrwx  1 greg greg   31 Jun 29 03:04 mainnet -> /home-ext/greg/daedalus/mainnet
greg@thardus:~/.local/share/Daedalus$ ls mainnet/
cardano-node.socket  chain  daedalus_lockfile  icon_large.png  icon.png  Logs  namespaceHelper  Secrets  tls  wallets
greg@thardus:~/.local/share/Daedalus$ ls /home-ext/greg/daedalus/mainnet
cardano-node.socket  chain  daedalus_lockfile  icon_large.png  icon.png  Logs  namespaceHelper  Secrets  tls  wallets
greg@thardus:~/.local/share/Daedalus$ 

Now Daedalus will not open. It starts to launch and opens an icon on the dock, then it's gone.

Then I tried linking the "chain" folder inside mainnet, which is what I've been doing all along.

greg@thardus:~/.local/share/Daedalus/mainnet$ ls -la
total 596
drwxrwxr-x 6 greg greg    185 Jun 29 03:29 .
drwxrwxr-x 3 greg greg     21 Jun 29 03:27 ..
srwxrwxr-x 1 greg greg      0 Jun 29 03:29 cardano-node.socket
lrwxrwxrwx 1 greg greg     29 Jun 29 03:28 chain -> /home-ext/greg/daedalus/chain
-rw-rw-r-- 1 greg greg      0 Jun 29 03:01 daedalus_lockfile
-rw-r--r-- 1 greg greg 594590 Jun 29 02:53 icon_large.png
-rw-r--r-- 1 greg greg   5641 Jun 29 02:53 icon.png
drwxrwxr-x 3 greg greg     17 Jun 29 02:53 Logs
-rwxr-xr-x 1 greg greg    880 Jun 29 02:53 namespaceHelper
drwxrwxr-x 2 greg greg      6 Jun 29 03:01 Secrets
drwxrwxr-x 4 greg greg     34 Jun 29 03:01 tls
drwxrwxr-x 2 greg greg     92 Jun 29 03:29 wallets
greg@thardus:~/.local/share/Daedalus/mainnet$ ls chain
clean  immutable  ledger  lock  protocolMagicId  volatile
greg@thardus:~/.local/share/Daedalus/mainnet$ ls /home-ext/greg/daedalus/chain
clean  immutable  ledger  lock  protocolMagicId  volatile
greg@thardus:~/.local/share/Daedalus/mainnet$ 

Dadalus opens fine, but its not using that linked folder. Its using /tmp.

lsof |grep /home-ext/greg/daedalus/chain

Outputs a ton of files used here: /tmp/nixlLYqq7/home-ext/greg/daedalus/chain

greg@thardus:~/.local/share/Daedalus/mainnet$ ls -lasth /tmp/nixlLYqq7/home-ext/greg/daedalus/chain
total 8.0K
4.0K drwxrwxr-x 2 greg greg 4.0K Jun 29 03:35 volatile
   0 drwxrwxr-x 2 greg greg  321 Jun 29 03:34 immutable
   0 drwxrwxr-x 2 greg greg   18 Jun 29 03:29 ledger
   0 drwxrwxr-x 5 greg greg   88 Jun 29 03:29 .
   0 drwxrwxr-x 3 greg greg   19 Jun 29 03:29 ..
   0 -rw-rw-r-- 1 greg greg    0 Jun 29 03:29 lock
4.0K -rw-rw-r-- 1 greg greg    9 Jun 29 03:29 protocolMagicId
greg@thardus:~/.local/share/Daedalus/mainnet$ ls -lasth /home-ext/greg/daedalus/chain
total 62K
 11K drwxrwxr-x 3 greg greg  3 Jun 29 03:28 ..
 11K drwxrwxr-x 5 greg greg  8 Jun 29 03:01 .
 512 -rw-rw-r-- 1 greg greg  0 Jun 29 03:01 clean
 11K drwxrwxr-x 2 greg greg 13 Jun 29 03:01 volatile
 11K drwxrwxr-x 2 greg greg  3 Jun 29 03:01 ledger
 11K drwxrwxr-x 2 greg greg  5 Jun 29 03:01 immutable
 512 -rw-rw-r-- 1 greg greg  0 Jun 29 03:01 lock
6.0K -rw-rw-r-- 1 greg greg  9 Jun 29 03:01 protocolMagicId

Your help is greatly appreciated. If you have any other suggestions, I'll have to look again tomorrow night. :) Thanks again!

miorsufianiohk commented 3 years ago

Hi @greg-fischer ,

The folder that you need to symlink is this one: /home//.local/share/Daedalus/mainnet/chain

miorsufianiohk commented 3 years ago

Hi @greg-fischer ,

I have been wondering if the formats of your harddrive and the external one are the same? One thing that you could try (if you haven't yet) is this .

CantTouchDis commented 3 years ago

@greg-fischer here are the contents of my $HOME/.local/bin/daedalus-mainnet:

...
if [ "x$DEBUG_SHELL" == x ]; then
  exec ./nix/store/apzfc51a2aki7xdyzifldp1nm4w8a1am-nix-user-chroot-2c52b5f/bin/nix-user-chroot -n ./nix -c -e -m /media/Samsung1TB/daedalus:/home -m /etc:/host-etc -m etc:/etc -p DISPLAY -p HOME -p XAUTHORITY -p LANG -p LANGUAGE -p LC_ALL -p LC_MESSAGES -- /nix/var/nix/profiles/profile-mainnet/bin/enter-phase2 daedalus
else
...

not sure why this branch is used, but maybe you need to change both the if and else branches occurrences

/media/Samsung1TB/ is the mount point of my second SSD both are ext4.

I did not create any links in .local/share/daedalus, because this folder does not exist for me.

Instead of this folder Deadalus uses /media/Samsung1TB/daedalus/.

In this folder daedalus created a folder for my user:

bauschp@mycomputer:~$ ls -la /media/Samsung1TB/daedalus/
total 489412
drwxr-xr-x  3 bauschp users        4096 Mar  9 17:05 .
drwxr-xr-x 12 bauschp bauschp      4096 Jun  5 20:00 ..
drwxr-xr-x  7 bauschp users        4096 Mar 31 13:30 bauschp
-rwxr-xr-x  1 bauschp users   394194987 Mar  6 12:26 daedalus-3.3.2-mainnet-16919.bin

with all the contents in it:

bauschp@mycomputer:~$ ls /media/Samsung1TB/daedalus/bauschp/.local/share/Daedalus/mainnet/
chain              Downloads       icon.png  namespaceHelper  Secrets  wallets
daedalus_lockfile  icon_large.png  Logs      safemode.yaml    tls

Hope this helps, maybe the different filesystems cause problems for you, you could also check if it makes a difference if you have a separate folder for your "fake" nix home path. (/home-ext/myFolder instead of /home-ext/)

Good luck, keep us informed if anything comes up

Edit: I just started Daedalus again to see if it is still working and it is:

bauschp@mycomputer:~$ ls -la /media/Samsung1TB/daedalus/bauschp/.local/share/Daedalus/mainnet/chain/
total 164
drwxr-xr-x 5 bauschp users   4096 Jun 21 19:50 .
drwxr-xr-x 8 bauschp users   4096 Jun 29 18:59 ..
drwxr-xr-x 2 bauschp users 135168 Jun 29 19:01 immutable
drwxr-xr-x 2 bauschp users   4096 Jun 29 18:59 ledger
-rw-r--r-- 1 bauschp users      0 MΓ€r 12 22:05 lock
-rw-r--r-- 1 bauschp users      9 MΓ€r 12 22:05 protocolMagicId
drwxr-xr-x 2 bauschp users  12288 Jun 29 19:02 volatile