Class: BSV::Network::Providers::GorillaPool
- Inherits:
-
Object
- Object
- BSV::Network::Providers::GorillaPool
- Defined in:
- lib/bsv/network/providers/gorilla_pool.rb
Overview
GorillaPool returns pre-configured Provider instances using the GorillaPool Arcade infrastructure for broadcasting, the GorillaPool Ordinals API for transaction and merkle path lookups, and JungleBus for indexed transaction data and block headers.
Mainnet composes three protocols:
-
Arcade at
https://arcade.gorillapool.io -
Ordinals at
https://ordinals.gorillapool.io -
JungleBus at
https://junglebus.gorillapool.io
Testnet composes two protocols:
-
Arcade at
https://testnet.arcade.gorillapool.io -
JungleBus at
https://testnet.junglebus.gorillapool.io
Example
provider = BSV::Network::Providers::GorillaPool.mainnet
provider.call(:broadcast, tx)
provider = BSV::Network::Providers::GorillaPool.mainnet(auth: { bearer: 'token' })
provider.call(:broadcast, tx)
# Legacy api_key: shorthand — still supported
provider = BSV::Network::Providers::GorillaPool.testnet(api_key: 'my-key')
Constant Summary collapse
- DEFAULT_RATE_LIMIT =
Default requests-per-second limit for unauthenticated use.
3
Class Method Summary collapse
-
.default(testnet: false, auth: nil, rate_limit: DEFAULT_RATE_LIMIT, **opts) ⇒ Provider
Returns a mainnet or testnet Provider depending on the
testnet:flag. -
.mainnet(auth: nil, rate_limit: DEFAULT_RATE_LIMIT, **opts) ⇒ Provider
Returns a mainnet Provider configured with Arcade, Ordinals, and JungleBus.
-
.testnet(auth: nil, rate_limit: DEFAULT_RATE_LIMIT, **opts) ⇒ Provider
Returns a testnet Provider configured with Arcade only.
Class Method Details
.default(testnet: false, auth: nil, rate_limit: DEFAULT_RATE_LIMIT, **opts) ⇒ Provider
Returns a mainnet or testnet Provider depending on the testnet: flag.
76 77 78 79 |
# File 'lib/bsv/network/providers/gorilla_pool.rb', line 76 def self.default(testnet: false, auth: nil, rate_limit: DEFAULT_RATE_LIMIT, **opts) kwargs = { auth: auth, rate_limit: rate_limit, **opts } testnet ? testnet(**kwargs) : mainnet(**kwargs) end |
.mainnet(auth: nil, rate_limit: DEFAULT_RATE_LIMIT, **opts) ⇒ Provider
Returns a mainnet Provider configured with Arcade, Ordinals, and JungleBus.
Auth is forwarded to all three protocols so each can authenticate independently.
42 43 44 45 46 47 48 49 50 51 |
# File 'lib/bsv/network/providers/gorilla_pool.rb', line 42 def self.mainnet(auth: nil, rate_limit: DEFAULT_RATE_LIMIT, **opts) resolved_auth = auth || (opts[:api_key] ? { bearer: opts[:api_key] } : :none) common = opts.slice(:api_key, :http_client).merge(auth: auth) Provider.new('GorillaPool', auth: resolved_auth, rate_limit: rate_limit) do |p| p.protocol Protocols::Arcade, base_url: 'https://arcade.gorillapool.io', auth: auth, **opts # TODO: re-register chaintracks_server at separate URL/port — see issue #778 p.protocol Protocols::Ordinals, base_url: 'https://ordinals.gorillapool.io', **common p.protocol Protocols::JungleBus, base_url: 'https://junglebus.gorillapool.io', **common end end |
.testnet(auth: nil, rate_limit: DEFAULT_RATE_LIMIT, **opts) ⇒ Provider
Returns a testnet Provider configured with Arcade only.
59 60 61 62 63 64 65 66 67 |
# File 'lib/bsv/network/providers/gorilla_pool.rb', line 59 def self.testnet(auth: nil, rate_limit: DEFAULT_RATE_LIMIT, **opts) resolved_auth = auth || (opts[:api_key] ? { bearer: opts[:api_key] } : :none) common = opts.slice(:api_key, :http_client).merge(auth: auth) Provider.new('GorillaPool', auth: resolved_auth, rate_limit: rate_limit) do |p| p.protocol Protocols::Arcade, base_url: 'https://testnet.arcade.gorillapool.io', auth: auth, **opts p.protocol Protocols::JungleBus, base_url: 'https://testnet.junglebus.gorillapool.io', **common # TODO: re-register chaintracks_server at separate URL/port — see issue #778 end end |