diff --git a/CMakeLists.txt b/CMakeLists.txt index cd4ffa7305850f7661157133eef20a2a6fdc10ca..b855f2fc505277fca6c0b83d180fe6f254709636 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,7 @@ SET( CPACK_GENERATOR "DEB") SET( CPACK_PACKAGE_NAME "${PROJECT_NAME}") SET( CPACK_PACKAGE_VERSION_MAJOR 0) SET( CPACK_PACKAGE_VERSION_MINOR 9) -SET( CPACK_PACKAGE_VERSION_PATCH 0) +SET( CPACK_PACKAGE_VERSION_PATCH 2) SET( CPACK_SYSTEM_NAME "debian-9.5-amd64") @@ -102,9 +102,9 @@ target_include_directories(${PROJECT_NAME} INTERFACE .) target_include_directories(${PROJECT_NAME}-cli INTERFACE .) target_include_directories(${PROJECT_NAME}-tool INTERFACE .) -INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../dist/ DESTINATION ${CMAKE_INSTALL_PREFIX} FILES_MATCHING PATTERN "*" PATTERN "*") +INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/dist/ DESTINATION ${CMAKE_INSTALL_PREFIX} FILES_MATCHING PATTERN "*" PATTERN "*") INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin ) INSTALL(TARGETS ${PROJECT_NAME}-cli DESTINATION ${CMAKE_INSTALL_PREFIX}/bin ) INSTALL(TARGETS ${PROJECT_NAME}-tool DESTINATION ${CMAKE_INSTALL_PREFIX}/bin ) -INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/ DESTINATION ${CMAKE_INSTALL_PREFIX}/bin FILES_MATCHING PATTERN "*" PATTERN "*" PERMISSIONS OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;WORLD_READ;GROUP_READ ) +INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/scripts/ DESTINATION ${CMAKE_INSTALL_PREFIX}/bin FILES_MATCHING PATTERN "*" PATTERN "*" PERMISSIONS OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;WORLD_READ;GROUP_READ ) INCLUDE(CPack) diff --git a/debian/postinst b/debian/postinst index 56288846f746acb06ad6e7ba322c5716feee9b55..9e068ccfa573b3dba7a14a931ec332c8400edf99 100755 --- a/debian/postinst +++ b/debian/postinst @@ -1,13 +1,17 @@ #!/bin/bash -e . /usr/share/debconf/confmodule -DAP_APP_NAME="kelvin-node" +DAP_CHAINS_NAME="kelvin" +DAP_APP_NAME="$DAP_CHAINS_NAME-node" DAP_PREFIX="/opt/$DAP_APP_NAME" DAP_CFG_TPL="$DAP_PREFIX/share/$DAP_APP_NAME.cfg.tpl" +DAP_CFG_TESTNET_TPL="$DAP_PREFIX/share/network/$DAP_CHAINS_NAME-testnet.cfg.tpl" # Store write config to new if present smth DAP_CFG="$DAP_PREFIX/etc/$DAP_APP_NAME.cfg" +DAP_CFG_TESTNET="$DAP_PREFIX/etc/network/$DAP_CHAINS_NAME-testnet.cfg" +# Init node config if [ -e "$DAP_CFG" ]; then DAP_CFG="$DAP_PREFIX/etc/$DAP_APP_NAME.cfg.dpkg-new" else @@ -16,6 +20,14 @@ fi cat $DAP_CFG_TPL > $DAP_CFG || true +# Init testnet +if [ -e "$DAP_CFG_TESTNET" ]; then + DAP_CFG_TESTNET="$DAP_PREFIX/etc/network/$DAP_CHAINS_NAME-testnet.cfg.dpkg-new" +else + DAP_CFG_TESTNET="$DAP_PREFIX/etc/network/$DAP_CHAINS_NAME-testnet.cfg" +fi + +cat $DAP_CFG_TESTNET_TPL > $DAP_CFG_TESTNET || true if [ -e "/etc/systemd/user/$DAP_APP_NAME.service" ]; then echo "Restart $DAP_APP_NAME to implement changes" diff --git a/dist/etc/network/kelvin-testnet.cfg b/dist/etc/network/kelvin-testnet.cfg deleted file mode 100755 index a455dcf256d84622ec225fc97f49b7a6a78c4a19..0000000000000000000000000000000000000000 --- a/dist/etc/network/kelvin-testnet.cfg +++ /dev/null @@ -1,16 +0,0 @@ -# Kelvin Blockchain: development network -# General section -[general] -id=0x0000000000000001 -name=kelvin-testnet -type=development -# Possible values: light, full, archive, master, root -node-role=root -node-alias=localnode -gdb_groups_prefix=kelvin.testnet. - -#[dag-poa] -#node-ca-sign=pvt.localcert - -#[dag-pos] -#node-ca-wallet=mywallet diff --git a/dist/etc/network/kelvin-testnet/chain-0.cfg b/dist/etc/network/kelvin-testnet/chain-0.cfg index 6756a302e3edf6d4e68d42ecf0fc4144fe8830bf..cadfaeb6c9fd449ba5efa667ab8ad014d8353553 100755 --- a/dist/etc/network/kelvin-testnet/chain-0.cfg +++ b/dist/etc/network/kelvin-testnet/chain-0.cfg @@ -14,6 +14,6 @@ datum_add_hashes_count=1 [dag-poa] auth_certs_prefix=kelvin.testnet.root -auth_certs_number=8 -auth_certs_number_verify=5 +auth_certs_number=7 +auth_certs_number_verify=4 auth_certs_dir=/opt/kelvin-node/share/ca diff --git a/dist/share/configs/kelvin-node.cfg b/dist/share/configs/kelvin-node.cfg deleted file mode 100755 index 57f0aa0a0d3d8d48f939a74f270e8cda4d6037d8..0000000000000000000000000000000000000000 --- a/dist/share/configs/kelvin-node.cfg +++ /dev/null @@ -1,36 +0,0 @@ -# General section -[general] -debug_mode=false - - -# Server part -[server] -# By default you don't need to open you to the world -enabled=true -listen_address=0.0.0.0 -listen_port_tcp=8079 - -# VPN stream channel processing module -[vpn] -# Turn to true if you want to share VPN service from you node -enabled=false -# List of loca security access groups. Built in: expats,admins,services,nobody,everybody -access_groups=expats,services,admins -network_address=10.0.0.0 -network_mask=255.255.255.0 - -# Application Resources -[resources] -# 0 means auto detect -threads_cnt=0 -pid_path=/opt/kelvin-node/var/run/kelvin-node.pid -log_file=/opt/kelvin-node/var/log/kelvin-node.log -dap_global_db_path=/opt/kelvin-node/db/global_db.ldb - - -# Small builtin WWW server -[www] -# Really who need this?? -enabled=false -www_root=/opt/dapserver/www -url=/ diff --git a/dist/etc/kelvin-node.cfg b/dist/share/configs/kelvin-node.cfg.tpl similarity index 91% rename from dist/etc/kelvin-node.cfg rename to dist/share/configs/kelvin-node.cfg.tpl index 4d854a396a25c0ef9539a2b5aca1f937cc5d3caa..528d33dc0769d48f52af3f5715b3e52cfd2f395d 100755 --- a/dist/etc/kelvin-node.cfg +++ b/dist/share/configs/kelvin-node.cfg.tpl @@ -4,6 +4,9 @@ debug_mode=false wallets_path=/opt/kelvin-node/var/lib/wallet wallets_default=default node_role=full +# seed mode. WARNING. Used true only when you start the new network +#seed_mode=false + # Server part [server] diff --git a/dist/share/configs/network/kelvin-testnet.cfg.tpl b/dist/share/configs/network/kelvin-testnet.cfg.tpl new file mode 100755 index 0000000000000000000000000000000000000000..c20d050045a6a459813a3975010a357bd8e9d356 --- /dev/null +++ b/dist/share/configs/network/kelvin-testnet.cfg.tpl @@ -0,0 +1,18 @@ +# Kelvin Blockchain: development network +# General section +[general] +id=0x0000000000000001 +name=kelvin-testnet +type=development +# Possible values: light, full, archive, master, root +node-role=root +node-alias=kelvin.testnet.root.0 +gdb_groups_prefix=kelvin.testnet +seed_nodes_ipv4=[159.89.228.115,165.227.17.239,104.248.89.205,157.230.240.104,167.99.87.197,46.101.149.240,159.89.122.48] +seed_nodes_aliases=[kelvin.testnet.root.0,kelvin.testnet.root.1,kelvin.testnet.root.2,kelvin.testnet.root.3,kelvin.testnet.root.4,kelvin.testnet.root.5,kelvin.testnet.root.6] + +[dag-poa] +node-ca-sign=pvt.kelvin.testnet.root.0 + +[dag-pos] +node-ca-wallet=naeper diff --git a/libdap b/libdap index ea3bd462382b3ae26885c0633495eb0c9e7d0ab3..cd32be3478c12e643043f51887c45d38eb251d62 160000 --- a/libdap +++ b/libdap @@ -1 +1 @@ -Subproject commit ea3bd462382b3ae26885c0633495eb0c9e7d0ab3 +Subproject commit cd32be3478c12e643043f51887c45d38eb251d62 diff --git a/libdap-chain b/libdap-chain index e57d9d47d4e79ab12e91959aba5d7c431f7f8925..c328ebef5bbfca18408ccc6a4d5b822916425b3f 160000 --- a/libdap-chain +++ b/libdap-chain @@ -1 +1 @@ -Subproject commit e57d9d47d4e79ab12e91959aba5d7c431f7f8925 +Subproject commit c328ebef5bbfca18408ccc6a4d5b822916425b3f diff --git a/libdap-chain-crypto b/libdap-chain-crypto index 0f25b0859fba05080388b24c0661dda3d845e18d..febf13426e98fccbd47238548f6ac66b6d64daea 160000 --- a/libdap-chain-crypto +++ b/libdap-chain-crypto @@ -1 +1 @@ -Subproject commit 0f25b0859fba05080388b24c0661dda3d845e18d +Subproject commit febf13426e98fccbd47238548f6ac66b6d64daea diff --git a/libdap-chain-cs-dag b/libdap-chain-cs-dag index 865d2227229f224cf3123b960a11d52acb5b32cd..9433046b49f4c1cfd254b071c61bfd780636530e 160000 --- a/libdap-chain-cs-dag +++ b/libdap-chain-cs-dag @@ -1 +1 @@ -Subproject commit 865d2227229f224cf3123b960a11d52acb5b32cd +Subproject commit 9433046b49f4c1cfd254b071c61bfd780636530e diff --git a/libdap-chain-cs-dag-poa b/libdap-chain-cs-dag-poa index f812a7e2ed3006ba466d06fe3bf605a1d23d6e5c..241ad741e9d5f099398ec4f2062ae01f194c5326 160000 --- a/libdap-chain-cs-dag-poa +++ b/libdap-chain-cs-dag-poa @@ -1 +1 @@ -Subproject commit f812a7e2ed3006ba466d06fe3bf605a1d23d6e5c +Subproject commit 241ad741e9d5f099398ec4f2062ae01f194c5326 diff --git a/libdap-chain-global-db b/libdap-chain-global-db index 4856b123f3030742ada8eced1373d3be45bfcec8..2e4ff84b039ab7901a76ac7df5d05b8b1eb42973 160000 --- a/libdap-chain-global-db +++ b/libdap-chain-global-db @@ -1 +1 @@ -Subproject commit 4856b123f3030742ada8eced1373d3be45bfcec8 +Subproject commit 2e4ff84b039ab7901a76ac7df5d05b8b1eb42973 diff --git a/libdap-chain-net b/libdap-chain-net index 49012c77f97666d7e3b33d618f175042f293d56d..b6726042bad2af82b951c5b341cf3ac79d7d3986 160000 --- a/libdap-chain-net +++ b/libdap-chain-net @@ -1 +1 @@ -Subproject commit 49012c77f97666d7e3b33d618f175042f293d56d +Subproject commit b6726042bad2af82b951c5b341cf3ac79d7d3986 diff --git a/libdap-chain-wallet b/libdap-chain-wallet index 1ebe4844c79665f58408c1d107bd741ee4b1e013..af8f50e1bfb4a1048ac13ac7085c143ac7da2538 160000 --- a/libdap-chain-wallet +++ b/libdap-chain-wallet @@ -1 +1 @@ -Subproject commit 1ebe4844c79665f58408c1d107bd741ee4b1e013 +Subproject commit af8f50e1bfb4a1048ac13ac7085c143ac7da2538 diff --git a/sources/main_node_cli_net.c b/sources/main_node_cli_net.c index a87e817625bc3598ff93ba6603b1c797f667e7c4..472c9b48e740468f3223e4e3fabb383227b0343c 100755 --- a/sources/main_node_cli_net.c +++ b/sources/main_node_cli_net.c @@ -155,6 +155,7 @@ int node_cli_post_command(connect_param *conn, cmd_state *cmd) add_mem_data((uint8_t**) &post_data, &post_data_len, cmd->cmd_param[i], strlen(cmd->cmd_param[i])); } } + } add_mem_data((uint8_t**) &post_data, &post_data_len, "\r\n\r\n", 4); if(post_data) ret = curl_easy_setopt(curl, CURLOPT_POSTFIELDS, post_data); // data for POST request @@ -169,9 +170,9 @@ int node_cli_post_command(connect_param *conn, cmd_state *cmd) printf("%s\n", (cmd->cmd_res) ? cmd->cmd_res : "no response"); DAP_DELETE(post_data); return ret; - } - else - printf("%s\n", "no parameters"); + //} + //else + // printf("%s\n", "no parameters"); return -1; }