diff --git a/docs/generating-gateway-api-specs.md b/docs/generating-gateway-api-specs.md new file mode 100644 index 000000000..7b919a7b8 --- /dev/null +++ b/docs/generating-gateway-api-specs.md @@ -0,0 +1,5 @@ +Whenever new changes are released in the Gateway API, it is important to update the public documentation specs. + +1. run `npx @redocly/cli@latest build-docs gateway-api-schema.yaml --output=gateway-api-specs.html` +2. upload generated `gateway-api-specs.html` file to https://github.com/shambupujar/radix-docs/tree/release/static/api-reference +3. Contact with repository owner (Shambu) to deploy them. diff --git a/docs/releasing-new-version.md b/docs/releasing-new-version.md new file mode 100644 index 000000000..51a4e407e --- /dev/null +++ b/docs/releasing-new-version.md @@ -0,0 +1,41 @@ +General approach to releasing Gateway API: + +1. Crate Git release branch `release/v{major.minor.path}` i.e `release/v1.10.6`. +2. Test Gateway and verify that it works correctly. +3. Make sure to update software version numbers. + 1. update `VersionPrefix` property in `directory.build.props` + 2. update `Version` in [gateway-api-schema.yaml](../src/RadixDlt.NetworkGateway.GatewayApi/gateway-api-schema.yaml) file. +4. Regenerate gateway models by executing [script](../generation/regenerate-gateway-api.py). +``` +cd generation/ +python regenerate-gateway-api.py +``` +5. Regenerate typescript SDK by executing [script](../sdk/typescript/regeneration/generate-typescript-client.py). +``` +cd sdk/typescript/regeneration/ +python generate-typescript-client.py +``` +6. Update [docker-compose.yml](../deployment/docker-compose.yml) image versions pre-emptively (images are still not yet published but to prevent multiple roundtrips to git we can already provide them). +``` +cd generation/ +python update-docker-compose.py {old_version} {new_version} #i.e python update-docker-compose.py v1.10.6 v1.10.7 +``` +7. Make sure to commit all changes made in steps 3, 4, 5, 6. +8. Merge the release branch created in step 1. (`release/v{major.minor.path}`) to `main` branch. +9. Create GitHub release `v{major.minor.path}` draft. + 1. Create a new tag with `v{major.minor.path}` version on `main` branch. + 2. Mark it as pre-release. +10. Publish docker images to repository: + 1. https://hub.docker.com/r/radixdlt/babylon-ng-gateway-api + 2. https://hub.docker.com/r/radixdlt/babylon-ng-data-aggregator + 3. https://hub.docker.com/r/radixdlt/babylon-ng-database-migrations +11. Publish new images to Gateway running on **stokenet** network. +12. Publish API specs docs for **stokenet** network (https://docs.radixdlt.com/api-reference/gateway-api-preview-specs) +13. Verify if it works correctly on **stokenet** network. +14. Publish new images to Gateway running on **mainnet** network. +15. Publish API specs docs for **mainnet** network (available here: https://docs.radixdlt.com/api-reference/gateway-api-specs) +16. Publish typescript SDK created in step 5. to npmjs repository (https://www.npmjs.com/package/@radixdlt/babylon-gateway-api-sdk). +17. Update GitHub release created in step 9 and mark it `Set as the latest release`. +18. Announce release publicly. +19. Merge `main` branch back to `develop`. + diff --git a/docs/updating-core-api-dependency.md b/docs/updating-core-api-dependency.md new file mode 100644 index 000000000..b39927586 --- /dev/null +++ b/docs/updating-core-api-dependency.md @@ -0,0 +1,16 @@ +Gateway API depends on the node’s Core API. + +When the Core API schema changes, we need to update the generated Core API client to consume new features. Follow these steps: + +1. Copy spec file from [node repository](https://github.com/radixdlt/babylon-node/blob/develop/core-rust/core-api-server/core-api-schema.yaml). + - Rename it to `core-api-spec-copy.yaml` + - Place it in `babylon-gateway\src\RadixDlt.CoreApiSdk\core-api-spec-copy.yaml` +2. Execute [this script](regenerate-core-api.py) to regenerate Core API Client. +``` +cd babylon-gateway\generation\ +python regenerate-core-api.py +``` +3. Ensure the project builds successfully after upgrading the Core API client: +``` +dotnet build +``` diff --git a/generation/update-docker-compose.py b/generation/update-docker-compose.py new file mode 100644 index 000000000..31467d885 --- /dev/null +++ b/generation/update-docker-compose.py @@ -0,0 +1,26 @@ +import sys +from pathlib import Path + +if len(sys.argv) != 3: + print("Usage: python replace_version.py ") + sys.exit(1) + +old_value = sys.argv[1] +new_value = sys.argv[2] + +file_path = Path("../deployment/docker-compose.yml") + +if not file_path.exists(): + print(f"Error: {file_path} not found") + sys.exit(1) + +# Read file +content = file_path.read_text(encoding="utf-8") + +# Replace text +updated_content = content.replace(old_value, new_value) + +# Write back +file_path.write_text(updated_content, encoding="utf-8") + +print(f"Replaced '{old_value}' with '{new_value}' in {file_path}") \ No newline at end of file