Go to file
2022-02-10 14:23:49 +01:00
bin p# Please enter the commit message for your changes. Lines starting 2022-02-10 14:23:49 +01:00
configs monero-javascript v0.5.2 2021-03-10 14:28:56 -05:00
dist p# Please enter the commit message for your changes. Lines starting 2022-02-10 14:23:49 +01:00
docs update jsdocs 2021-12-02 10:37:58 -05:00
external urho3d now builds for web target 2021-12-15 14:34:51 +00:00
src p# Please enter the commit message for your changes. Lines starting 2022-02-10 14:23:49 +01:00
.gitignore add browser tests build 2020-03-27 22:20:35 -04:00
.gitmodules c++ library moved to monero-ecosystem/monero-cpp, update submodule 2020-06-03 13:23:58 -04:00
.project build townforge 2021-12-03 13:21:05 -05:00
CMakeLists.txt p# Please enter the commit message for your changes. Lines starting 2022-02-10 14:23:49 +01:00
donate.png update donate qr <3 2020-06-02 15:57:34 -04:00
index.js add townforge test 2021-12-03 14:27:11 -05:00
LICENSE.txt remove years from license 2021-10-27 07:24:41 -04:00
package-lock.json update names to townforge-wasm 2021-12-07 10:48:35 -05:00
package.json update names to townforge-wasm 2021-12-07 10:48:35 -05:00
README.md build townforge 2021-12-03 13:21:05 -05:00
todo.txt test waits for pool txs if no confirmed txs with destinations 2021-01-15 09:18:23 -05:00
wasm_exception_whitelist.txt update names to townforge-wasm 2021-12-07 10:48:35 -05:00
webpack.base.js update to webpack 5.50.0, manually add polyfills 2021-08-12 17:27:57 -04:00
webpack.tests.js update names to townforge-wasm 2021-12-07 10:48:35 -05:00
webpack.worker.js change references from "monero-core" to "monero-project" 2021-01-13 19:46:43 -05:00

townforge-wasm

Builds townforge as a wasm for the browser.

Building WebAssembly binaries from source

This project uses WebAssembly to package and execute Townforge's source code for use in a browser.

Compiled WebAssembly binaries are committed to ./dist for convenience, but these files can be built independently from source code:

  1. Install and activate emscripten.
    1. Clone emscripten repository: git clone https://github.com/emscripten-core/emsdk.git
    2. cd emsdk
    3. git pull && ./emsdk install latest-upstream && ./emsdk activate latest-upstream && source ./emsdk_env.sh
    4. export EMSCRIPTEN=path/to/emsdk/upstream/emscripten (change for your system)
  2. Clone townforge-wasm's repository: git clone https://github.com/woodser/townforge-wasm.git
  3. cd townforge-wasm
  4. ./bin/update_submodules.sh
  5. Modify ./external/monero-cpp/external/townforge/src/crypto/wallet/CMakeLists.txt from set(MONERO_WALLET_CRYPTO_LIBRARY "auto" ... to set(MONERO_WALLET_CRYPTO_LIBRARY "cn" ....
  6. ./bin/build_all.sh (install townforge dependencies as needed for your system)

Running tests

  1. Clone the project repository: git clone https://github.com/woodser/townforge-wasm.git
  2. cd townforge-wasm
  3. Start RPC servers:
    1. Download and install Monero CLI.
    2. Start monero-daemon-rpc, e.g.: ./monerod --stagenet (or use a remote daemon).
    3. Start monero-wallet-rpc, e.g.: ./monero-wallet-rpc --daemon-address http://localhost:38081 --stagenet --rpc-bind-port 38084 --rpc-login rpc_user:abc123 --wallet-dir ./
  4. Configure the appropriate RPC endpoints, authentication, and other settings in TestUtils.js (e.g. WALLET_RPC_CONFIG and DAEMON_RPC_CONFIG).

Running tests in Node.js

  • Run all tests: npm test
  • Run tests by their description, e.g.: npm run test -- --grep "Can get transactions"

Running tests in a browser

  1. Start monero-wallet-rpc servers used by tests: ./bin/start_wallet_rpc_test_servers.sh
  2. In another terminal, build browser tests: ./bin/build_browser_tests.sh
  3. Access http://localhost:8080/tests.html in a browser to run all tests

License

This project is licensed under MIT.