diff --git a/.gitignore b/.gitignore index 88883cdb58b..09bebc4dbf1 100644 --- a/.gitignore +++ b/.gitignore @@ -63,7 +63,7 @@ tests/plugin_test unittests/unit_test doxygen -haya.doxygen +daobet.doxygen wallet.json witness_node_data_dir diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 48909093ac7..09c51b21f87 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -36,11 +36,11 @@ publish-nomral: - schedules <<: *docker-login script: - - docker build -f Docker/Dockerfile -t haya --build-arg registry=${REGISTRY} . - - docker tag haya ${REGISTRY}/haya:${CI_COMMIT_SHA:0:8} - - docker tag haya ${REGISTRY}/haya:${CI_COMMIT_REF_NAME}-latest - - docker tag haya ${REGISTRY}/haya:latest - - docker push ${REGISTRY}/haya + - docker build -f Docker/Dockerfile -t daobet --build-arg registry=${REGISTRY} . + - docker tag daobet ${REGISTRY}/daobet:${CI_COMMIT_SHA:0:8} + - docker tag daobet ${REGISTRY}/daobet:${CI_COMMIT_REF_NAME}-latest + - docker tag daobet ${REGISTRY}/daobet:latest + - docker push ${REGISTRY}/daobet publish-dev: stage: publish to gitlab registry dev @@ -59,11 +59,11 @@ publish-dev: - schedules <<: *docker-login script: - - docker build -f Docker/dev/Dockerfile -t haya-dev --build-arg registry=${REGISTRY} . - - docker tag haya-dev ${REGISTRY}/haya-dev:${CI_COMMIT_SHA:0:8} - - docker tag haya-dev ${REGISTRY}/haya-dev:${CI_COMMIT_REF_NAME}-latest - - docker tag haya-dev ${REGISTRY}/haya-dev:latest - - docker push ${REGISTRY}/haya-dev + - docker build -f Docker/dev/Dockerfile -t daobet-dev --build-arg registry=${REGISTRY} . + - docker tag daobet-dev ${REGISTRY}/daobet-dev:${CI_COMMIT_SHA:0:8} + - docker tag daobet-dev ${REGISTRY}/daobet-dev:${CI_COMMIT_REF_NAME}-latest + - docker tag daobet-dev ${REGISTRY}/daobet-dev:latest + - docker push ${REGISTRY}/daobet-dev publish-builder: stage: publish builder @@ -85,8 +85,8 @@ publish-builder: <<: *docker-login script: - cd Docker/builder - - docker build -t haya-builder . - - docker tag haya-builder ${REGISTRY}/haya-builder:${CI_COMMIT_SHA:0:8} - - docker tag haya-builder ${REGISTRY}/haya-builder:${CI_COMMIT_REF_NAME}-latest - - docker tag haya-builder ${REGISTRY}/haya-builder:latest - - docker push ${REGISTRY}/haya-builder + - docker build -t daobet-builder . + - docker tag daobet-builder ${REGISTRY}/daobet-builder:${CI_COMMIT_SHA:0:8} + - docker tag daobet-builder ${REGISTRY}/daobet-builder:${CI_COMMIT_REF_NAME}-latest + - docker tag daobet-builder ${REGISTRY}/daobet-builder:latest + - docker push ${REGISTRY}/daobet-builder diff --git a/.travis.yml b/.travis.yml index b1f3e24bd1c..4848986a427 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,16 +26,16 @@ jobs: - cp -r $HOME/.ccache .ccache #copy cache into build context - docker build --build-arg registry=mixbytes --build-arg build_type=$BUILD_TYPE -t tmp-builder -f Docker/Dockerfile --target builder . - - docker run --rm -v $HOME/.ccache:/out tmp-builder /bin/bash -c "cp -r /haya/.ccache/* /out" #save updated cache - - docker build --build-arg registry=mixbytes --build-arg build_type=$BUILD_TYPE -t mixbytes/haya:$TRAVIS_BRANCH -f Docker/Dockerfile . #build main image + - docker run --rm -v $HOME/.ccache:/out tmp-builder /bin/bash -c "cp -r /daobet/.ccache/* /out" #save updated cache + - docker build --build-arg registry=mixbytes --build-arg build_type=$BUILD_TYPE -t mixbytes/daobet:$TRAVIS_BRANCH -f Docker/Dockerfile . #build main image - if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ $BUILD_TYPE != "Debug" ]; then docker run tmp-builder /bin/bash -c 'cd /tmp/build && ctest -R "simulator|unit_test"'; fi - if [ "$TRAVIS_PULL_REQUEST" != "false" ] && [ $BUILD_TYPE != "Debug" ]; then docker run tmp-builder /bin/bash -c 'cd /tmp/build && ctest -R "simulator|unit_test|nodeos_sanity|nodeos_run" -E "mongo"'; fi - - docker push mixbytes/haya:$TRAVIS_BRANCH #push main image to registry + - docker push mixbytes/daobet:$TRAVIS_BRANCH #push main image to registry - | if [ $TRAVIS_BRANCH == "master" ]; then - docker tag mixbytes/haya:master mixbytes/haya:latest - docker push mixbytes/haya:latest + docker tag mixbytes/daobet:master mixbytes/daobet:latest + docker push mixbytes/daobet:latest fi diff --git a/CMakeLists.txt b/CMakeLists.txt index b13f3e23300..28e8564fa49 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required( VERSION 3.5 ) -project( HAYA ) +project( DAOBET ) enable_testing() @@ -12,8 +12,8 @@ if(CCACHE_FOUND) endif(CCACHE_FOUND) if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - message(WARNING "CMAKE_INSTALL_PREFIX is set to default path of ${CMAKE_INSTALL_PREFIX}, resetting to ${CMAKE_INSTALL_PREFIX}/haya") - set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/haya") + message(WARNING "CMAKE_INSTALL_PREFIX is set to default path of ${CMAKE_INSTALL_PREFIX}, resetting to ${CMAKE_INSTALL_PREFIX}/daobet") + set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/daobet") elseif ("${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr/local") message(WARNING "CMAKE_INSTALL_PREFIX is explicitly set to /usr/local. This is not recommended.") endif() @@ -46,10 +46,10 @@ else() set(VERSION_FULL "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}") endif() -set( CLI_CLIENT_EXECUTABLE_NAME haya-cli ) -set( NODE_EXECUTABLE_NAME haya-node ) -set( KEY_STORE_EXECUTABLE_NAME haya-wallet ) -set( GUI_CLIENT_EXECUTABLE_NAME haya ) +set( CLI_CLIENT_EXECUTABLE_NAME daobet-cli ) +set( NODE_EXECUTABLE_NAME daobet-node ) +set( KEY_STORE_EXECUTABLE_NAME daobet-wallet ) +set( GUI_CLIENT_EXECUTABLE_NAME daobet ) set( CUSTOM_URL_SCHEME "gcs" ) set( INSTALLER_APP_ID "68ad7005-8eee-49c9-95ce-9eed97e5b347" ) @@ -236,48 +236,48 @@ add_subdirectory( tools ) add_subdirectory( debian ) add_subdirectory( simulator ) -install_directory_permissions(DIRECTORY ${CMAKE_INSTALL_FULL_SYSCONFDIR}/haya) +install_directory_permissions(DIRECTORY ${CMAKE_INSTALL_FULL_SYSCONFDIR}/daobet) -install(FILES testnet.template DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/haya/launcher) -install_directory_permissions(DIRECTORY ${CMAKE_INSTALL_FULL_SYSCONFDIR}/haya) -install_directory_permissions(DIRECTORY ${CMAKE_INSTALL_FULL_SYSCONFDIR}/haya/launcher) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/testnet.template ${CMAKE_CURRENT_BINARY_DIR}/etc/haya/launcher/testnet.template COPYONLY) +install(FILES testnet.template DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/daobet/launcher) +install_directory_permissions(DIRECTORY ${CMAKE_INSTALL_FULL_SYSCONFDIR}/daobet) +install_directory_permissions(DIRECTORY ${CMAKE_INSTALL_FULL_SYSCONFDIR}/daobet/launcher) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/testnet.template ${CMAKE_CURRENT_BINARY_DIR}/etc/daobet/launcher/testnet.template COPYONLY) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/haya.version.in ${CMAKE_CURRENT_BINARY_DIR}/haya.version.hpp) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/haya.version.hpp DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/daobet.version.in ${CMAKE_CURRENT_BINARY_DIR}/daobet.version.hpp) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/daobet.version.hpp DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}) set(EOS_ROOT_DIR ${CMAKE_BINARY_DIR}) -configure_file(${CMAKE_SOURCE_DIR}/CMakeModules/eosio-config.cmake.in ${CMAKE_BINARY_DIR}/lib/cmake/haya/eosio-config.cmake @ONLY) -configure_file(${CMAKE_SOURCE_DIR}/CMakeModules/EosioTesterBuild.cmake.in ${CMAKE_BINARY_DIR}/lib/cmake/haya/EosioTester.cmake @ONLY) +configure_file(${CMAKE_SOURCE_DIR}/CMakeModules/eosio-config.cmake.in ${CMAKE_BINARY_DIR}/lib/cmake/daobet/eosio-config.cmake @ONLY) +configure_file(${CMAKE_SOURCE_DIR}/CMakeModules/EosioTesterBuild.cmake.in ${CMAKE_BINARY_DIR}/lib/cmake/daobet/EosioTester.cmake @ONLY) set(EOS_ROOT_DIR ${CMAKE_INSTALL_PREFIX}) configure_file(${CMAKE_SOURCE_DIR}/CMakeModules/eosio-config.cmake.in ${CMAKE_BINARY_DIR}/modules/eosio-config.cmake @ONLY) -install(FILES ${CMAKE_BINARY_DIR}/modules/eosio-config.cmake DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/cmake/haya) +install(FILES ${CMAKE_BINARY_DIR}/modules/eosio-config.cmake DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/cmake/daobet) configure_file(${CMAKE_SOURCE_DIR}/CMakeModules/EosioTester.cmake.in ${CMAKE_BINARY_DIR}/modules/EosioTester.cmake @ONLY) -install(FILES ${CMAKE_BINARY_DIR}/modules/EosioTester.cmake DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/cmake/haya) +install(FILES ${CMAKE_BINARY_DIR}/modules/EosioTester.cmake DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/cmake/daobet) configure_file(${CMAKE_SOURCE_DIR}/LICENSE - ${CMAKE_BINARY_DIR}/licenses/haya/LICENSE COPYONLY) + ${CMAKE_BINARY_DIR}/licenses/daobet/LICENSE COPYONLY) configure_file(${CMAKE_SOURCE_DIR}/libraries/wabt/LICENSE - ${CMAKE_BINARY_DIR}/licenses/haya/LICENSE.wabt COPYONLY) + ${CMAKE_BINARY_DIR}/licenses/daobet/LICENSE.wabt COPYONLY) configure_file(${CMAKE_SOURCE_DIR}/libraries/softfloat/COPYING.txt - ${CMAKE_BINARY_DIR}/licenses/haya/LICENSE.softfloat COPYONLY) + ${CMAKE_BINARY_DIR}/licenses/daobet/LICENSE.softfloat COPYONLY) configure_file(${CMAKE_SOURCE_DIR}/libraries/wasm-jit/LICENSE - ${CMAKE_BINARY_DIR}/licenses/haya/LICENSE.wavm COPYONLY) + ${CMAKE_BINARY_DIR}/licenses/daobet/LICENSE.wavm COPYONLY) configure_file(${CMAKE_SOURCE_DIR}/libraries/fc/secp256k1/upstream/COPYING - ${CMAKE_BINARY_DIR}/licenses/haya/LICENSE.secp256k1 COPYONLY) + ${CMAKE_BINARY_DIR}/licenses/daobet/LICENSE.secp256k1 COPYONLY) configure_file(${CMAKE_SOURCE_DIR}/libraries/fc/src/network/LICENSE.go - ${CMAKE_BINARY_DIR}/licenses/haya/LICENSE.go COPYONLY) + ${CMAKE_BINARY_DIR}/licenses/daobet/LICENSE.go COPYONLY) configure_file(${CMAKE_SOURCE_DIR}/libraries/yubihsm/LICENSE - ${CMAKE_BINARY_DIR}/licenses/haya/LICENSE.yubihsm COPYONLY) - -install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/licenses/haya/ COMPONENT base) -install(FILES libraries/wabt/LICENSE DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/licenses/haya/ RENAME LICENSE.wabt COMPONENT base) -install(FILES libraries/softfloat/COPYING.txt DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/licenses/haya/ RENAME LICENSE.softfloat COMPONENT base) -install(FILES libraries/wasm-jit/LICENSE DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/licenses/haya/ RENAME LICENSE.wavm COMPONENT base) -install(FILES libraries/fc/secp256k1/upstream/COPYING DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/licenses/haya/ RENAME LICENSE.secp256k1 COMPONENT base) -install(FILES libraries/fc/src/network/LICENSE.go DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/licenses/haya/ COMPONENT base) -install(FILES libraries/yubihsm/LICENSE DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/licenses/haya/ RENAME LICENSE.yubihsm COMPONENT base) + ${CMAKE_BINARY_DIR}/licenses/daobet/LICENSE.yubihsm COPYONLY) + +install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/licenses/daobet/ COMPONENT base) +install(FILES libraries/wabt/LICENSE DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/licenses/daobet/ RENAME LICENSE.wabt COMPONENT base) +install(FILES libraries/softfloat/COPYING.txt DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/licenses/daobet/ RENAME LICENSE.softfloat COMPONENT base) +install(FILES libraries/wasm-jit/LICENSE DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/licenses/daobet/ RENAME LICENSE.wavm COMPONENT base) +install(FILES libraries/fc/secp256k1/upstream/COPYING DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/licenses/daobet/ RENAME LICENSE.secp256k1 COMPONENT base) +install(FILES libraries/fc/src/network/LICENSE.go DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/licenses/daobet/ COMPONENT base) +install(FILES libraries/yubihsm/LICENSE DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/licenses/daobet/ RENAME LICENSE.yubihsm COMPONENT base) add_custom_target(base-install COMMAND "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" diff --git a/CMakeModules/additionalPlugins.cmake b/CMakeModules/additionalPlugins.cmake index b498073ae97..4af01baa838 100644 --- a/CMakeModules/additionalPlugins.cmake +++ b/CMakeModules/additionalPlugins.cmake @@ -9,5 +9,5 @@ foreach(ADDITIONAL_PLUGIN_SOURCE_DIR ${EOSIO_ADDITIONAL_PLUGINS}) endforeach() foreach(ADDITIONAL_PLUGIN_TARGET ${ADDITIONAL_PLUGINS_TARGET}) - target_link_libraries( haya-node PRIVATE -Wl,${whole_archive_flag} ${ADDITIONAL_PLUGIN_TARGET} -Wl,${no_whole_archive_flag} ) + target_link_libraries( daobet-node PRIVATE -Wl,${whole_archive_flag} ${ADDITIONAL_PLUGIN_TARGET} -Wl,${no_whole_archive_flag} ) endforeach() diff --git a/CMakeModules/doxygen.cmake b/CMakeModules/doxygen.cmake index 1edd03eee2f..4d480fee9e6 100644 --- a/CMakeModules/doxygen.cmake +++ b/CMakeModules/doxygen.cmake @@ -1,4 +1,4 @@ -configure_file("haya.doxygen.in" "${CMAKE_BINARY_DIR}/haya.doxygen") +configure_file("daobet.doxygen.in" "${CMAKE_BINARY_DIR}/daobet.doxygen") include(FindDoxygen) @@ -20,7 +20,7 @@ else() # Doxygen has issues making destination directories more than one level deep, so do it for it. add_custom_target(make_doc_dir ALL COMMAND ${CMAKE_COMMAND} -E make_directory "${DOXY_DOC_DEST_DIR}") add_custom_target(contract_documentation ALL - COMMAND "${DOXYGEN_EXECUTABLE}" "${CMAKE_BINARY_DIR}/haya.doxygen" + COMMAND "${DOXYGEN_EXECUTABLE}" "${CMAKE_BINARY_DIR}/daobet.doxygen" DEPENDS make_doc_dir WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" COMMENT "Building doxygen documentation into ${DOXY_DOC_DEST_DIR}..." diff --git a/CMakeModules/installer.cmake b/CMakeModules/installer.cmake index d5995e055ee..53190d44536 100644 --- a/CMakeModules/installer.cmake +++ b/CMakeModules/installer.cmake @@ -43,7 +43,7 @@ else() set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY TRUE) set(CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION TRUE) - set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/mixbytes/haya") + set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/mixbytes/daobet") endif() include(CPack) diff --git a/CMakeModules/package.cmake b/CMakeModules/package.cmake index 2e8fa1e70e2..67e305d55fd 100644 --- a/CMakeModules/package.cmake +++ b/CMakeModules/package.cmake @@ -1,7 +1,7 @@ set(VENDOR "mixbytes") -set(PROJECT_NAME "haya") +set(PROJECT_NAME "daobet") set(DESC "blockchain software") -set(URL "https://github.com/mixbytes/haya") +set(URL "https://github.com/DaoCasino/DAObet") set(EMAIL "hello@mixbytes.io") configure_file(${CMAKE_SOURCE_DIR}/scripts/generate_package.sh.in ${CMAKE_BINARY_DIR}/packages/generate_package.sh @ONLY) diff --git a/Docker/Dockerfile b/Docker/Dockerfile index da74dbd9d2e..d1b07d025c6 100644 --- a/Docker/Dockerfile +++ b/Docker/Dockerfile @@ -5,13 +5,13 @@ ARG build_type RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install ccache -ADD . haya -WORKDIR haya -ENV CCACHE_DIR /haya/.ccache +ADD . daobet +WORKDIR daobet +ENV CCACHE_DIR /daobet/.ccache RUN git submodule init && git submodule update --init --recursive -RUN echo "$(git rev-parse --abbrev-ref HEAD):$(git rev-parse HEAD)" > /etc/haya-version \ +RUN echo "$(git rev-parse --abbrev-ref HEAD):$(git rev-parse HEAD)" > /etc/daobet-version \ && cmake -H. -B"/tmp/build" -GNinja -DCMAKE_BUILD_TYPE=${build_type} -DWASM_ROOT=/opt/wasm -DCMAKE_CXX_COMPILER=clang++ \ -DCMAKE_C_COMPILER=clang -DCMAKE_INSTALL_PREFIX=/tmp/build -DBUILD_MONGO_DB_PLUGIN=true -DCORE_SYMBOL_NAME=$symbol \ -DENABLE_TX_SPONSORSHIP=1 \ @@ -22,12 +22,12 @@ FROM ubuntu:18.04 RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install openssl ca-certificates libcurl4-openssl-dev libusb-1.0 gdb && rm -rf /var/lib/apt/lists/* COPY --from=builder /usr/local/lib/* /usr/local/lib/ -COPY --from=builder /tmp/build/bin /opt/haya/bin -COPY --from=builder /haya/Docker/config.ini / -COPY --from=builder /etc/haya-version /etc -COPY --from=builder /haya/Docker/haya-node.sh /opt/haya/bin/haya-node.sh -ENV EOSIO_ROOT=/opt/haya -RUN chmod +x /opt/haya/bin/haya-node.sh +COPY --from=builder /tmp/build/bin /opt/daobet/bin +COPY --from=builder /daobet/Docker/config.ini / +COPY --from=builder /etc/daobet-version /etc +COPY --from=builder /daobet/Docker/daobet-node.sh /opt/daobet/bin/daobet-node.sh +ENV EOSIO_ROOT=/opt/daobet +RUN chmod +x /opt/daobet/bin/daobet-node.sh RUN ulimit -c unlimited ENV LD_LIBRARY_PATH /usr/local/lib -ENV PATH /opt/haya/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +ENV PATH /opt/daobet/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin diff --git a/Docker/haya-cli.sh b/Docker/daobet-cli.sh similarity index 100% rename from Docker/haya-cli.sh rename to Docker/daobet-cli.sh diff --git a/Docker/daobet-node.sh b/Docker/daobet-node.sh new file mode 100755 index 00000000000..336dd18130f --- /dev/null +++ b/Docker/daobet-node.sh @@ -0,0 +1,37 @@ +#!/bin/sh +cd /opt/daobet/bin + +if [ ! -d "/opt/daobet/bin/data-dir" ]; then + mkdir /opt/daobet/bin/data-dir +fi + +if [ -f '/opt/daobet/bin/data-dir/config.ini' ]; then + echo + else + cp /config.ini /opt/daobet/bin/data-dir +fi + +if [ -d '/opt/daobet/bin/data-dir/contracts' ]; then + echo + else + cp -r /contracts /opt/daobet/bin/data-dir +fi + +while :; do + case $1 in + --config-dir=?*) + CONFIG_DIR=${1#*=} + ;; + *) + break + esac + shift +done + +if [ ! "$CONFIG_DIR" ]; then + CONFIG_DIR="--config-dir=/opt/daobet/bin/data-dir" +else + CONFIG_DIR="" +fi + +exec /opt/daobet/bin/daobet-node $CONFIG_DIR "$@" diff --git a/Docker/dev/Dockerfile b/Docker/dev/Dockerfile index b1fabc61131..c928dca5c02 100644 --- a/Docker/dev/Dockerfile +++ b/Docker/dev/Dockerfile @@ -2,20 +2,20 @@ ARG registry FROM ${registry}/haya:latest-builder as builder ARG symbol=SYS -ADD . haya -WORKDIR haya +ADD . daobet +WORKDIR daobet RUN git submodule init && git submodule update --init --recursive -RUN echo "$(git rev-parse --abbrev-ref HEAD):$(git rev-parse HEAD)" > /etc/haya-version \ - && cmake -H. -B"/opt/haya" -GNinja -DCMAKE_BUILD_TYPE=Release -DWASM_ROOT=/opt/wasm -DCMAKE_CXX_COMPILER=clang++ \ - -DCMAKE_C_COMPILER=clang -DCMAKE_INSTALL_PREFIX=/opt/haya -DBUILD_MONGO_DB_PLUGIN=true -DCORE_SYMBOL_NAME=$symbol \ - && cmake --build /opt/haya --target install \ - && cp /haya/Docker/config.ini / && ln -s /opt/haya/contracts /contracts && cp /haya/Docker/nodeosd.sh /opt/haya/bin/nodeosd.sh && ln -s /haya/tutorials /tutorials +RUN echo "$(git rev-parse --abbrev-ref HEAD):$(git rev-parse HEAD)" > /etc/daobet-version \ + && cmake -H. -B"/opt/daobet" -GNinja -DCMAKE_BUILD_TYPE=Release -DWASM_ROOT=/opt/wasm -DCMAKE_CXX_COMPILER=clang++ \ + -DCMAKE_C_COMPILER=clang -DCMAKE_INSTALL_PREFIX=/opt/daobet -DBUILD_MONGO_DB_PLUGIN=true -DCORE_SYMBOL_NAME=$symbol \ + && cmake --build /opt/daobet --target install \ + && cp /daobet/Docker/config.ini / && ln -s /opt/daobet/contracts /contracts && cp /daobet/Docker/nodeosd.sh /opt/daobet/bin/nodeosd.sh && ln -s /daobet/tutorials /tutorials RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install openssl ca-certificates vim psmisc python3-pip libcurl4-openssl-dev libusb-1.0 && rm -rf /var/lib/apt/lists/* RUN pip3 install numpy -ENV EOSIO_ROOT=/opt/haya -RUN chmod +x /opt/haya/bin/nodeosd.sh +ENV EOSIO_ROOT=/opt/daobet +RUN chmod +x /opt/daobet/bin/nodeosd.sh ENV LD_LIBRARY_PATH /usr/local/lib -ENV PATH /opt/haya/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +ENV PATH /opt/daobet/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin diff --git a/Docker/docker-compose.yml b/Docker/docker-compose.yml index 28a9daee3c0..b5003194aaf 100755 --- a/Docker/docker-compose.yml +++ b/Docker/docker-compose.yml @@ -9,8 +9,8 @@ services: nodeosd: build: context: . - image: registry.gitlab.com/cyberos/infrastructure/haya:latest - command: /opt/haya/bin/haya-node.sh --data-dir /opt/haya/bin/data-dir -e --http-alias=nodeosd:8888 --http-alias=127.0.0.1:8888 --http-alias=localhost:8888 + image: registry.gitlab.com/cyberos/infrastructure/daobet:latest + command: /opt/daobet/bin/daobet-node.sh --data-dir /opt/daobet/bin/data-dir -e --http-alias=nodeosd:8888 --http-alias=127.0.0.1:8888 --http-alias=localhost:8888 hostname: nodeosd ports: - 8888:8888 @@ -18,19 +18,19 @@ services: expose: - "8888" volumes: - - nodeos-data-volume:/opt/haya/bin/data-dir + - nodeos-data-volume:/opt/daobet/bin/data-dir cap_add: - IPC_LOCK stop_grace_period: 10m keosd: - image: registry.gitlab.com/cyberos/infrastructure/haya:latest - command: /opt/haya/bin/haya-wallet --wallet-dir /opt/haya/bin/data-dir --http-server-address=127.0.0.1:8900 --http-alias=keosd:8900 --http-alias=localhost:8900 + image: registry.gitlab.com/cyberos/infrastructure/daobet:latest + command: /opt/daobet/bin/daobet-wallet --wallet-dir /opt/daobet/bin/data-dir --http-server-address=127.0.0.1:8900 --http-alias=keosd:8900 --http-alias=localhost:8900 hostname: keosd links: - nodeosd volumes: - - keosd-data-volume:/opt/haya/bin/data-dir + - keosd-data-volume:/opt/daobet/bin/data-dir stop_grace_period: 10m volumes: diff --git a/Docker/haya-node.sh b/Docker/haya-node.sh deleted file mode 100755 index a2c1797532c..00000000000 --- a/Docker/haya-node.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -cd /opt/haya/bin - -if [ ! -d "/opt/haya/bin/data-dir" ]; then - mkdir /opt/haya/bin/data-dir -fi - -if [ -f '/opt/haya/bin/data-dir/config.ini' ]; then - echo - else - cp /config.ini /opt/haya/bin/data-dir -fi - -if [ -d '/opt/haya/bin/data-dir/contracts' ]; then - echo - else - cp -r /contracts /opt/haya/bin/data-dir -fi - -while :; do - case $1 in - --config-dir=?*) - CONFIG_DIR=${1#*=} - ;; - *) - break - esac - shift -done - -if [ ! "$CONFIG_DIR" ]; then - CONFIG_DIR="--config-dir=/opt/haya/bin/data-dir" -else - CONFIG_DIR="" -fi - -exec /opt/haya/bin/haya-node $CONFIG_DIR "$@" diff --git a/README.md b/README.md index 0898b30075e..625243af8fe 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ We also provide some test and benchmarking tools, so you can actually run RANDPA ## Build ```bash -./scripts/haya_build.sh +./scripts/daobet_build.sh ``` ## Run full node (testnet) @@ -47,7 +47,7 @@ by running ```bash -./bin/nodeos --delete-all-blocks -c ../tutorials/randpa-tutorial/configs/config0.ini +./bin/daobet-node --delete-all-blocks -c ../tutorials/randpa-tutorial/configs/config0.ini ... @@ -74,9 +74,9 @@ of setting block producers 1.Run 3 nodes ```bash -./bin/nodeos --delete-all-blocks -c ../tutorials/randpa-tutorial/config0.ini -./bin/nodeos --delete-all-blocks -c ../tutorials/randpa-tutorial/config1.ini -./bin/nodeos --delete-all-blocks -c ../tutorials/randpa-tutorial/config2.ini +./bin/daobet-node --delete-all-blocks -c ../tutorials/randpa-tutorial/config0.ini +./bin/daobet-node --delete-all-blocks -c ../tutorials/randpa-tutorial/config1.ini +./bin/daobet-node --delete-all-blocks -c ../tutorials/randpa-tutorial/config2.ini ``` 2.Set block producers diff --git a/haya.doxygen.in b/daobet.doxygen.in similarity index 100% rename from haya.doxygen.in rename to daobet.doxygen.in diff --git a/haya.version.in b/daobet.version.in similarity index 100% rename from haya.version.in rename to daobet.version.in diff --git a/debian/postinst b/debian/postinst index b96ccc71cfb..c2a04cf19da 100755 --- a/debian/postinst +++ b/debian/postinst @@ -8,8 +8,8 @@ set -e -PACKAGE="haya" -USER="haya" +PACKAGE="daobet" +USER="daobet" GROUP=${USER} # summary of how this script can be called: @@ -40,8 +40,8 @@ case "$1" in chown ${USER}:${GROUP} /var/lib/${PACKAGE} chown ${USER}:${GROUP} /etc/${PACKAGE} chown ${USER}:${GROUP} /etc/${PACKAGE}/node_00 - chown ${USER} /usr/bin/haya-node - chmod u+s /usr/bin/haya-node + chown ${USER} /usr/bin/daobet-node + chmod u+s /usr/bin/daobet-node ;; abort-upgrade|abort-remove|abort-deconfigure) diff --git a/plugins/randpa_plugin/include/eosio/randpa_plugin/prefix_chain_tree.hpp b/plugins/randpa_plugin/include/eosio/randpa_plugin/prefix_chain_tree.hpp index 03c69226fa4..f710b47f812 100644 --- a/plugins/randpa_plugin/include/eosio/randpa_plugin/prefix_chain_tree.hpp +++ b/plugins/randpa_plugin/include/eosio/randpa_plugin/prefix_chain_tree.hpp @@ -5,6 +5,7 @@ #include #include #include +#include namespace randpa_finality { @@ -83,7 +84,6 @@ class prefix_chain_tree { vector blocks; std::tie(node, blocks) = get_tree_node(chain); if (!node) { - dlog("Cannot find base block"); return nullptr; } return _add_confirmations(node, blocks, sender_key, conf); @@ -167,7 +167,6 @@ class prefix_chain_tree { }); if (block_itr != blocks.end()) { - dlog("Found node: ${id}", ("id", *block_itr)); return { find(*block_itr), vector(block_itr + 1, blocks.end()) }; } return {nullptr, {} }; @@ -188,15 +187,21 @@ class prefix_chain_tree { } node_ptr find_node(const block_id_type& block_id, node_ptr node) const { - if (block_id == node->block_id) { - return node; - } - for (const auto& adjacent_node : node->adjacent_nodes) { - auto result = find_node(block_id, adjacent_node); - if (result) { - return result; + std::queue queue {{ node }}; + + while (queue.size()) { + auto top_node = queue.front(); + queue.pop(); + + if (top_node->block_id == block_id) { + return top_node; + } + + for (auto&& adj_node: top_node->adjacent_nodes) { + queue.push(adj_node); } } + return nullptr; } @@ -252,4 +257,4 @@ class prefix_chain_tree { } }; -} //namespace randpa_finality \ No newline at end of file +} //namespace randpa_finality diff --git a/plugins/randpa_plugin/include/eosio/randpa_plugin/randpa.hpp b/plugins/randpa_plugin/include/eosio/randpa_plugin/randpa.hpp index 5b19c478a15..01ae1c37406 100644 --- a/plugins/randpa_plugin/include/eosio/randpa_plugin/randpa.hpp +++ b/plugins/randpa_plugin/include/eosio/randpa_plugin/randpa.hpp @@ -330,7 +330,7 @@ class randpa { void process_net_msg(const randpa_net_msg& msg) { if (fc::time_point::now() - msg.receive_time > fc::milliseconds(msg_expiration_ms)) { - ilog("Network message dropped"); + wlog("Network message dropped, msg age: ${age}", ("age", fc::time_point::now() - msg.receive_time)); return; } @@ -417,7 +417,7 @@ class randpa { auto node = _prefix_tree->find(best_block); if (!node) { - wlog("Received proof for unknown block: ${block_id}", ("block_id", best_block)); + dlog("Received proof for unknown block: ${block_id}", ("block_id", best_block)); return false; } @@ -427,7 +427,7 @@ class randpa { for (const auto& prevote : proof.prevotes) { const auto& prevoter_pub_key = prevote.public_key(); if (!validate_prevote(prevote.data, prevoter_pub_key, best_block, bp_keys)) { - wlog("Prevote validation failed, base_block: ${id}, blocks: ${blocks}", + dlog("Prevote validation failed, base_block: ${id}, blocks: ${blocks}", ("id", prevote.data.base_block) ("blocks", prevote.data.blocks)); return false; @@ -438,12 +438,12 @@ class randpa { for (const auto& precommit : proof.precommits) { const auto& precommiter_pub_key = precommit.public_key(); if (!prevoted_keys.count(precommiter_pub_key)) { - wlog("Precommiter has not prevoted, pub_key: ${pub_key}", ("pub_key", precommiter_pub_key)); + dlog("Precommiter has not prevoted, pub_key: ${pub_key}", ("pub_key", precommiter_pub_key)); return false; } if (!validate_precommit(precommit.data, precommiter_pub_key, best_block, bp_keys)) { - wlog("Precommit validation failed for ${id}", ("id", precommit.data.block_id)); + dlog("Precommit validation failed for ${id}", ("id", precommit.data.block_id)); return false; } precommited_keys.insert(precommiter_pub_key); @@ -478,7 +478,7 @@ class randpa { } if (!validate_proof(proof)) { - wlog("Invalid proof from ${peer}", ("peer", msg.public_key())); + ilog("Invalid proof from ${peer}", ("peer", msg.public_key())); dlog("Proof msg: ${msg}", ("msg", msg)); return; } @@ -501,9 +501,7 @@ class randpa { send(ses_id, handshake_ans_msg(handshake_ans_type { _lib }, _signature_provider)); } catch (const fc::exception& e) { - elog("Randpa handshake_msg handler error, reason: ${e}, msg: ${msg}", - ("e", e.what()) - ("msg", msg)); + elog("Randpa handshake_msg handler error, reason: ${e}", ("e", e.what())); } } @@ -512,9 +510,7 @@ class randpa { try { _peers[msg.public_key()] = ses_id; } catch (const fc::exception& e) { - elog("Randpa handshake_ans_msg handler error, reason: ${e}, msg: ${msg}", - ("e", e.what()) - ("msg", msg)); + elog("Randpa handshake_ans_msg handler error, reason: ${e}", ("e", e.what())); } } @@ -563,7 +559,9 @@ class randpa { ); if (get_block_num(event.block_id) <= get_block_num(_prefix_tree->get_root()->block_id)) { - wlog("Randpa handled on_irreversible for old block"); + wlog("Randpa handled on_irreversible for old block: block_num: ${blk_num}", + ("blk_num", get_block_num(event.block_id)) + ); return; } @@ -573,7 +571,6 @@ class randpa { void on(const on_new_peer_event& event) { dlog("Randpa on_new_peer_event event handled, ses_id: ${ses_id}", ("ses_id", event.ses_id)); auto msg = handshake_msg(handshake_type{_lib}, _signature_provider); - dlog("Sending handshake msg"); send(event.ses_id, msg); } @@ -648,7 +645,6 @@ class randpa { return; } - dlog("Randpa finishing round, num: ${n}", ("n", _round->get_num())); if (!_round->finish()) { return; } diff --git a/plugins/randpa_plugin/include/eosio/randpa_plugin/round.hpp b/plugins/randpa_plugin/include/eosio/randpa_plugin/round.hpp index 3085cc2f329..b10460c90a1 100644 --- a/plugins/randpa_plugin/include/eosio/randpa_plugin/round.hpp +++ b/plugins/randpa_plugin/include/eosio/randpa_plugin/round.hpp @@ -75,17 +75,13 @@ class randpa_round { } void on(const prevote_msg& msg) { - dlog("Received prevote for round ${num}", - ("num", num)); if (state != state::prevote && state != state::ready_to_precommit) { dlog("Prevote while wrong state, round: ${r}", ("r", num)); return; } if (!validate_prevote(msg)) { - dlog("Invalid prevote for round ${num}: ${msg}", - ("num", num) - ("msg", msg)); + dlog("Invalid prevote for round ${num}", ("num", num)); return; } @@ -93,18 +89,13 @@ class randpa_round { } void on(const precommit_msg& msg) { - dlog("Received precommit for round ${num}", - ("num", num)); - if (state != state::precommit && state != state::ready_to_precommit) { dlog("Precommit while wrong state, round: ${r}", ("r", num)); return; } if (!validate_precommit(msg)) { - dlog("Invalid precommit for round ${num}: ${msg}", - ("num", num) - ("msg", msg)); + dlog("Invalid precommit for round ${num}", ("num", num)); return; } @@ -145,7 +136,6 @@ class randpa_round { private: void prevote() { FC_ASSERT(state == state::init, "state should be `init`"); - dlog("Round sending prevote, num: ${n}", ("n", num)); state = state::prevote; auto last_node = tree->get_last_inserted_block(primary); @@ -165,7 +155,6 @@ class randpa_round { void precommit() { FC_ASSERT(state == state::ready_to_precommit, "state should be `ready_to_precommit`"); - dlog("Round sending precommit, num: ${n}", ("n", num)); state = state::precommit; auto precommit = precommit_type { num, best_node->block_id }; diff --git a/plugins/randpa_plugin/randpa_plugin.cpp b/plugins/randpa_plugin/randpa_plugin.cpp index 319d193188e..a3295043a6a 100644 --- a/plugins/randpa_plugin/randpa_plugin.cpp +++ b/plugins/randpa_plugin/randpa_plugin.cpp @@ -211,11 +211,6 @@ class randpa_plugin_impl { app().get_plugin() .subscribe(get_net_msg_type(), [ch](uint32_t ses_id, const T & msg) { - dlog("Randpa network message received, ses_id: ${ses_id}, type: ${type}, msg: ${msg}", - ("ses_id", ses_id) - ("type", get_net_msg_type()) - ("msg", msg) - ); ch->send(randpa_net_msg { ses_id, msg, fc::time_point::now() }); switch (randpa_net_msg_data::tag::value) { case randpa_net_msg_data::tag::value: diff --git a/plugins/telemetry_plugin/include/eosio/telemetry_plugin/telemetry_plugin.hpp b/plugins/telemetry_plugin/include/eosio/telemetry_plugin/telemetry_plugin.hpp index 01837800e0e..17a07c05a6a 100644 --- a/plugins/telemetry_plugin/include/eosio/telemetry_plugin/telemetry_plugin.hpp +++ b/plugins/telemetry_plugin/include/eosio/telemetry_plugin/telemetry_plugin.hpp @@ -1,6 +1,6 @@ /** * @file - * @copyright defined in haya/LICENSE + * @copyright defined in daobet/LICENSE */ #pragma once #include diff --git a/plugins/telemetry_plugin/telemetry_plugin.cpp b/plugins/telemetry_plugin/telemetry_plugin.cpp index b7686a68171..ccf77b9cb0d 100644 --- a/plugins/telemetry_plugin/telemetry_plugin.cpp +++ b/plugins/telemetry_plugin/telemetry_plugin.cpp @@ -1,6 +1,6 @@ /** * @file - * @copyright defined in haya/LICENSE + * @copyright defined in daobet/LICENSE */ #include #include diff --git a/programs/CMakeLists.txt b/programs/CMakeLists.txt index 83f2c4e3706..47c4e3d8701 100644 --- a/programs/CMakeLists.txt +++ b/programs/CMakeLists.txt @@ -1,5 +1,5 @@ -add_subdirectory( haya-node ) -add_subdirectory( haya-cli ) -add_subdirectory( haya-wallet ) -add_subdirectory( haya-launcher ) -add_subdirectory( haya-blocklog ) +add_subdirectory( daobet-node ) +add_subdirectory( daobet-cli ) +add_subdirectory( daobet-wallet ) +add_subdirectory( daobet-launcher ) +add_subdirectory( daobet-blocklog ) diff --git a/programs/haya-blocklog/CMakeLists.txt b/programs/daobet-blocklog/CMakeLists.txt similarity index 63% rename from programs/haya-blocklog/CMakeLists.txt rename to programs/daobet-blocklog/CMakeLists.txt index 4903d3b8ef8..13be8d5e4f5 100644 --- a/programs/haya-blocklog/CMakeLists.txt +++ b/programs/daobet-blocklog/CMakeLists.txt @@ -1,4 +1,4 @@ -add_executable( haya-blocklog main.cpp ) +add_executable( daobet-blocklog main.cpp ) if( UNIX AND NOT APPLE ) set(rt_library rt ) @@ -6,18 +6,18 @@ endif() find_package( Gperftools QUIET ) if( GPERFTOOLS_FOUND ) - message( STATUS "Found gperftools; compiling haya-blocklog with TCMalloc") + message( STATUS "Found gperftools; compiling daobet-blocklog with TCMalloc") list( APPEND PLATFORM_SPECIFIC_LIBS tcmalloc ) endif() -target_include_directories(haya-blocklog PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) +target_include_directories(daobet-blocklog PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) -target_link_libraries( haya-blocklog +target_link_libraries( daobet-blocklog PRIVATE appbase PRIVATE eosio_chain fc ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} ) install( TARGETS - haya-blocklog + daobet-blocklog RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR} diff --git a/programs/haya-blocklog/main.cpp b/programs/daobet-blocklog/main.cpp similarity index 99% rename from programs/haya-blocklog/main.cpp rename to programs/daobet-blocklog/main.cpp index 9445c8cbb9c..e285319a345 100644 --- a/programs/haya-blocklog/main.cpp +++ b/programs/daobet-blocklog/main.cpp @@ -173,7 +173,7 @@ void blocklog::initialize(const variables_map& options) { int main(int argc, char** argv) { std::ios::sync_with_stdio(false); // for potential performance boost for large block log files - options_description cli ("haya-blocklog command line options"); + options_description cli ("daobet-blocklog command line options"); try { blocklog blog; blog.set_program_options(cli); diff --git a/programs/haya-cli/CLI11.hpp b/programs/daobet-cli/CLI11.hpp similarity index 100% rename from programs/haya-cli/CLI11.hpp rename to programs/daobet-cli/CLI11.hpp diff --git a/programs/haya-cli/CMakeLists.txt b/programs/daobet-cli/CMakeLists.txt similarity index 100% rename from programs/haya-cli/CMakeLists.txt rename to programs/daobet-cli/CMakeLists.txt diff --git a/programs/haya-cli/config.hpp.in b/programs/daobet-cli/config.hpp.in similarity index 100% rename from programs/haya-cli/config.hpp.in rename to programs/daobet-cli/config.hpp.in diff --git a/programs/haya-cli/eosc.pot b/programs/daobet-cli/eosc.pot similarity index 100% rename from programs/haya-cli/eosc.pot rename to programs/daobet-cli/eosc.pot diff --git a/programs/haya-cli/help_text.cpp b/programs/daobet-cli/help_text.cpp similarity index 100% rename from programs/haya-cli/help_text.cpp rename to programs/daobet-cli/help_text.cpp diff --git a/programs/haya-cli/help_text.hpp b/programs/daobet-cli/help_text.hpp similarity index 100% rename from programs/haya-cli/help_text.hpp rename to programs/daobet-cli/help_text.hpp diff --git a/programs/haya-cli/httpc.cpp b/programs/daobet-cli/httpc.cpp similarity index 100% rename from programs/haya-cli/httpc.cpp rename to programs/daobet-cli/httpc.cpp diff --git a/programs/haya-cli/httpc.hpp b/programs/daobet-cli/httpc.hpp similarity index 100% rename from programs/haya-cli/httpc.hpp rename to programs/daobet-cli/httpc.hpp diff --git a/programs/haya-cli/localize.hpp b/programs/daobet-cli/localize.hpp similarity index 100% rename from programs/haya-cli/localize.hpp rename to programs/daobet-cli/localize.hpp diff --git a/programs/haya-cli/main.cpp b/programs/daobet-cli/main.cpp similarity index 100% rename from programs/haya-cli/main.cpp rename to programs/daobet-cli/main.cpp diff --git a/programs/haya-launcher/CMakeLists.txt b/programs/daobet-launcher/CMakeLists.txt similarity index 85% rename from programs/haya-launcher/CMakeLists.txt rename to programs/daobet-launcher/CMakeLists.txt index 56946567989..00b40172931 100644 --- a/programs/haya-launcher/CMakeLists.txt +++ b/programs/daobet-launcher/CMakeLists.txt @@ -1,4 +1,4 @@ -add_executable( haya-launcher main.cpp ) +add_executable( daobet-launcher main.cpp ) if( UNIX AND NOT APPLE ) set(rt_library rt ) endif() @@ -26,13 +26,13 @@ endif() configure_file(config.hpp.in config.hpp ESCAPE_QUOTES) -target_include_directories(haya-launcher PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) +target_include_directories(daobet-launcher PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) -target_link_libraries(haya-launcher +target_link_libraries(daobet-launcher PRIVATE eosio_chain fc ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} ) install( TARGETS - haya-launcher + daobet-launcher RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR} diff --git a/programs/haya-launcher/config.hpp.in b/programs/daobet-launcher/config.hpp.in similarity index 100% rename from programs/haya-launcher/config.hpp.in rename to programs/daobet-launcher/config.hpp.in diff --git a/programs/haya-launcher/main.cpp b/programs/daobet-launcher/main.cpp similarity index 99% rename from programs/haya-launcher/main.cpp rename to programs/daobet-launcher/main.cpp index d819ca4c2af..92b6339ce9d 100644 --- a/programs/haya-launcher/main.cpp +++ b/programs/daobet-launcher/main.cpp @@ -614,7 +614,7 @@ launcher_def::initialize (const variables_map &vmap) { } } - config_dir_base = "etc/haya"; + config_dir_base = "etc/daobet"; data_dir_base = "var/lib"; next_node = 0; ++prod_nodes; // add one for the bios node @@ -1511,7 +1511,7 @@ launcher_def::launch (eosd_def &instance, string >s) { node_rt_info info; info.remote = !host->is_local(); - string eosdcmd = "programs/haya-node/haya-node "; + string eosdcmd = "programs/daobet-node/daobet-node "; if (skip_transaction_signatures) { eosdcmd += "--skip-transaction-signatures "; } diff --git a/programs/haya-node/CMakeLists.txt b/programs/daobet-node/CMakeLists.txt similarity index 100% rename from programs/haya-node/CMakeLists.txt rename to programs/daobet-node/CMakeLists.txt diff --git a/programs/haya-node/config.hpp.in b/programs/daobet-node/config.hpp.in similarity index 100% rename from programs/haya-node/config.hpp.in rename to programs/daobet-node/config.hpp.in diff --git a/programs/haya-node/main.cpp b/programs/daobet-node/main.cpp similarity index 100% rename from programs/haya-node/main.cpp rename to programs/daobet-node/main.cpp diff --git a/programs/haya-wallet/CMakeLists.txt b/programs/daobet-wallet/CMakeLists.txt similarity index 100% rename from programs/haya-wallet/CMakeLists.txt rename to programs/daobet-wallet/CMakeLists.txt diff --git a/programs/haya-wallet/config.hpp.in b/programs/daobet-wallet/config.hpp.in similarity index 100% rename from programs/haya-wallet/config.hpp.in rename to programs/daobet-wallet/config.hpp.in diff --git a/programs/haya-wallet/main.cpp b/programs/daobet-wallet/main.cpp similarity index 100% rename from programs/haya-wallet/main.cpp rename to programs/daobet-wallet/main.cpp diff --git a/run-node.sh b/run-node.sh index 08ee5aab294..ef5fb61bab5 100755 --- a/run-node.sh +++ b/run-node.sh @@ -1,33 +1,129 @@ NODE_PATH=$HOME/.dao-node -NODE_IMAGE='daocasino/blockchain:v0.2.2' -CONFIG_URL='https://explorer.dao.casino/config' +NODE_IMAGE='daocasino/blockchain:v0.2.3' +CONFIG_URL='https://explorer.daobet.org/config' +read -p "Node data dir: $NODE_PATH, do you want change it? (y/n) " resp +if [ $resp == "y" ]; then + read -p "Enter new node data dir:"$'\n' resp + NODE_PATH=$(realpath $resp) + echo "New node data dir: $NODE_PATH" +fi + +if [ -f $NODE_PATH/config/config.ini ]; then + CONFIG_EXISTS=true +fi + +if [ -d $NODE_PATH/state/blocks ]; then + STATE_EXISTS=true +fi + +if [ -d $NODE_PATH/wallet/ ]; then + WALLET_EXISTS=true +fi mkdir -p $NODE_PATH/config mkdir -p $NODE_PATH/state +mkdir -p $NODE_PATH/wallet + +function download-configs() { + echo "Downloading configs..." + curl -sk $CONFIG_URL/config.ini -o $NODE_PATH/config/config.ini + curl -sk $CONFIG_URL/genesis.json -o $NODE_PATH/config/genesis.json + curl -sk $CONFIG_URL/logger.json -o $NODE_PATH/config/logger.json +} + +if [ $CONFIG_EXISTS ]; then + read -p "Config file already exists, do you want rewrite it? (y/n) " resp + if [ $resp == "y" ]; then + download-configs + fi +else + download-configs +fi +if [ $STATE_EXISTS ]; then + read -p "Blockchain state already exists, do you want delete it? (y/n) " resp + if [ $resp == "y" ]; then + echo "Deleting state..." + sudo rm -rf $NODE_PATH/state/* + fi +fi -curl -sk $CONFIG_URL/config.ini -o $NODE_PATH/config/config.ini -curl -sk $CONFIG_URL/genesis.json -o $NODE_PATH/config/genesis.json -curl -sk $CONFIG_URL/logger.json -o $NODE_PATH/config/logger.json +if [ $WALLET_EXISTS ]; then + read -p "Wallet file already exists, do you want delete it? (y/n) " resp + if [ $resp == "y" ]; then + echo "Deleting wallet files..." + sudo rm -rf $NODE_PATH/wallet/* + fi +fi -docker run -d --cap-add IPC_LOCK \ - --env EOSIO_ROOT=/opt/haya \ +DAO_NODE_EXISTS=$(docker container ls -qf name=dao-node) +DAO_WALLET_EXISTS=$(docker container ls -qf name=dao-wallet) + +function run-dao-node() { + echo "Running dao-node container..." + docker run -d --cap-add IPC_LOCK \ + --env EOSIO_ROOT=/opt/daobet \ --env LD_LIBRARY_PATH=/usr/local/lib \ - --env PATH=/opt/haya/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ + --env PATH=/opt/daobet/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ --name dao-node \ --network host \ --volume $NODE_PATH:/opt/dao:rw \ $NODE_IMAGE \ - /opt/haya/bin/haya-node \ + /opt/daobet/bin/daobet-node \ --config-dir=/opt/dao/config \ --genesis-json=/opt/dao/config/genesis.json \ --logconf=/opt/dao/config/logger.json \ -d /opt/dao/state +} -docker run -d --network host \ +function run-dao-wallet() { + echo "Running dao-wallet container..." + docker run -d --network host \ --volume $NODE_PATH:/opt/dao:rw \ --name dao-wallet $NODE_IMAGE \ - /opt/haya/bin/haya-wallet \ - --http-server-address 127.0.0.1:8899 + /opt/daobet/bin/daobet-wallet \ + --http-server-address=127.0.0.1:8899 \ + --http-alias=localhost:8899 \ + --unlock-timeout=99999999 \ + --wallet-dir=/opt/dao/wallet +} + +if [ $DAO_NODE_EXISTS ]; then + read -p "Dao node docker contrainer already exists, do you want delete it? (y/n) " resp + if [ $resp == "y" ]; then + echo "Deleting old dao-node container..." + docker stop dao-node + docker rm dao-node + run-dao-node + else + read -p "Do you want restart dao node container? (y/n) " resp + if [ $resp == "y" ]; then + echo "Restarting dao-node container..." + docker restart dao-node + fi + fi +else + run-dao-node +fi + + + +if [ $DAO_WALLET_EXISTS ]; then + read -p "Dao wallet docker contrainer already exists, do you want delete it? (y/n) " resp + if [ $resp == "y" ]; then + echo "Deleting old dao-wallet container..." + docker stop dao-wallet + docker rm dao-wallet + run-dao-wallet + else + read -p "Do you want restart dao wallet container? (y/n) " resp + if [ $resp == "y" ]; then + echo "Restarting dao-wallet container..." + docker restart dao-wallet + fi + fi +else + run-dao-wallet +fi diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 1e6c0b656e5..afb80342e96 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -1,6 +1,6 @@ -configure_file(haya-tn_bounce.sh haya-tn_bounce.sh COPYONLY) -configure_file(haya-tn_down.sh haya-tn_down.sh COPYONLY) -configure_file(haya-tn_roll.sh haya-tn_roll.sh COPYONLY) -configure_file(haya-tn_up.sh haya-tn_up.sh COPYONLY) +configure_file(daobet-tn_bounce.sh daobet-tn_bounce.sh COPYONLY) +configure_file(daobet-tn_down.sh daobet-tn_down.sh COPYONLY) +configure_file(daobet-tn_roll.sh daobet-tn_roll.sh COPYONLY) +configure_file(daobet-tn_up.sh daobet-tn_up.sh COPYONLY) configure_file(abi_is_json.py abi_is_json.py COPYONLY) diff --git a/scripts/haya-tn_bounce.sh b/scripts/daobet-tn_bounce.sh similarity index 100% rename from scripts/haya-tn_bounce.sh rename to scripts/daobet-tn_bounce.sh diff --git a/scripts/haya-tn_down.sh b/scripts/daobet-tn_down.sh similarity index 100% rename from scripts/haya-tn_down.sh rename to scripts/daobet-tn_down.sh diff --git a/scripts/haya-tn_roll.sh b/scripts/daobet-tn_roll.sh similarity index 100% rename from scripts/haya-tn_roll.sh rename to scripts/daobet-tn_roll.sh diff --git a/scripts/haya-tn_up.sh b/scripts/daobet-tn_up.sh similarity index 100% rename from scripts/haya-tn_up.sh rename to scripts/daobet-tn_up.sh diff --git a/scripts/haya_build.sh b/scripts/daobet_build.sh similarity index 91% rename from scripts/haya_build.sh rename to scripts/daobet_build.sh index c48de3cd4d5..1db7df9e0ba 100755 --- a/scripts/haya_build.sh +++ b/scripts/daobet_build.sh @@ -1,7 +1,7 @@ #!/bin/bash ########################################################################## # This is the EOSIO automated install script for Linux and Mac OS. -# This file was downloaded from https://github.com/EOSIO/eos +# This file was downloaded from https://github.com/DaoCasino/DAObet # # Copyright (c) 2017, Respective Authors all rights reserved. # @@ -27,7 +27,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. # -# https://github.com/EOSIO/eos/blob/master/LICENSE +# https://github.com/DaoCasino/DAObet/blob/master/LICENSE ########################################################################## VERSION=2.1 # Build script version @@ -165,7 +165,7 @@ fi if [ ! -d "${REPO_ROOT}/.git" ]; then printf "\\nThis build script only works with sources cloned from git\\n" - printf "Please clone a new haya directory with 'git clone https://github.com/mixbytes/haya --recursive'\\n" + printf "Please clone a new daobet directory with 'git clone https://github.com/DaoCasino/DAObet --recursive'\\n" exit 1 fi @@ -208,38 +208,38 @@ if [ "$ARCH" == "Linux" ]; then fi case "$OS_NAME" in "Amazon Linux AMI"|"Amazon Linux") - FILE="${REPO_ROOT}/scripts/haya_build_amazon.sh" + FILE="${REPO_ROOT}/scripts/daobet_build_amazon.sh" CXX_COMPILER=g++ C_COMPILER=gcc ;; "CentOS Linux") - FILE="${REPO_ROOT}/scripts/haya_build_centos.sh" + FILE="${REPO_ROOT}/scripts/daobet_build_centos.sh" CXX_COMPILER=g++ C_COMPILER=gcc ;; "elementary OS") - FILE="${REPO_ROOT}/scripts/haya_build_ubuntu.sh" + FILE="${REPO_ROOT}/scripts/daobet_build_ubuntu.sh" CXX_COMPILER=clang++-4.0 C_COMPILER=clang-4.0 ;; "Fedora") export CPATH=/usr/include/llvm4.0:$CPATH # llvm4.0 for fedora package path inclusion - FILE="${REPO_ROOT}/scripts/haya_build_fedora.sh" + FILE="${REPO_ROOT}/scripts/daobet_build_fedora.sh" CXX_COMPILER=g++ C_COMPILER=gcc ;; "Linux Mint") - FILE="${REPO_ROOT}/scripts/haya_build_ubuntu.sh" + FILE="${REPO_ROOT}/scripts/daobet_build_ubuntu.sh" CXX_COMPILER=clang++-4.0 C_COMPILER=clang-4.0 ;; "Ubuntu") - FILE="${REPO_ROOT}/scripts/haya_build_ubuntu.sh" + FILE="${REPO_ROOT}/scripts/daobet_build_ubuntu.sh" CXX_COMPILER=clang++-4.0 C_COMPILER=clang-4.0 ;; "Debian GNU/Linux") - FILE="${REPO_ROOT}/scripts/haya_build_ubuntu.sh" + FILE="${REPO_ROOT}/scripts/daobet_build_ubuntu.sh" CXX_COMPILER=clang++-4.0 C_COMPILER=clang-4.0 ;; @@ -256,7 +256,7 @@ if [ "$ARCH" == "Darwin" ]; then # opt/gettext: cleos requires Intl, which requires gettext; it's keg only though and we don't want to force linking: https://github.com/EOSIO/eos/issues/2240#issuecomment-396309884 # HOME/lib/cmake: mongo_db_plugin.cpp:25:10: fatal error: 'bsoncxx/builder/basic/kvp.hpp' file not found LOCAL_CMAKE_FLAGS="-DCMAKE_PREFIX_PATH=/usr/local/opt/gettext;$HOME/lib/cmake ${LOCAL_CMAKE_FLAGS}" - FILE="${REPO_ROOT}/scripts/haya_build_darwin.sh" + FILE="${REPO_ROOT}/scripts/daobet_build_darwin.sh" CXX_COMPILER=clang++ C_COMPILER=clang OPENSSL_ROOT_DIR=/usr/local/opt/openssl @@ -282,7 +282,7 @@ $CMAKE -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" -DCMAKE_CXX_COMPILER="${CXX_COMP -DCMAKE_C_COMPILER="${C_COMPILER}" -DCORE_SYMBOL_NAME="${CORE_SYMBOL_NAME}" \ -DOPENSSL_ROOT_DIR="${OPENSSL_ROOT_DIR}" -DBUILD_MONGO_DB_PLUGIN=true \ -DENABLE_COVERAGE_TESTING="${ENABLE_COVERAGE_TESTING}" -DBUILD_DOXYGEN="${DOXYGEN}" \ - -DCMAKE_INSTALL_PREFIX=$OPT_LOCATION/haya -DENABLE_TX_SPONSORSHIP=1 $LOCAL_CMAKE_FLAGS "${REPO_ROOT}" + -DCMAKE_INSTALL_PREFIX=$OPT_LOCATION/daobet -DENABLE_TX_SPONSORSHIP=1 $LOCAL_CMAKE_FLAGS "${REPO_ROOT}" if [ $? -ne 0 ]; then exit -1; fi make -j"${JOBS}" if [ $? -ne 0 ]; then exit -1; fi @@ -301,7 +301,7 @@ printf "| | | | | | | | | | | | | |\n" printf "| | | | | | | | ______/ | | | | |\n" printf "|_| |_| |_| |_| \______/ |_| |_|\n\n${txtrst}" -printf "\\HAYA has been successfully built. %02d:%02d:%02d\\n" $(($TIME_END/3600)) $(($TIME_END%3600/60)) $(($TIME_END%60)) +printf "\\daobet has been successfully built. %02d:%02d:%02d\\n" $(($TIME_END/3600)) $(($TIME_END%3600/60)) $(($TIME_END%60)) printf "==============================================================================================\\n${bldred}" printf "(Optional) Testing Instructions:\\n" print_instructions @@ -309,5 +309,5 @@ printf "${BIN_LOCATION}/mongod --dbpath ${MONGODB_DATA_LOCATION} -f ${MONGODB_CO printf "cd ./build && PATH=\$PATH:$HOME/opt/mongodb/bin make test\\n" # PATH is set as currently 'mongo' binary is required for the mongodb test printf "${txtrst}==============================================================================================\\n" printf "For more information:\\n" -printf "Haya Github: https://github.com/mixbytes/haya\\n" +printf "daobet Github: https://github.com/DaoCasino/DAObet\\n" diff --git a/scripts/haya_build_amazon.sh b/scripts/daobet_build_amazon.sh similarity index 100% rename from scripts/haya_build_amazon.sh rename to scripts/daobet_build_amazon.sh diff --git a/scripts/haya_build_centos.sh b/scripts/daobet_build_centos.sh similarity index 100% rename from scripts/haya_build_centos.sh rename to scripts/daobet_build_centos.sh diff --git a/scripts/haya_build_darwin.sh b/scripts/daobet_build_darwin.sh similarity index 99% rename from scripts/haya_build_darwin.sh rename to scripts/daobet_build_darwin.sh index 3db6630f80a..8dee1c4b062 100755 --- a/scripts/haya_build_darwin.sh +++ b/scripts/daobet_build_darwin.sh @@ -109,7 +109,7 @@ while read -r name tester testee brewname uri; do DISPLAY="${DISPLAY}${COUNT}. ${name}\\n" printf " - %s ${bldred}NOT${txtrst} found.\\n" "${name}" (( COUNT++ )) -done < "${REPO_ROOT}/scripts/haya_build_darwin_deps" +done < "${REPO_ROOT}/scripts/daobet_build_darwin_deps" IFS="${var_ifs}" if [ ! -d /usr/local/Frameworks ]; then diff --git a/scripts/haya_build_darwin_deps b/scripts/daobet_build_darwin_deps similarity index 100% rename from scripts/haya_build_darwin_deps rename to scripts/daobet_build_darwin_deps diff --git a/scripts/haya_build_fedora.sh b/scripts/daobet_build_fedora.sh similarity index 100% rename from scripts/haya_build_fedora.sh rename to scripts/daobet_build_fedora.sh diff --git a/scripts/haya_build_ubuntu.sh b/scripts/daobet_build_ubuntu.sh similarity index 100% rename from scripts/haya_build_ubuntu.sh rename to scripts/daobet_build_ubuntu.sh diff --git a/scripts/haya_install.sh b/scripts/daobet_install.sh similarity index 82% rename from scripts/haya_install.sh rename to scripts/daobet_install.sh index 0d2688334db..5613dc853c7 100755 --- a/scripts/haya_install.sh +++ b/scripts/daobet_install.sh @@ -1,7 +1,7 @@ #!/bin/bash ########################################################################## # This is the EOSIO automated install script for Linux and Mac OS. -# This file was downloaded from https://github.com/mixbytes/haya +# This file was downloaded from https://github.com/DaoCasino/dc-blockchain # # Copyright (c) 2017, Respective Authors all rights reserved. # @@ -27,7 +27,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. # -# https://github.com/mixbytes/haya/blob/master/LICENSE.txt +# https://github.com/mixbytes/daobet/blob/master/LICENSE.txt ########################################################################## SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" @@ -41,7 +41,7 @@ mkdir -p $LIB_LOCATION CMAKE_BUILD_TYPE=Release TIME_BEGIN=$( date -u +%s ) -INSTALL_PREFIX=$OPT_LOCATION/haya +INSTALL_PREFIX=$OPT_LOCATION/daobet VERSION=1.2 txtbld=$(tput bold) @@ -49,7 +49,7 @@ bldred=${txtbld}$(tput setaf 1) txtrst=$(tput sgr0) if [ ! -d $BUILD_DIR ]; then - printf "\\nError, haya_build.sh has not ran. Please run ./haya_build.sh first!\\n\\n" + printf "\\nError, daobet_build.sh has not ran. Please run ./daobet_build.sh first!\\n\\n" exit -1 fi @@ -59,7 +59,7 @@ if ! pushd "${BUILD_DIR}" &> /dev/null;then fi if ! make install; then - printf "\\nMAKE installing EOSIO has exited with the above error.\\n\\n" + printf "\\nMAKE installing DAOBET has exited with the above error.\\n\\n" exit -1 fi popd &> /dev/null @@ -75,8 +75,8 @@ printf "| | | | | | | | ______/ | | | | |\n" printf "|_| |_| |_| |_| \______/ |_| |_|\n\n${txtrst}" printf "==============================================================================================\\n" -printf "HAYA has been installed into ${OPT_LOCATION}/haya/bin!\\n" -printf "If you need to, you can fully uninstall using haya_uninstall.sh && scripts/clean_old_install.sh.\\n" +printf "daobet has been installed into ${OPT_LOCATION}/daobet/bin!\\n" +printf "If you need to, you can fully uninstall using daobet_uninstall.sh && scripts/clean_old_install.sh.\\n" printf "==============================================================================================\\n\\n" -printf "Haya Github: https://github.com/mixbytes/haya\\n" +printf "daobet Github: https://github.com/DaoCasino/dc-blockchain\\n" diff --git a/scripts/haya_uninstall.sh b/scripts/daobet_uninstall.sh similarity index 67% rename from scripts/haya_uninstall.sh rename to scripts/daobet_uninstall.sh index 4e715b3cd6f..129d36eceab 100755 --- a/scripts/haya_uninstall.sh +++ b/scripts/daobet_uninstall.sh @@ -10,27 +10,27 @@ binaries=( eosio-wast2wasm eosiocpp eosio-applesdemo - haya-wallet - haya-node + daobet-wallet + daobet-node ) -if [ -d $OPT_LOCATION/haya ]; then +if [ -d $OPT_LOCATION/daobet ]; then printf "Do you wish to remove this install? (requires sudo)\n" select yn in "Yes" "No"; do case $yn in [Yy]* ) if [ "$(id -u)" -ne 0 ]; then - printf "\nThis requires sudo, please run ./haya_uninstall.sh with sudo\n\n" + printf "\nThis requires sudo, please run ./daobet_uninstall.sh with sudo\n\n" exit -1 fi pushd $HOME &> /dev/null pushd opt &> /dev/null - rm -rf haya + rm -rf daobet # Handle cleanup of directories created from installation if [ "$1" == "--full" ]; then - if [ -d ~/Library/Application\ Support/haya ]; then rm -rf ~/Library/Application\ Support/haya; fi # Mac OS - if [ -d ~/.local/share/haya ]; then rm -rf ~/.local/share/haya; fi # Linux + if [ -d ~/Library/Application\ Support/daobet ]; then rm -rf ~/Library/Application\ Support/daobet; fi # Mac OS + if [ -d ~/.local/share/daobet ]; then rm -rf ~/.local/share/daobet; fi # Linux fi popd &> /dev/null pushd bin &> /dev/null @@ -39,7 +39,7 @@ if [ -d $OPT_LOCATION/haya ]; then done popd &> /dev/null pushd lib/cmake &> /dev/null - rm -rf haya + rm -rf daobet popd &> /dev/null break;; @@ -50,23 +50,23 @@ if [ -d $OPT_LOCATION/haya ]; then done fi -if [ -d "/usr/local/haya" ]; then +if [ -d "/usr/local/daobet" ]; then printf "Do you wish to remove this install? (requires sudo)\n" select yn in "Yes" "No"; do case $yn in [Yy]* ) if [ "$(id -u)" -ne 0 ]; then - printf "\nThis requires sudo, please run ./haya_uninstall.sh with sudo\n\n" + printf "\nThis requires sudo, please run ./daobet_uninstall.sh with sudo\n\n" exit -1 fi pushd /usr/local &> /dev/null pushd opt &> /dev/null - rm -rf haya + rm -rf daobet # Handle cleanup of directories created from installation if [ "$1" == "--full" ]; then - if [ -d ~/Library/Application\ Support/haya ]; then rm -rf ~/Library/Application\ Support/haya; fi # Mac OS - if [ -d ~/.local/share/haya ]; then rm -rf ~/.local/share/haya; fi # Linux + if [ -d ~/Library/Application\ Support/daobet ]; then rm -rf ~/Library/Application\ Support/daobet; fi # Mac OS + if [ -d ~/.local/share/daobet ]; then rm -rf ~/.local/share/daobet; fi # Linux fi popd &> /dev/null pushd bin &> /dev/null @@ -75,7 +75,7 @@ if [ -d "/usr/local/haya" ]; then done popd &> /dev/null pushd lib/cmake &> /dev/null - rm -rf haya + rm -rf daobet popd &> /dev/null break;; diff --git a/scripts/full_uninstaller.sh b/scripts/full_uninstaller.sh index aad88a32d57..c763b69f874 100755 --- a/scripts/full_uninstaller.sh +++ b/scripts/full_uninstaller.sh @@ -1,7 +1,7 @@ #! /bin/bash ANSWER=0 if [[ $1 =~ force-* ]]; then FORCED=1; else FORCED=0; fi -if [ -d "/usr/local/include/haya" ] || [ -d "$HOME/opt/haya" ] || [ $FORCED == 1 ]; then # use force for running the script directly +if [ -d "/usr/local/include/daobet" ] || [ -d "$HOME/opt/daobet" ] || [ $FORCED == 1 ]; then # use force for running the script directly printf "\nEOSIO installation (AND DEPENDENCIES) already found...\n" if [ $1 == 0 ]; then read -p "Do you wish to remove them? (this includes dependencies)? (y/n) " ANSWER @@ -11,9 +11,9 @@ if [ -d "/usr/local/include/haya" ] || [ -d "$HOME/opt/haya" ] || [ $FORCED == 1 echo "Uninstalling..." case $ANSWER in 1 | [Yy]* ) - if [ -d "$HOME/opt/haya" ] || [[ $1 == "force-new" ]]; then + if [ -d "$HOME/opt/daobet" ] || [[ $1 == "force-new" ]]; then if [ $( uname ) == "Darwin" ]; then - # gettext and other brew packages are not modified as they can be dependencies for things other than haya + # gettext and other brew packages are not modified as they can be dependencies for things other than daobet if [ $ANSWER != 1 ]; then read -p "Do you wish to uninstall and unlink all brew installed llvm@4 versions? (y/n) " ANSWER; fi case $ANSWER in 1 | [Yy]* ) @@ -51,9 +51,9 @@ if [ -d "/usr/local/include/haya" ] || [ -d "$HOME/opt/haya" ] || [ $FORCED == 1 * ) echo "Please type 'y' for yes or 'n' for no."; exit;; esac fi - rm -rf $HOME/opt/haya + rm -rf $HOME/opt/daobet rm -f $HOME/bin/eosio-launcher - rm -rf $HOME/lib/cmake/haya + rm -rf $HOME/lib/cmake/daobet rm -rf $HOME/opt/llvm rm -f $HOME/opt/boost rm -rf $HOME/src/boost_* @@ -65,7 +65,7 @@ if [ -d "/usr/local/include/haya" ] || [ -d "$HOME/opt/haya" ] || [ $FORCED == 1 rm -rf $HOME/src/mongo* fi - if [ -d "/usr/local/include/haya" ] || [[ $1 == "force-old" ]]; then + if [ -d "/usr/local/include/daobet" ] || [[ $1 == "force-old" ]]; then if [ "$(id -u)" -ne 0 ]; then printf "\nCleanup requires sudo... Please manually run ./scripts/clean_old_install.sh with sudo.\n" exit -1 @@ -74,10 +74,10 @@ if [ -d "/usr/local/include/haya" ] || [ -d "$HOME/opt/haya" ] || [ $FORCED == 1 rm -rf wasm pushd include &> /dev/null rm -rf libbson-1.0 libmongoc-1.0 mongocxx bsoncxx appbase chainbase eosio.system eosiolib fc libc++ musl secp256k* 2>/dev/null - rm -rf haya 2>/dev/null + rm -rf daobet 2>/dev/null popd &> /dev/null pushd bin &> /dev/null - rm cleos eosio-abigen eosio-applesedemo eosio-launcher eosio-s2wasm eosio-wast2wasm eosiocpp haya-node haya-wallet 2>/dev/null + rm cleos eosio-abigen eosio-applesedemo eosio-launcher eosio-s2wasm eosio-wast2wasm eosiocpp daobet-node daobet-wallet 2>/dev/null popd &> /dev/null libraries=( libeosio_testing @@ -110,19 +110,19 @@ if [ -d "/usr/local/include/haya" ] || [ -d "$HOME/opt/haya" ] || [ $FORCED == 1 done popd &> /dev/null pushd etc &> /dev/null - rm haya 2>/dev/null + rm daobet 2>/dev/null popd &> /dev/null pushd share &> /dev/null - rm haya 2>/dev/null + rm daobet 2>/dev/null popd &> /dev/null pushd usr/share &> /dev/null - rm haya 2>/dev/null + rm daobet 2>/dev/null popd &> /dev/null pushd var/lib &> /dev/null - rm haya 2>/dev/null + rm daobet 2>/dev/null popd &> /dev/null pushd var/log &> /dev/null - rm haya 2>/dev/null + rm daobet 2>/dev/null popd &> /dev/null fi ;; diff --git a/scripts/generate_tarball.sh b/scripts/generate_tarball.sh index 4aa97720fce..919a42f85ca 100644 --- a/scripts/generate_tarball.sh +++ b/scripts/generate_tarball.sh @@ -5,7 +5,7 @@ EOS_PREFIX=${PREFIX}/${SUBPREFIX} mkdir -p ${PREFIX}/bin/ #mkdir -p ${PREFIX}/lib/cmake/${PROJECT} mkdir -p ${EOS_PREFIX}/bin -mkdir -p ${EOS_PREFIX}/licenses/haya +mkdir -p ${EOS_PREFIX}/licenses/daobet #mkdir -p ${EOS_PREFIX}/include #mkdir -p ${EOS_PREFIX}/lib/cmake/${PROJECT} #mkdir -p ${EOS_PREFIX}/cmake @@ -15,7 +15,7 @@ mkdir -p ${EOS_PREFIX}/licenses/haya cp -R ${BUILD_DIR}/bin/* ${EOS_PREFIX}/bin || exit 1 # install licenses -cp -R ${BUILD_DIR}/licenses/haya/* ${EOS_PREFIX}/licenses || exit 1 +cp -R ${BUILD_DIR}/licenses/daobet/* ${EOS_PREFIX}/licenses || exit 1 # install libraries #cp -R ${BUILD_DIR}/lib/* ${EOS_PREFIX}/lib diff --git a/testnet.template b/testnet.template index e1e6644f120..8c910da7bd6 100644 --- a/testnet.template +++ b/testnet.template @@ -37,16 +37,16 @@ echo Initializing ignition sequence at $(date) | tee $logfile echo "http-server-address = $wdaddr" > $wddir/config.ini -programs/haya-wallet/haya-wallet --config-dir $wddir --data-dir $wddir 2> $wddir/wdlog.txt & +programs/daobet-wallet/daobet-wallet --config-dir $wddir --data-dir $wddir 2> $wddir/wdlog.txt & echo $$ > ignition_wallet.pid echo keosd log in $wddir/wdlog.txt >> $logfile sleep 1 ecmd () { echo ===== Start: $step ============ >> $logfile - echo executing: haya-cli --wallet-url $wdurl --url http://$bioshost:$biosport $* | tee -a $logfile + echo executing: daobet-cli --wallet-url $wdurl --url http://$bioshost:$biosport $* | tee -a $logfile echo ----------------------- >> $logfile - programs/haya-cli/haya-cli --wallet-url $wdurl --url http://$bioshost:$biosport $* >> $logfile 2>&1 + programs/daobet-cli/daobet-cli --wallet-url $wdurl --url http://$bioshost:$biosport $* >> $logfile 2>&1 echo ==== End: $step ============== >> $logfile step=$(($step + 1)) } @@ -56,7 +56,7 @@ wcmd () { } cacmd () { - programs/haya-cli/haya-cli --wallet-url $wdurl --url http://$bioshost:$biosport system newaccount --transfer --stake-net "10000000.0000 SYS" --stake-cpu "10000000.0000 SYS" --stake-vote "1.0000 SYS" --buy-ram "10000000.0000 SYS" eosio $* >> $logfile 2>&1 + programs/daobet-cli/daobet-cli --wallet-url $wdurl --url http://$bioshost:$biosport system newaccount --transfer --stake-net "10000000.0000 SYS" --stake-cpu "10000000.0000 SYS" --stake-vote "1.0000 SYS" --buy-ram "10000000.0000 SYS" eosio $* >> $logfile 2>&1 ecmd system regproducer $1 $2 ecmd system voteproducer prods $1 $1 } @@ -99,16 +99,16 @@ ecmd set contract eosio.msig unittests/contracts/eosio.msig eosio.msig.wasm eosi ecmd set contract eosio.wrap unittests/contracts/eosio.wrap eosio.wrap.wasm eosio.wrap.abi echo ===== Start: $step ============ >> $logfile -echo executing: haya-cli --wallet-url $wdurl --url http://$bioshost:$biosport push action eosio.token create '[ "eosio", "10000000000.0000 SYS" ]' -p eosio.token | tee -a $logfile -echo executing: haya-cli --wallet-url $wdurl --url http://$bioshost:$biosport push action eosio.token issue '[ "eosio", "1000000000.0000 SYS", "memo" ]' -p eosio | tee -a $logfile +echo executing: daobet-cli --wallet-url $wdurl --url http://$bioshost:$biosport push action eosio.token create '[ "eosio", "10000000000.0000 SYS" ]' -p eosio.token | tee -a $logfile +echo executing: daobet-cli --wallet-url $wdurl --url http://$bioshost:$biosport push action eosio.token issue '[ "eosio", "1000000000.0000 SYS", "memo" ]' -p eosio | tee -a $logfile echo ----------------------- >> $logfile -programs/haya-cli/haya-cli --wallet-url $wdurl --url http://$bioshost:$biosport push action eosio.token create '[ "eosio", "10000000000.0000 SYS" ]' -p eosio.token >> $logfile 2>&1 -programs/haya-cli/haya-cli --wallet-url $wdurl --url http://$bioshost:$biosport push action eosio.token issue '[ "eosio", "1000000000.0000 SYS", "memo" ]' -p eosio >> $logfile 2>&1 +programs/daobet-cli/daobet-cli --wallet-url $wdurl --url http://$bioshost:$biosport push action eosio.token create '[ "eosio", "10000000000.0000 SYS" ]' -p eosio.token >> $logfile 2>&1 +programs/daobet-cli/daobet-cli --wallet-url $wdurl --url http://$bioshost:$biosport push action eosio.token issue '[ "eosio", "1000000000.0000 SYS", "memo" ]' -p eosio >> $logfile 2>&1 echo ==== End: $step ============== >> $logfile step=$(($step + 1)) ecmd set contract eosio unittests/contracts/eosio.system eosio.system.wasm eosio.system.abi -programs/haya-cli/haya-cli --wallet-url $wdurl --url http://$bioshost:$biosport push action eosio init '[0, "4,SYS"]' -p eosio >> $logfile 2>&1 +programs/daobet-cli/daobet-cli --wallet-url $wdurl --url http://$bioshost:$biosport push action eosio init '[0, "4,SYS"]' -p eosio >> $logfile 2>&1 # Manual deployers, add a series of lines below this block that looks like: # cacmd $PRODNAME[0] $OWNERKEY[0] $ACTIVEKEY[0] @@ -120,4 +120,4 @@ programs/haya-cli/haya-cli --wallet-url $wdurl --url http://$bioshost:$biosport # ------ DO NOT ALTER THE NEXT LINE ------- ###INSERT cacmd -pkill -15 haya-wallet +pkill -15 daobet-wallet diff --git a/tests/Cluster.py b/tests/Cluster.py index cdc7b72b90c..9f968d6fdea 100644 --- a/tests/Cluster.py +++ b/tests/Cluster.py @@ -30,7 +30,7 @@ class Cluster(object): __BiosPort=8788 __LauncherCmdArr=[] __bootlog="eosio-ignition-wd/bootlog.txt" - __configDir="etc/haya/" + __configDir="etc/daobet/" __dataDir="var/lib/" # pylint: disable=too-many-arguments diff --git a/tests/launcher_test.py b/tests/launcher_test.py index 0a6bee73f81..58825b93eb0 100755 --- a/tests/launcher_test.py +++ b/tests/launcher_test.py @@ -39,7 +39,7 @@ killWallet=not dontKill WalletdName=Utils.EosWalletName -ClientName="haya-cli" +ClientName="daobet-cli" timeout = .5 * 12 * 2 + 60 # time for finalization with 1 producer + 60 seconds padding Utils.setIrreversibleTimeout(timeout) diff --git a/tests/testUtils.py b/tests/testUtils.py index 536f51d4d1e..c5d0f53e2d4 100755 --- a/tests/testUtils.py +++ b/tests/testUtils.py @@ -18,21 +18,21 @@ class Utils: Debug=False FNull = open(os.devnull, 'w') - EosClientPath="programs/haya-cli/haya-cli" + EosClientPath="programs/daobet-cli/daobet-cli" MiscEosClientArgs="--no-auto-keosd" - EosWalletName="haya-wallet" - EosWalletPath="programs/haya-wallet/"+ EosWalletName + EosWalletName="daobet-wallet" + EosWalletPath="programs/daobet-wallet/"+ EosWalletName - EosServerName="haya-node" - EosServerPath="programs/haya-node/"+ EosServerName + EosServerName="daobet-node" + EosServerPath="programs/daobet-node/"+ EosServerName - EosLauncherPath="programs/haya-launcher/haya-launcher" + EosLauncherPath="programs/daobet-launcher/daobet-launcher" MongoPath="mongo" ShuttingDown=False CheckOutputDeque=deque(maxlen=10) - EosBlockLogPath="programs/haya-blocklog/haya-blocklog" + EosBlockLogPath="programs/daobet-blocklog/daobet-blocklog" FileDivider="=================================================================" diff --git a/tests/validate-dirty-db.py b/tests/validate-dirty-db.py index 67cb0b6fb93..14043300715 100755 --- a/tests/validate-dirty-db.py +++ b/tests/validate-dirty-db.py @@ -38,7 +38,7 @@ def runNodeosAndGetOutput(myTimeout=3): """Startup nodeos, wait for timeout (before forced shutdown) and collect output. Stdout, stderr and return code are returned in a dictionary.""" Print("Launching nodeos process.") - cmd="programs/haya-node/haya-node --config-dir etc/haya/node_bios --data-dir var/lib/node_bios --verbose-http-errors --http-validate-host=false" + cmd="programs/daobet-node/daobet-node --config-dir etc/daobet/node_bios --data-dir var/lib/node_bios --verbose-http-errors --http-validate-host=false" Print("cmd: %s" % (cmd)) proc=subprocess.Popen(cmd.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE) if debug: Print("Nodeos process launched.") diff --git a/tutorials/bios-boot-tutorial/bios-boot-tutorial.py b/tutorials/bios-boot-tutorial/bios-boot-tutorial.py index 4a8870830be..dea393a5168 100755 --- a/tutorials/bios-boot-tutorial/bios-boot-tutorial.py +++ b/tutorials/bios-boot-tutorial/bios-boot-tutorial.py @@ -351,9 +351,9 @@ def stepLog(): parser.add_argument('--public-key', metavar='', help="EOSIO Public Key", default='EOS8Znrtgwt8TfpmbVpTKvA2oB8Nqey625CLN8bCN3TEbgx86Dsvr', dest="public_key") parser.add_argument('--private-Key', metavar='', help="EOSIO Private Key", default='5K463ynhZoCDDa4RDcr63cUwWLTnKqmdcoTKTHBjqoKfv4u5V7p', dest="private_key") -parser.add_argument('--cleos', metavar='', help="Cleos command", default='../../build/programs/haya-cli/haya-cli --wallet-url http://127.0.0.1:6666 ') -parser.add_argument('--nodeos', metavar='', help="Path to nodeos binary", default='../../build/programs/haya-node/haya-node') -parser.add_argument('--keosd', metavar='', help="Path to keosd binary", default='../../build/programs/haya-wallet/haya-wallet') +parser.add_argument('--cleos', metavar='', help="Cleos command", default='../../build/programs/daobet-cli/daobet-cli --wallet-url http://127.0.0.1:6666 ') +parser.add_argument('--nodeos', metavar='', help="Path to nodeos binary", default='../../build/programs/daobet-node/daobet-node') +parser.add_argument('--keosd', metavar='', help="Path to keosd binary", default='../../build/programs/daobet-wallet/daobet-wallet') parser.add_argument('--contracts-dir', metavar='', help="Path to contracts directory", default='../../build/contracts/') parser.add_argument('--nodes-dir', metavar='', help="Path to nodes directory", default='./nodes/') parser.add_argument('--genesis', metavar='', help="Path to genesis.json", default="./genesis.json")