forked from eigenwallet/core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
146 lines (108 loc) · 4.04 KB
/
justfile
File metadata and controls
146 lines (108 loc) · 4.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# Show help for each of the justfile recipes
help:
@just --list
# Build Monero C++ Codebase (currently disabled)
# build_monero_cpp:
# just update_submodules
# cd monero-sys/monero && make -j8 release
# Clean the Monero C++ Codebase and build cache
clean:
cargo clean
cd monero-sys && rm -rf monero monero_c
just update_submodules
# Builds the Rust bindings for Monero
monero_sys:
just update_submodules
cd monero-sys && cargo build
undo-monero-changes:
cd monero-sys/monero && git restore .
# Test the FFI bindings using various sanitizers, that can detect memory safety issues.
test-ffi: test-ffi-address
# Tests the FFI bindings using AddressSanitizer (https://doc.rust-lang.org/beta/unstable-book/compiler-flags/sanitizer.html#addresssanitizer). Can detect memory safety issues like use-after-free, double-free, leaks, etc.
test-ffi-address:
cd monero-sys && RUSTFLAGS=-Zsanitizer=address cargo +nightly nextest run -Zbuild-std --target=`rustc --version --verbose | grep "host:" | cut -d' ' -f2`
# Start the Tauri app
tauri:
cd src-tauri && cargo tauri dev --no-watch -- -vv -- --testnet
tauri-mainnet:
cd src-tauri && cargo tauri dev --no-watch -- -vv
# Install the GUI dependencies
gui_install:
cd src-gui && yarn install
# Start the GUI Dev Server
web:
cd src-gui && yarn dev
gui:
just web & just tauri
gui-mainnet:
just web & just tauri-mainnet
# Build the GUI
gui_build:
cd src-gui && yarn build
build-gui-windows:
cargo tauri build --target x86_64-pc-windows-gnu -- -vv
# Run the Rust tests
tests:
cargo nextest run
# Run docker tests (e.g., "just docker_test happy_path_alice_developer_tip")
docker_test test_name:
cargo test --package swap --test {{test_name}} -- --nocapture
docker_test_happy_path:
just docker_test happy_path
docker_test_happy_path_with_developer_tip:
just docker_test happy_path_alice_developer_tip
docker_test_refund_path:
just docker_test alice_refunds_after_restart_bob_refunded
# Tests the Rust bindings for Monero
test_monero_sys:
cd monero-sys && cargo nextest run
# Builds the ASB and Swap binaries
swap:
cargo build -p swap-asb --bin asb && cd swap && cargo build --bin=swap
# Run the asb on testnet
asb-testnet:
ASB_DEV_ADDR_OUTPUT_PATH="$PWD/src-gui/.env.development" cargo run -p swap-asb --bin asb -- --testnet --trace start --rpc-bind-port 9944 --rpc-bind-host 0.0.0.0
# Launch the ASB controller REPL against a local testnet ASB instance
asb-testnet-controller:
cargo run -p swap-controller --bin asb-controller -- --url http://127.0.0.1:9944
# Updates our submodules (currently only Monero C++ codebase)
update_submodules:
cd monero-sys && git submodule update --init --recursive --force
# Run clippy checks
clippy:
cargo clippy --workspace --all-targets --all-features -- -D warnings
# Generate the bindings for the Tauri API
bindings:
cd src-gui && yarn run gen-bindings
# Format the code
fmt:
dprint fmt
generate-sqlx-cache:
./dev-scripts/regenerate_sqlx_cache.sh
# Run eslint for the GUI frontend
check_gui_eslint:
cd src-gui && yarn run eslint
# Run the typescript type checker for the GUI frontend
check_gui_tsc:
cd src-gui && yarn run tsc --noEmit
# Check for unused code in the GUI frontend
check_gui_unused_code:
cd src-gui && npx knip
test test_name:
cargo test --test {{test_name}} -- --nocapture
# Run the checks for the GUI frontend
check_gui:
just check_gui_eslint || true
just check_gui_tsc
# Sometimes you have to prune the docker network to get the integration tests to work
docker-prune-network:
docker network prune -f
# Install dependencies required for building monero-sys
prepare_mac_os_brew_dependencies:
cd dev-scripts && chmod +x ./brew_dependencies_install.sh && ./brew_dependencies_install.sh
# Takes a crate (e.g monero-rpc-pool) and uses code2prompt to copy to clipboard
# E.g code2prompt . --exclude "*.lock" --exclude ".sqlx/*" --exclude "target"
code2prompt_single_crate crate:
cd {{crate}} && code2prompt . --exclude "*.lock" --exclude ".sqlx/*" --exclude "target"
prepare-windows-build:
cd dev-scripts && ./ubuntu_build_x86_86-w64-mingw32-gcc.sh