@@ -57,6 +57,7 @@ def __init__(
57
57
self ,
58
58
host : str = "localhost" ,
59
59
port : int = 1337 ,
60
+ path : str = "" ,
60
61
secure : bool = False ,
61
62
refetch_chain_tip_interval : Optional [float ] = None ,
62
63
utxo_cache_size : int = 10000 ,
@@ -65,6 +66,7 @@ def __init__(
65
66
):
66
67
self .host = host
67
68
self .port = port
69
+ self .path = path
68
70
self .secure = secure
69
71
self ._network = network
70
72
self ._service_name = "ogmios"
@@ -84,26 +86,26 @@ def __init__(
84
86
self ._datum_cache = LRUCache (maxsize = datum_cache_size )
85
87
86
88
def _query_current_era (self ) -> OgmiosEra :
87
- with OgmiosClient (self .host , self .port , self .secure ) as client :
89
+ with OgmiosClient (self .host , self .port , self .path , self . secure ) as client :
88
90
return get_current_era (client )
89
91
90
92
def _query_current_epoch (self ) -> int :
91
- with OgmiosClient (self .host , self .port , self .secure ) as client :
93
+ with OgmiosClient (self .host , self .port , self .path , self . secure ) as client :
92
94
epoch , _ = client .query_epoch .execute ()
93
95
return epoch
94
96
95
97
def _query_chain_tip (self ) -> OgmiosTip :
96
- with OgmiosClient (self .host , self .port , self .secure ) as client :
98
+ with OgmiosClient (self .host , self .port , self .path , self . secure ) as client :
97
99
tip , _ = client .query_network_tip .execute ()
98
100
return tip
99
101
100
102
def _query_utxos_by_address (self , address : Address ) -> List [OgmiosUtxo ]:
101
- with OgmiosClient (self .host , self .port , self .secure ) as client :
103
+ with OgmiosClient (self .host , self .port , self .path , self . secure ) as client :
102
104
utxos , _ = client .query_utxo .execute ([address ])
103
105
return utxos
104
106
105
107
def _query_utxos_by_tx_id (self , tx_id : str , index : int ) -> List [OgmiosUtxo ]:
106
- with OgmiosClient (self .host , self .port , self .secure ) as client :
108
+ with OgmiosClient (self .host , self .port , self .path , self . secure ) as client :
107
109
utxos , _ = client .query_utxo .execute (
108
110
[OgmiosTxOutputReference (tx_id , index )]
109
111
)
@@ -133,7 +135,7 @@ def protocol_param(self) -> ProtocolParameters:
133
135
return self ._protocol_param
134
136
135
137
def _fetch_protocol_param (self ) -> ProtocolParameters :
136
- with OgmiosClient (self .host , self .port , self .secure ) as client :
138
+ with OgmiosClient (self .host , self .port , self .path , self . secure ) as client :
137
139
protocol_parameters , _ = client .query_protocol_parameters .execute ()
138
140
pyc_protocol_params = ProtocolParameters (
139
141
min_fee_constant = protocol_parameters .min_fee_constant .lovelace ,
@@ -203,7 +205,7 @@ def genesis_param(self) -> GenesisParameters:
203
205
return self ._genesis_param # type: ignore[return-value]
204
206
205
207
def _fetch_genesis_param (self ) -> OgmiosGenesisParameters :
206
- with OgmiosClient (self .host , self .port , self .secure ) as client :
208
+ with OgmiosClient (self .host , self .port , self .path , self . secure ) as client :
207
209
return OgmiosGenesisParameters (client , self ._query_current_era ())
208
210
209
211
@property
@@ -308,13 +310,13 @@ def utxo_by_tx_id(self, tx_id: str, index: int) -> Optional[UTxO]:
308
310
def submit_tx_cbor (self , cbor : Union [bytes , str ]):
309
311
if isinstance (cbor , bytes ):
310
312
cbor = cbor .hex ()
311
- with OgmiosClient (self .host , self .port , self .secure ) as client :
313
+ with OgmiosClient (self .host , self .port , self .path , self . secure ) as client :
312
314
client .submit_transaction .execute (cbor )
313
315
314
316
def evaluate_tx_cbor (self , cbor : Union [bytes , str ]) -> Dict [str , ExecutionUnits ]:
315
317
if isinstance (cbor , bytes ):
316
318
cbor = cbor .hex ()
317
- with OgmiosClient (self .host , self .port , self .secure ) as client :
319
+ with OgmiosClient (self .host , self .port , self .path , self . secure ) as client :
318
320
result , _ = client .evaluate_transaction .execute (cbor )
319
321
result_dict = {}
320
322
for res in result :
@@ -363,6 +365,7 @@ class OgmiosChainContext(OgmiosV6ChainContext):
363
365
def KupoOgmiosV6ChainContext (
364
366
host : str ,
365
367
port : int ,
368
+ path : str ,
366
369
secure : bool ,
367
370
refetch_chain_tip_interval : Optional [float ] = None ,
368
371
utxo_cache_size : int = 10000 ,
@@ -374,6 +377,7 @@ def KupoOgmiosV6ChainContext(
374
377
OgmiosV6ChainContext (
375
378
host ,
376
379
port ,
380
+ path ,
377
381
secure ,
378
382
refetch_chain_tip_interval ,
379
383
utxo_cache_size ,
0 commit comments