Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion watchdog/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ doctor:
exit 1; \
}
@lua -e "package.cpath = '.deps/lua/?.so;' .. package.cpath; require('lcurl'); print('doctor: lcurl ok')"
@lua -e "package.path = './?.lua;./?/init.lua;' .. package.path; local m=require('watchdog.machine_cartesi').new(); local inst,err=m:load('examples/canonical-app/out/canonical-machine-image'); if not inst then error('doctor: machine_cartesi cannot load devnet image: '..tostring(err)) end; print('doctor: machine_cartesi load ok')"
@LUA_CPATH_5_4="/usr/lib/lua/5.4/?.so;/usr/lib/lua/5.4/?/init.so;${LUA_CPATH_5_4:-;}" LUA_PATH_5_4="/usr/share/lua/5.4/?.lua;/usr/share/lua/5.4/?/init.so;${LUA_PATH_5_4:-;}" lua -e "package.path = './?.lua;./?/init.lua;' .. package.path; local m=require('watchdog.machine_cartesi').new(); local inst,err=m:load('examples/canonical-app/out/canonical-machine-image'); if not inst then error('doctor: machine_cartesi cannot load devnet image: '..tostring(err)) end; print('doctor: machine_cartesi load ok')"
@echo "doctor: watchdog toolchain ok"
10 changes: 10 additions & 0 deletions watchdog/sequencer-watchdog
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ fi
lua_root="${CARTESI_WATCHDOG_LUA_ROOT:-/opt/watchdog/lua}"
lua_bin="${CARTESI_WATCHDOG_LUA_BIN:-lua5.4}"

# Prefer deb-installed cartesi bindings under /usr/lib over stale /usr/local
# copies left by an older manual install (same ordering as the cartesi-machine
# wrapper shipped in machine-emulator_*.deb).
_cartesi_lua_cpath="/usr/lib/lua/5.4/?.so;/usr/lib/lua/5.4/?/init.so"
_cartesi_lua_path="/usr/share/lua/5.4/?.lua;/usr/share/lua/5.4/?/init.so"
export LUA_CPATH="${_cartesi_lua_cpath};${LUA_CPATH:-;}"
export LUA_PATH="${_cartesi_lua_path};${LUA_PATH:-;}"
export LUA_CPATH_5_4="${_cartesi_lua_cpath};${LUA_CPATH_5_4:-;}"
export LUA_PATH_5_4="${_cartesi_lua_path};${LUA_PATH_5_4:-;}"

cd "${lua_root}"

if [[ "$#" -gt 0 && ( "$1" == "init" || "$1" == "tick" ) ]]; then
Expand Down