From 0577d83a0933079889a01f6b5e88245828f1a4da Mon Sep 17 00:00:00 2001 From: Eyob Yirdaw Date: Thu, 22 Aug 2019 16:51:31 +0300 Subject: [PATCH 1/2] mods for deploying serivce on new beta --- .gitignore | 1 - Docker/Dockerfile | 16 +++++++++-- Docker/daemons/snetd_topic_kovan.json | 33 +++++++++++++++++++++++ Docker/daemons/snetd_topic_mainnet.json | 33 +++++++++++++++++++++++ Docker/daemons/snetd_topic_mainnet_2.json | 23 ++++++++++++++++ Docker/daemons/snetd_topic_ropsten.json | 33 +++++++++++++++++++++++ Docker/supervisor/mainnetd_2.conf | 20 ++++++++++++++ 7 files changed, 156 insertions(+), 3 deletions(-) create mode 100644 Docker/daemons/snetd_topic_kovan.json create mode 100644 Docker/daemons/snetd_topic_mainnet.json create mode 100644 Docker/daemons/snetd_topic_mainnet_2.json create mode 100644 Docker/daemons/snetd_topic_ropsten.json create mode 100644 Docker/supervisor/mainnetd_2.conf diff --git a/.gitignore b/.gitignore index d96a1d8..115deb1 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,3 @@ plsa-service/plsa/_plsa.c service_spec/__pycache__/ service_spec/topic_analysis_pb2.py service_spec/topic_analysis_pb2_grpc.py -Docker/daemons/*.* diff --git a/Docker/Dockerfile b/Docker/Dockerfile index 4cd1ced..800e5fb 100644 --- a/Docker/Dockerfile +++ b/Docker/Dockerfile @@ -70,6 +70,7 @@ RUN mkdir /home/top/pay/ \ /home/top/daemons/kovan/ \ /home/top/daemons/ropsten/ \ /home/top/daemons/mainnet/ \ + /home/top/daemons/mainnet_2/ \ /home/top/dep/ \ /home/top/dep/appData/ \ /home/top/dep/appData/plsa/ \ @@ -86,7 +87,16 @@ RUN wget -O snet-daemon.tar.gz https://github.com/singnet/snet-daemon/releases/d tar --strip-components=1 -xzf snet-daemon.tar.gz && \ cp snetd /home/top/daemons/kovan/ && \ cp snetd /home/top/daemons/ropsten/ && \ - cp snetd /home/top/daemons/mainnet/ + cp snetd /home/top/daemons/mainnet/ && \ + rm -r snet-daemon.tar.gz && \ + rm snetd + + +ENV DAEMON_VERSION_2 2.0.2 + +RUN wget -O snet-daemon.tar.gz https://github.com/singnet/snet-daemon/releases/download/v$DAEMON_VERSION_2/snet-daemon-v$DAEMON_VERSION_2-linux-amd64.tar.gz && \ + tar --strip-components=1 -xzf snet-daemon.tar.gz && \ + cp snetd /home/top/daemons/mainnet_2/ RUN echo 37 @@ -94,10 +104,12 @@ RUN echo 37 COPY daemons/snetd_topic_kovan.json /home/top/daemons/kovan/ COPY daemons/snetd_topic_ropsten.json /home/top/daemons/ropsten/ COPY daemons/snetd_topic_mainnet.json /home/top/daemons/mainnet/ +COPY daemons/snetd_topic_mainnet_2.json /home/top/daemons/mainnet_2/ COPY gunicorn/config.py /home/top/gunicorn/ -COPY supervisor/kovand.conf /etc/supervisor/conf.d/ +#COPY supervisor/kovand.conf /etc/supervisor/conf.d/ COPY supervisor/ropstend.conf /etc/supervisor/conf.d/ COPY supervisor/mainnetd.conf /etc/supervisor/conf.d/ +COPY supervisor/mainnetd_2.conf /etc/supervisor/conf.d/ COPY supervisor/topic_grpc.conf /etc/supervisor/conf.d/ COPY supervisor/topic_rest.conf /etc/supervisor/conf.d/ COPY supervisor/supervisord.conf /etc/supervisor/ diff --git a/Docker/daemons/snetd_topic_kovan.json b/Docker/daemons/snetd_topic_kovan.json new file mode 100644 index 0000000..f4c796f --- /dev/null +++ b/Docker/daemons/snetd_topic_kovan.json @@ -0,0 +1,33 @@ +{ + "DAEMON_END_POINT": "0.0.0.0:2300", + "ETHEREUM_JSON_RPC_ENDPOINT": "https://kovan.infura.io", + "IPFS_END_POINT": "http://ipfs.singularitynet.io:80", + "REGISTRY_ADDRESS_KEY": "0xe331bf20044a5b24c1a744abc90c1fd711d2c08d", + "PASSTHROUGH_ENABLED": true, + "PASSTHROUGH_ENDPOINT": "http://127.0.0.1:5000", + "ORGANIZATION_ID": "snet", + "SERVICE_ID": "topic-analysis", + "ssl_cert": "/etc/letsencrypt/live/tz-services-1.snet.sh/fullchain.pem", + "ssl_key": "/etc/letsencrypt/live/tz-services-1.snet.sh/privkey.pem", + "PAYMENT_CHANNEL_STORAGE_SERVER": { + "id":"st1", + "host" : "127.0.0.1", + "client_port": 2379, + "peer_port": 2380, + "token": "unique-token", + "enabled": true, + "cluster": "st1=http://127.0.0.1:2380", + "DATA_DIR": "/home/top/pay/kovan/" + }, + "payment_channel_storage_client": { + "connection_timeout": "5s", + "request_timeout": "3s", + "endpoints": ["http://127.0.0.1:2379"] + }, + "LOG": { + "LEVEL": "debug", + "OUTPUT": { + "TYPE": "stdout" + } + } +} diff --git a/Docker/daemons/snetd_topic_mainnet.json b/Docker/daemons/snetd_topic_mainnet.json new file mode 100644 index 0000000..66ca055 --- /dev/null +++ b/Docker/daemons/snetd_topic_mainnet.json @@ -0,0 +1,33 @@ +{ + "DAEMON_END_POINT": "0.0.0.0:2333", + "ETHEREUM_JSON_RPC_ENDPOINT": "https://mainnet.infura.io", + "IPFS_END_POINT": "http://ipfs.singularitynet.io:80", + "REGISTRY_ADDRESS_KEY": "0xb3180a92e210b45e3447976a412ac0df859febaf", + "PASSTHROUGH_ENABLED": true, + "PASSTHROUGH_ENDPOINT": "http://127.0.0.1:5000", + "ORGANIZATION_ID": "snet", + "SERVICE_ID": "topic-analysis", + "ssl_cert": "/etc/letsencrypt/live/tz-services-1.snet.sh/fullchain.pem", + "ssl_key": "/etc/letsencrypt/live/tz-services-1.snet.sh/privkey.pem", + "PAYMENT_CHANNEL_STORAGE_SERVER": { + "id":"st3", + "host" : "127.0.0.1", + "client_port": 2399, + "peer_port": 2390, + "token": "unique-token", + "enabled": true, + "cluster": "st3=http://127.0.0.1:2390", + "DATA_DIR": "/home/top/pay/mainnet/" + }, + "payment_channel_storage_client": { + "connection_timeout": "5s", + "request_timeout": "3s", + "endpoints": ["http://127.0.0.1:2399"] + }, + "LOG": { + "LEVEL": "debug", + "OUTPUT": { + "TYPE": "stdout" + } + } +} diff --git a/Docker/daemons/snetd_topic_mainnet_2.json b/Docker/daemons/snetd_topic_mainnet_2.json new file mode 100644 index 0000000..ea028fc --- /dev/null +++ b/Docker/daemons/snetd_topic_mainnet_2.json @@ -0,0 +1,23 @@ +{ + "DAEMON_END_POINT": "0.0.0.0:2300", + "IPFS_END_POINT": "http://ipfs.singularitynet.io:80", + "PASSTHROUGH_ENABLED": true, + "PASSTHROUGH_ENDPOINT": "http://127.0.0.1:5000", + "ORGANIZATION_ID": "snet", + "SERVICE_ID": "topic-analysis", + "ssl_cert": "/etc/letsencrypt/live/tz-services-1.snet.sh/fullchain.pem", + "ssl_key": "/etc/letsencrypt/live/tz-services-1.snet.sh/privkey.pem", + "payent_channel_cert_path": "/ssl/client.pem", + "payent_channel_ca_path": "/ssl/ca.pem", + "payent_channel_key_path": "/ssl/client-key.pem", + "free_call_signer_address":"0x3Bb9b2499c283cec176e7C707Ecb495B7a961ebf", + "blockchain_network_selected": "main", + "metering_end_point": "https://mainnet-marketplace.singularitynet.io/metering", + "pvt_key_for_metering": "12d4f860df6466c2f0b5619176134b17a26c90989d1bf2d4a110d42028422cd6", + "LOG": { + "LEVEL": "debug", + "OUTPUT": { + "TYPE": "stdout" + } + } +} diff --git a/Docker/daemons/snetd_topic_ropsten.json b/Docker/daemons/snetd_topic_ropsten.json new file mode 100644 index 0000000..c41b112 --- /dev/null +++ b/Docker/daemons/snetd_topic_ropsten.json @@ -0,0 +1,33 @@ +{ + "DAEMON_END_POINT": "0.0.0.0:2301", + "ETHEREUM_JSON_RPC_ENDPOINT": "https://ropsten.infura.io", + "IPFS_END_POINT": "http://ipfs.singularitynet.io:80", + "REGISTRY_ADDRESS_KEY": "0x5156fde2ca71da4398f8c76763c41bc9633875e4", + "PASSTHROUGH_ENABLED": true, + "PASSTHROUGH_ENDPOINT": "http://127.0.0.1:5000", + "ORGANIZATION_ID": "snet", + "SERVICE_ID": "topic-analysis", + "ssl_cert": "/etc/letsencrypt/live/tz-services-1.snet.sh/fullchain.pem", + "ssl_key": "/etc/letsencrypt/live/tz-services-1.snet.sh/privkey.pem", + "PAYMENT_CHANNEL_STORAGE_SERVER": { + "id":"st2", + "host" : "127.0.0.1", + "client_port": 2387, + "peer_port": 2388, + "token": "unique-token", + "enabled": true, + "cluster": "st2=http://127.0.0.1:2388", + "DATA_DIR": "/home/top/pay/ropsten/" + }, + "payment_channel_storage_client": { + "connection_timeout": "5s", + "request_timeout": "3s", + "endpoints": ["http://127.0.0.1:2387"] + }, + "LOG": { + "LEVEL": "debug", + "OUTPUT": { + "TYPE": "stdout" + } + } +} diff --git a/Docker/supervisor/mainnetd_2.conf b/Docker/supervisor/mainnetd_2.conf new file mode 100644 index 0000000..56607a3 --- /dev/null +++ b/Docker/supervisor/mainnetd_2.conf @@ -0,0 +1,20 @@ +[supervisord] +logfile=/dev/null +nodaemon=true + +[program:mainnetd_2] +command=/home/top/daemons/mainnet_2/snetd serve --config /home/top/daemons/mainnet_2/snetd_topic_mainnet_2.json +;directory=/home/top/daemons/mainnet +user=root +autostart=true +autorestart=true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +redirect_stderr=true +;stderr_logfile=/var/log/mainnet/err.log +;stdout_logfile=/var/log/mainnet/out.log +;redirect_stderr=true +;stdout_logfile_maxbytes=10MB +;stdout_logfile_backups=100 +;stderr_logfile_maxbytes=10MB +;stderr_logfile_backups=100 From 55194c33e502b9da91d2c04dd8061f8fcd79c742 Mon Sep 17 00:00:00 2001 From: Eyob Yirdaw Date: Fri, 23 Aug 2019 16:18:17 +0300 Subject: [PATCH 2/2] added ssl info to daemon --- Docker/daemons/snetd_topic_mainnet_2.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Docker/daemons/snetd_topic_mainnet_2.json b/Docker/daemons/snetd_topic_mainnet_2.json index ea028fc..1ffa355 100644 --- a/Docker/daemons/snetd_topic_mainnet_2.json +++ b/Docker/daemons/snetd_topic_mainnet_2.json @@ -7,9 +7,9 @@ "SERVICE_ID": "topic-analysis", "ssl_cert": "/etc/letsencrypt/live/tz-services-1.snet.sh/fullchain.pem", "ssl_key": "/etc/letsencrypt/live/tz-services-1.snet.sh/privkey.pem", - "payent_channel_cert_path": "/ssl/client.pem", - "payent_channel_ca_path": "/ssl/ca.pem", - "payent_channel_key_path": "/ssl/client-key.pem", + "payent_channel_cert_path": "/home/top/ssl/client.pem", + "payent_channel_ca_path": "/home/top/ssl/ca.pem", + "payent_channel_key_path": "/home/top/ssl/client-key.pem", "free_call_signer_address":"0x3Bb9b2499c283cec176e7C707Ecb495B7a961ebf", "blockchain_network_selected": "main", "metering_end_point": "https://mainnet-marketplace.singularitynet.io/metering",