Skip to content

Commit

Permalink
chore: update readme for generating types
Browse files Browse the repository at this point in the history
  • Loading branch information
devdanco authored Feb 27, 2024
1 parent e15b5be commit f85c0fc
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions generate-types-automation.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
1. Create a new branch from **main** and name it **rpc/***, where the asterisk represents any desired identifier.
2. Initially, in the **packages/type-definitions** directory, include **rpc** and **types** (specifically for Polkadot apps).
3. Incorporate new RPCs and types under **mTypes** and **mRpc**.
4. After that you need to add those **rpc** and **types** into **packages/types**
5. Within the **interfaces/definitions.ts** file, append new types if any changes occur
6. For new RPCs like **xyk** or **pos**, insert their RPC into either **interfaces/xyk/definitions.ts** or **interfaces/pos/definitions.ts**.
7. If there is new rpc you need to create a new folder inside **interfaces** directory like for example **rolldown** directory and inside this directory you need to create **definitions.ts** file
8. Inside the **interfaces/rolldown/definitions.ts** file, ensure to export these RPCs as defaults (refer to the **xyk** or **pos** directory for guidance)
9. These steps encompass the process of adding new RPCs and Types.
10. Subsequently, proceed to push to the branch.
11. Once the changes are committed to the branch, manually initiate the release of all packages containing new RPCs and types.
12. ![Trigger](trigger.png)
13. **User workflow from** change from **main** to your branch in this case **rpc/types/generation**. Customize the elements depicted in the image as per your requirements.
In the Mangata Node repository, the **pr-automation-types.yml** process is triggered, which helps release type definitions, types, and sdk. If you want to add your own custom RPC and types, please follow these instructions:

1. In the **packages/type-definitions** directory, include **rpc** and **types**.
2. Incorporate new RPCs and types under **mTypes** and **mRpc**.
3. After that you need to add those **rpc** and **types** into **packages/types**
4. Within the **interfaces/definitions.ts** file, append new types if any changes occur
5. For new RPCs like **xyk** or **pos**, insert their RPC into either **interfaces/xyk/definitions.ts** or **interfaces/pos/definitions.ts**.
6. If there is new rpc you need to create a new folder inside **interfaces** directory like for example **rolldown** directory and inside this directory you need to create **definitions.ts** file
7. Inside the **interfaces/rolldown/definitions.ts** file, ensure to export these RPCs as defaults (refer to the **xyk** or **pos** directory for guidance)
8. These steps encompass the process of adding new RPCs and Types.
9. Subsequently, proceed to push to the branch.
10. Once the changes are committed to the branch, trigger the CI on the mangata node and it will trigger again this workflow in mangata-dev-kit.

0 comments on commit f85c0fc

Please sign in to comment.