-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[TS SDK] Explore http2 #7432
[TS SDK] Explore http2 #7432
Conversation
exit(0); | ||
} | ||
|
||
async function transafer(sender: AptosAccount, recipient: string, sequenceNumber: bigint, amount: number) { |
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.
transfer or tran safer? 😂
"0x1::coin", | ||
"transfer", |
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.
fyi, for future ease of use: 0x1::aptos_account::transfer_coins
will create the account / register the coin if it doesn't exist
accounts.push(new AptosAccount()); | ||
recipients.push(new AptosAccount()); | ||
} | ||
console.log(`${accounts.length * 2} accounts created`); |
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.
console.log(`${accounts.length * 2} accounts created`); | |
console.log(`${accounts.length + recipients.length} accounts created`); |
nit: Number still the same, but i felt like its more read-able this way :D
fetch(fund, { | ||
method: "POST", | ||
headers: { | ||
Authorization: `Bearer ejfklsdfj7vr4388fhhfh3f78hf345345hf00da0`, |
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.
Curious, what is this bearer token here?
// const txn = await submitTransaction(bcsTxn); | ||
// return txn.hash; |
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.
nit: Forgot to remove these 2 lines?
Description
Explore http2 using fetch-h2 package.
Notes:
axios
but it doesnt support http2.waitFoTransaction
with this new client.Maximum call stack size exceeded
- seems like a known issue RangeError: Maximum call stack size exceeded grantila/fetch-h2#93. Also checked the same process on the low-level http2 node module (what fetch-h2 is based on) and getting aStream closed with error code NGHTTP2_REFUSED_STREAM
error although they claim they fixed it HTTP/2 requests eventually start throwing NGHTTP2_ENHANCE_YOUR_CALM errors nodejs/node#27416https://explorer.aptoslabs.com/account/0x2230fa1a57bf2a1a1e22dcdcd9ef5ce99a0330d5bdb470fc6bc7b4d923d07175
https://explorer.aptoslabs.com/account/0xaad9a573b24d805fe9faa7b29e4c74ce50fe0a48346ce43c35152841faf41abb
https://explorer.aptoslabs.com/account/0x8e61b5b6d0cf993f37050c1c7a77dde01c0c845231db1521f57e66942a537e1b
https://explorer.aptoslabs.com/account/0x89f548868fae1ca803776c85d37b29cfa6b5ab722d5364f02cf3f30ee6e6edfe
All end up with sequence number = 99 - which makes sense since we submitted 100 txns per account.
Thank you David for code inspiration.