Code Monkey home page Code Monkey logo

Comments (8)

woodser avatar woodser commented on May 18, 2024

Thanks for pointing out the issue with MoneroError. That's fixed in 1e29000.

Does this have issues when the Library is called via Workers?

By default, the library will run all WASM wallets in a single web worker off the main thread. I believe running multiple wallets in multiple workers runs into the issue of concurrent daemon requests interfering with each other, but maybe there is a way around that.

from monero-ts.

HCPioquinto avatar HCPioquinto commented on May 18, 2024

I did what you said and let the WASMs run on their own and not to a specified Worker. Thanks a ton.

Another quick question: Why does Memory object out of etc whatever will display when you are attempting to open/create two wallets at once

from monero-ts.

HCPioquinto avatar HCPioquinto commented on May 18, 2024
RuntimeError: memory access out of bounds

Here's the issue when trying to open two wallets at once

from monero-ts.

woodser avatar woodser commented on May 18, 2024

Why does Memory object out of etc whatever will display when you are attempting to open/create two wallets at once

I'm not able to reproduce an error by creating or opening multiple wallets at once, with or without await. Can you elaborate how you're creating it?

from monero-ts.

HCPioquinto avatar HCPioquinto commented on May 18, 2024

Probably due to my weak computer so not particularly sure regarding that one. But what I basically did was have an array of at least 2 wallets with { mnemonic, heght} then attempt to recover it by looping like

// Sample code
wallets.map( wallet => {
    const walletConfig = {
         path: pathjs.join(walletsDir, mnemonicHash),
          mnemonic: wallet.mnemonic,
        restoreHeight: wallet.height
   };
     monerojs.createWalletWasm( walletConfig)
   }):

^ Kind of pseudo coding here but I think you get the idea

Then the memory access out of bounds will display.

from monero-ts.

HCPioquinto avatar HCPioquinto commented on May 18, 2024

While we are at it a quick question:

I am currently doing like a way to open a wallet first then save it later to a specified path as I intend to use the hashed mnemonic of that wallet as the filename of the WASMs to be saved.

I was thinking of doing either:
a.) Create wallet, get mnemonic, close without saving then restore (in which I think it's not efficient but willing to be corrected)

b.) Create wallet, get mnemonic, set path, save using the path. (in which I was checking the code is not possible for now?) and this is my first choice but is there a way to set a path after a wallet WASM is created??

c.) Create wallet with path, get mnemonic, hash mnemonic, close and save WASM, rename all files related to that WASM (wasm, wasm.keys, wasm.address.txt)

Which would be the optimal / possible route to take for now? Thanks a ton @woodser

from monero-ts.

woodser avatar woodser commented on May 18, 2024

I'm still not able to reproduce the memory access out of bounds error. monerojs.createWalletWasm(...) returns a promise which needs to be awaited/resolved before the wallet is fully initialized. Perhaps that's the problem?

I added support for MoneroWalletWasm.moveTo(path) (committed to master) which can save the wallet after being created in-memory. Hope that resolves your issue?

from monero-ts.

woodser avatar woodser commented on May 18, 2024

Closing this since the original issue is resolved. Please open another issue if further help is needed.

from monero-ts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.