Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add additional file sharing check and update readme #859

Merged
merged 3 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .github/docker-file-sharing-settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ The Hedera Local Node project allows developers to set up their own local networ
![settings.png](https://raw.githubusercontent.com/hashgraph/hedera-local-node/refs/heads/main/.github/settings.png)

- Ensure the hedera-local-node folder is added to Docker File Sharing **Settings -> Resources -> File Sharing**.
- If you're using hedera-local as npm package - running 'npm root -g' should output the path you have to add under File Sharing Docker's Setting.
- If you're using hedera-local as cloned repo - running 'pwd' in the project's root should output the path you have to add under File Sharing Docker's Setting.

**Note**: The image may look different if you are on a different version
![docker-file-sharing-settings.png](https://raw.githubusercontent.com/hashgraph/hedera-local-node/refs/heads/main/.github/docker-file-sharing-settings.png)
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hashgraph/hedera-local",
"version": "2.32.4",
"version": "2.32.5",
"description": "Developer tooling for running Local Hedera Network (Consensus + Mirror Nodes).",
"main": "index.ts",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,4 @@ export const RESOURCE_CREATION_STARTING_ASYNCHRONOUS_MESSAGE = `${LOADING} Start

// Docker messages
export const SHARED_PATHS_ERROR = `You can configure shared paths from Docker -> Preferences... -> Resources -> File Sharing.`;
export const MOUNT_ERROR = `: error mounting`;
10 changes: 5 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,19 @@ yargs(hideBin(process.argv))
.epilogue(
`
Requirements:
- Node.js >= v14.x
- Node.js >= v20.11.0
Node version check: node -v
- NPM >= v6.14.17
- NPM >= v10.2.4
NPM version check: npm -v
- Docker >= v20.10.x
- Docker >= v27.3.1
Docker version check: docker -v
- Docker Compose => v2.12.2
- Docker Compose => v2.29.7
Docker Compose version check: docker compose version

* Ensure the gRPC FUSE for file sharing setting is disabled in the docker settings and VirtioFS is enabled
* Ensure the following configurations are set at minimum in Docker Settings -> Resources and are available for use
CPUs: 6
Memory: 8GB
Memory: 8 GB
Swap: 1 GB
Disk Image Size: 64 GB`
)
Expand Down
6 changes: 4 additions & 2 deletions src/services/DockerService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
IS_WINDOWS, NECESSARY_PORTS, UNKNOWN_VERSION, OPTIONAL_PORTS, MIN_CPUS,
MIN_MEMORY_MULTI_MODE, MIN_MEMORY_SINGLE_MODE, RECOMMENDED_CPUS,
RECOMMENDED_MEMORY_SINGLE_MODE, CHECK_SUCCESS, CHECK_FAIL, LOADING,
SHARED_PATHS_ERROR, DOCKER_PULLING_IMAGES_MESSAGE,
SHARED_PATHS_ERROR, DOCKER_PULLING_IMAGES_MESSAGE, MOUNT_ERROR,
} from '../constants';
import { IService } from './IService';
import { LoggerService } from './LoggerService';
Expand Down Expand Up @@ -281,10 +281,12 @@ export class DockerService implements IService{
private logShellOutput(shellExec: any) {
[shellExec.stdout, shellExec.stderr].forEach( (output: string) => {
output.split("\n").map((line: string) => {
if (line.indexOf(SHARED_PATHS_ERROR) > -1) {
if (line.indexOf(SHARED_PATHS_ERROR) > -1 || line.indexOf(MOUNT_ERROR) > -1) {
this.logger.error(`Hedera local node start up TERMINATED due to docker's misconfiguration`);
this.logger.error(SHARED_PATHS_ERROR);
this.logger.error(`See https://docs.docker.com/desktop/settings/mac/#file-sharing for more info.`);
this.logger.error(`-- If you're using hedera-local as npm package - running 'npm root -g' should output the path you have to add under File Sharing Docker's Setting.`);
this.logger.error(`-- If you're using hedera-local as cloned repo - running 'pwd' in the project's root should output the path you have to add under File Sharing Docker's Setting.`);
process.exit();
}
if (line === "") return;
Expand Down
Loading