The Windows Challenge: Getting `auto-market` Running and Pondering Dependencies

Hey everyone,

Today's post is a bit of a story, and it comes with another big shoutout to @herman-german! He recently reached out for some help getting the auto-market tool (the one for auto-selling/buying HIVE/HBD and Hive-Engine tokens) set up and running on Windows.

Now, I'll be the first to admit, I haven't regularly used Windows for going on three decades, so I knew this might be an adventure. I did what I could to assist remotely.

The Usual Suspect: scrypt and OpenSSL

It turned out the main hurdle was a familiar one for many Python developers trying to install certain cryptographic libraries on Windows: the scrypt package was failing to build. This is almost always due to missing OpenSSL development libraries – on Linux, it's usually a quick apt install libssl-dev or similar. On Windows, it's often a bit more involved to get the right headers and libraries in place for C extensions to compile.

I pointed him to some common places one might get OpenSSL for Windows. We tried a few things, and... no dice. More errors.

Computer Sleuthing

The Solution? Blast from the Past!

Long story short, after a good bit of troubleshooting, the only way we could get the scrypt dependency to build successfully on his Windows setup was by installing an antique version of OpenSSL. I'm talking so old, we had to dig up an installer via the Internet Archive because it wasn't readily available on current OpenSSL distribution sites!

But, persistence paid off! We eventually got auto-market up and running for him. And as a small bonus, while working through this, I also managed to squash a couple of bugs related to the 'buy' functionality in the hive-market script that weren't working quite right. So, win-win!

Back to the Main Point: Dependency Auditing

This whole experience brought a key thought back to the forefront. When I first started forking beem to create hive-nectar, one of my long-term goals was to audit its dependencies. The idea was to identify older, potentially problematic, or less maintained libraries and see if they could be swapped out for more modern, cross-platform friendly, and actively maintained alternatives.

The scrypt library, given the hoops we had to jump through on Windows due to its OpenSSL compilation requirements, seems like a prime candidate for this review. If there's a more modern Python-native or easier-to-install cryptographic library that can provide the necessary KDF (Key Derivation Function) functionality without these heavy external C dependencies, it would likely make hive-nectar (and by extension, tools that use it like auto-market) much more accessible and easier to install for users across all operating systems, especially Windows.

It's a reminder that while a library might work perfectly fine in your own development environment (Linux, in my case), ensuring a smooth experience for users on different systems often means taking a hard look at the entire dependency chain.

Food for thought for future hive-nectar development!

As always,
Michael Garcia a.k.a. TheCrazyGM



0
0
0.000
6 comments
avatar

You can use newer versions of OpenSSL, you just have to re-enable legacy_sect as it dropped support for the algorithm Hive requires.

openssl.conf

openssl_conf = openssl_init


[openssl_init]
providers = provider_sect

[provider_sect]
[legacy_sect]
default = default_sect
legacy = legacy_sect

[default_sect]
activate = 1

activate = 1

Then force pip install cryptography again.

You can find where your config is with

openssl version -d

0
0
0.000
avatar

I remember having to do that to allow it to do ripemd160, but the compilation error we were getting was that libcrypto_static.lib was missing, and only appeared to be in the older versions. My guess is they moved away from static libraries. Holger maintains the python scrypt as well, and it probably hasn't been updated since either. Didn't really look into it too much other than helping get it going. I do plan on digging into the deps anyway, e.g. there is at least 3 difference ecdsa libraries it tries to import as well.

0
0
0.000
avatar

I also haven't used Windows in many years, also, though so do have me beat, and I remember some of the ridiculous issues that I'd encounter on it often. Installing in Linux is like night and day compared to doing it in Windows, and so much better! Congratulations on your success in resolving the compilation problem, and for squashing a few more bugs! 😁 🙏 💚 ✨ 🤙

0
0
0.000