bnb-chain / greenfield-js-sdk

JS SDK for Greenfield
https://docs.bnbchain.org/greenfield-js-sdk/
GNU General Public License v3.0
28 stars 16 forks source link

Fix ERR_BUFFER_OUT_OF_BOUNDS issue #563

Closed AndrewChupin closed 2 months ago

AndrewChupin commented 2 months ago

SDK version: "@bnb-chain/bsc-cross-greenfield-sdk": "^0.0.3", "@bnb-chain/greenfield-contracts-sdk": "^1.1.0", "@bnb-chain/greenfield-js-sdk": "^2.1.1"

Environment:

What happened: Using your sample to create bucket, but having some issues. telegram-cloud-photo-size-2-5391100206604475921-y telegram-cloud-photo-size-2-5391100206604475922-y

What you expected to happen: Fix ERR_BUFFER_OUT_OF_BOUNDS error

Have you tried the latest version: yes

How to reproduce it (as minimally and precisely as possible):

Try
const client = Client.create(
        "https://gnfd-testnet-fullnode-tendermint-ap.bnbchain.org",
        "5600",
    );

    const createBucketTx = await client.bucket.createBucket({
        bucketName: "gorandbuck",
        creator: "0X7EEE0E672244F9F199C4D5B644D4351D14EE7D41",
        visibility: VisibilityType.VISIBILITY_TYPE_PUBLIC_READ,
        chargedReadQuota: Long.fromString('0'),
        primarySpAddress: "0x5FFf5A6c94b182fB965B40C7B9F30199b969eD2f", // spInfo.primarySpAddress
        paymentAddress: "0X7EEE0E672244F9F199C4D5B644D4351D14EE7D41",
    });

Logs (paste a small part showing an error (< 10 lines) or link a pastebin, gist, etc. containing more of the log file):

Config (you can paste only the changes you've made):

node command runtime flags:

Anything else we need to know:

AndrewChupin commented 2 months ago

The problem was with NodeJS in version 22.7.0, updated to 22.8.0, now it's OK