You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the new Pre-Production and Preview Testnets aren't easily accessible using this Ruby client library. Or at least it's not obvious how they could be used.
I question the design decision to have separate classes per network (CardanoMainNet/CardanoTestNet). It could've been built simpler with only one class (i.e Cardano) and setting the network is part of the configuration when initialising an object. This would make it very easy to use any supported network without changing any code in this library.
Of course, I am able to create a CardanoPreProductionNet by inheriting from Net and define the url inside the initializer, but I first have to read the code of this library to understand I can do it this way, and secondly it feels a bit cumbersome.
# Extend Blockfrostruby to support PreProd Testnet
class Blockfrostruby::CardanoPreProductionNet < Blockfrostruby::MainNet
def initialize(project_id, config = {})
super
@url = "https://cardano-preprod.blockfrost.io/api/v0"
end
end
For now I will just go with this second approach, but if you like the idea of the described simplification, I could submit a PR when I've got some time for it.
Please let me know ✌️
~Robin
The text was updated successfully, but these errors were encountered:
Currently, the new Pre-Production and Preview Testnets aren't easily accessible using this Ruby client library. Or at least it's not obvious how they could be used.
I question the design decision to have separate classes per network (
CardanoMainNet
/CardanoTestNet
). It could've been built simpler with only one class (i.eCardano
) and setting the network is part of the configuration when initialising an object. This would make it very easy to use any supported network without changing any code in this library.Of course, I am able to create a
CardanoPreProductionNet
by inheriting fromNet
and define the url inside the initializer, but I first have to read the code of this library to understand I can do it this way, and secondly it feels a bit cumbersome.For now I will just go with this second approach, but if you like the idea of the described simplification, I could submit a PR when I've got some time for it.
Please let me know ✌️
~Robin
The text was updated successfully, but these errors were encountered: