-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
148 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
poetry run python -m snapshotter.snapshotter_id_ping | ||
ret_status=$? | ||
|
||
if [ $ret_status -ne 0 ]; then | ||
echo "Snapshotter identity check failed on protocol smart contract" | ||
exit 1 | ||
fi | ||
echo 'starting processes...'; | ||
pm2 start pm2.config.js | ||
|
||
# Waiting for other processes to start | ||
echo 'waiting for processes to start..'; | ||
sleep 10 | ||
|
||
poetry run python -m snapshotter.processhub_cmd start ProcessorDistributor | ||
sleep 3 | ||
|
||
poetry run python -m snapshotter.processhub_cmd start SystemEventDetector | ||
|
||
echo 'started all snapshotter scripts'; | ||
|
||
pm2 logs --lines 1000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
poetry run python -m snapshotter.snapshotter_id_ping | ||
ret_status=$? | ||
|
||
if [ $ret_status -ne 0 ]; then | ||
echo "Snapshotter identity check failed on protocol smart contract" | ||
exit 1 | ||
fi | ||
|
||
echo 'starting processes...'; | ||
pm2 start pm2.config.js | ||
|
||
# Waiting for other processes to start | ||
echo 'waiting for processes to start..'; | ||
sleep 10 | ||
|
||
poetry run python -m snapshotter.processhub_cmd start ProcessorDistributor | ||
sleep 3 | ||
|
||
poetry run python -m snapshotter.processhub_cmd start SystemEventDetector | ||
|
||
echo 'started all snapshotter scripts'; | ||
|
||
pm2 logs --lines 1000 |
99 changes: 99 additions & 0 deletions
99
snapshotter/utils/models/proto/snapshot_submission/submission_pb2_grpc.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! | ||
"""Client and server classes corresponding to protobuf-defined services.""" | ||
import grpc | ||
|
||
from snapshotter.utils.models.proto.snapshot_submission import submission_pb2 as snapshotter_dot_utils_dot_models_dot_proto_dot_snapshot__submission_dot_submission__pb2 | ||
|
||
|
||
class SubmissionStub(object): | ||
"""Missing associated documentation comment in .proto file.""" | ||
|
||
def __init__(self, channel): | ||
"""Constructor. | ||
Args: | ||
channel: A grpc.Channel. | ||
""" | ||
self.SubmitSnapshotSimulation = channel.stream_stream( | ||
'/submission.Submission/SubmitSnapshotSimulation', | ||
request_serializer=snapshotter_dot_utils_dot_models_dot_proto_dot_snapshot__submission_dot_submission__pb2.SnapshotSubmission.SerializeToString, | ||
response_deserializer=snapshotter_dot_utils_dot_models_dot_proto_dot_snapshot__submission_dot_submission__pb2.SubmissionResponse.FromString, | ||
) | ||
self.SubmitSnapshot = channel.stream_unary( | ||
'/submission.Submission/SubmitSnapshot', | ||
request_serializer=snapshotter_dot_utils_dot_models_dot_proto_dot_snapshot__submission_dot_submission__pb2.SnapshotSubmission.SerializeToString, | ||
response_deserializer=snapshotter_dot_utils_dot_models_dot_proto_dot_snapshot__submission_dot_submission__pb2.SubmissionResponse.FromString, | ||
) | ||
|
||
|
||
class SubmissionServicer(object): | ||
"""Missing associated documentation comment in .proto file.""" | ||
|
||
def SubmitSnapshotSimulation(self, request_iterator, context): | ||
"""Missing associated documentation comment in .proto file.""" | ||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) | ||
context.set_details('Method not implemented!') | ||
raise NotImplementedError('Method not implemented!') | ||
|
||
def SubmitSnapshot(self, request_iterator, context): | ||
"""Missing associated documentation comment in .proto file.""" | ||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) | ||
context.set_details('Method not implemented!') | ||
raise NotImplementedError('Method not implemented!') | ||
|
||
|
||
def add_SubmissionServicer_to_server(servicer, server): | ||
rpc_method_handlers = { | ||
'SubmitSnapshotSimulation': grpc.stream_stream_rpc_method_handler( | ||
servicer.SubmitSnapshotSimulation, | ||
request_deserializer=snapshotter_dot_utils_dot_models_dot_proto_dot_snapshot__submission_dot_submission__pb2.SnapshotSubmission.FromString, | ||
response_serializer=snapshotter_dot_utils_dot_models_dot_proto_dot_snapshot__submission_dot_submission__pb2.SubmissionResponse.SerializeToString, | ||
), | ||
'SubmitSnapshot': grpc.stream_unary_rpc_method_handler( | ||
servicer.SubmitSnapshot, | ||
request_deserializer=snapshotter_dot_utils_dot_models_dot_proto_dot_snapshot__submission_dot_submission__pb2.SnapshotSubmission.FromString, | ||
response_serializer=snapshotter_dot_utils_dot_models_dot_proto_dot_snapshot__submission_dot_submission__pb2.SubmissionResponse.SerializeToString, | ||
), | ||
} | ||
generic_handler = grpc.method_handlers_generic_handler( | ||
'submission.Submission', rpc_method_handlers) | ||
server.add_generic_rpc_handlers((generic_handler,)) | ||
|
||
|
||
# This class is part of an EXPERIMENTAL API. | ||
class Submission(object): | ||
"""Missing associated documentation comment in .proto file.""" | ||
|
||
@staticmethod | ||
def SubmitSnapshotSimulation(request_iterator, | ||
target, | ||
options=(), | ||
channel_credentials=None, | ||
call_credentials=None, | ||
insecure=False, | ||
compression=None, | ||
wait_for_ready=None, | ||
timeout=None, | ||
metadata=None): | ||
return grpc.experimental.stream_stream(request_iterator, target, '/submission.Submission/SubmitSnapshotSimulation', | ||
snapshotter_dot_utils_dot_models_dot_proto_dot_snapshot__submission_dot_submission__pb2.SnapshotSubmission.SerializeToString, | ||
snapshotter_dot_utils_dot_models_dot_proto_dot_snapshot__submission_dot_submission__pb2.SubmissionResponse.FromString, | ||
options, channel_credentials, | ||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata) | ||
|
||
@staticmethod | ||
def SubmitSnapshot(request_iterator, | ||
target, | ||
options=(), | ||
channel_credentials=None, | ||
call_credentials=None, | ||
insecure=False, | ||
compression=None, | ||
wait_for_ready=None, | ||
timeout=None, | ||
metadata=None): | ||
return grpc.experimental.stream_unary(request_iterator, target, '/submission.Submission/SubmitSnapshot', | ||
snapshotter_dot_utils_dot_models_dot_proto_dot_snapshot__submission_dot_submission__pb2.SnapshotSubmission.SerializeToString, | ||
snapshotter_dot_utils_dot_models_dot_proto_dot_snapshot__submission_dot_submission__pb2.SubmissionResponse.FromString, | ||
options, channel_credentials, | ||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata) |