-
Notifications
You must be signed in to change notification settings - Fork 13
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
Deployment error #3
Comments
It seems that the issue stems from the Cell.fromBoc method not recognizing the BOC (Bag of Cells) data due to either an encoding mismatch or a formatting issue with the provided BOC string. To address this effectively, here are a few steps to consider. First, verify that the BOC string itself (te6ccgEBAgEAMgABFP8A9KQT9LzyyAsBAEbT7UTQddch+kCDB9ch0QLQ0wMx+kAwWMcF8ojU1NEB+wTtVA==) is correct. Even a small typo can cause parsing errors. Additionally, when passing this string to Buffer.from, use the 'base64' encoding explicitly, as shown below, to ensure it’s decoded accurately:
Updating all dependencies is another critical step; libraries like @ton/ton, @ton/core, @ton/crypto, and buffer are frequently updated, and using the latest versions can resolve compatibility issues. Run yarn upgrade to ensure you have the latest releases. Additionally, compatibility with Node.js v20.17.0 may be a factor here, as some libraries perform best on LTS versions. If updating dependencies doesn’t resolve the issue, try downgrading to Node.js 18, a stable LTS version, then reinstall dependencies with yarn install. Lastly, if issues persist after trying the above, check the library documentation or GitHub issues section for any recent updates or alternative methods for BOC parsing. With these steps, your script should work as expected, enabling you to deploy the contract successfully. |
Thank you, explicitly using |
You're welcome! I'm glad that using base64 encoding solved the issue. Adding this detail to the deployment guide is a great idea—it would definitely help others who are new to working with BOC data and encoding. |
I'm trying to deploy contract following provided example
I installed ton.js with
yarn add @ton/ton @ton/crypto @ton/core buffer
.Running
with
node main.js
results in error:
Node.js version:
v20.17.0
Yarn version:
1.22.22
How could this be fixed, or how else to achieve succesful deployment?
The text was updated successfully, but these errors were encountered: