Skip to content

Commit

Permalink
Protocol v2.0 (#745)
Browse files Browse the repository at this point in the history
- OT protocol v2.
- OT data layer v2.
- Network layer fixes.
- OT node various fixes.
- Configuration refactor.
- Integration testing framework.
  • Loading branch information
simonovic86 authored and kipliklotrika committed Nov 19, 2018
1 parent afeab21 commit 3111853
Show file tree
Hide file tree
Showing 246 changed files with 19,416 additions and 13,286 deletions.
18 changes: 18 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.DS_Store
.idea
.vscode/*
.env
.nyc_output
.git
.origintrail_noderc
node_modules
keys
data
# postman
# test
node.log
modules/blockchain_interface/ethereum/build/*
modules/Blockchain/Ethereum/build/
hidden_service
modules/Database/system.db
logs
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ IS_BOOTSTRAP_NODE=0

# Sent logs to OriginTrail - TestNet
SEND_LOGS=1
LOGS_LEVEL_DEBUG=1
48 changes: 0 additions & 48 deletions .env.travis

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ node.log
keys
data
modules/blockchain_interface/ethereum/build/*
modules/Blockchain/Ethereum/test/development.test.js
modules/Blockchain/Ethereum/build/
hidden_service
!*.gitkeep
Expand All @@ -28,3 +29,4 @@ Envoy.blade.php
test.*
db_backup/*
newrelic_agent.log
logs/*
7 changes: 7 additions & 0 deletions .origintrail_noderc.travis
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"node_wallet": "0x0556b6d87f011424c7b099040f03ad23774fe7fe",
"node_private_key": "askRadomirIfYouNeedIt",
"database": {
"password": "root"
}
}
28 changes: 6 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,30 @@
language: node_js
node_js:
- "9"
services:
- neo4j
env:
- NODE_ENV=development
sudo: enabled
before_script:
- cp .env.travis .env
- npm run bootstrap
- echo arangodb3 arangodb/password password root | sudo debconf-set-selections # set username 'root'
- echo arangodb3 arangodb/password_again password root | sudo debconf-set-selections # set password 'root'
- chmod +x setup_arangodb.sh
- ./setup_arangodb.sh &> /dev/null
- rm -rf ArangoDB-3.2.2.tar.gz
- cp .origintrail_noderc.travis .origintrail_noderc
- npm run bootstrap
- npm install -g [email protected] &> /dev/null
- npm install -g truffle &> /dev/null
- npm install -g truffle@beta &> /dev/null
script:
- npm run lint
- 'if [ "$TRAVIS_EVENT_TYPE" != "push" ]; then npm run test:bdd; fi'
# checks for arangodb based solution
- npm test 2> mocha-logs.log
- npm start &>arangodb.log &
- sleep 10
- jobs
- kill %1
# make sure previous deamon is really terminated
# - jobs
# - kill $(lsof -t -i:8900)
# switches graph database in .env
# - node switchDatabase.js
# checks for neo4j based solution
# - npm run config > run-config.log
# - npm start &>neo4jdb.log &
# - sleep 10
# - jobs
# - kill %1
- if [ -n "$(jobs -p)" ]; then kill %1; fi
# compile and check Smart Contracts
- ganache-cli -i 5777 -p 7545 -l 10000000 &>ganache.log &
- ganache-cli -i 5777 -p 7545 -l 10000000 -m "aspect ask story desert profit engage tuition leave fade giraffe exclude brief" &>ganache.log &
- cd modules/Blockchain/Ethereum
- truffle test --network test > ../../../truffle-test.log
- rm -rf build && truffle migrate --reset --compile-all --network ganache > ../../../truffle-migrate.log
Expand All @@ -46,12 +34,8 @@ script:
after_script:
- cat mocha-logs.log
- rm -f mocha-logs.log
# - cat run-config.log
# - rm -f run-config.log
- cat arangodb.log
- rm -f arangodb.log
# - cat neo4jdb.log
# - rm -f neo4jdb.log
- cat truffle-test.log
- rm -f truffle-test.log
- cat truffle-migrate.log
Expand Down
22 changes: 9 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#base image
FROM ubuntu:16.04
MAINTAINER OriginTrail
LABEL maintainer="OriginTrail"
ARG targetEnvironment=production

ENV NODE_ENV=production
ENV NODE_ENV=$targetEnvironment
ENV GRANAX_USE_SYSTEM_TOR=1

RUN apt-get -qq update && apt-get -qq -y install curl
RUN curl -sL https://deb.nodesource.com/setup_9.x | bash -
Expand All @@ -19,25 +22,18 @@ RUN apt-get update && apt install -y -qq supervisor
RUN mkdir -p /var/log/supervisor
COPY testnet/supervisord.conf /etc/supervisor/conf.d/supervisord.conf

COPY package.json /tmp/package.json
RUN cd /tmp && npm install
# Add files
COPY . /ot-node
RUN echo '{ "database": { "password": "root" }}' > /ot-node/.origintrail_noderc
RUN service arangodb3 start && cd /ot-node && npm install && npm run setup -- --configDir=/ot-node/data

RUN wget https://github.com/papertrail/remote_syslog2/releases/download/v0.20/remote_syslog_linux_amd64.tar.gz

RUN tar xzf ./remote_syslog_linux_amd64.tar.gz && cd remote_syslog && cp ./remote_syslog /usr/local/bin
ADD testnet/papertrail.yml /etc/log_files.yml

#Clone the project
RUN wget -O ot-node.zip https://codeload.github.com/OriginTrail/ot-node/zip/master
RUN unzip ot-node.zip -d . && rm ot-node.zip && mv ot-node-master ot-node

RUN cp -a /tmp/node_modules /ot-node

WORKDIR /ot-node
RUN mkdir keys data &> /dev/null
RUN cp .env.example .env
COPY testnet/start.sh /ot-node/testnet/start.sh
RUN chmod 400 testnet/start.sh

VOLUME /ot-node /var/lib/arangodb
EXPOSE 5278 8900 3000 3010
CMD ["sh", "/ot-node/testnet/start.sh"]
21 changes: 8 additions & 13 deletions Dockerfile.development
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#base image
FROM ubuntu:16.04
MAINTAINER OriginTrail
LABEL maintainer="OriginTrail"
ARG targetEnvironment=development

ENV NODE_ENV=development
ENV NODE_ENV=$targetEnvironment

RUN apt-get -qq update && apt-get -qq -y install curl
RUN curl -sL https://deb.nodesource.com/setup_9.x | bash -
Expand All @@ -19,25 +21,18 @@ RUN apt-get update && apt install -y -qq supervisor
RUN mkdir -p /var/log/supervisor
COPY testnet/supervisord.conf /etc/supervisor/conf.d/supervisord.conf

COPY package.json /tmp/package.json
RUN cd /tmp && npm install
# Add files
COPY . /ot-node
RUN echo '{ "database": { "password": "root" }}' > /ot-node/.origintrail_noderc
RUN service arangodb3 start && cd /ot-node && npm install && npm run setup -- --configDir=/ot-node/data

RUN wget https://github.com/papertrail/remote_syslog2/releases/download/v0.20/remote_syslog_linux_amd64.tar.gz

RUN tar xzf ./remote_syslog_linux_amd64.tar.gz && cd remote_syslog && cp ./remote_syslog /usr/local/bin
ADD testnet/papertrail.yml /etc/log_files.yml

#Clone the project
RUN wget -O ot-node.zip https://codeload.github.com/OriginTrail/ot-node/zip/development
RUN unzip ot-node.zip -d . && rm ot-node.zip && mv ot-node-development ot-node

RUN cp -a /tmp/node_modules /ot-node

WORKDIR /ot-node
RUN mkdir keys data &> /dev/null
RUN cp .env.example .env
COPY testnet/start.sh /ot-node/testnet/start.sh
RUN chmod 400 testnet/start.sh

VOLUME /ot-node /var/lib/arangodb
EXPOSE 5278 8900 3000 3010
CMD ["sh", "/ot-node/testnet/start.sh"]
39 changes: 39 additions & 0 deletions Dockerfile.mariner
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#base image
FROM ubuntu:16.04
MAINTAINER OriginTrail
LABEL maintainer="OriginTrail"
ARG targetEnvironment=mariner

ENV NODE_ENV=$targetEnvironment
ENV GRANAX_USE_SYSTEM_TOR=1

RUN apt-get -qq update && apt-get -qq -y install curl
RUN curl -sL https://deb.nodesource.com/setup_9.x | bash -
RUN apt-get -qq update && apt-get -qq -y install wget apt-transport-https software-properties-common build-essential git nodejs sqlite unzip nano
RUN add-apt-repository -y ppa:ethereum/ethereum && apt-get -qq update && apt-get install -y -qq ethereum geth
#ArangoDB
ADD testnet/install-arango.sh /install-arango.sh
RUN ["chmod", "+x", "/install-arango.sh"]
RUN /install-arango.sh

RUN export LC_ALL=C

RUN apt-get update && apt install -y -qq supervisor
RUN mkdir -p /var/log/supervisor
COPY testnet/supervisord.conf /etc/supervisor/conf.d/supervisord.conf

# Add files
COPY . /ot-node
RUN echo '{ "database": { "password": "root" }}' > /ot-node/.origintrail_noderc
RUN service arangodb3 start && cd /ot-node && npm install && npm run setup -- --configDir=/ot-node/data

RUN wget https://github.com/papertrail/remote_syslog2/releases/download/v0.20/remote_syslog_linux_amd64.tar.gz
RUN tar xzf ./remote_syslog_linux_amd64.tar.gz && cd remote_syslog && cp ./remote_syslog /usr/local/bin
ADD testnet/papertrail.yml /etc/log_files.yml

WORKDIR /ot-node
RUN chmod 400 testnet/start.sh

VOLUME /ot-node /var/lib/arangodb
EXPOSE 5278 8900 3000
CMD ["sh", "/ot-node/testnet/start.sh"]
21 changes: 8 additions & 13 deletions Dockerfile.stable
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#base image
FROM ubuntu:16.04
MAINTAINER OriginTrail
LABEL maintainer="OriginTrail"
ARG targetEnvironment=stable

ENV NODE_ENV=stable
ENV NODE_ENV=$targetEnvironment

RUN apt-get -qq update && apt-get -qq -y install curl
RUN curl -sL https://deb.nodesource.com/setup_9.x | bash -
Expand All @@ -19,25 +21,18 @@ RUN apt-get update && apt install -y -qq supervisor
RUN mkdir -p /var/log/supervisor
COPY testnet/supervisord.conf /etc/supervisor/conf.d/supervisord.conf

COPY package.json /tmp/package.json
RUN cd /tmp && npm install
# Add files
COPY . /ot-node
RUN echo '{ "database": { "password": "root" }}' > /ot-node/.origintrail_noderc
RUN service arangodb3 start && cd /ot-node && npm install && npm run setup -- --configDir=/ot-node/data

RUN wget https://github.com/papertrail/remote_syslog2/releases/download/v0.20/remote_syslog_linux_amd64.tar.gz

RUN tar xzf ./remote_syslog_linux_amd64.tar.gz && cd remote_syslog && cp ./remote_syslog /usr/local/bin
ADD testnet/papertrail.yml /etc/log_files.yml

#Clone the project
RUN wget -O ot-node.zip https://codeload.github.com/OriginTrail/ot-node/zip/release/stable
RUN unzip ot-node.zip -d . && rm ot-node.zip && mv ot-node-release-stable ot-node

RUN cp -a /tmp/node_modules /ot-node

WORKDIR /ot-node
RUN mkdir keys data &> /dev/null
RUN cp .env.example .env
COPY testnet/start.sh /ot-node/testnet/start.sh
RUN chmod 400 testnet/start.sh

VOLUME /ot-node /var/lib/arangodb
EXPOSE 5278 8900 3000 3010
CMD ["sh", "/ot-node/testnet/start.sh"]
21 changes: 8 additions & 13 deletions Dockerfile.staging
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#base image
FROM ubuntu:16.04
MAINTAINER OriginTrail
LABEL maintainer="OriginTrail"
ARG targetEnvironment=staging

ENV NODE_ENV=staging
ENV NODE_ENV=$targetEnvironment

RUN apt-get -qq update && apt-get -qq -y install curl
RUN curl -sL https://deb.nodesource.com/setup_9.x | bash -
Expand All @@ -19,25 +21,18 @@ RUN apt-get update && apt install -y -qq supervisor
RUN mkdir -p /var/log/supervisor
COPY testnet/supervisord.conf /etc/supervisor/conf.d/supervisord.conf

COPY package.json /tmp/package.json
RUN cd /tmp && npm install
# Add files
COPY . /ot-node
RUN echo '{ "database": { "password": "root" }}' > /ot-node/.origintrail_noderc
RUN service arangodb3 start && cd /ot-node && npm install && npm run setup -- --configDir=/ot-node/data

RUN wget https://github.com/papertrail/remote_syslog2/releases/download/v0.20/remote_syslog_linux_amd64.tar.gz

RUN tar xzf ./remote_syslog_linux_amd64.tar.gz && cd remote_syslog && cp ./remote_syslog /usr/local/bin
ADD testnet/papertrail.yml /etc/log_files.yml

#Clone the project
RUN wget -O ot-node.zip https://codeload.github.com/OriginTrail/ot-node/zip/release/staging
RUN unzip ot-node.zip -d . && rm ot-node.zip && mv ot-node-release-staging ot-node

RUN cp -a /tmp/node_modules /ot-node

WORKDIR /ot-node
RUN mkdir keys data &> /dev/null
RUN cp .env.example .env
COPY testnet/start.sh /ot-node/testnet/start.sh
RUN chmod 400 testnet/start.sh

VOLUME /ot-node /var/lib/arangodb
EXPOSE 5278 8900 3000 3010
CMD ["sh", "/ot-node/testnet/start.sh"]
Loading

0 comments on commit 3111853

Please sign in to comment.