Skip to content
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] Initialize sdk_v2 folder structure and basic usage #9448

Merged
merged 3 commits into from
Aug 4, 2023
Merged

Conversation

0xmaayan
Copy link
Contributor

@0xmaayan 0xmaayan commented Aug 3, 2023

Description

This PR is the first step for the sdk_v2 development process. It includes only the basic structure, client files, Aptos class in aptos.ts and AptosConfig in aptos_config.ts

src/
 api
  aptos.ts // main class to initialize
  aptosConfig.ts // global configuration type
 bcs // bcs related operations
 client // core client files
 crypto // holds all crypto related functions (ED25519, multi ED25519, etc) 
 internal // holds internal operations like api calls
 types // sdk types 
 utils // util functions
 index.ts // main file to export all modules

Test Plan

Copy link
Contributor

@gregnazario gregnazario left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I now realize this is mostly just copy pasta, so I'm going to stop commenting on it, but keep in mind anything that's been copied over, and had a bug that was fixed in it, will now diverge.

May just be better to write it from scratch with empty files, and just have all the license, and setup files etc.

ecosystem/typescript/sdk_v2/tsconfig.json Outdated Show resolved Hide resolved
ecosystem/typescript/sdk_v2/src/types/index.ts Outdated Show resolved Hide resolved
ecosystem/typescript/sdk_v2/src/internal/account.ts Outdated Show resolved Hide resolved
ecosystem/typescript/sdk_v2/src/internal/account.ts Outdated Show resolved Hide resolved
add aptos config

add aptos config

support new client

implement new client

support and use post request

create types folder

add gitignore

add utils folder

add openapi generated types

add types folder

add transactions folder

add crypto folder

add bcs folder

add api folder

add account folder

move files location

export aptos api error class

export files

modify tests

install openapi and modify build commands
ecosystem/typescript/sdk_v2/src/client/types.ts Outdated Show resolved Hide resolved
@@ -0,0 +1,2 @@
// hardcoded for now, we would want to have it injected dynamically
export const VERSION = "2.0.0";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder are alpha versions supported in npm?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohh yea, we were thinking on publishing the new SDK under @aptos-labs namespace to comply with all other packages aptos labs holds https://www.npmjs.com/settings/aptos-labs/packages , so something like @aptos-labs/sdk
we can think about it later down the road

Copy link
Contributor

@0xmigo 0xmigo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the plan to create a new sdk_v2 folder, then slowly migrating everything over to sdk_v2, and eventually deprecating/replacing the existing one?

@0xmaayan
Copy link
Contributor Author

0xmaayan commented Aug 4, 2023

Is the plan to create a new sdk_v2 folder, then slowly migrating everything over to sdk_v2, and eventually deprecating/replacing the existing one?

the plan is to create a sdk_v2 that holds sdk v2 files. some would be ported over from v1 and new ones. eventually we would have 2 folders, sdk and sdk_v2 and just publish sdk_v2 under a new name. we keep the sdk folder b/c we need to keep maintaining it for some time

@0xmaayan 0xmaayan enabled auto-merge (squash) August 4, 2023 17:53
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 4, 2023

✅ Forge suite compat success on aptos-node-v1.5.1 ==> d1ad9c95729818b7b68276c5387de70c9f43597f

Compatibility test results for aptos-node-v1.5.1 ==> d1ad9c95729818b7b68276c5387de70c9f43597f (PR)
1. Check liveness of validators at old version: aptos-node-v1.5.1
compatibility::simple-validator-upgrade::liveness-check : committed: 4410 txn/s, latency: 7292 ms, (p50: 6900 ms, p90: 10900 ms, p99: 16000 ms), latency samples: 167580
2. Upgrading first Validator to new version: d1ad9c95729818b7b68276c5387de70c9f43597f
compatibility::simple-validator-upgrade::single-validator-upgrade : committed: 1832 txn/s, latency: 16106 ms, (p50: 18700 ms, p90: 22200 ms, p99: 22300 ms), latency samples: 93440
3. Upgrading rest of first batch to new version: d1ad9c95729818b7b68276c5387de70c9f43597f
compatibility::simple-validator-upgrade::half-validator-upgrade : committed: 1773 txn/s, latency: 15643 ms, (p50: 18800 ms, p90: 21900 ms, p99: 22600 ms), latency samples: 92220
4. upgrading second batch to new version: d1ad9c95729818b7b68276c5387de70c9f43597f
compatibility::simple-validator-upgrade::rest-validator-upgrade : committed: 3450 txn/s, latency: 9328 ms, (p50: 9900 ms, p90: 12900 ms, p99: 13300 ms), latency samples: 144900
5. check swarm health
Compatibility test for aptos-node-v1.5.1 ==> d1ad9c95729818b7b68276c5387de70c9f43597f passed
Test Ok

@github-actions
Copy link
Contributor

github-actions bot commented Aug 4, 2023

✅ Forge suite realistic_env_max_load success on d1ad9c95729818b7b68276c5387de70c9f43597f

two traffics test: inner traffic : committed: 6003 txn/s, latency: 6529 ms, (p50: 6300 ms, p90: 8400 ms, p99: 12300 ms), latency samples: 2599300
two traffics test : committed: 100 txn/s, latency: 2989 ms, (p50: 2900 ms, p90: 3400 ms, p99: 7300 ms), latency samples: 1820
Max round gap was 1 [limit 4] at version 1172955. Max no progress secs was 3.602432 [limit 10] at version 1172955.
Test Ok

@github-actions
Copy link
Contributor

github-actions bot commented Aug 4, 2023

✅ Forge suite framework_upgrade success on aptos-node-v1.5.1 ==> d1ad9c95729818b7b68276c5387de70c9f43597f

Compatibility test results for aptos-node-v1.5.1 ==> d1ad9c95729818b7b68276c5387de70c9f43597f (PR)
Upgrade the nodes to version: d1ad9c95729818b7b68276c5387de70c9f43597f
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 2868 txn/s, latency: 7733 ms, (p50: 7500 ms, p90: 11100 ms, p99: 17700 ms), latency samples: 157760
5. check swarm health
Compatibility test for aptos-node-v1.5.1 ==> d1ad9c95729818b7b68276c5387de70c9f43597f passed
Test Ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants