Skip to content

Commit c13116f

Browse files
authored
Prepare for 0.0.3 release (#18)
* Enhance Besu binary management and update configuration - Added methods for logging and verifying the Besu binary path, ensuring the correct binary is used for service configuration. - Updated the BesuNodeConfig struct to include a required version field for better configuration management. - Refactored the installation process to improve error handling and logging during Besu binary installation. - Implemented tests for binary path construction and detection logic to ensure robustness. These changes improve the reliability and clarity of the Besu node management process. Signed-off-by: dviejokfs <dviejo@kfs.es> * Update API documentation and enhance chaincode management features - Regenerated Swagger documentation to reflect recent changes, including updates to the `service.Mode` field in `docs.go`, `swagger.json`, and `swagger.yaml`. - Enhanced the `ChaincodeService` to include new fields for managing Docker labels and environment variables during chaincode deployment, improving deployment flexibility. - Introduced new API endpoints for managing chaincode definitions, including deployment and retrieval functionalities, ensuring better interaction with chaincode operations. - Updated frontend components to integrate new chaincode management dialogs and timeline features, enhancing user experience for chaincode actions. These changes improve the overall functionality and usability of the chaincode management features, providing better tools for users to interact with chaincode deployments. Signed-off-by: dviejokfs <dviejo@kfs.es> * Update dependencies and enhance API documentation - Updated `go.mod` and `go.sum` to include new dependencies and versions for improved functionality. - Regenerated Swagger documentation to reflect recent changes in API endpoints and response structures, ensuring clarity and usability. - Enhanced error handling in various components to provide more informative feedback during operations, improving overall user experience. These changes improve the application's reliability and maintainability, providing better tools for managing dependencies and API interactions. Signed-off-by: dviejokfs <dviejo@kfs.es> * Refactor Besu installation process and enhance error handling - Updated error messages in the Besu installation process for improved clarity, changing "Docker daemon" to "docker daemon" for consistency. - Removed redundant symlink creation and verification steps in the installation method, streamlining the process. - Enhanced the ChaincodeDefinitionCard component by removing the deploy mutation logic, delegating it to the DeployChaincodeDialog for better separation of concerns. - Simplified the DeployChaincodeDialog by removing unused imports and ensuring it integrates smoothly with the updated deployment logic. These changes improve the maintainability and clarity of the Besu installation and chaincode management processes, enhancing overall user experience. Signed-off-by: David VIEJO <dviejo@kungfusoftware.es> * Implement Besu node configuration validation in the service layer - Added a new method `validateBesuNodeConfig` in the `NodeService` to validate the configuration of Besu nodes, ensuring all required fields are present and correctly formatted. - Implemented checks for network ID, key ID, P2P and RPC ports, host addresses, and deployment modes, providing clear error messages for invalid configurations. - Removed the previous implementation of `validateBesuNodeConfig` from `service.go` to maintain a single source of truth for validation logic. - Updated the HTTP handler to utilize the new validation method, enhancing error handling and response clarity for Besu node configuration requests. These changes improve the robustness and maintainability of the Besu node management process, ensuring that configurations are validated before being processed. Signed-off-by: David VIEJO <dviejo@kungfusoftware.es> * Enhance CI/CD workflow by adding Java 21 setup in e2e tests - Updated the e2e-tests.yaml workflow to include a step for setting up Java 21 using the `actions/setup-java@v4` action. - This addition ensures that the necessary Java environment is available for running end-to-end tests, improving the reliability of the CI/CD pipeline. These changes enhance the testing framework by ensuring compatibility with Java 21, which may be required for certain functionalities in the application. Signed-off-by: David VIEJO <dviejo@kungfusoftware.es> * Enhance chaincode management by adding CORE_CHAINCODE_ID_NAME environment variable - Introduced the CORE_CHAINCODE_ID_NAME environment variable in the .env file during chaincode installation, improving clarity in chaincode identification. - Updated DockerChaincodeDeployer to include CORE_CHAINCODE_ID_NAME in the environment variables for chaincode deployment, ensuring consistency across configurations. - Enhanced FabricLifecycle to set CORE_CHAINCODE_ID_NAME during pre-start operations, providing better context for chaincode management. These changes improve the overall management and identification of chaincode instances, enhancing user experience and operational clarity. Signed-off-by: dviejokfs <dviejo@kfs.es> * Enhance error handling in Fabric chaincode operations - Improved error handling in the ApproveFabricChaincode and CommitFabricChaincode methods to provide more detailed feedback on endorsement errors. - Enhanced error messages to include specific details from gRPC status responses, improving clarity for users during chaincode approval and commit processes. - Updated logging to ensure consistent error reporting across chaincode operations, enhancing overall maintainability and user experience. These changes significantly improve the robustness of chaincode management by providing clearer insights into errors encountered during operations. Signed-off-by: dviejokfs <dviejo@kfs.es> --------- Signed-off-by: dviejokfs <dviejo@kfs.es> Signed-off-by: David VIEJO <dviejo@kungfusoftware.es>
1 parent e13d856 commit c13116f

38 files changed

+1711
-396
lines changed

.github/workflows/e2e-tests.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,13 @@ jobs:
9494
steps:
9595
- name: Checkout code
9696
uses: actions/checkout@v4
97+
98+
- name: Set up Java 21
99+
uses: actions/setup-java@v4
100+
with:
101+
distribution: 'temurin'
102+
java-version: '21'
103+
97104
- name: Download build artifacts
98105
uses: actions/download-artifact@v4
99106
with:

cmd/fabric/install/install.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,9 @@ func (c installCmd) start() error {
332332
err = os.WriteFile(c.envFile, []byte(fmt.Sprintf(`
333333
CORE_CHAINCODE_ADDRESS=%s
334334
CORE_CHAINCODE_ID=%s
335+
CORE_CHAINCODE_ID_NAME=%s
335336
CORE_PEER_TLS_ENABLED=false
336-
`, c.chaincodeAddress, packageID)), 0777)
337+
`, c.chaincodeAddress, packageID, packageID)), 0777)
337338
if err != nil {
338339
c.logger.Warn("Failed to write .env file: %s", err)
339340
return err

docs/docs.go

Lines changed: 129 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Package docs Code generated by swaggo/swag at 2025-07-31 10:54:08.320933 +0200 CEST m=+4.426527085. DO NOT EDIT
1+
// Package docs Code generated by swaggo/swag at 2025-08-06 09:23:14.506210668 +0200 CEST m=+4.793752287. DO NOT EDIT
22
package docs
33

44
import "github.com/swaggo/swag"
@@ -5929,6 +5929,29 @@ const docTemplate = `{
59295929
}
59305930
}
59315931
},
5932+
"/nodes/readiness/besu": {
5933+
"get": {
5934+
"description": "Check if Java and Besu are installed and ready for deployment",
5935+
"consumes": [
5936+
"application/json"
5937+
],
5938+
"produces": [
5939+
"application/json"
5940+
],
5941+
"tags": [
5942+
"nodes"
5943+
],
5944+
"summary": "Check Besu readiness",
5945+
"responses": {
5946+
"200": {
5947+
"description": "OK",
5948+
"schema": {
5949+
"$ref": "#/definitions/service.BesuReadinessResponse"
5950+
}
5951+
}
5952+
}
5953+
}
5954+
},
59325955
"/nodes/{id}": {
59335956
"get": {
59345957
"description": "Get a node by ID",
@@ -11240,7 +11263,7 @@ const docTemplate = `{
1124011263
},
1124111264
"/sc/fabric/definitions/{definitionId}/deploy": {
1124211265
"post": {
11243-
"description": "Deploy chaincode for a given definition using Docker image",
11266+
"description": "Deploy a chaincode definition using Docker",
1124411267
"consumes": [
1124511268
"application/json"
1124611269
],
@@ -11250,7 +11273,7 @@ const docTemplate = `{
1125011273
"tags": [
1125111274
"Chaincode"
1125211275
],
11253-
"summary": "Deploy chaincode based on chaincode definition (Docker)",
11276+
"summary": "Deploy a chaincode definition",
1125411277
"parameters": [
1125511278
{
1125611279
"type": "integer",
@@ -11260,7 +11283,7 @@ const docTemplate = `{
1126011283
"required": true
1126111284
},
1126211285
{
11263-
"description": "Docker deploy params",
11286+
"description": "Deployment parameters",
1126411287
"name": "request",
1126511288
"in": "body",
1126611289
"required": true,
@@ -12794,12 +12817,14 @@ const docTemplate = `{
1279412817
"description": "Compiled contract bytecode",
1279512818
"type": "array",
1279612819
"items": {
12797-
"type": "integer"
12820+
"type": "integer",
12821+
"format": "int32"
1279812822
}
1279912823
},
1280012824
"chainID": {
1280112825
"description": "Chain ID for the target network",
12802-
"type": "integer"
12826+
"type": "integer",
12827+
"format": "int64"
1280312828
},
1280412829
"constructorArgs": {
1280512830
"description": "Constructor arguments for the contract",
@@ -12981,7 +13006,8 @@ const docTemplate = `{
1298113006
"additionalProperties": {
1298213007
"type": "array",
1298313008
"items": {
12984-
"type": "integer"
13009+
"type": "integer",
13010+
"format": "int32"
1298513011
}
1298613012
}
1298713013
}
@@ -13039,7 +13065,8 @@ const docTemplate = `{
1303913065
"additionalProperties": {
1304013066
"type": "array",
1304113067
"items": {
13042-
"type": "integer"
13068+
"type": "integer",
13069+
"format": "int32"
1304313070
}
1304413071
}
1304513072
}
@@ -13148,7 +13175,16 @@ const docTemplate = `{
1314813175
}
1314913176
},
1315013177
"chainlaunchdeploy.DeployChaincodeByDefinitionRequest": {
13151-
"type": "object"
13178+
"type": "object",
13179+
"properties": {
13180+
"environment_variables": {
13181+
"description": "Environment variables for the chaincode container",
13182+
"type": "object",
13183+
"additionalProperties": {
13184+
"type": "string"
13185+
}
13186+
}
13187+
}
1315213188
},
1315313189
"chainlaunchdeploy.DeploymentResult": {
1315413190
"type": "object",
@@ -13226,7 +13262,8 @@ const docTemplate = `{
1322613262
"type": "string"
1322713263
},
1322813264
"sequence": {
13229-
"type": "integer"
13265+
"type": "integer",
13266+
"format": "int64"
1323013267
},
1323113268
"version": {
1323213269
"type": "string"
@@ -13257,7 +13294,8 @@ const docTemplate = `{
1325713294
"description": "Serialized CollectionConfigPackage",
1325813295
"type": "array",
1325913296
"items": {
13260-
"type": "integer"
13297+
"type": "integer",
13298+
"format": "int32"
1326113299
}
1326213300
},
1326313301
"endorsementPolicy": {
@@ -13276,7 +13314,8 @@ const docTemplate = `{
1327613314
"type": "string"
1327713315
},
1327813316
"sequence": {
13279-
"type": "integer"
13317+
"type": "integer",
13318+
"format": "int64"
1328013319
},
1328113320
"version": {
1328213321
"type": "string"
@@ -13293,7 +13332,8 @@ const docTemplate = `{
1329313332
"description": "Serialized CollectionConfigPackage",
1329413333
"type": "array",
1329513334
"items": {
13296-
"type": "integer"
13335+
"type": "integer",
13336+
"format": "int32"
1329713337
}
1329813338
},
1329913339
"endorsementPolicy": {
@@ -13309,7 +13349,8 @@ const docTemplate = `{
1330913349
"type": "string"
1331013350
},
1331113351
"sequence": {
13312-
"type": "integer"
13352+
"type": "integer",
13353+
"format": "int64"
1331313354
},
1331413355
"version": {
1331513356
"type": "string"
@@ -13341,7 +13382,8 @@ const docTemplate = `{
1334113382
"description": "Chaincode package bytes",
1334213383
"type": "array",
1334313384
"items": {
13344-
"type": "integer"
13385+
"type": "integer",
13386+
"format": "int32"
1334513387
}
1334613388
},
1334713389
"peer": {
@@ -13365,7 +13407,8 @@ const docTemplate = `{
1336513407
"type": "string"
1336613408
},
1336713409
"sequence": {
13368-
"type": "integer"
13410+
"type": "integer",
13411+
"format": "int64"
1336913412
},
1337013413
"version": {
1337113414
"type": "string"
@@ -16283,7 +16326,8 @@ const docTemplate = `{
1628316326
"items": {
1628416327
"type": "array",
1628516328
"items": {
16286-
"type": "integer"
16329+
"type": "integer",
16330+
"format": "int32"
1628716331
}
1628816332
}
1628916333
},
@@ -16448,6 +16492,7 @@ const docTemplate = `{
1644816492
},
1644916493
"models.Duration": {
1645016494
"type": "integer",
16495+
"format": "int64",
1645116496
"enum": [
1645216497
-9223372036854775808,
1645316498
9223372036854775807,
@@ -17281,6 +17326,55 @@ const docTemplate = `{
1728117326
}
1728217327
}
1728317328
},
17329+
"service.BesuReadinessInfo": {
17330+
"type": "object",
17331+
"properties": {
17332+
"error": {
17333+
"type": "string"
17334+
},
17335+
"installed": {
17336+
"type": "boolean"
17337+
},
17338+
"path": {
17339+
"type": "string"
17340+
},
17341+
"version": {
17342+
"type": "string"
17343+
}
17344+
}
17345+
},
17346+
"service.BesuReadinessResponse": {
17347+
"type": "object",
17348+
"properties": {
17349+
"arch": {
17350+
"type": "string"
17351+
},
17352+
"besu": {
17353+
"$ref": "#/definitions/service.BesuReadinessInfo"
17354+
},
17355+
"errors": {
17356+
"type": "array",
17357+
"items": {
17358+
"type": "string"
17359+
}
17360+
},
17361+
"java": {
17362+
"$ref": "#/definitions/service.JavaReadinessInfo"
17363+
},
17364+
"platform": {
17365+
"type": "string"
17366+
},
17367+
"ready": {
17368+
"type": "boolean"
17369+
},
17370+
"warnings": {
17371+
"type": "array",
17372+
"items": {
17373+
"type": "string"
17374+
}
17375+
}
17376+
}
17377+
},
1728417378
"service.CreateSettingParams": {
1728517379
"type": "object",
1728617380
"properties": {
@@ -17408,6 +17502,23 @@ const docTemplate = `{
1740817502
}
1740917503
}
1741017504
},
17505+
"service.JavaReadinessInfo": {
17506+
"type": "object",
17507+
"properties": {
17508+
"error": {
17509+
"type": "string"
17510+
},
17511+
"installed": {
17512+
"type": "boolean"
17513+
},
17514+
"path": {
17515+
"type": "string"
17516+
},
17517+
"version": {
17518+
"type": "string"
17519+
}
17520+
}
17521+
},
1741117522
"service.Mode": {
1741217523
"type": "string",
1741317524
"enum": [
@@ -17672,6 +17783,7 @@ const docTemplate = `{
1767217783
},
1767317784
"time.Duration": {
1767417785
"type": "integer",
17786+
"format": "int64",
1767517787
"enum": [
1767617788
-9223372036854775808,
1767717789
9223372036854775807,

0 commit comments

Comments
 (0)