Open Ligang9 opened 3 weeks ago
Please try WASM SDK development builds (or build from source) from PR https://github.com/kaspanet/rusty-kaspa/pull/459
also, please use --rpclisten-borsh=
if running a local node as Borsh encoding is the default setting in examples.
1.Change to cargo run --release --bin kaspad -- --rpclisten-borsh 2.Use kaspa-wasm32-sdk-latest\kaspa-wasm32-sdk\nodejs\kaspa.js 3.require('./kaspa/kaspa_wasm') is changed to require('./kaspa/kaspa') 7a7440ee783988a2e132bea6b22f991fb971c4eca2f3378e2a99aded7df353ae 027a7440ee783988a2e132bea6b22f991fb971c4eca2f3378e2a99aded7df353ae Full kaspa address: kaspa:qpa8gs8w0quc3ghpx2l2dv30ny0mjuwyaj30xduw92v6mmta7df6uayhcthxq { version: 'PubKey', prefix: 'kaspa', payload: 'qpa8gs8w0quc3ghpx2l2dv30ny0mjuwyaj30xduw92v6mmta7df6uayhcthxq' } node:internal/process/promises:288 triggerUncaughtException(err, true / fromPromise /); ^
[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "Reflect.get called on non-object".] {
code: 'ERR_UNHANDLED_REJECTION'
}
Node.js v18.19.1
in typescript branch
Transaction information: Transaction: { id: '97ec6949659f0ddf6a854c3e554769747b8435ef2a6b96d261dadc92fe20265b', inputs: [ { previousOutpoint: [Object], signatureScript: '41c676b769448c2c58e7e1fe16a54f7c6f70477ba67aa5deaa846693133bf6d5424c26ce35184591f0c4c06faf1acc093b75aeccac378c9954140f3428b3bdf19201', sequence: 0n, sigOpCount: 1, utxo: [Object] } ], outputs: [ { value: 78810n, scriptPublicKey: [Object] } ], version: 0, lock_time: 0n, gas: 0n, subnetworkId: '0000000000000000000000000000000000000000', payload: '' }
Execute node demo.js and report an error
Error: RPC Server (remote error) -> WebSocket disconnected at module.exports.__wbindgen_error_new (C:\Users\Administrator\Desktop\rusty-kaspa\wasm\nodejs\kaspa\kaspa_wasm.js:9347:17) at wasm://wasm/01c0c6fa:wasm-function[545]:0x1c7bda at wasm://wasm/01c0c6fa:wasm-function[1558]:0x308070 at wasm://wasm/01c0c6fa:wasm-function[5091]:0x4bc1c6 at __wbg_adapter_67 (C:\Users\Administrator\Desktop\rusty-kaspa\wasm\nodejs\kaspa\kaspa_wasm.js:272:10) at real (C:\Users\Administrator\Desktop\rusty-kaspa\wasm\nodejs\kaspa\kaspa_wasm.js:243:20)
Node.js v18.19.1