@avaprotocol/sdk-js 0.7.3 → 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,7 +63,26 @@ 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
67
+
68
+ ```bash
69
+ docker compose up -d --pull always
70
+ ```
71
+
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
+
81
+ ```bash
82
+ npm run gen-apikey
83
+ ```
84
+
85
+ 5. Run the test command with env variables set in `.env.test`.
68
86
 
69
87
  ```bash
70
88
  # Run all tests
@@ -74,12 +92,13 @@ To ensure the SDK is functioning correctly, we have a comprehensive test suite.
74
92
  npm run test:select -- <authWithSignature>
75
93
  ```
76
94
 
77
- 4. In order to individually test `cancelTask` or `deleteTask`, `createTask` test needs to run first.
78
- ```bash
79
- npm run test:select -- "createTask|cancelTask"
80
- ```
95
+ > Note: In order to individually test `cancelTask` or `deleteTask`, `createTask` test needs to run first.
96
+
97
+ > ```bash
98
+ > npm run test:select -- "createTask|cancelTask"
99
+ > ```
81
100
 
82
- This will execute all unit and integration tests. Make sure all tests pass before submitting a pull request or deploying changes.
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.
83
102
 
84
103
  ## Release Process
85
104