Author

Topic: How to make a portable Bitcoin client for Mac OS X! (Read 3012 times)

newbie
Activity: 10
Merit: 0
Thanks so much for this write-up. I've got a handy usb-key wallet now. The program is a little laggy running off the drive but it works and that's what matters. As an added bonus you can add other arguments to the last line of the script which (imho) is much easier than monkeying around with a .conf file.
newbie
Activity: 47
Merit: 0
Yes, it will :-).

It has two drawbacks, though:

It stores not only the wallet but also the block chain cache, which is grows as time goes by, inside the app.

Furthermore, If you don't use a client+wallet bundle often, when you launch it, you have to sync download all the keychain blocks that have been since the last use, or you'll have to copy them manually, which means that you risk to mess up and overwrite the wallet.

I've written a new script that that only stores the wallet and creates a symlink in the ~/Library/Application Support/Bitcoin, but I haven't tested it yet (and I'm not home right now).
newbie
Activity: 28
Merit: 0
Would the final result of this effectively be portable? I could put in on a USB and run it on any Mac?
newbie
Activity: 47
Merit: 0
The wallet switching user experience is currently sub par on all platform. You must either manipulate folders (and risk screwing up) or use the command line.

I offer here a nicer solution for Mac Os X: Use one Bitcoin.app per wallet, and put the wallet inside the application bundle.

It creates a standalone, portable Bitcoin.app that can be copied around and run as is on any Mac, or stored on an encrypted partition.

Here's the procedure to create a new, empty wallet (it could be automated, but I'm not there yet).

1) Create a copy of the Bitcoin.app and put it in your encrypted partition (let's call it BitSafe.app, for a "bank safe"-type wallet).

2) open the terminal (Terminal.app) and type
Code:
cd /Path/To/Your/Encypted/Volume/BitSafe.app/Contents/Resources
mkdir data
cd ../macOS
cat > start.sh
#! /bin/sh
dir1=$(cd "$(dirname "$0")"; pwd)
dir=`echo $dir1 | sed 's/"/\\"/g' | tr -d '\n'`
data="$dir/../Resources/data"
"$dir"/bitcoin -datadir="$data"
then press ctrl + d.

3) Again, from the prompt, type chmod +x start.sh to make the script executable.

4) now, we must edit the Info.plist file in order to tell OS X to launch our script instead of directly running the bitcoin binary. Type nano ../Info.plist . From there, find the following lines
Code:
CFBundleExecutable
bitcoin
and replace bitcoin with start.sh .

You should also change the Bitcoin strings corresponding to the CFBundleDisplayName and CFBundleName to BitSafe (or whatever strikes your fancy). This will change the Application name in the menu bar.

Once you're done, press ctrl + o, return then ctrl + x

6) Save a backup copy of the file (it will wake it easier to create new integrated App+Wallet bundles).

You can now open BitSafe.app. A new wallet will be generated inside BistSafe.app. You can have as many of them as you like, and you can move them around for backups and so on.



If you want to copy an existing wallet (located by default in /Users/YourUserName/Library/Application Support/Bitcoin), you must go inside the Bitcoin.app package. From the Finder, right click on Bitsafe.app and pick the "Show Package Contents" option. It will an open new Finder window. From there, go to Contents/Resources/data . You can paste your wallet.dat and other resource files here.



Updating the Bitcoin client:

If a new version of the BitCoin client is released, you can update the binary inside the Bundle. Right click the new Bitcoin.app file and choose Show Package Contents. From there, copy the bitcoin file located in Contents/MacOS/ file and paste it at the same place inside the BitSafe.app package.



Note: I've tried to change the LSMultipleInstancesProhibited from true to false, but it doesn't allow to run multiple Bitcoin clients simultaneously (even if I change the CFBundelIdentifier entry). I'd love to know if it is possible to overrule that behaviour?

Jump to: