From cf5d57c060e10f97d14699de369da8723a81d1cf Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Wed, 2 Aug 2023 10:50:22 -0500 Subject: [PATCH] Copy eos-evm-node and eos-evm-rpc executables into the bin directory during build. --- CMakeLists.txt | 3 +++ CMakeModules/utils.cmake | 4 ++++ README.md | 4 ++-- src/CMakeLists.txt | 5 ++++- tests/nodeos_eos_evm_server/PERFORMANCE.md | 4 ++-- tests/nodeos_eos_evm_test.py | 4 ++-- 6 files changed, 17 insertions(+), 7 deletions(-) create mode 100644 CMakeModules/utils.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 9354013..640a82e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,10 @@ cmake_minimum_required(VERSION 3.16.2) +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules") + include(cmake/cable/bootstrap.cmake) include(CableBuildType) +include(utils) cable_set_build_type(DEFAULT Release CONFIGURATION_TYPES Release Debug) if(NOT CMAKE_TOOLCHAIN_FILE) diff --git a/CMakeModules/utils.cmake b/CMakeModules/utils.cmake new file mode 100644 index 0000000..d0d5528 --- /dev/null +++ b/CMakeModules/utils.cmake @@ -0,0 +1,4 @@ +macro( copy_bin file ) + add_custom_command( TARGET ${file} POST_BUILD COMMAND mkdir -p ${CMAKE_BINARY_DIR}/bin ) + add_custom_command( TARGET ${file} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/${file}${CMAKE_EXECUTABLE_SUFFIX} ${CMAKE_BINARY_DIR}/bin/ ) +endmacro( copy_bin ) diff --git a/README.md b/README.md index db97544..a993a69 100644 --- a/README.md +++ b/README.md @@ -48,8 +48,8 @@ make -j8 ``` You'll get the list of binaries with other tools: ``` -src/eos-evm-node -src/eos-evm-rpc +bin/eos-evm-node +bin/eos-evm-rpc ``` Alternatively, to build with specific compiler: diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7e1bbd4..a3e949b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -30,4 +30,7 @@ target_link_libraries(eos-evm-node PRIVATE appbase abieos sys_plugin engine_plug add_executable(eos-evm-rpc eos-evm-rpc.cpp) target_include_directories(eos-evm-rpc PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -target_link_libraries(eos-evm-rpc PRIVATE appbase abieos sys_plugin rpc_plugin boost_filesystem version) \ No newline at end of file +target_link_libraries(eos-evm-rpc PRIVATE appbase abieos sys_plugin rpc_plugin boost_filesystem version) + +copy_bin( eos-evm-node ) +copy_bin( eos-evm-rpc ) diff --git a/tests/nodeos_eos_evm_server/PERFORMANCE.md b/tests/nodeos_eos_evm_server/PERFORMANCE.md index 374fef1..c2a35c9 100644 --- a/tests/nodeos_eos_evm_server/PERFORMANCE.md +++ b/tests/nodeos_eos_evm_server/PERFORMANCE.md @@ -68,14 +68,14 @@ cd .. ### Launch eos-evm-node ``` -cd ~/evmperf/eos-evm/build/cmd +cd ~/evmperf/eos-evm/build/bin rm -rf chaindata etl-temp config-dir ./eos-evm-node --plugin=blockchain_plugin --ship-endpoint=127.0.0.1:8999 --genesis-json=$HOME/evmperf/leap/build/eos-evm-genesis.json --verbosity=4 ``` ### Launch eos-evm-rpc ``` -cd ~/evmperf/eos-evm/build/cmd +cd ~/evmperf/eos-evm/build/bin ./eos-evm-rpc --eos-evm-node=127.0.0.1:8080 --http-port=0.0.0.0:8881 --chaindata=./ --api-spec=eth,debug,net,trace --verbosity=4 ``` diff --git a/tests/nodeos_eos_evm_test.py b/tests/nodeos_eos_evm_test.py index f88a84f..534554b 100755 --- a/tests/nodeos_eos_evm_test.py +++ b/tests/nodeos_eos_evm_test.py @@ -661,7 +661,7 @@ def makeReservedEvmAddress(account): os.makedirs(dataDir) outFile = open(nodeStdOutDir, "w") errFile = open(nodeStdErrDir, "w") - cmd = f"{eosEvmBuildRoot}/src/eos-evm-node --plugin=blockchain_plugin --ship-endpoint=127.0.0.1:8999 --genesis-json={genesisJson} --verbosity=5 --nocolor=1 --chain-data={dataDir}" + cmd = f"{eosEvmBuildRoot}/bin/eos-evm-node --plugin=blockchain_plugin --ship-endpoint=127.0.0.1:8999 --genesis-json={genesisJson} --verbosity=5 --nocolor=1 --chain-data={dataDir}" Utils.Print(f"Launching: {cmd}") evmNodePOpen=Utils.delayedCheckOutput(cmd, stdout=outFile, stderr=errFile) @@ -672,7 +672,7 @@ def makeReservedEvmAddress(account): rpcStdErrDir = dataDir + "/eos-evm-rpc.stderr" outFile = open(rpcStdOutDir, "w") errFile = open(rpcStdErrDir, "w") - cmd = f"{eosEvmBuildRoot}/src/eos-evm-rpc --eos-evm-node=127.0.0.1:8080 --http-port=0.0.0.0:8881 --chaindata={dataDir} --api-spec=eth,debug,net,trace" + cmd = f"{eosEvmBuildRoot}/bin/eos-evm-rpc --eos-evm-node=127.0.0.1:8080 --http-port=0.0.0.0:8881 --chaindata={dataDir} --api-spec=eth,debug,net,trace" Utils.Print(f"Launching: {cmd}") evmRPCPOpen=Utils.delayedCheckOutput(cmd, stdout=outFile, stderr=errFile)