In order to simplify login during debug session Debug login
button provided in gui (debug mode only).
Please create assets/debug_data.json
file with wallet credentials to use it.
File structure example bellow:
{
"wallet": {
"name": "wasmtest",
"password": "debugpassword",
"seed": "test seed phrase please change with your actual debug seed",
"activated_coins": ["RICK", "MORTY"],
"automateLogin": true
},
"swaps": {
"import": []
}
}
flutter run -d chrome --web-hostname=0.0.0.0 --web-port=7777
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 3650 -nodes -subj "/C=XX/ST=StateName/L=CityName/O=CompanyName/OU=CompanySectionName/CN=CommonNameOrHostname"
flutter run -d chrome --web-hostname=0.0.0.0 --web-port=7777 --web-tls-cert-key-path=key.pem --web-tls-cert-path=cert.pem
Or as a standalone web server for use with any browser:
flutter run -d web-server --web-hostname=0.0.0.0 --web-port=7777 --web-tls-cert-key-path=key.pem --web-tls-cert-path=cert.pem
Since app behavior in mobile browser on physical device may differ from its behavior in Chrome Desktop mobile emulator, sometimes it is necessary to run local app build on a physical mobile phone.
- On your mac:
1.2. Plug in your iPhone to Mac with cable
1.3. Go to System Preferences -> Sharing
1.4. Uncheck 'Internet Sharing' checkbox on the left side, if checked
1.5. Check 'iPhone USB' checkbox on the right
1.6. Check 'Internet Sharing' checkbox on the left again
1.7. At the top of the window you'll see message, similar to 'Computers on your local network can access your computer at: %yourMacName%.local'. You can press 'Edit' button and change
%yourMacName%
with shorter value. 1.8. Runflutter run -d web-server --web-hostname 0.0.0.0 --web-port 53875
in project directory. You can use different port if needed. - On your iPhone:
2.1. Open Safari
2.2. Switch to 'Private' mode (to avoid caching)
2.3. Enter
%yourMacName%.local:53875
in the address bar (%yourMacName%.local
is the value from 1.7, port is from 1.8) 2.4. You should see app running in your mobile browser
-
Server for static files on node.js:
const express = require('express'); const path = require('path'); var app = express(); app.use(express.static(path.join(__dirname, '/build/web'))); app.get('/', (req, res) => { res.sendFile(path.join(__dirname, '/build/web/index.html')); }); app.listen(53875);
-
Change
updateCheckerEndpoint
inlib/app_config/constants.dart
to use your custom version checker endpoint -
Decrease time for checking of version, see
init
method inupdate_bloc.dart
At the time of writing used branch gen-recoverable-swap
-
Setup atomicDex-API, see
-
Setup dev environment, see
-
Run command below
BOB_PASSPHRASE="seedphrase1" ALICE_PASSPHRASE="seedphrase2" TAKER_FAIL_AT="taker_payment_refund" MAKER_FAIL_AT="taker_payment_spend" cargo test --package mm2_main --lib mm2::lp_swap::lp_swap_tests::gen_recoverable_swap -- --exact --ignored --nocapture
-
In the end of test you should see in the console JSON-files with swaps data
Maker swap path /Users/ivan/projects/atomicDEX-API/mm2src/mm2_main/DB/030e5e283d0405ae3d01c6d6fd1e7a060aa61fde/SWAPS/MY/336dc9dd-4a1c-4da8-8a63-a2881067ae0c.json Taker swap path /Users/ivan/projects/atomicDEX-API/mm2src/mm2_main/DB/21605444b36ec72780bdf52a5ffbc18288893664/SWAPS/MY/336dc9dd-4a1c-4da8-8a63-a2881067ae0c.json
-
Copy swap with for your seedphrase to 'assets/debug_data.json', see Debug Login
-
Run Komodo Wallet in debug mode and click 'Debug Login' button in the top right corner
-
Imported swaps should appear in history on the DEX page
Explanation for env variables: