<commit_before>#!/bin/bash

if [ -z "$SERVICE_ROOT" ]; then
    echo "Need to set SERVICE_ROOT"
    exit 1
fi

destdir=$SERVICE_ROOT
scriptdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
supervisor_conf=${destdir}/etc/supervisord.conf

install() {
    mkdir -p ${destdir}/log/supervisor
    mkdir ${destdir}/run
    mkdir ${destdir}/var
    rsync -rt ${scriptdir}/supervisord/etc/ ${destdir}/etc || exit 1
    ln -s ${scriptdir}/../frontend ${destdir}/frontend
    cd ${destdir}/frontend
    npm install
    bower install
    cd -
    ln -s ${scriptdir}/../backend ${destdir}/backend
    cd ${destdir}/backend
    cargo build -p cryptocurrency
    cd -
    ${destdir}/backend/target/debug/cryptocurrency generate -o ${destdir}/etc 6 -p 2000
}

enable() {
    cd ${destdir}
    if [ -e /tmp/supervisord.sock ]
    then
        supervisorctl reload || exit 1
    else
        supervisord || exit 1
    fi
}

disable() {
    cd ${destdir}
    if [ -e /tmp/supervisord.sock ]
    then
        supervisorctl shutdown || exit 1
    fi
}

update() {
    test -e /tmp/supervisord.sock || exit 1

    rsync -rt ${scriptdir}/supervisord/etc/ ${destdir}/etc/ || exit 1
    cd ${destdir}
    supervisorctl reread || exit 1
}

clear() {
    rm -rf ${destdir}/${1}
}<commit_msg>Activate public api for the first node<commit_after>#!/bin/bash

if [ -z "$SERVICE_ROOT" ]; then
    echo "Need to set SERVICE_ROOT"
    exit 1
fi

destdir=$SERVICE_ROOT
scriptdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
supervisor_conf=${destdir}/etc/supervisord.conf

install() {
    mkdir -p ${destdir}/log/supervisor
    mkdir ${destdir}/run
    mkdir ${destdir}/var
    rsync -rt ${scriptdir}/supervisord/etc/ ${destdir}/etc || exit 1
    ln -s ${scriptdir}/../frontend ${destdir}/frontend
    cd ${destdir}/frontend
    npm install
    bower install
    cd -
    ln -s ${scriptdir}/../backend ${destdir}/backend
    cd ${destdir}/backend
    cargo build -p cryptocurrency
    cd -
    ${destdir}/backend/target/debug/cryptocurrency generate -o ${destdir}/etc 6 -p 2000
    sed 's/\[api\]/[api]\npublic_api_address = "127.0.0.1:8500"/' -i ${destdir}/etc/validators/0.toml
}

enable() {
    cd ${destdir}
    if [ -e /tmp/supervisord.sock ]
    then
        supervisorctl reload || exit 1
    else
        supervisord || exit 1
    fi
}

disable() {
    cd ${destdir}
    if [ -e /tmp/supervisord.sock ]
    then
        supervisorctl shutdown || exit 1
    fi
}

update() {
    test -e /tmp/supervisord.sock || exit 1

    rsync -rt ${scriptdir}/supervisord/etc/ ${destdir}/etc/ || exit 1
    cd ${destdir}
    supervisorctl reread || exit 1
}

clear() {
    rm -rf ${destdir}/${1}
}
{'fraction_non_alphanumeric': 0.15761886933732686, 'fraction_numerical': 0.015350056158742045, 'mean_word_length': 2.62550881953867, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2931039', 'n_tokens_mistral': 994, 'n_tokens_neox': 929, 'n_words': 237}