Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

Commit

Permalink
add version and windows fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Bucky Kittinger committed Jul 22, 2022
1 parent 859b7d4 commit 11d2899
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* text=auto
*.sh text eol=lf
File renamed without changes.
41 changes: 41 additions & 0 deletions Dockerfile.win
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# syntax=docker/dockerfile:1
FROM ubuntu:20.04

ARG USER_ID
ARG GROUP_ID

RUN apt-get update
RUN apt-get update --fix-missing
RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata
RUN apt-get -y install zip unzip libncurses5 wget git build-essential cmake curl libboost-all-dev libcurl4-openssl-dev libgmp-dev libssl-dev libusb-1.0.0-dev libzstd-dev time pkg-config llvm-11-dev nginx npm yarn jq gdb lldb
RUN npm install -D webpack-cli
RUN npm install -D webpack
RUN npm install -D webpack-dev-server

WORKDIR /app

COPY ./scripts/ .
RUN chmod +x bootstrap_env.sh
RUN chmod +x start_node.sh
RUN chmod +x setup_system.sh
RUN chmod +x write_context.sh
RUN mv my_init /sbin

RUN ./bootstrap_env.sh
RUN ./setup_system.sh

RUN mkdir /home/www-data/nodes
RUN cp /app/config.ini /home/www-data/config.ini

# thanks to github.com/phusion
# this should solve reaping issues of stopped nodes
CMD ["/sbin/my_init"]

# port for nodeos p2p
EXPOSE 9876
# port for nodeos http
EXPOSE 8888
# port for state history
EXPOSE 8080
# port for webapp
EXPOSE 8000
2 changes: 1 addition & 1 deletion bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ GROUP_ID=$(id -g ${USER})
if [[ $(uname) == "Darwin" ]]; then
GROUP_ID=200
fi
docker build --no-cache --build-arg USER_ID=$(id -u ${USER}) --build-arg GROUP_ID=${GROUP_ID} -t dune $SDIR
docker build --no-cache --build-arg USER_ID=$(id -u ${USER}) --build-arg GROUP_ID=${GROUP_ID} -f Dockerfile.unix -t dune $SDIR
4 changes: 4 additions & 0 deletions src/dune/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from dune import node
from dune import dune_error
from dune import dune_node_not_found
from dune import version_full
from args import arg_parser
from args import parse_optional

Expand Down Expand Up @@ -128,6 +129,9 @@
elif args.get_table != None:
dune_sys.get_table(args.get_table[0], args.get_table[1], args.get_table[2])

elif args.version:
print ("DUNE "+version_full())

except KeyboardInterrupt:
pass
except dune_node_not_found as err:
Expand Down
1 change: 1 addition & 0 deletions src/dune/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def __init__(self):
self._parser.add_argument('--get-table', nargs=3, metavar=["ACCOUNT", "SCOPE", "TABLE"], help='get the data from the given table')
self._parser.add_argument('--activate-feature', metavar=["CODENAME"], help='active protocol feature')
self._parser.add_argument('--list-features', action='store_true', help='list available protocol feature code names')
self._parser.add_argument('--version', action='store_true', help='display the current version of DUNE')
self._parser.add_argument('remainder', nargs=argparse.REMAINDER) # used to store arguments to individual programs, starting with --
#TODO readdress after the launch
#self._parser.add_argument('--start-webapp', metavar=["DIR"], help='start a webapp with ')
Expand Down
12 changes: 12 additions & 0 deletions src/dune/dune.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@
from context import context

import os, platform, getpass

# VERSION INFORMATION
def version_major():
return 1
def version_minor():
return 0
def version_patch():
return 0
def version_suffix():
return "rc1"
def version_full():
return "v"+str(version_major())+"."+str(version_minor())+"."+str(version_patch())+"."+version_suffix()
class dune_error(Exception):
pass
class dune_node_not_found(dune_error):
Expand Down

0 comments on commit 11d2899

Please sign in to comment.