Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] offline error #929

Open
loversmile opened this issue Sep 24, 2024 · 2 comments
Open

[Bug] offline error #929

loversmile opened this issue Sep 24, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@loversmile
Copy link

🐛 Bug Report

when I run this template code
https://github.com/AleoNet/sdk/tree/testnet-beta/create-aleo-app/template-offline-public-transaction-ts

it works ok when online, but when I disconnect the netwrok , it raise the error before. I have download the provider key before I close the network.

.........
Proving the transfer execution
wasm://wasm/01e2a6fa:1

RuntimeError: unreachable
at wasm://wasm/01e2a6fa:wasm-function[2983]:0x6ef8ea
at wasm://wasm/01e2a6fa:wasm-function[3698]:0x70dc22
at wasm://wasm/01e2a6fa:wasm-function[3504]:0x708499
at wasm://wasm/01e2a6fa:wasm-function[198]:0x1f8d4e
at wasm://wasm/01e2a6fa:wasm-function[114]:0xb8acc
at wasm://wasm/01e2a6fa:wasm-function[2493]:0x6b5c38
at wasm://wasm/01e2a6fa:wasm-function[1378]:0x60bb2b
at wasm://wasm/01e2a6fa:wasm-function[3656]:0x70ce0b
at wasm://wasm/01e2a6fa:wasm-function[225]:0x22b440
at wasm://wasm/01e2a6fa:wasm-function[508]:0x3b9466

Node.js v22.2.0

Steps to Reproduce

Code snippet to reproduce

# Add code here

Stack trace & error message

// Paste the output here

Expected Behavior

(Write what you expected to happen here)

Your Environment

@loversmile loversmile added the bug Something isn't working label Sep 24, 2024
@zhp1254
Copy link

zhp1254 commented Sep 24, 2024

Hi, do you know how to sign the offline tx by private key?

@loversmile
Copy link
Author

Hi, do you know how to sign the offline tx by private key?

use the buildTransferPublicTxOffline function, and use the privatekey like this

 const seedStr = "fa059434f92fe98a793d9123456789064f4b8661be07d03248ee7b1234567890";
    const seed = fromHexString(seedStr)

    const pKey = PrivateKey.from_seed_unchecked(seed);

    var account = new Account({
        privateKey: pKey.to_string()
    })
    programManager.setAccount(account);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants