diff --git a/docs/content/User/StepByStepGuide.md b/docs/content/User/StepByStepGuide.md index 53bd57662..31be1bd08 100644 --- a/docs/content/User/StepByStepGuide.md +++ b/docs/content/User/StepByStepGuide.md @@ -1,5 +1,7 @@ ## Advanced User Guide + For those who would like to have more control or need some customized setups, here are some step by step instructions of how to setup and deploy a solo network. + ### Setup Kubernetes cluster #### Remote cluster @@ -28,6 +30,7 @@ Then run the following command to set the kubectl context to the new cluster: ```bash kind create cluster -n "${SOLO_CLUSTER_NAME}" ``` + Example output ``` @@ -48,7 +51,6 @@ Thanks for using kind! 😊 You may now view pods in your cluster using `k9s -A` as below: - ``` Context: kind-solo <0> all Attach Delete | |/ _/ __ \______ @@ -75,7 +77,6 @@ You may now view pods in your cluster using `k9s -A` as below: └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ ``` - ### Step by Step Instructions * Initialize `solo` directories: @@ -136,13 +137,16 @@ Kubernetes Cluster : kind-solo ✔ Generate gRPC TLS Keys ✔ Finalize ``` + PEM key files are generated in `~/.solo/keys` directory. + ``` hedera-node1.crt hedera-node3.crt s-private-node1.pem s-public-node1.pem unused-gossip-pem hedera-node1.key hedera-node3.key s-private-node2.pem s-public-node2.pem unused-tls hedera-node2.crt hedera-node4.crt s-private-node3.pem s-public-node3.pem hedera-node2.key hedera-node4.key s-private-node4.pem s-public-node4.pem ``` + * Setup cluster with shared components ``` diff --git a/examples/README.md b/examples/README.md index ce383a6d5..95ee98d8c 100644 --- a/examples/README.md +++ b/examples/README.md @@ -10,7 +10,7 @@ * make sure that your current kubeconfig context is pointing to the cluster that you want to deploy to * run `task` which will do the rest and deploy the network and take care of many of the pre-requisites -NOTES: +NOTES: * Some of these examples are for running against large clusters with a lot of resources available. * the `env` environment variables if set in your shell will take precedence over what is in the Taskfile.yml. e.g. `export HEDERA_SERVICES_ROOT=` diff --git a/src/core/lease/interval_lease.ts b/src/core/lease/interval_lease.ts index 5d54a8338..c610f8453 100644 --- a/src/core/lease/interval_lease.ts +++ b/src/core/lease/interval_lease.ts @@ -23,7 +23,6 @@ import {sleep} from '../helpers.js'; import {Duration} from '../time/duration.js'; import type {Lease, LeaseRenewalService} from './lease.js'; import {StatusCodes} from 'http-status-codes'; -import chalk from 'chalk'; /** * Concrete implementation of a Kubernetes based time-based mutually exclusive lock via the Coordination API. @@ -144,14 +143,16 @@ export class IntervalLease implements Lease { async acquire(): Promise { const lease = await this.retrieveLease(); - if (!lease || IntervalLease.checkExpiration(lease) || this.heldBySameProcess(lease)) { + if (!lease || this.heldBySameProcess(lease)) { return this.createOrRenewLease(lease); + } else if (IntervalLease.checkExpiration(lease)) { + return this.transferLease(lease); } const otherHolder: LeaseHolder = LeaseHolder.fromJson(lease.spec.holderIdentity); if (this.heldBySameMachineIdentity(lease) && !otherHolder.isProcessAlive()) { - return await this.transferLease(lease); + return this.transferLease(lease); } throw new LeaseAcquisitionError( @@ -220,7 +221,6 @@ export class IntervalLease implements Lease { * @throws LeaseRelinquishmentError - If the lease is already acquired by another process or an error occurs during relinquishment. */ async release(): Promise { - this.client.logger.showUser(`${chalk.gray('releasing lease')}`); const lease = await this.retrieveLease(); if (this.scheduleId) { @@ -329,10 +329,8 @@ export class IntervalLease implements Lease { this.leaseHolder.toJson(), this.durationSeconds, ); - } else if (this.leaseHolder.equals(LeaseHolder.fromJson(lease.spec.holderIdentity))) { - await this.client.renewNamespaceLease(this.leaseName, this.namespace, lease); } else { - await this.client.transferNamespaceLease(lease, this.leaseHolder.toJson()); + await this.client.renewNamespaceLease(this.leaseName, this.namespace, lease); } if (!this.scheduleId) {