Skip to content

Commit

Permalink
chore: add untracked files
Browse files Browse the repository at this point in the history
  • Loading branch information
anomit committed Sep 25, 2024
1 parent f8ab8f4 commit 3b8dcc6
Show file tree
Hide file tree
Showing 3 changed files with 148 additions and 0 deletions.
24 changes: 24 additions & 0 deletions init_docker.sh
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
25 changes: 25 additions & 0 deletions init_docker_dev.sh
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
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)

0 comments on commit 3b8dcc6

Please sign in to comment.