Ethereum Wallet / Mist, checksum mismatch in dowloaded node, geth-1.8.23, MyCrypto Desktop App

Bottom line:

Ethereum Wallet stopped working for me, so I stopped working with him. Now using MyCrypto Desktop App with the keystore files (in my keystore/ folder).

The longer story:

After a while of not running my Ethereum Wallet, it notified me of the existence of a new geth. I told him to download it (as I’ve done multiple times in the past), but since that point it stopped working for me: kept complaining on a checksum mismatch in the downloaded node, and told me I should download geth-1.8.23 myself. I did. I tried various other geth versions. I tried running the geth locally and then run the Ethereum Wallet etc., but it wouldn’t work.

I eventually realized that the team has decided to sunset Mist, and they proposed some migration options.

I followed their recommendation and installed MyCrypto Desktop App from https://download.mycrypto.com/ (there’s a checksums.txt file here). That’s it. Apparently you could use their online version directly to some extent. Anyway, from their Desktop App (.exe file running directly from where you saved it), choose to access your wallet from a “Keystore File” and just refer to the keystore file (in your keystore/ folder, which I’m sure you took care of backing up after each transaction, right?). Done.

Final note: At that point, relying on a remote node using that MyCrypto app, there’s probably no need for the big geth/ local folder, as well as the geth.exe (can uninstall it if you installed it using their installer file).

Chrome Extensions

Some random notes on Chrome Extensions:

A Browser Action appears as some added icon that e.g. opens some popup.html when clicked.

How to debug (e.g. where to see the console.log messages) each script:

  • Background script: In chrome://extensions/, there’s a link to “inspect views” or access the background page.
  • Content script: The active tab’s main console
  • popup.js: Right-click icon (or the popup.html) and click inspect element

Example permissions:

  • “activeTab”: to use chrome.tab.executeScript()
  • “contextMenus”: to do stuff with context menus
  • DB or something for the Chrome Extension is stored here:

    C:\Users\\AppData\Local\Google\Chrome\User Data\Default\Extensions\theextensionidsomestring
    When I removed an extension (from chrome://extensions/, it also deleted its theextensionidsomestring folder from there.

    Python notebook tricks (Jupyter, nbconvert, Slideshow)

    Tip #1: To generate slides (“Slideshow”) from your notebook:

  • View => Slideshow, then decide which cell is which Slide / Sub-slide (arrow down to see it) / Fragment (Enter to reveal; i.e. fragment of a Slide) / Skip
  • Then from command line: jupyter nbconvert my_slides.ipynb --to slides --post serve will generate an html file + serve it from local webserver (that also has reveal.js etc.).
  • There’s a ~bug with the zoom

    There’s a ~bug with the zoom. reveal.js takes control of the zoom, so you cannot e.g. adjust font size during Slideshow, whose default is too small.

    For anyone interested in a temporary fix to both issues (nicer initial font size + browser zoom functionality to affect the slides): You can hack the CSS of the `.slides` element in the page by adding the following code (=essentially one line of JS) to some(*) Markdown cell in your Slideshow notebook: <script> console.log("Hello. You'll see this printed in your browser's DevTools / Console. Feel free to delete this line."); document.querySelector('head').innerHTML += '<style>.slides { zoom: 1.0 !important; }</style>'; </script> (*)any cell which is not of type ‘Skip’; e.g. add it to some Markdown cell that you already intended to display in your Slideshow.

    Tip #2: Run notebook from command line using `nbconvert`

    Example:
    C:\Temp>jupyter nbconvert --to notebook --execute C:\dev\python\JupyterLocal\MyStuff\Statistics.ipynb
    [NbConvertApp] Converting notebook C:\dev\python\JupyterLocal\MyStuff\Statistics.ipynb to notebook
    [NbConvertApp] Executing notebook with kernel: python2
    [NbConvertApp] Writing 4319 bytes to C:\dev\python\JupyterLocal\MyStuff\Statistics.nbconvert.ipynb
    

    Python packages, conda, pip

    Fresh install, Feb. 21, 2018

    • Started with `conda -V` 4.6.3. (had Anaconda 2.2.0 (64-bit), installed in C:\Dev\Anaconda\).
    • Ran the `Uninstall-Anaconda.exe` in C:\Dev\Anaconda\. Note: Once you click the “Details” button, it cannot be undone (and it takes more time when it prints all the stuff it deletes; so don’t click “Details”, the uninstall is already long as it is).
    • Went to https://www.anaconda.com/distribution/#download-section (Anaconda 2018.12 for Windows Installer), where I could download either Python 3.7 version or Python 2.7 version. Downloaded the Python 3.7 version, “64-Bit Graphical Installer” (https://repo.anaconda.com/archive/Anaconda3-2018.12-Windows-x86_64.exe, 614.3 MB).

    Older notes

    Useful commands — venvs:
    # list of venvs
    conda env list
    # activate/deactivate
    activate my_venv
    conda deactivate
    
    Usefull commands — packages:
    # installed packages
    pip list
    # search a package (actually a *string* in the text (descriptions?) of packages)
    pip search statsmodels
    # info on specific package
    pip show statsmodels
    # install / upgrade a package
    pip install statsmodels
    pip install statsmodels --upgrade
    
    # Conda list packages -- better than 'pip list', because supposedly listing all package installations whether they were installed using pip or conda (so e.g. you might have statsmodels version 0.8 that you once installed using pip, but version 0.9 if you installed using conda)
    conda list
    
    Conda channels etc.: The documentation is really helpful.
    conda config --help
    
    # So e.g. to add the channel conda-canary:
    conda config --add channels conda-canary
    

    JS Classes Example

    Server (NodeJS) Side:

    ////////// _myDummyModule.js
    
    // A really bad usecase is demonstrated here.
    var count = 1;
    exports.increment = function() {
        count++;
    };
    exports.getCount = function() {
        return count;
    };
    
    ////////// _myDummyModuleClass.js
    // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes
    // Noob caveat: If you want to OVERWRITE *module.exports*, do it directly!
    // (i.e. if you overwrite the 'exports' alias instead, it will be meaningless;
    // because exports=module.exports... you should: module.exports=yourNewObject)
    module.exports = class Calculator { // Doesn't really matter that it's named
      constructor(initialValue) {
        this.count = initialValue===undefined ? 1 : initialValue;
      }
      increment() { this.count++; }
      getCount() { return this.count; }
    }
    
    ////////// _myNotesOnJS.js
    
    // module.exports is the variable that gets returned from require().
    // 'exports' is just an "alias" to module.exports.
    console.log(module.exports == exports); // => true
    
    // Requiring twice can be problematic!
    const a = require('./_myDummyModule.js');
    const b = require('./_myDummyModule.js');
    console.log(typeof a); // => object
    console.log(a==b, a===b); // => true true
    a.increment(); // We increment a, but b (which is ==a) is also incremented :(
    console.log(a.getCount()); // => 2
    console.log(b.getCount()); // => 2
    
    // How to use a class
    const c = require('./_myDummyModuleClass.js');
    c1 = new c();
    c2 = new c();
    c3 = new c(123);
    console.log(typeof c); // => function
    console.log(typeof c1); // => object
    console.log(c1 == c2); // => false
    c1.increment(); // OK: We increment only c1
    console.log(c1.getCount(), c2.getCount(), c3.getCount()); // 2 1 123
    

    Client side:

    ////////// _myDummyClassClientSide.js
    // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes
    // Noob caveat: If you want to OVERWRITE *module.exports*, do it directly!
    // (i.e. if you overwrite the 'exports' alias instead, it will be meaningless;
    // because exports=module.exports... you should: module.exports=yourNewObject)
    module.exports = class Calculator { // Doesn't really matter that it's named
      constructor(initialValue) {
        this.count = initialValue===undefined ? 1 : initialValue;
      }
      increment() { this.count++; }
      getCount() { return this.count; }
    }
    
    ////////// _myDummyClassLikeClientSide.js
    function Apple(appleType) {
        this.appleType = appleType;
        this.color = "red";
    }
    Apple.prototype.updateColor = function(color) {
      this.color = color;
    }
    Apple.prototype.getInfo = function() {
        return this.color + ' ' + this.appleType + ' apple';
    };
    module.exports = Apple;
    
    ////////// someClientJS.js
    // (note: make sure you enable ES2015 in the gulpfile for this to run...)
    const MyDummyClass = require('./_myDummyClassClientSide.js');
    let c1 = new MyDummyClass();  // private 'count' initialzied to 1 by default
    let c2 = new MyDummyClass(17);
    console.log(typeof MyDummyClass); // => function
    console.log(typeof c1); // => object
    console.log(c1 == c2); // => false
    c1.increment(); // OK: We increment only c1
    console.log(c1.getCount(), c2.getCount()); // 2 17
    // (note: the following is in vanilla JS; no need for ES2015)
    var MyDummyClass = require('./_myDummyClassLikeClientSide.js');
    console.log(MyDummyClass); // => ƒ n(e){this.appleType=e,this.color="red"}
    var a1 = new MyDummyClass();
    var a2 = new MyDummyClass('aaaaaaa');
    console.log(a1.getInfo()); // => red undefined apple
    console.log(a2.getInfo()); // => red aaaaaaa apple
    a1.updateColor('newcolor');
    console.log(a1.getInfo()); // => newcolor undefined apple
    console.log(a2.getInfo()); // => red aaaaaaa apple
    

    How to fix: WordPress permalinks not working

    If only the “plain” permalinks work:
    • Maybe the .htaccess file is not set properly? Ensure WordPress can modify it (chmod 777 .htaccess for a moment; don’t forget to chmod back once we’re done with this step), then go to Settings ⇒ Permalinks and modify your Permalink preference and “Save Changes”. This will ensure .htaccess has the proper contents.
    • If you still have a problem, maybe the mod_rewrite is not enabled?! (have you upgraded your server recently?) So just enable it! (how? depending on your Apache version. Maybe: sudo a2enmod rewrite and then service apache2 restart)
    • If you already had mod_rewrite enabled, then maybe there is some conflicting plugin? :/ try to disable your plugins and enable them one after the other to see whether that’s the case.
    • Still not fixed? Let’s look again at the .htaccess. Maybe your Apache configuration does not AllowOverride All? Hope this helps!
    • None of this worked? Sucks for you.

    Python Virtual Environments in Windows, virtualenv, lsvirtualenv, venv

    sSome commands for Anaconda:
  • Which version do I have?
  • > conda --version
  • The latter actually recommended me to update the conda using conda update -n base conda, so…
  • > conda update -n base conda
  • Creating a new venv: Following https://www.tensorflow.org/install/install_windows, I ran:
  • > conda create -n venv_tf python=3.5
    (venv_tf) > pip install --ignore-installed --upgrade tensorflow
  • Can then simply activate it from ordinary command prompt:
  • > activate venv_tf
    # Deactivate the current venv
    > deactivate
    # Which environments I have?
    > conda env list
    # Get help:
    > conda env
    > conda env --help
    
  • Can then share your environment’s environment.yml file. See https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#sharing-an-environment
  • More useful commands from command line: (not necessarily related to Anaconda…)
    • lsvirtualenv to view virtual environments (assuming they were created by venv, and not by conda, because each of these maintains their venvs in different places, I guess).
    • To activate the virtual environment located in C:\Dev\venv\, simply run: C:\Dev\venv\Scripts\activate
    Other notes on PyCharm:
    • PyCharm’s built-in Terminal does NOT work as an external command line. I witnessed different error messages (formatted differently, less detailed) in the built-in Terminal. In one case, python setup.py did NOT work from the built-in Terminal, while the same command worked from a normal command line.
    • If the packages you install need for some reason Visual Studio C++ of some version, it did NOT help me to add to the PATH the directories where my Visual Studio C++ was located (namely, set PATH=C:\Users\%USERNAME%\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64;C:\Users\%USERNAME%\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\WinSDK\Bin\x64;C:\Users\%USERNAME%\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\WinSDK\Bin;%PATH%). Instead, press “Start”, then search for “Visual C++ Command Prompt” or something like that, and this command prompt already includes in its %PATH% variable the relevant directories.
    Other notes on python:
    • https://www.lfd.uci.edu/~gohlke/pythonlibs/ — Unofficial Windows Binaries for Python Extension Packages

    ZCash zcash4win problems starting up

    The problem:
    • You are using Windows.
    • You are using http://zcash4win.com/ as your ZCash node / wallet.
    • For some reason, it doesn’t start up as it usually did, and instead gives you some weird message “daemon is taking longer than expected to start”
    Solution:
    • Make sure you’re using the latest version from http://zcash4win.com/. This will usually solve it.
    • Otherwise, edit the file zcash.conf as explained in: https://forum.z.cash/t/required-config-change-for-zcash4win-1-0-12/26632

    Ethereum Wallet and geth

    IMPORTANT: Sunsetting Mist (!) https://medium.com/@avsa/sunsetting-mist-da21c8e943d2

    Migration options here: https://medium.com/@omgwtfmarc/mist-migration-patterns-6bcf066ac383

    See newer post https://kewool.com/2019/05/ethereum-wallet-mist-checksum-mismatch-in-dowloaded-node-geth-1-8-23-mycrypto-desktop-app/


    (from here, the older, original post…)

    Windows 10, 64-bit:

    Geth:

    • Download Geth from https://geth.ethereum.org/downloads/ (Update, April 3rd: https://ethereum.github.io/go-ethereum/downloads/).
    • Note: There is an “Installer” version and an “Archive” version. You can go with the “Installer” (even though it was once deemed suspicious by my Antivirus software). But probably okay to download the 64-bit “Archive”, unzip it and move the geth.exe into Program Files\Geth\ instead of the older geth.exe file you had there. Less important: I believe the “Installer” does more stuff, namely to try to change the PATH variable (it didn’t succeed in my case), and to update the uninstall.exe file as well…
    • Run certutil -hashfile __path_to_file__ MD5 to compare to MD5 in website.

    Ethereum Wallet:

    • Download Ethereum-Wallet-installer-*.exe from https://github.com/ethereum/mist/releases/.
    • Run certutil -hashfile __path_to_file__ SHA256 to compare to SHA256 in website.
    • Run the installer. IMPORTANT: It may suggest to place the blockchain data in: C:\Users\___your_user_name___\AppData\Roaming\Ethereum. Here you may change it to D:\Ethereum instead, if you prefer an external drive.
    • Optional (recommended): Create a shortcut with --syncmode "light". In fact, the “Target” in the shortcut can be something like: "C:\Program Files\Ethereum-Wallet\Ethereum Wallet.exe" --node-syncmode "light" --node-datadir="D:\Ethereum"
    • Note: No need to run both geth and wallet. Just run the wallet (using that shortcut you created!), it will invoke the proper geth.