Skip to content

Commit

Permalink
(fix) Removed k8s node support for testnet. Synchronized all proto de…
Browse files Browse the repository at this point in the history
…finitions with the core and indexer versions used in chain v1.22 release. Updated version number and changelog.
  • Loading branch information
abel committed Nov 1, 2023
1 parent 520b793 commit 1f053da
Show file tree
Hide file tree
Showing 10 changed files with 366 additions and 242 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

All notable changes to this project will be documented in this file.

## [0.10.0] - 2023-10-04
## [1.0] - 2023-11-01
### Added
- Added logic to support use of Client Order ID (CID) new identifier in OrderInfo
- New chain stream support

### Changed
- Remove support for `sentry` nodes in mainnet network. The only supported node option in mainnet is `lb`
- Migrated all proto objects dependency to support chain version 1.22
- Moved changelog from the README.md file to its own CHANGELOG.md file
- Remove `aiocron` dependency. Use plain asyncio tasks to solve the timeout height synchronization

Expand Down
29 changes: 9 additions & 20 deletions pyinjective/core/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,30 +248,19 @@ def testnet(cls, node="lb"):
@classmethod
def mainnet(cls, node="lb"):
nodes = [
"lb", # us, asia, prod
"lb_k8s",
"lb",
]
if node not in nodes:
raise ValueError("Must be one of {}".format(nodes))

if node == "lb":
lcd_endpoint = "https://sentry.lcd.injective.network:443"
tm_websocket_endpoint = "wss://sentry.tm.injective.network:443/websocket"
grpc_endpoint = "sentry.chain.grpc.injective.network:443"
grpc_exchange_endpoint = "sentry.exchange.grpc.injective.network:443"
grpc_explorer_endpoint = "sentry.explorer.grpc.injective.network:443"
chain_stream_endpoint = "sentry.chain.stream.injective.network:443"
cookie_assistant = BareMetalLoadBalancedCookieAssistant()
use_secure_connection = True
else:
lcd_endpoint = "https://k8s.global.mainnet.lcd.injective.network:443"
tm_websocket_endpoint = "wss://k8s.global.mainnet.tm.injective.network:443/websocket"
grpc_endpoint = "k8s.global.mainnet.chain.grpc.injective.network:443"
grpc_exchange_endpoint = "k8s.global.mainnet.exchange.grpc.injective.network:443"
grpc_explorer_endpoint = "k8s.global.mainnet.explorer.grpc.injective.network:443"
chain_stream_endpoint = "k8s.global.mainnet.chain.stream.injective.network:443"
cookie_assistant = KubernetesLoadBalancedCookieAssistant()
use_secure_connection = True
lcd_endpoint = "https://sentry.lcd.injective.network:443"
tm_websocket_endpoint = "wss://sentry.tm.injective.network:443/websocket"
grpc_endpoint = "sentry.chain.grpc.injective.network:443"
grpc_exchange_endpoint = "sentry.exchange.grpc.injective.network:443"
grpc_explorer_endpoint = "sentry.explorer.grpc.injective.network:443"
chain_stream_endpoint = "sentry.chain.stream.injective.network:443"
cookie_assistant = BareMetalLoadBalancedCookieAssistant()
use_secure_connection = True

Check warning on line 263 in pyinjective/core/network.py

View check run for this annotation

Codecov / codecov/patch

pyinjective/core/network.py#L256-L263

Added lines #L256 - L263 were not covered by tests

return cls(
lcd_endpoint=lcd_endpoint,
Expand Down
48 changes: 19 additions & 29 deletions pyinjective/proto/exchange/event_provider_api_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions pyinjective/proto/exchange/injective_campaign_rpc_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 70 additions & 0 deletions pyinjective/proto/exchange/injective_campaign_rpc_pb2_grpc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc

from exchange import injective_campaign_rpc_pb2 as exchange_dot_injective__campaign__rpc__pb2


class InjectiveCampaignRPCStub(object):
"""InjectiveCampaignRPC defined a gRPC service for Injective Campaigns.
"""

def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.Ranking = channel.unary_unary(
'/injective_campaign_rpc.InjectiveCampaignRPC/Ranking',
request_serializer=exchange_dot_injective__campaign__rpc__pb2.RankingRequest.SerializeToString,
response_deserializer=exchange_dot_injective__campaign__rpc__pb2.RankingResponse.FromString,
)


class InjectiveCampaignRPCServicer(object):
"""InjectiveCampaignRPC defined a gRPC service for Injective Campaigns.
"""

def Ranking(self, request, context):
"""Lists all trading strategies
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')


def add_InjectiveCampaignRPCServicer_to_server(servicer, server):
rpc_method_handlers = {
'Ranking': grpc.unary_unary_rpc_method_handler(
servicer.Ranking,
request_deserializer=exchange_dot_injective__campaign__rpc__pb2.RankingRequest.FromString,
response_serializer=exchange_dot_injective__campaign__rpc__pb2.RankingResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'injective_campaign_rpc.InjectiveCampaignRPC', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))


# This class is part of an EXPERIMENTAL API.
class InjectiveCampaignRPC(object):
"""InjectiveCampaignRPC defined a gRPC service for Injective Campaigns.
"""

@staticmethod
def Ranking(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/injective_campaign_rpc.InjectiveCampaignRPC/Ranking',
exchange_dot_injective__campaign__rpc__pb2.RankingRequest.SerializeToString,
exchange_dot_injective__campaign__rpc__pb2.RankingResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
Loading

0 comments on commit 1f053da

Please sign in to comment.