q9f / eth.rb

a straightforward library to build, sign, and broadcast ethereum transactions anywhere you can run ruby.
https://q9f.github.io/eth.rb
Apache License 2.0
200 stars 86 forks source link

OpenSSL support. Release 0.5 still supports openssl 3.0 but the 0.5.3 branch has be downgraded to OpenSSL 2.2 #87

Closed Lasvad closed 2 years ago

Lasvad commented 2 years ago

Hi there,

Is there any plan to bring this back up to openssl 3.0? I need to use the branch 0.5.3 because I need the ability to call a contract which doesn't seem to be supported yet in the main release branch.


Bundler could not find compatible versions for gem "openssl":
  In snapshot (Gemfile.lock):
    openssl (= 3.0.0)

  In Gemfile:
    openssl

    eth (= 0.5.3) was resolved to 0.5.3, which depends on
      openssl (~> 2.2)

Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.

I've tried to downgrade the Openssl gem to version to 2.2 but having issues getting the install to work correctly on my machine.

My main question is, will the OpenSSL 3 dependency be coming back once this hits main branch?

Thanks

q9f commented 2 years ago

Just remove your Gemfile.lock and run bundle install.

eth.rb works with any version of OpenSSL, either 2.2 or 3.0. If you install from the main branch, you could also just modify the Gemfile to whichever version you personally prefer. But removing the lockfile is probably the easiest workaround for you.

Blocked by https://github.com/cedarcode/openssl-signature_algorithm/pull/5

Ref #55 #56

Lasvad commented 2 years ago

hmm so using just gem eth, everything works great for installing the gem image image

But the issue I'm facing is that I want to interact with contracts. Contracts are documented, but doesn't look like this was implement in eth.rb 0.5.0 but rather Eth::Contract support was added in eth.rb 0.5.3.

When I explicitly set the version to 0.5.3, I hit the errors with SSL image image

deleting my gemfile.lock at this point and re-running bundle install leads here image

I can look into installing openssl 2.2.1 locally, which I think is the issue. I don't have Openssl 2.2.1 installed.

Based on these changes, https://github.com/q9f/eth.rb/pull/56/files, the dependency requires 2.x and would not support 3.x after 3a9514f0256c3aca5c7a14a2099a08c52dbad1e1. I've created a PR which should address this (https://github.com/q9f/eth.rb/pull/88).

My main intention is to have access to Eth::Contract which is only available in eth.rb v5.3 and greater.

q9f commented 2 years ago

On a side-note, the ::Contract is still very early in progress and will change again with 0.5.4.

q9f commented 2 years ago

please try the latest release 0.5.4 🚀

Lasvad commented 2 years ago

On a side-note, the ::Contract is still very early in progress and will change again with 0.5.4.

@q9f Any recommendations for another gem/library to use for Contract support in the mean time? Only need to basic interaction with simply contract like balanceOf/ownerOf (no need to deploy).

q9f commented 2 years ago

0.5.4 is released, this is your best shot IMHO.