Skip to content

Commit

Permalink
Copy eos-evm-node and eos-evm-rpc executables into the bin directory …
Browse files Browse the repository at this point in the history
…during build.
  • Loading branch information
oschwaldp-oci committed Aug 2, 2023
1 parent 8dbc112 commit cf5d57c
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 7 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
4 changes: 4 additions & 0 deletions CMakeModules/utils.cmake
Original file line number Diff line number Diff line change
@@ -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 )
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 4 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
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 )
4 changes: 2 additions & 2 deletions tests/nodeos_eos_evm_server/PERFORMANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down
4 changes: 2 additions & 2 deletions tests/nodeos_eos_evm_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)

Expand Down

0 comments on commit cf5d57c

Please sign in to comment.