Skip to content
Snippets Groups Projects
Commit 6f45b138 authored by Éloïs's avatar Éloïs
Browse files

Merge branch 'StartUp' into 'StartUp'

Start up

See merge request !1223
parents 70a1073f 929f3bd3
No related branches found
No related tags found
1 merge request!1223Start up
......@@ -26,27 +26,6 @@ push_to_github:
- mv packed-refs-new packed-refs
- bash -c "git push --force --mirror github 2>&1 | grep -v duniter-gitlab; echo $?"
enforce_readme:
stage: github-sync
variables:
GIT_STRATEGY: none
tags:
- github
before_script:
- ''
script:
- rm -rf ./*
- rm -rf .git
- git clone $GITHUB_URL_AND_KEY .
- git config --global user.email "contact@duniter.org"
- git config --global user.name "Duniter"
- git checkout master
- cat .github/github_disclaimer.md > README.md.new
- cat README.md >> README.md.new
- mv README.md.new README.md
- git commit -am "Enforce github readme"
- git push origin master
test:
stage: test
tags:
......
......@@ -217,7 +217,7 @@ function beginNewProofOfWork(stuff:any) {
****************/
// We wait for a maximum time of `turnDuration`.
// This will trigger the end of the turn by the concurrent race I. During that time, the proof.js script
// just does nothing: this gives of a bit of breath to the CPU. Tthe amount of "breath" depends on the "cpu"
// just does nothing: this gives of a bit of breath to the CPU. The amount of "breath" depends on the "cpu"
// parameter.
await countDown(turnDuration);
}
......
......@@ -16,8 +16,8 @@ export const WS2PDependency = {
cliOptions: [
{ value: '--ws2p-upnp', desc: 'Use UPnP to open remote port.' },
{ value: '--ws2p-noupnp', desc: 'Do not use UPnP to open remote port.' },
{ value: '--ws2p-host <host>', desc: 'Port to listen to.' },
{ value: '--ws2p-port <port>', desc: 'Host to listen to.', parser: (val:string) => parseInt(val) },
{ value: '--ws2p-host <host>', desc: 'Host to listen to.' },
{ value: '--ws2p-port <port>', desc: 'Port to listen to.', parser: (val:string) => parseInt(val) },
{ value: '--ws2p-remote-host <address>', desc: 'Availabily host.' },
{ value: '--ws2p-remote-port <port>', desc: 'Availabily port.', parser: (val:string) => parseInt(val) },
{ value: '--ws2p-remote-path <path>', desc: 'Availabily web path.' },
......
......@@ -486,6 +486,7 @@ function commandLineConf(program:any, conf:any = {}) {
if (cli.currency) conf.currency = cli.currency;
if (cli.server.port) conf.port = cli.server.port;
if (cli.cpu) conf.cpu = Math.max(0.01, Math.min(1.0, cli.cpu));
if (cli.nbCores) conf.nbCores = Math.max(1, Math.min(ProverConstants.CORES_MAXIMUM_USE_IN_PARALLEL, cli.nbCores));
if (cli.prefix) conf.prefix = Math.max(ProverConstants.MIN_PEER_ID, Math.min(ProverConstants.MAX_PEER_ID, cli.prefix));
if (cli.logs.http) conf.httplogs = true;
if (cli.logs.nohttp) conf.httplogs = false;
......
......@@ -219,5 +219,7 @@ zip -qr ${RELEASES}/duniter-server-x64/opt/duniter/duniter-desktop.nw *
cd ${RELEASES}
sed -i "s/Package: .*/Package: duniter/g" ${RELEASES}/duniter-server-x64/DEBIAN/control
rm -rf ${RELEASES}/duniter-server-x64/usr
mkdir -p ${RELEASES}/duniter-server-x64/lib/systemd/system
cp "${RELEASES}/duniter/release/contrib/systemd/duniter.service" ${RELEASES}/duniter-server-x64/lib/systemd/system
fakeroot dpkg-deb --build duniter-server-x64
mv duniter-server-x64.deb /vagrant/duniter-server-${DUNITER_TAG}-linux-x64.deb
# File containing crypto keys
#DUNITER_KEYS=/etc/duniter/keys.yml
# Uncomment the following line to start the web GUI
#DUNITER_WEB=yes
# Parameters for the web GUI
#DUNITER_WEB_HOST=localhost
#DUNITER_WEB_PORT=9220
# User and group of running process
#DUNITER_GROUP=duniter
#DUNITER_USER=duniter
# Directory of duniter files
#DUNITER_HOME=/var/lib/duniter
# Directory of duniter data
#DUNITER_DATA=duniter_default
#!/sbin/openrc-run
: ${DUNITER_GROUP:=duniter}
: ${DUNITER_USER:=duniter}
: ${DUNITER_HOME:=/var/lib/duniter}
: ${DUNITER_DATA:=duniter_default}
command="/usr/bin/duniter"
if yesno "${DUNITER_WEB}"; then
command_args="webstart"
if [[ ! -z ${DUNITER_WEB_HOST} ]]; then
command_args="${command_args} --webmhost \"${DUNITER_WEB_HOST}\""
fi
if [[ ! -z ${DUNITER_WEB_PORT} ]]; then
command_args="${command_args} \"--webmport ${DUNITER_WEB_PORT}\""
fi
else
command_args="start"
fi
if [[ ! -z ${DUNITER_KEYS} ]] && [[ -r ${DUNITER_KEYS} ]]; then
command_args="${command_args} --keyfile \"${DUNITER_KEYS}\""
fi
command_args="${command_args} --home \"${DUNITER_HOME}\" --mdb \"${DUNITER_DATA}\""
start_stop_daemon_args="--user \"${DUNITER_USER}\":\"${DUNITER_GROUP}\""
description="Duniter node"
depend() {
need net
}
status() {
if ${command} status --home "${DUNITER_HOME}" --mdb "${DUNITER_DATA}" | grep -q "is running"; then
einfo "status: started"
return 0
else
if service_started; then
mark_service_stopped
eerror "status: crashed"
return 32
else
einfo "status: stopped"
return 3
fi
fi
}
stop() {
${command} stop --home "${DUNITER_HOME}" --mdb "${DUNITER_DATA}"
}
[Unit]
Description=Duniter node
After=network.target
[Service]
# Should be set to web in order to start with web GUI
Environment=DUNITER_WEB=
Environment=DUNITER_HOME="/var/lib/duniter"
Environment=DUNITER_DATA="duniter_default"
# If using a key file, DUNITER_OPTS can be defined like so:
#Environment=DUNITER_OPTS=--keyfile "/etc/duniter/keys.yml"
Environment=DUNITER_OPTS=
Group=duniter
User=duniter
Type=forking
ExecStart=/usr/bin/duniter ${DUNITER_WEB}start --home ${DUNITER_HOME} --mdb ${DUNITER_DATA} $DUNITER_OPTS
ExecReload=/usr/bin/duniter ${DUNITER_WEB}restart --home ${DUNITER_HOME} --mdb ${DUNITER_DATA} $DUNITER_OPTS
ExecStop=/usr/bin/duniter stop --home ${DUNITER_HOME} --mdb ${DUNITER_DATA}
Restart=on-failure
[Install]
WantedBy=multi-user.target
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment