*OBSOLETE* How to compile “blue-app-eth dockerized builder” from source in Windows 10
UPDATE: this article is rendered obsolete, as the Ledger devices now support Etho Protocol (formally “Ether-1”)
These instructions are specifically to replace the official Ledger Nano S “ethereum” app with a custom build version, as well as to install a custom Ether-1 version. All support leading up to this document, and the custom built apps themselves, have been provided by and donated to the community by @mkrufky
The app in question for this example is MK’s dockerized ledgerblue app.
- *IMPORTANT NOTES**
- REMOVE ALL apps from your ledger, not just your ethereum apps. ALL APPS. Your ledger should be “empty”. Don’t worry — your wallet IDs will remain the same when you reinstall your apps later on.
- Make sure your ledger is using the latest firmware.
- Once you’ve installed ethereum-based apps with this builder, you **MUST NOT** use the official ledger-manager to install other ethereum based apps!
- Read again: if you want to use ethereum-based apps side-by-side with these custom installed ones, you MUST also install those apps with this custom builder. You can NOT run “official” ethereum-based ledger apps side-by-side with ANY of these custom built apps on your ledger.
- If you’d like to remove these apps and return to any of the official apps, follow the un-install process at the end of this document. Make sure your ledger is “empty” before installing any Official apps.
- The commands given here will install Ethereum and Ether-1 onto your ledger. As per the read-me, supplied on the github page, using this builder, you may also install other ethereum-based apps to your ledger. Instructions follow at the bottom.
Pre-requisites / Setup:
- Install docker (you’ll need to create an account, download, install, reboot, etc.) https://store.docker.com/editions/community/docker-ce-desktop-windows
- Install Python3: https://www.python.org/downloads/
- Install Cygwin: https://www.cygwin.com/setup-x86_64.exe
—I recommend going through the “standard” installation for cygwin, then re-run the setup file to make sure everything installed right. If it didn’t the first time around, it will find the missing packages and install them on the next installation. Re-running the install file won’t “duplicate” (unless you change install directories on future runs) — it acts as a custom installer to add to or remove packages once the base install is complete, or to repair the base install.
— Important: you’ll also need to re-run the cygwin installation file and select these packages for installation (or do this on initial installation): When you get to the “Select Packages” screen, expand the “Devel” section, find the "make" and "gcc"
packages
- Install Git command line: https://git-scm.com/download/win
- Install Microsoft Build Tools for Visual Studio 2017. Install options: select only the “Windows 10 SDK”
Okay, everything is installed and setup. Now for some CRITICAL housekeeping.
- We’re going to need to execute some code in command prompt. Now, navigating to each directory can be quite a pain within windows command prompt. Like, a real real pain. A quickie shortcut to enter a directory in CMD with that directory pre-loaded is to hold down SHIFT and right-click the file to select “Open Command Window Here”. If you are like me, that option didn’t exist — it only offered a Windows Power Shell window. So there’s a custom registry edit you can do to get this option back (must have been removed in recent Windows Updates). If that’s the case for you, follow the instructions here:
- Now all this software we installed is great, but when you try to execute “linux” or “bash” commands, Windows doesn’t know what software that command is trying to utilize or where it is. So we need to edit our PATH shortcuts. To do that:
- Save yourself a bunch of time and open a notepad file or word doc and get all your file locations ready and saved in one spot for quick entering later:
- Where is this software installed in YOUR system? If you changed installation locations or drives when installing all the pre-requisite software, they could be anywhere. There’s a host of cmd commands you can run to figure it out — google — but generally speaking, the easiest way to find it is to click the search bar next to the start menu and search for the program listed below.
- A) It will bring up a result, which is a shortcut.
B) Right-click the result and under the “more” menu, choose “Open File Location”. Now this is just the location of the shortcut, so
C) right click the actual shortcut itself and select “Open File Location” again — bam, you’ll be at the actual directory of where the target in question resides. Here’s what it looks like in my system - Once you’ve found each of these directories in your system, you’ll need to right-click on the location (“windows explorer URL bar”, if you will) and click “copy address as text”). Paste each location into your notepad or word document or whatever, we’ll need it for the next step. Here’s the locations you need to find (exact path will differ from system-to-system, but here’s the directories you need and where they were on my system):
— C:\Program Files\Docker\Docker\Resources\bin
— C:\cygwin64\bin
— C:\Users\[YOUR-USER-NAME]\AppData\Local\Programs\Python\Python37\Scripts
— C:\Program Files\Git\cmd
— C:\Users\[YOUR-USER-NAME]\AppData\Local\Programs\Python\Python37
- *IMPORTANT:*
- Head over to your python directory (in my case, C:\Users\[YOUR-USER-NAME]\AppData\Local\Programs\Python\Python37) and make a copy the file “python.exe”
- Rename the COPY to “python3.exe”
- You should now have two files: python3.exe & python.exe
- Okay. Now we’re ready to add the paths to the individual installation locations
- Press Windows Key + “R”.
- Type “ SystemPropertiesAdvanced” and press enter.
- At the bottom of the window, click “Environment Variables”.
- Under “System Variables”, find the Variable “Path”.
- Select it, then click “Edit”.
- Click “new”
- Paste the first file location (ie, C:\Program Files\Docker\Docker\Resources\bin)
- Click “new” again, and repeat to create a new path entry for each of the above locations. When you’re finished, click OK, Apply, OK.
Sweet. Now we’re ready to rock and roll.
- Open a new command prompt, and type “cd \” then press enter to change to the root of the drive letter you’d like to install (or, if you’d prefer another drive, just type “d:”, or “f:” and hit enter — doesn’t matter which you choose. Just make sure you’re at the “root” of the drive letter. Don’t ask me why, but having a bunch of filenames in front of the compile directory can cause problems).
- Enter the following commands, one at a time, and let it do its thing:
git clone https://github.com/mkrufky/blue-app-eth-dockerized.gitcd blue-app-eth-dockerizedmake && make ethereum && make ether1
It’s going to do a bunch of stuff. Hang in there.
Your ledger will ask if you want to allow the unknown manager access to your device. Confirm with a right-button click on the ledger above the check box.
Your ledger will then ask if you want to install the ethereum app. Confirm. It will ask for your pin. Enter it and confirm.
Again, you’ll eventually be asked by your ledger to confirm an unknown manager, and again, to confirm to install the app — this time Ether-1. Again, pin, confirm.
- *To install additional ethereum apps while these custom apps are in use, you’ll need to install them via this builder. Again, you cannot run official eth apps side-by-side with custom ones!: type
make && make COIN
(replace COIN with ethereum
, pirl
, akroma
, callisto
, ubiq
, expanse
, etc)
REMOVAL INSTRUCTIONS:
- Head to your “root” directory where you started the first command of git clone (for example, your C: drive).
- Find the folder created called “blue-app-eth-dockerized”, and within that folder, the folder called “binaries” — enter that folder, and you’ll see a folder for each app you built/installed (“ethereum”, “ether1” etc.). Go to the folder for the app you want to un-install from your ledger, beginning with the eth-based apps (if you want to remove all of the apps, start with the eth-based ones such as ether1 or pirl, then remove ethereum last)
- Make a copy of “load.sh” and rename it to “remove.sh”
- Right-click “remove.sh” and click “Open With…” and choose notepad (or preferred text editor).
- At the beginning of the line of code, find the part that looks like this (may display differently depending on your text editor and how it handles spaces and line breaks)
#!/bin/sh
python3 -m ledgerblue.loadApp
and replace “loadApp” with “delete”
It should now look like
#!/bin/sh
python3 -m ledgerblue.delete
Leave the rest of the file as it is. Save and close the file.
Now lets remove it. My system had trouble with this, here’s what I found that worked:
- In windows explorer, back out into the blue-app-eth-dockerized directory.
- Hold SHIFT key and right-click the folder of the app you want to remove (ie, “ether1”)
- Select “Open command window here”
- Type “remove.sh” and press enter. It will seem like nothing has happened. That’s okay. If your ledger prompts you to authorize the unkown manager and then prompts to authorize removal of the app, great! If not:
- Type “load.sh”
- Watch your ledger. It should prompt to confirm unknown manager, then prompt to confirm app removal. Once you do that, it will remove the app, and then immediately prompt you to confirm install the app. Reject the install, or else you’ll simply re-load it right away.
- You should be done.