@avaprotocol/sdk-js 0.7.2 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -33,9 +33,7 @@ import { AvaSDK } from "ava-sdk-js";
33
33
 
34
34
  ## Development
35
35
 
36
- ### Regenerating gRPC Types
37
-
38
- In the case of `.proto` files at https://github.com/AvaProtocol/EigenLayer-AVS/blob/main/protobuf/avs.proto changes, the gRPC types needs to be regenerated.Before regenerating the types from the protocol buffers, ensure that `grpc_tools_node_protoc` is installed globally on your system. You can install it using npm:
36
+ ### Install Dependencies and Download Proto Files
39
37
 
40
38
  ```bash
41
39
  npm install # install grpc-tools, etc. as dev dependencies
@@ -49,9 +47,10 @@ npm run proto-download
49
47
 
50
48
  # Generate the TypeScript types and gRPC code based on the downloaded .proto file
51
49
  npm run gen-protoc
52
- ```
53
50
 
54
- > Important: the last line of the `grpc_codegen/avs_pb.js` needs to be manually added after the `gen-protoc` command. These type definitions must be exported; otherwise they will be undefined in the SDK. For example: `export const { Task, CreateTaskReq, CreateTaskResp, GetKeyReq, KeyResp, UpdateChecksReq, UpdateChecksResp, AddressResp, AddressRequest } = proto.aggregator;`
51
+ # Build the source files in to ./dist folder
52
+ npm run build
53
+ ```
55
54
 
56
55
  ### Running Tests
57
56
 
@@ -64,39 +63,42 @@ To ensure the SDK is functioning correctly, we have a comprehensive test suite.
64
63
  ```
65
64
  2. Before running the e2e tests, make sure to configure the required environment variables in your `.env.test` file, based on the `.env.example` file.
66
65
 
67
- 3. Run the test command. This will test the SDK against test server, configured in `.env.test`.
66
+ 3. Bring up a locally environment for aggregator
68
67
 
69
68
  ```bash
70
- # Run all tests
71
- npm test
72
-
73
- # or, run a specific test
74
- npm run test:select -- <authWithSignature>
69
+ docker compose up -d --pull always
75
70
  ```
76
71
 
77
- 4. In order to individually test `cancelTask` or `deleteTask`, `createTask` test needs to run first.
72
+ > By default the above command will pull the docker image of the latest commit on the `main` branch of https://github.com/AvaProtocol/EigenLayer-AVS. Alternatively, we could also run tests against a specific commit with the below command.
73
+ >
74
+ > ```
75
+ > export AVS_BUILD_VERSION=git-commit-hash-123
76
+ > docker compose up -d --pull always
77
+ > ```
78
+
79
+ 4. Generate a test API key for the local tests with the following command. It will automatically save the output to the `TEST_API_KEY` variable in `.env.test`.
80
+
78
81
  ```bash
79
- npm run test:select -- "createTask|cancelTask"
82
+ npm run gen-apikey
80
83
  ```
81
84
 
82
- This will execute all unit and integration tests. Make sure all tests pass before submitting a pull request or deploying changes.
83
-
84
- ## Version Management
85
+ 5. Run the test command with env variables set in `.env.test`.
85
86
 
86
- This project uses [Changesets](https://github.com/changesets/changesets) to manage versions and changelogs. To contribute changes:
87
+ ```bash
88
+ # Run all tests
89
+ npm test
87
90
 
88
- 1. Make your changes to the codebase.
89
- 2. Run `npm run changeset` to create a new changeset.
90
- 3. Follow the prompts to describe your changes.
91
- 4. Commit the generated changeset file along with your changes.
91
+ # or, run a specific test
92
+ npm run test:select -- <authWithSignature>
93
+ ```
92
94
 
93
- To release a new version:
95
+ > Note: In order to individually test `cancelTask` or `deleteTask`, `createTask` test needs to run first.
94
96
 
95
- 1. Run `npm run version` to update package versions and changelogs.
96
- 2. Review and commit the changes.
97
- 3. Run `npm run release` to publish the new version to npm.
97
+ > ```bash
98
+ > npm run test:select -- "createTask|cancelTask"
99
+ > ```
98
100
 
99
- For more detailed information on using Changesets, refer to the [Changesets documentation](https://github.com/changesets/changesets/blob/main/docs/intro-to-using-changesets.md).
101
+ This will execute all unit and integration tests. Make sure all tests pass in local dev environment before submitting a pull request or deploying changes.
100
102
 
101
103
  ## Release Process
102
104
 
@@ -120,10 +122,10 @@ This repository uses a two-step workflow process for creating new releases:
120
122
 
121
123
  The NPM publishing of dev versions can be handled manually, since the test cases reference the dist folder and don’t require a new version on NPM. NPM publish on dev tag is only required for testing the new version in a web app.
122
124
 
123
- 1. Publish a dev version and test it in your local environment:
125
+ 1. Publish a dev version and test it in your local environment. The `npm publish` will use the version number in `package.json`, so run `npm version prerelease --preid=dev` first if you need a new version number.
124
126
 
125
127
  ```bash
126
- # Update version with dev tag in package.json
128
+ # Optionally, update version with dev tag in package.json
127
129
  npm version prerelease --preid=dev
128
130
 
129
131
  # Publish to npm with dev tag