You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Crypto City 7029c0e1da p# Please enter the commit message for your changes. Lines starting 12 months ago
bin p# Please enter the commit message for your changes. Lines starting 12 months ago
configs monero-javascript v0.5.2 2 years ago
dist p# Please enter the commit message for your changes. Lines starting 12 months ago
docs update jsdocs 1 year ago
external urho3d now builds for web target 1 year ago
src p# Please enter the commit message for your changes. Lines starting 12 months ago
.gitignore add browser tests build 3 years ago
.gitmodules c++ library moved to monero-ecosystem/monero-cpp, update submodule 3 years ago
.project build townforge 1 year ago
CMakeLists.txt p# Please enter the commit message for your changes. Lines starting 12 months ago
LICENSE.txt remove years from license 1 year ago
README.md build townforge 1 year ago
donate.png update donate qr <3 3 years ago
index.js add townforge test 1 year ago
package-lock.json update names to townforge-wasm 1 year ago
package.json update names to townforge-wasm 1 year ago
todo.txt test waits for pool txs if no confirmed txs with destinations 2 years ago
wasm_exception_whitelist.txt update names to townforge-wasm 1 year ago
webpack.base.js update to webpack 5.50.0, manually add polyfills 1 year ago
webpack.tests.js update names to townforge-wasm 1 year ago
webpack.worker.js change references from "monero-core" to "monero-project" 2 years ago

README.md

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.