Testing ETH Contract Deployment using the `eth` Ruby gem against provider endpoints

For the past few days I have been testing the eth gem and various blockchain provider endpoints. Here are the endpoints I have been testing, which are in a module I created located in my test file, not surprisingly called endpoints.rb:

module Endpoint
    class Provider
        def initialize
        end
        def self.get(provider_network=ENV['ALCHEMY_ENDPOINT_GOERLI'])
            if provider_network == "alchemy_mainnet"
                    ENV['ALCHEMY_ENDPOINT_ETH_MAINNET'].nil? ? nil :  ENV['ALCHEMY_ENDPOINT_ETH_MAINNET']

                elsif provider_network == "getblock_goerli"
                    ENV['GETBLOCK_ENDPOINT_GOERLI'].nil? ? nil :  ENV['GETBLOCK_ENDPOINT_GOERLI']

                elsif provider_network == "quicknode_ropsten"
                    ENV['QUICKNODE_ENDPOINT_ROPSTEN'].nil? ? nil :  ENV['QUICKNODE_ENDPOINT_ROPSTEN']

                elsif provider_network == "quicknode_goerli"
                    ENV['QUICKNODE_ENDPOINT_GOERLI'].nil? ? nil :  ENV['QUICKNODE_ENDPOINT_GOERLI']
                
                elsif provider_network == "chainstack_ropsten"
                    ENV['CHAINSTACK_ENDPOINT_ROPSTEN'].nil? ? nil :  ENV['CHAINSTACK_ENDPOINT_ROPSTEN']

                elsif provider_network == "chainstack_goerli"
                    ENV['CHAINSTACK_ENDPOINT_GOERLI'].nil? ? nil :  ENV['CHAINSTACK_ENDPOINT_GOERLI']

                elsif provider_network == "alchemy_goerli"
                    ENV['ALCHEMY_ENDPOINT_GOERLI'].nil? ? nil :  ENV['ALCHEMY_ENDPOINT_GOERLI']

                elsif provider_network == "alchemy_rinkeby"
                    ENV['ALCHEMY_ENDPOINT_RINK'].nil? ? nil :  ENV['ALCHEMY_ENDPOINT_RINK']

                else
                    ENV['ALCHEMY_ENDPOINT_GOERLI'].nil? ? nil :  ENV['ALCHEMY_ENDPOINT_GOERLI']
            end
        end
    end
end

As you can see from the module, I "over coded" this nil check :slight_smile:

Basically, with this module we can easily update the endpoint provider list as needed and use the endpoint provider and the name of the Ethereum test chain, like so; which you can see takes the name of the contract and the "provider_network" combination which represents the blockchain service provider and the name of the test network (as simple Strings):

chain = Eth::Client.create Endpoint::Provider.get(provider_network)

Using this simple idea, I created a basic method using the eth gem to test the most basic hello_world.sol smart contract:

module EthGem 
    require "eth"
   
    require_relative "#{Rails.root}/lib/assets/config.rb"

    class Core
       include Endpoint
       include Wallet

       def initialize
       end

       def self.contract(file="hello_world",provider_network=="alchemy_goerli")
            return nil if file.nil?
            chain = Eth::Client.create Endpoint::Provider.get(provider_network)
            deposit_contract = Eth::Address.new Wallet::Address.metamask_eth
            balance = (chain.get_balance deposit_contract).to_f
            puts "Balance is #{balance.round(8)}"
            puts "FILE: #{contract_file}"
            contract_file = "#{Rails.root}/lib/assets/contracts/#{file}.sol"
            contract = Eth::Contract.from_file(file: contract_file)
            chain.deploy_and_wait(contract)
       end
    end
end

Amazingly, none of these blockchain provider tests worked as expected for a number of reasons and it's interesting and instructive to look at each provider and their error message returned, which I will launch in the Rails console, as in the following example:

MacStudio:eth tim$ rails c
Loading development environment (Rails 7.0.3)
irb(main):001:0> require "#{Rails.root}/lib/assets/eth.rb"
=> true
irb(main):002:0> EthGem::Core.contract("hello_world","alchemy_goerli")

In each case, we also print the balance of our test ETH in each test network just to show the API is "working" in it's most simple method, getting a balance of ETH in the network.

alchemy_goerli

irb(main):002:0> EthGem::Core.contract("hello_world","alchemy_goerli")
Balance is 1.1e+18                                                                                                    
FILE: /Users/tim/rails/eth/lib/assets/contracts/hello_world.sol                        
                               
/Users/tim/rails/eth/vendor/bundle/ruby/3.0.0/gems/eth-0.5.5/lib/eth/client.rb:453:in `send_command': Unsupported method: eth_coinbase. Alchemy does not support mining eth. See available methods at https://docs.alchemy.com/alchemy/documentation/apis (IOError)                

Note that for Alchemy, they provide a very instructive error message. This error occurs regardless of which test network we try on the Alchemy-hosted blockchains.

I reported this issue to the owner of the eth gem and received a light thank you and he tagged this as an eth gem bug here:

So, although I cannot yet deploy Hello World contract on an Alchemy Ethereum test network using the eth gem, we learned that Alchemy returns informative error messages and that the eth gem owner is actively supporting the eth gem. This is all good news.

chainstack_ropsten

irb(main):003:0> **EthGem**::**Core**.contract(**"**hello_world**"**,**"**chainstack_ropsten**"**)
Balance is 1.0400990549999952e+20
FILE: /Users/tim/rails/eth/lib/assets/contracts/hello_world.sol

/Users/tim/rails/eth/vendor/bundle/ruby/3.0.0/gems/eth-0.5.5/lib/eth/client.rb:453:in `send_command': **etherbase must be explicitly specified (****IOError****)**

This "etherbase" error is vague, but so far I have not reported the issue to the eth gem repo, as I do not wish to overwhelm the developer with my test results. However, early in my testing, I reported this error to Chainstack, who came back with me with a proposal for $1,600 USD per day to help me fix this issue :slight_smile:

I will note at this point that Alchemy lets us freely create and test up to five different blockchain endpoints, where Chainstack only permits one. Testing multiple chains on Chainstack requires deleting endpoints, which is annoying. When I first deleted an endpoint to create another one for a different test network, I received some sales-related email from Chainstack asking me to upgrade to the paid tier.

getblock_goerli

irb(main):004:0> EthGem::Core.contract("hello_world","getblock_goerli")

/Users/tim/.rbenv/versions/3.0.3/lib/ruby/3.0.0/json/common.rb:216:in `parse': 809: unexpected token at 'Apikey missed' (JSON::ParserError)

As you can see, this API endpoint just dies. When I double checked the GetBlock docs, there is no clue about this error. I suspect it might be an error in the eth JSON parser; however, I have not yet reported this issue to the eth gem repo owner. I have not yet interacted with GetBlock support and do not have any current plans to do so.

quicknode_goerli

irb(main):007:0> EthGem::Core.contract("hello_world","quicknode_goerli")

/Users/tim/.rbenv/versions/3.0.3/lib/ruby/3.0.0/json/common.rb:216:in `parse': 809: unexpected token at 'Not Found' (JSON::ParserError)

Quicknode tests did not get very far and we got a similar JSON parsing error in the eth gem as with GetBlock.

The problem as a developer testing Quicknode endpoints is that they charge $9 per node per month to test. Alchemy, on the other hand, provides 5 free nodes to developers. Alchemy has been very easy and smooth to work with so far.

Regarding the parsing errors, I suspect the issue may be related to the JSON parsing method in the gem, but have not reported this issue to the owner yet.

Maybe I will report these issues to the eth gem repo later this week.

Regarding Quicknode support, I have been chatting with one of there team member in India who has been helpful and friendly. He also provided me with 4 free Ropsten test network ETH before I found some faucets and now I have nearly 400 Ropsten ETH (rETH). A link to a list of faucets to get free test ETH is at the bottom.

Summary

I have tested Ethereum endpoints deploying the most basic Hello World contract for four blockchain hosting providers (1) Alchemy, (2) Chainstack, (3) GetBlock and (4) Quicknode.

When we search the net for reviews on each of these providers, we find a lot of top 10 lists and other click-bait which is 99% copy-and-paste SEO text without any real testing or understanding of what or how to test.

However, in this case, I have signed-up for, and tested, four providers and found Alchemy to be the best from (1) a "free developer tier" perspective, (2) an error message return perspective and (3) a dashboard perspective (which I did not show here).

The bottom line is that I cannot yet deploy a Hello World "smart" contract on an Ethereum test network. It appears that there are still some bugs to work out with the eth gem as far as parsing JSON data and interacting with different provider blockchain endpoints.

I have reported one of the issues to the eth gem owner, who has gently acknowledged this bug. I have not yet reported the JSON parsing error, as I am trying to be gentle and not inundate a fellow developer, who is a busy coder and doing an "act of kindness" making this gem available for everyone, with issues.

Hopefully, I can find a provider endpoint (free) where I can get a Hello World contract to deploy on an Ethereum test network; but I think the issue fall in the scope of the eth gem and not with the endpoint blockchain provider.

Hope this helps!

List of Faucets for Free Test ETH

Some of the links in this GitHub list are dead, others are great. This is a good place to start if you are searching for test ETH.

Update: Reported These Issues

Assuming the developer would like to know....

Final Thoughts

Would be great if people who post tutorials and "top 10 lists" on the net would actually use and test the services they are posting click-bait about; but I that "wish" is not going to happen as the trend is more click-bait SEO "reviews" and "tutorials", less "signal" and a lot more "noise".

However, with my tests, you are getting real tests and zero click-bait.

Testing infura....

infura_goerli

MacStudio:eth tim$ rails c
Loading development environment (Rails 7.0.3)
irb(main):001:0> require "#{Rails.root}/lib/assets/eth.rb"
=> true
irb(main):002:0> EthGem::Core.contract("hello_world","infura_goerli")
Balance is 1.1e+18              
FILE: /Users/tim/rails/eth/lib/assets/contracts/hello_world.sol

/Users/tim/rails/eth/vendor/bundle/ruby/3.0.0/gems/eth-0.5.5/lib/eth/client.rb:453:in `send_command': The method eth_coinbase does not exist/is not available (IOError)                      

Results

Same results identified in bug report (115) submitted previously:

Update

Found a workaround for the eth_coinbase issue for test networks (not mining). The workaround is to send the sender private key to sign the contract (versus the default of using the miner key).

priv_key = Eth::Key.new priv: ENV['ETH_CONTRACT_SENDERS_PRIVATE_KEY']
key = Eth::Key.new priv:  priv_key 
chain.deploy_and_wait(contract,sender_key:key)

This appears to have worked on the "chainstack_ropsten" network, but so far, I get getting issues related to gas prices (causing timeouts) for other test networks.

irb(main):002:0> EthGem::Core.contract("hello_world","chainstack_ropsten")
Balance is 1.0400990549999952e+20         
FILE: /Users/tim/rails/eth/lib/assets/contracts/hello_world.sol                    
=> "0xb9554BF515750AD073Ec197AD415aEc5b69483D6"
irb(main):003:0> 

However, when I check the blockchain, it shows that it failed, not enough gas.

https://ropsten.etherscan.io/tx/0x851839899f6ca753305c94ed22138ee955cd1c6f48b0e83883697c9520ad5441

Update

I'm in a kind of dystopian ethereum loop with the eth gem.

When I push a Hello World contract to any ethereum test network; I get errors (paraphrasing), "your gas price is too low, increase gas fees".

Then, when I increase gas fees, it errors (paraphrasing), "this transaction already exists".

Well, I know it exists because I got an error telling me to increase my gas fees (because the transaction exists on the blockchain).

I tried changing nonce values, and that did not work. I printed the output from each API return call, nothing there.

The docs on the eth gem do not discuss this. Reading the gem code, it's not obvious what to change.

LOL... it seems a simple "Hello Wlord" contract on a test eth blockchain should be a lot easier than three days work, with no "Hello World" :slight_smile:

Hello World in new tech I'm learning generally takes me a few minutes. In this case, it's been days, LOL and still nothing....

As a side project, I try to get the eth.rb gem to dance with Binance Smart Chain (BSC) today since BSC is an Ethereum fork.

Created a testing endpoint on QuickNode and was able to successfully check by BNB balance.

However, when trying this now famous "Hello World" contract on the BSC, I got this error:

irb(main):005:0> EthGem::Core.contract("hello_world","quicknode_bsc")

Endpoint: https://xxxxxxxxx.bsc.quiknode.pro/xxxxxxxxxx/
Initializing Eth:  @max_fee_per_gas=20000000000.0 @gas_limit=21000
PUMPED UP GAS: chain.max_fee_per_gas=60000000000.0 & chain.gas_limit=210000
METAMASK_ADDRESS: 0x863de77F62cf351124A386Cbd4eC3XXXXXXX

{"jsonrpc"=>"2.0", "id"=>1, "result"=>"0x4547258d1ec000"}
Balance is 1.95e+16

FILE: /Users/tim/rails/ethgem/lib/assets/contracts/hello_world.sol

{"jsonrpc"=>"2.0", "id"=>2, "result"=>"0x12a05f200"}
Gas Max Fee: {"jsonrpc"=>"2.0", "id"=>2, "result"=>"0x12a05f200"}
{"jsonrpc"=>"2.0", "id"=>3, "result"=>"0x38"}
{"jsonrpc"=>"2.0", "id"=>4, "result"=>"0x0"}
DEBUG NEO get_nonce: nonce=0
{"jsonrpc"=>"2.0",
 "id"=>5,
 "error"=>{"code"=>-32000, "message"=>"transaction type not supported"}}

/Users/tim/rails/ethgem/vendor/bundle/ruby/3.0.0/bundler/gems/eth.rb-cfa68b506df6/lib/eth/client.rb:463:in `send_command': transaction type not supported (IOError)

I think I will avoid this BSC and eth.rb rabbit hole :slight_smile:

The good news is that I used the eth.rb gem to generate the wallet address I used for other eth test cases and it was cool to buy BNB on a small exchange overseas and transfer that BNB (to pay gas fees, if needed, for the testing above) to my eth.rb generated key / address.

So, in between sanding teak wood floors and other tasks today, I wrote a quick Rails "wallet" to manage all these keys, and used the "latest" Rails active record encryption methods to encrypt all the private keys in the DB.

See also:

https://www.quicknode.com/chains/bsc

https://guides.rubyonrails.org/active_record_encryption.html

Regarding what anyone might think about the future of blockchain, it's interesting to write blockchain-related code; well, interesting and "head banging" at times :slight_smile: To a small degree, I regret not starting down this rabbit hole a few years ago, as I have always enjoyed cryptography and cryptographic applications.

Decades ago, I was on a committee in Washington, DC working with NIST on AES standards. It's been so long ago, I forgot how I ended doing that work!

Google helps! Found the minutes, from nearly 24 years ago:

Minutes of the Computer System Security and
Privacy Advisory Board Meeting

December 2-3, 1998
National Institute of Standards and Technology
Gaithersburg, MD

Wednesday, December 2, 1998

Mr. Tim Bass, principal engineer with The Silk Road Group, Ltd. presented an
update to the Board on the activities regarding the Langley Cyber Attack. (He
had briefed the Board on this at their September meeting.) Next, he discussed a
draft tutorial article on the emerging Advanced Encryption Standard that he is
producing as an invited paper for the Proceedings of the IEEE. He invited the
Board to review the outline presented [Ref. #4] and provide him any assistance
they deemed appropriate.

References:

#1 Hunker presentation
#2 November 16, 1998, letter from Ray Kammer, Director, NIST
#3 Access in Trust report/GITS Committee
#4 Bass draft AES tutorial article
#5 EPIC�s Report on the PCCIP
#6 Adams presentation
#7 Brownstein presentation

Actually, I need to find that old draft paper. I do not think I ever finished it and of course, it would be totally OBE today.

Footnote:

For anyone wondering, I formed a company called "The Silk Road Group" long before hackers create the dark web silk road. I sold that company nearly 17 years ago. I think I formed that company around 25-30 years ago (cannot remember).

Minutes

https://csrc.nist.rip/csspab/minutes/minutes12-98.txt

Of note regarding eth.rb and the Quicknode BSC endpoint I created, there are zero errors in the stats for that node:

It's interesting that the node shows zero errors; but the eth.rb gem show errors when working with contracts on the BSC chain.

{"jsonrpc"=>"2.0",
 "id"=>5,
 "error"=>{"code"=>-32000, "message"=>"transaction type not supported"}}

Maybe QuickNode considers this error as 200, because at least there is a valid JSON reply, with error message?

Maybe I will go down this rabbit hole later ....

1 Like

Update

Current List of Provider Endnodes (Testing)

module Endpoint
    class Provider
        def initialize
        end
        def self.get(provider_network=ENV['ALCHEMY_ENDPOINT_GOERLI'])
            if provider_network == "alchemy_mainnet"
                    ENV['ALCHEMY_ENDPOINT_ETH_MAINNET'].nil? ? nil :  ENV['ALCHEMY_ENDPOINT_ETH_MAINNET']

                elsif provider_network == "getblock_goerli"
                    ENV['GETBLOCK_ENDPOINT_GOERLI'].nil? ? nil :  ENV['GETBLOCK_ENDPOINT_GOERLI']

                elsif provider_network == "quicknode_ropsten"
                    ENV['QUICKNODE_ENDPOINT_ROPSTEN'].nil? ? nil :  ENV['QUICKNODE_ENDPOINT_ROPSTEN']

                elsif provider_network == "quicknode_goerli"
                    ENV['QUICKNODE_ENDPOINT_GOERLI'].nil? ? nil :  ENV['QUICKNODE_ENDPOINT_GOERLI']
                
                elsif provider_network == "chainstack_ropsten"
                    ENV['CHAINSTACK_ENDPOINT_ROPSTEN'].nil? ? nil :  ENV['CHAINSTACK_ENDPOINT_ROPSTEN']

                elsif provider_network == "chainstack_goerli"
                    ENV['CHAINSTACK_ENDPOINT_GOERLI'].nil? ? nil :  ENV['CHAINSTACK_ENDPOINT_GOERLI']

                elsif provider_network == "alchemy_goerli"
                    ENV['ALCHEMY_ENDPOINT_GOERLI'].nil? ? nil :  ENV['ALCHEMY_ENDPOINT_GOERLI']

                elsif provider_network == "alchemy_rinkeby"
                    ENV['ALCHEMY_ENDPOINT_RINK'].nil? ? nil :  ENV['ALCHEMY_ENDPOINT_RINK']

                elsif provider_network == "infura_mainnet"
                    ENV['INFURA_ENDPOINT_MAINNET'].nil? ? nil :  ENV['INFURA_ENDPOINT_MAINNET']

                elsif provider_network == "infura_goerli"
                    ENV['INFURA_ENDPOINT_GOERLI'].nil? ? nil :  ENV['INFURA_ENDPOINT_GOERLI']
                
                elsif provider_network == "infura_ropsten"
                    ENV['INFURA_ENDPOINT_ROPSTEN'].nil? ? nil :  ENV['INFURA_ENDPOINT_ROPSTEN']    

                elsif provider_network == "infura_koven"
                    ENV['INFURA_ENDPOINT_KOVAN'].nil? ? nil :  ENV['INFURA_ENDPOINT_KOVAN'] 

                elsif provider_network == "quicknode_bsc"
                    ENV['QUICKNODE_ENDPOINT_BSC'].nil? ? nil :  ENV['QUICKNODE_ENDPOINT_BSC'] 

                else
                    ENV['ALCHEMY_ENDPOINT_GOERLI'].nil? ? nil :  ENV['ALCHEMY_ENDPOINT_GOERLI']
            end
        end

        def self.core_nodes
            [
                ENV['INFURA_ENDPOINT_MAINNET'],
                ENV['INFURA_ENDPOINT_ROPSTEN'],
                ENV['ALCHEMY_ENDPOINT_GOERLI'],
                ENV['ALCHEMY_ENDPOINT_RINK'],
                ENV['INFURA_ENDPOINT_KOVAN'],
                ENV['QUICKNODE_ENDPOINT_BSC'],
            ]
        end
    end
end

Have tried to get support from Alchemy, QuickNode, Infura and Chainstack how to get this very simple "Hello World" contract to actually deploy.

The last time I asked Chainstack for support, they requested $1,600 USD a day for "hello world".

QuickNode has not provided any meaningful help even though their website has countless Ruby eth gem tutorials.

Alchemy sends developers to a Discord community which seems more like a community of "school children in a. playground" versus software developers. I finally found a way to submit a "ticket" directly to Alchemy.

Let's see what happens next, who replies and what "real" support they offer for getting "hello world" to work on their various eth test chains.

I am starting to understand why crypto development has such a bad name? Some have described it as akin to "eating glass".

I recall when we started work on the Internet decades ago, development was dominated by professors and academics. However, with "web3" it seems (comparative speaking) dominated by novices and schemers, all looking to make a quick buck.

1 Like

woah, you are deep in the wrabbit hole , how's you feeling ?

So far, support from blockchain providers I have been trying to work with is as follows:

  1. Infura
  2. Chainstack
  3. QuickNode
  4. Alchemy

Infura

Responded (so far) to my "Hello World" issue with intelligent and reasonable questions. Requested a github repo, which I provided. I'm optimistic Infura will put some "skin in the game" and help with Hello Work, but only cautiously optimistic.

Chainstack

Seems focused on trying to sell technical services at $1600 a day, which seems crazy to me since they have not demonstrated they can even help with the most simple "Hello World" contract. The questions they have asked so far are also "off target" in my view; but at least they asked to see the simple contract. I'm not writing off Chainstack yet. They seem to be "trying" after I complained when they offered me $1600 a day support for Hello World.

QuickNode

Website tutorials are mostly deprecated clickbait, in my opinion. No depth of support so far. Disappointing; but I remain hopeful. On the other hand, at least they "tried" to be helpful with educational tutorials; even if they do not actually work since their tutorial code is either half-baked or obsolete. I do understand the crypto space is rapidly evolving and hard to keep all the tutorials current.

Alchemy

Alchemy refers customers to a Discord community who are not helpful at all. In fact, I found it "trollish" one person providing "google" search answers, as if I do not know how to use google. Finally figured out how to submit a support ticket (and canceled the Discord server), but so far no response. At least I got a reply from QuickNode, otherwise they would both be tied for the worse of the group.

Let's see what happens by the end-the-day today? Will any one of these blockchain providers actually add value to "Hello World" and get it running?

I'm cheering for Infura, since their team actually request a GitHub repo, which I provided:

I will "rerank' the support tomorrow.

QuickNode Update

Yay! QuickNode provided a clear explanation why the eth.rb gem does not support the Binance Smart Chain (BSC). I read their support reply and agree with their assessment. This was excellent support.

QuickNode Support Reply

We do not have much information on how you are building the request that is giving you that response, but it looks like it is related to how the transaction is built.

Ethereum and its testnets are currently using a transaction type based on EIP-1559 after London Hardfork.
BSC hasn't adopted that proposal and it is still using the traditional transaction type, so if you are building the transaction the same way in Ethereum and BSC, that would be probably giving you an error in BSC.

I haven't had the chance to use the Ruby library you are using, but these will be the differences in the gas fields:

  • BSC
    • Use the gas field
  • Ethereum:
    • Use the maxPriorityFeePerGas and maxFeePerGas (EIP-1159 fields)

The Gist of My Reply to QN

Yes, I agree this below is perhaps the issue, as you pointed out. Thanks and Regards. I was told by another QuickNode person that the eth.rb gem would work, but they did not test it. That gem does not work because the eth.rb gem uses EIP-1159 fields.

I appreciate you telling me that about BSC. Thank you again.

  • BSC
    • Use the gas field
  • Ethereum:
    • Use the maxPriorityFeePerGas and maxFeePerGas (EIP-1159 fields)

So, QuickNode moves up to #2, now in second place. Let's see what come in next :slight_smile:

  1. Infura
  2. QuickNode
  3. Chainstack
  4. Alchemy

The horse race is on!

1 Like

Last support reply from QuickNode was embarrassing to read. I requested support for Ruby and instead, get a curl example of how to deploy "Hello World" but I have been requesting support for the eth Ruby gem.

In my view, QuickNode's Ruby tutorials can only be described as click-bait, as they have no idea what they are doing in Ruby and cannot assist in debugging the most simple Ethereum contract possible, "Hello World'. It's has been very disappointing with QuickNode, that is for sure.

Was going to adjust rankings and comment further, but I am beginning to think all the blockchain providers I have tested so far cannot write and debug a simple Ruby program which deploys a "Hello World" contract.

QuickNode responding with curl when I specifically filed a ticket for the Ruby eth gem was the last straw for QuickNode for me. Because of the poor tech support for the Ruby eth gem, I decided to delete all QuickNode endpoints and cancel all test subscriptions.

Reminder: This topic is -

Testing ETH Contract Deployment using the eth Ruby gem against provider endpoints

... not testing Go, Python, shell, curl, Javacript, node.js, etc. My experience (before going down the BaaS rabbit hole analysis) is that only the most underfunded IT departments base their API docs on curl, so maybe these blockchain service provider companies are basically underfunded startups with very little technical expertise and talent?

I have decided that the QuickNode Ruby tutorials is mostly just click-bait, because if they supported Ruby, they would actually reply with working Ruby code using the eth gem and not curl, of course.

This was actually the "second chance" for QuickNode. In both support contacts, they do not support their own Ruby tutorials for the most simple Hello World contract deployment on an Ethereum test chain.

Disappointing.

Days and days into this rabbit hole, using numerous blockchain providers, different Hello World and Hi There contracts, changing all types of gas related parameters, I remain in a loop of:

{"jsonrpc"=>"2.0",
 "error"=>{"code"=>-32000, "message"=>"replacement transaction underpriced"},
 "id"=>6}

and then:

{"jsonrpc"=>"2.0",
 "error"=>{"code"=>-32000, "message"=>"already known"},
 "id"=>7}

Ropsten, Rinkeby, Goerli, all these ethereum test networks have this same problem.

It's only Hello World and a week has passed with not a single successful transition using this eth.rb gem

It makes no sense why it is this complex, undocumented and unsupported from any provider. Google yields nothing of value. Block chain providers have not been helpful. The eth.rb gem owner is ignoring me on GitHub :slight_smile:

It's no wonder the cryptoverse is so fragile......

A guy with over 4 decades of leading edge IT work cannot even get Hello World to work using the same Ruby gem which every blockchain provider references.

Welcome to distributed blockchain apps!

Here is my current list of blockchain service providers I have been testing against and submitting tickets for support (after removing QuickNode from my list of endpoint providers):

module Endpoint
    class Provider
        def initialize
        end
        def self.get(provider_network=ENV['ALCHEMY_ENDPOINT_GOERLI'])
            if provider_network == "alchemy_mainnet"
                    ENV['ALCHEMY_ENDPOINT_ETH_MAINNET'].nil? ? nil :  ENV['ALCHEMY_ENDPOINT_ETH_MAINNET']

                elsif provider_network == "getblock_goerli"
                    ENV['GETBLOCK_ENDPOINT_GOERLI'].nil? ? nil :  ENV['GETBLOCK_ENDPOINT_GOERLI']
                
                elsif provider_network == "chainstack_ropsten"
                    ENV['CHAINSTACK_ENDPOINT_ROPSTEN'].nil? ? nil :  ENV['CHAINSTACK_ENDPOINT_ROPSTEN']

                elsif provider_network == "chainstack_goerli"
                    ENV['CHAINSTACK_ENDPOINT_GOERLI'].nil? ? nil :  ENV['CHAINSTACK_ENDPOINT_GOERLI']

                elsif provider_network == "alchemy_goerli"
                    ENV['ALCHEMY_ENDPOINT_GOERLI'].nil? ? nil :  ENV['ALCHEMY_ENDPOINT_GOERLI']

                elsif provider_network == "alchemy_rinkeby"
                    ENV['ALCHEMY_ENDPOINT_RINK'].nil? ? nil :  ENV['ALCHEMY_ENDPOINT_RINK']

                elsif provider_network == "infura_mainnet"
                    ENV['INFURA_ENDPOINT_MAINNET'].nil? ? nil :  ENV['INFURA_ENDPOINT_MAINNET']

                elsif provider_network == "infura_goerli"
                    ENV['INFURA_ENDPOINT_GOERLI'].nil? ? nil :  ENV['INFURA_ENDPOINT_GOERLI']
                
                elsif provider_network == "infura_ropsten"
                    ENV['INFURA_ENDPOINT_ROPSTEN'].nil? ? nil :  ENV['INFURA_ENDPOINT_ROPSTEN']    

                elsif provider_network == "infura_koven"
                    ENV['INFURA_ENDPOINT_KOVAN'].nil? ? nil :  ENV['INFURA_ENDPOINT_KOVAN'] 

                else
                    ENV['ALCHEMY_ENDPOINT_GOERLI'].nil? ? nil :  ENV['ALCHEMY_ENDPOINT_GOERLI']
            end
        end

        def self.core_nodes
            [
                ENV['INFURA_ENDPOINT_MAINNET'],
                ENV['INFURA_ENDPOINT_ROPSTEN'],
                ENV['ALCHEMY_ENDPOINT_GOERLI'],
                ENV['ALCHEMY_ENDPOINT_RINK'],
                ENV['INFURA_ENDPOINT_KOVAN'],
            ]
        end
    end
end

Example of recent errors:

Update

Removed getblock from the list because of all the providers tested over the past week, only getblock errors out on this parse error every time I test it using the same test harness:

parse source Apikey missed
/Users/tim/.rbenv/versions/3.0.3/lib/ruby/3.0.0/json/common.rb:217:in `parse': 809: unexpected token at 'Apikey missed' (JSON::ParserError)

My best guess is that GetBlock has some odd way of passing the API key (compared to all the other blockchain providers) which does not work in the eth.rb gem; but since all the other providers I have tested so far do not have this problem, I'm removing GetBlock from the list today. Good bye GetBlock!

Updated List of Endpoint Providers Being Tested

module Endpoint
    class Provider
        def initialize
        end
        def self.get(provider_network=ENV['ALCHEMY_ENDPOINT_GOERLI'])
            if provider_network == "alchemy_mainnet"
                    ENV['ALCHEMY_ENDPOINT_ETH_MAINNET'].nil? ? nil :  ENV['ALCHEMY_ENDPOINT_ETH_MAINNET']
                
                elsif provider_network == "chainstack_ropsten"
                    ENV['CHAINSTACK_ENDPOINT_ROPSTEN'].nil? ? nil :  ENV['CHAINSTACK_ENDPOINT_ROPSTEN']

                elsif provider_network == "chainstack_goerli"
                    ENV['CHAINSTACK_ENDPOINT_GOERLI'].nil? ? nil :  ENV['CHAINSTACK_ENDPOINT_GOERLI']

                elsif provider_network == "alchemy_goerli"
                    ENV['ALCHEMY_ENDPOINT_GOERLI'].nil? ? nil :  ENV['ALCHEMY_ENDPOINT_GOERLI']

                elsif provider_network == "alchemy_rinkeby"
                    ENV['ALCHEMY_ENDPOINT_RINK'].nil? ? nil :  ENV['ALCHEMY_ENDPOINT_RINK']

                elsif provider_network == "infura_mainnet"
                    ENV['INFURA_ENDPOINT_MAINNET'].nil? ? nil :  ENV['INFURA_ENDPOINT_MAINNET']

                elsif provider_network == "infura_goerli"
                    ENV['INFURA_ENDPOINT_GOERLI'].nil? ? nil :  ENV['INFURA_ENDPOINT_GOERLI']
                
                elsif provider_network == "infura_ropsten"
                    ENV['INFURA_ENDPOINT_ROPSTEN'].nil? ? nil :  ENV['INFURA_ENDPOINT_ROPSTEN']    

                elsif provider_network == "infura_koven"
                    ENV['INFURA_ENDPOINT_KOVAN'].nil? ? nil :  ENV['INFURA_ENDPOINT_KOVAN'] 

                else
                    ENV['ALCHEMY_ENDPOINT_GOERLI'].nil? ? nil :  ENV['ALCHEMY_ENDPOINT_GOERLI']
            end
        end

        def self.core_nodes
            [
                ENV['INFURA_ENDPOINT_MAINNET'],
                ENV['INFURA_ENDPOINT_ROPSTEN'],
                ENV['ALCHEMY_ENDPOINT_GOERLI'],
                ENV['ALCHEMY_ENDPOINT_RINK'],
                ENV['INFURA_ENDPOINT_KOVAN'],
            ]
        end
    end
end

Found the following on Telegram. Seems I am not the only person having problems with this gem:

Based on this recent development, I should pause this part of by analysis until this gem is "fixed".

1 Like

No being able to fully pause the dive down this rabbit hole, I have been debugging away at the eth gem with more print statements than anyone would include in code, and I cannot get past this EVM error message:

{"jsonrpc"=>"2.0",
 "id"=>7,
 "error"=>{"code"=>-32000, "message"=>"already known"}}

The wise network tells us that if there are any pending transactions, we simple send 0 ETH from / to the same address and all transactions will be cancelled for that address. That sounds reasonable, so I did this for the addresses I have been using (using MetaMask and not the eth gem) and the zero amount transferred just fine.

However, after doing this "send 0 ETH from the same account to cancel pending transations" magic, I get the same error when I run this again:

{"jsonrpc"=>"2.0",
 "id"=>7,
 "error"=>{"code"=>-32000, "message"=>"already known"}}

Reference:

See also:

// ErrAlreadyKnown is returned if the transactions is already contained
// within the pool.
ErrAlreadyKnown = errors.New("already known")

Reference:

could this be a synchronisation / timing issue with whatever manages/oversees the transaction pool ?
is there a cleanser process that wipes out dead/cancelled/erroneous entries ?

You tell me :slight_smile:

Thanks.