Skip to content

Commit aa191ae

Browse files
authored
Merge pull request #228 from InjectiveLabs/fix/fix_testnet_urls
fix/fix testnet urls'
2 parents f4db6f2 + 2fb5da4 commit aa191ae

File tree

3 files changed

+72
-69
lines changed

3 files changed

+72
-69
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ make tests
8787
```
8888

8989
### Changelogs
90+
**0.7.1.1**
91+
* Fixed Testnet network URLs
92+
9093
**0.7.1**
9194
* Include implementation of the MessageBroadcaster, to simplify the transaction creation and broadcasting process.
9295

pyinjective/constant.py

Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
MAX_MEMO_CHARACTERS = 256
77

88
devnet_config = ConfigParser()
9-
devnet_config.read(os.path.join(os.path.dirname(__file__), 'denoms_devnet.ini'))
9+
devnet_config.read(os.path.join(os.path.dirname(__file__), "denoms_devnet.ini"))
1010

1111
testnet_config = ConfigParser()
12-
testnet_config.read(os.path.join(os.path.dirname(__file__), 'denoms_testnet.ini'))
12+
testnet_config.read(os.path.join(os.path.dirname(__file__), "denoms_testnet.ini"))
1313

1414
mainnet_config = ConfigParser()
15-
mainnet_config.read(os.path.join(os.path.dirname(__file__), 'denoms_mainnet.ini'))
15+
mainnet_config.read(os.path.join(os.path.dirname(__file__), "denoms_mainnet.ini"))
1616

1717
class Denom:
1818
def __init__(
@@ -31,32 +31,32 @@ def __init__(
3131

3232
@classmethod
3333
def load_market(cls, network, market_id):
34-
if network == 'devnet':
34+
if network == "devnet":
3535
config = devnet_config
36-
elif network == 'testnet':
36+
elif network == "testnet":
3737
config = testnet_config
3838
else:
3939
config =mainnet_config
4040

4141
return cls(
42-
description=config[market_id]['description'],
43-
base=int(config[market_id]['base']),
44-
quote=int(config[market_id]['quote']),
45-
min_price_tick_size=float(config[market_id]['min_price_tick_size']),
46-
min_quantity_tick_size=float(config[market_id]['min_quantity_tick_size']),
42+
description=config[market_id]["description"],
43+
base=int(config[market_id]["base"]),
44+
quote=int(config[market_id]["quote"]),
45+
min_price_tick_size=float(config[market_id]["min_price_tick_size"]),
46+
min_quantity_tick_size=float(config[market_id]["min_quantity_tick_size"]),
4747
)
4848

4949
@classmethod
5050
def load_peggy_denom(cls, network, symbol):
51-
if network == 'devnet':
51+
if network == "devnet":
5252
config = devnet_config
53-
elif network == 'local':
53+
elif network == "local":
5454
config = devnet_config
55-
elif network == 'testnet':
55+
elif network == "testnet":
5656
config = testnet_config
5757
else:
5858
config = mainnet_config
59-
return config[symbol]['peggy_denom'], int(config[symbol]['decimals'])
59+
return config[symbol]["peggy_denom"], int(config[symbol]["decimals"])
6060

6161

6262
class Network:
@@ -83,14 +83,14 @@ def __init__(
8383
@classmethod
8484
def devnet(cls):
8585
return cls(
86-
lcd_endpoint='https://devnet.lcd.injective.dev',
87-
tm_websocket_endpoint='wss://devnet.tm.injective.dev/websocket',
88-
grpc_endpoint='devnet.injective.dev:9900',
89-
grpc_exchange_endpoint='devnet.injective.dev:9910',
90-
grpc_explorer_endpoint='devnet.injective.dev:9911',
91-
chain_id='injective-777',
92-
fee_denom='inj',
93-
env='devnet'
86+
lcd_endpoint="https://devnet.lcd.injective.dev",
87+
tm_websocket_endpoint="wss://devnet.tm.injective.dev/websocket",
88+
grpc_endpoint="devnet.injective.dev:9900",
89+
grpc_exchange_endpoint="devnet.injective.dev:9910",
90+
grpc_explorer_endpoint="devnet.injective.dev:9911",
91+
chain_id="injective-777",
92+
fee_denom="inj",
93+
env="devnet"
9494
)
9595

9696
@classmethod
@@ -100,78 +100,78 @@ def testnet(cls, node="lb"):
100100
"sentry",
101101
]
102102
if node not in nodes:
103-
raise ValueError('Must be one of {}'.format(nodes))
104-
105-
if node == 'lb':
106-
lcd_endpoint = 'https://k8s.testnet.lcd.injective.network',
107-
tm_websocket_endpoint = 'wss://k8s.testnet.tm.injective.network/websocket',
108-
grpc_endpoint = 'k8s.testnet.chain.grpc.injective.network:443',
109-
grpc_exchange_endpoint = 'k8s.testnet.exchange.grpc.injective.network:443',
110-
grpc_explorer_endpoint = 'k8s.testnet.explorer.grpc.injective.network:443',
103+
raise ValueError("Must be one of {}".format(nodes))
104+
105+
if node == "lb":
106+
lcd_endpoint = "https://k8s.testnet.lcd.injective.network"
107+
tm_websocket_endpoint = "wss://k8s.testnet.tm.injective.network/websocket"
108+
grpc_endpoint = "k8s.testnet.chain.grpc.injective.network:443"
109+
grpc_exchange_endpoint = "k8s.testnet.exchange.grpc.injective.network:443"
110+
grpc_explorer_endpoint = "k8s.testnet.explorer.grpc.injective.network:443"
111111
else:
112-
lcd_endpoint = 'https://testnet.lcd.injective.network'
113-
tm_websocket_endpoint = 'wss://testnet.tm.injective.network/websocket'
114-
grpc_endpoint = 'testnet.chain.grpc.injective.network'
115-
grpc_exchange_endpoint = 'testnet.exchange.grpc.injective.network'
116-
grpc_explorer_endpoint = 'testnet.explorer.grpc.injective.network'
112+
lcd_endpoint = "https://testnet.lcd.injective.network"
113+
tm_websocket_endpoint = "wss://testnet.tm.injective.network/websocket"
114+
grpc_endpoint = "testnet.chain.grpc.injective.network"
115+
grpc_exchange_endpoint = "testnet.exchange.grpc.injective.network"
116+
grpc_explorer_endpoint = "testnet.explorer.grpc.injective.network"
117117

118118
return cls(
119119
lcd_endpoint=lcd_endpoint,
120120
tm_websocket_endpoint=tm_websocket_endpoint,
121121
grpc_endpoint=grpc_endpoint,
122122
grpc_exchange_endpoint=grpc_exchange_endpoint,
123123
grpc_explorer_endpoint=grpc_explorer_endpoint,
124-
chain_id='injective-888',
125-
fee_denom='inj',
126-
env='testnet'
124+
chain_id="injective-888",
125+
fee_denom="inj",
126+
env="testnet"
127127
)
128128

129129
@classmethod
130-
def mainnet(cls, node='lb'):
130+
def mainnet(cls, node="lb"):
131131
nodes = [
132-
'lb', # us, asia, prod
133-
'sentry0', # ca, prod
134-
'sentry1', # ca, prod
135-
'sentry3', # us, prod
132+
"lb", # us, asia, prod
133+
"sentry0", # ca, prod
134+
"sentry1", # ca, prod
135+
"sentry3", # us, prod
136136
]
137137
if node not in nodes:
138-
raise ValueError('Must be one of {}'.format(nodes))
139-
140-
if node == 'lb':
141-
lcd_endpoint = 'https://k8s.global.mainnet.lcd.injective.network:443'
142-
tm_websocket_endpoint = 'wss://k8s.global.mainnet.tm.injective.network:443/websocket'
143-
grpc_endpoint = 'k8s.global.mainnet.chain.grpc.injective.network:443'
144-
grpc_exchange_endpoint = 'k8s.global.mainnet.exchange.grpc.injective.network:443'
145-
grpc_explorer_endpoint = 'k8s.global.mainnet.explorer.grpc.injective.network:443'
138+
raise ValueError("Must be one of {}".format(nodes))
139+
140+
if node == "lb":
141+
lcd_endpoint = "https://k8s.global.mainnet.lcd.injective.network:443"
142+
tm_websocket_endpoint = "wss://k8s.global.mainnet.tm.injective.network:443/websocket"
143+
grpc_endpoint = "k8s.global.mainnet.chain.grpc.injective.network:443"
144+
grpc_exchange_endpoint = "k8s.global.mainnet.exchange.grpc.injective.network:443"
145+
grpc_explorer_endpoint = "k8s.global.mainnet.explorer.grpc.injective.network:443"
146146
else:
147-
lcd_endpoint=f'http://{node}.injective.network:10337'
148-
tm_websocket_endpoint=f'ws://{node}.injective.network:26657/websocket'
149-
grpc_endpoint=f'{node}.injective.network:9900'
150-
grpc_exchange_endpoint=f'{node}.injective.network:9910'
151-
grpc_explorer_endpoint=f'{node}.injective.network:9911'
147+
lcd_endpoint = f"http://{node}.injective.network:10337"
148+
tm_websocket_endpoint = f"ws://{node}.injective.network:26657/websocket"
149+
grpc_endpoint = f"{node}.injective.network:9900"
150+
grpc_exchange_endpoint = f"{node}.injective.network:9910"
151+
grpc_explorer_endpoint = f"{node}.injective.network:9911"
152152

153153
return cls(
154154
lcd_endpoint=lcd_endpoint,
155155
tm_websocket_endpoint=tm_websocket_endpoint,
156156
grpc_endpoint=grpc_endpoint,
157157
grpc_exchange_endpoint=grpc_exchange_endpoint,
158158
grpc_explorer_endpoint=grpc_explorer_endpoint,
159-
chain_id='injective-1',
160-
fee_denom='inj',
161-
env='mainnet'
159+
chain_id="injective-1",
160+
fee_denom="inj",
161+
env="mainnet"
162162
)
163163

164164
@classmethod
165165
def local(cls):
166166
return cls(
167-
lcd_endpoint='http://localhost:10337',
168-
tm_websocket_endpoint='ws://localhost:26657/websocket',
169-
grpc_endpoint='localhost:9900',
170-
grpc_exchange_endpoint='localhost:9910',
171-
grpc_explorer_endpoint='localhost:9911',
172-
chain_id='injective-1',
173-
fee_denom='inj',
174-
env='local'
167+
lcd_endpoint="http://localhost:10337",
168+
tm_websocket_endpoint="ws://localhost:26657/websocket",
169+
grpc_endpoint="localhost:9900",
170+
grpc_exchange_endpoint="localhost:9910",
171+
grpc_explorer_endpoint="localhost:9911",
172+
chain_id="injective-1",
173+
fee_denom="inj",
174+
env="local"
175175
)
176176

177177
@classmethod
@@ -183,7 +183,7 @@ def custom(cls, lcd_endpoint, tm_websocket_endpoint, grpc_endpoint, grpc_exchang
183183
grpc_exchange_endpoint=grpc_exchange_endpoint,
184184
grpc_explorer_endpoint=grpc_explorer_endpoint,
185185
chain_id=chain_id,
186-
fee_denom='inj',
186+
fee_denom="inj",
187187
env=env
188188
)
189189

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
1818
AUTHOR = "Injective Labs"
1919
REQUIRES_PYTHON = ">=3.9"
20-
VERSION = "0.7.1"
20+
VERSION = "0.7.1.1"
2121

2222
REQUIRED = [
2323
"aiohttp",

0 commit comments

Comments
 (0)