-
Notifications
You must be signed in to change notification settings - Fork 259
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
Add web3jsV2 examples #610
base: main
Are you sure you want to change the base?
Add web3jsV2 examples #610
Conversation
// Figure out how many compute units to budget for this transaction | ||
// so that you can right-size the compute budget to maximize the | ||
// chance that it will be selected for inclusion into a block. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since the real compute consumed could vary when it hits the network with more complicated programs, do you think its worth adding in some extra cus? iirc, the helpers
library adds in some small amount of cus to add a little wiggle room (since that is what star atlas found to be effective)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm do you know what staratlas is doing there? Sounds pretty random to just add some number. The Helpers just simulate with a 1.4 mil cu. I was hoping the new function works better. At least this is what luscher recommended. Ill ask him
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/solana-labs/solana-web3.js/tree/master/packages/library#getcomputeunitestimatefortransactionmessagefactoryrpc Ah there is this which explains the problem. Still not sure what value i should recommend. Some random const, some random multiplier? Maybe just a link to the docs.
Problem
Most examples in cookbook only have examples for web3.js@1. With @2 cominig it makes sense to have more examples in both versions of the library.
Summary of Changes
Added examples for:
get-account-balance
load-keypair-from-file
add-memo
add-priority-fees
calculate-cost