-
Notifications
You must be signed in to change notification settings - Fork 19
fix: fix mnode scripts and update code owners #26
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
Merged
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
fb6fc1d
fix: fix mnode scripts
stevanlohja 3cd14d6
feat: add mn-devrel as code owner
stevanlohja 2018e69
fix: explicitly pin shell to use
gilescope 11e282b
fix: rm devrel codeowner
stevanlohja 309733b
fix: updates
stevanlohja ee60068
Merge branch 'main' into fix-node-scripts
stevanlohja e695434
fix: update midnight-node script
stevanlohja File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,4 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| if [ -z "$MIDNIGHT_NODE_IMAGE" ]; then | ||
| echo "Error: Env var MIDNIGHT_NODE_IMAGE is not set or is empty" | ||
| echo "Please install direnv and run 'direnv allow' to activate it." | ||
| exit 1 | ||
| fi | ||
|
|
||
| docker exec -t midnight /midnight-node "$@" | ||
| # Docker compose up midnight-node interactively in shell. | ||
| docker compose -f compose.yml up | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,30 @@ | ||
| #!/usr/bin/env bash | ||
| # | ||
| # This will mount the ./data dir and allow you to run a series of midnight commands | ||
| # | ||
| # To register an SPO: | ||
| # | ||
| # ./midnight-node wizards generate-keys | ||
| # ./midnight-node wizards register1 USE Ogmios hostname: host.docker.internal | ||
| # | ||
|
|
||
| docker exec -it midnight bash | ||
| # Define container name | ||
| CONTAINER_NAME="midnight" | ||
|
|
||
| # Check if the container already exists | ||
| if [ $(docker ps -a -f name=^${CONTAINER_NAME}$ --format '{{.Names}}' | grep -w ${CONTAINER_NAME} | wc -l) -eq 0 ]; then | ||
| echo "Container '${CONTAINER_NAME}' does not exist. Creating and starting it..." | ||
|
|
||
| # Run the container with the specified configuration | ||
| docker run -it \ | ||
| --name ${CONTAINER_NAME} \ | ||
| -e CFG_PRESET="${CFG_PRESET}" \ | ||
| -e DB_SYNC_POSTGRES_CONNECTION_STRING="${DB_SYNC_POSTGRES_CONNECTION_STRING}" \ | ||
| -v ./data:/data \ | ||
| -v "./envs/${CFG_PRESET}/pc-chain-config.json:/pc-chain-config.json" \ | ||
| --entrypoint bash \ | ||
| "${MIDNIGHT_NODE_IMAGE}" | ||
| else | ||
| echo "Container '${CONTAINER_NAME}' already exists. Opening an interactive shell..." | ||
|
|
||
| # Check if the container is running, if not, start it | ||
| if [ $(docker ps -f name=^${CONTAINER_NAME}$ --format '{{.Names}}' | grep -w ${CONTAINER_NAME} | wc -l) -eq 0 ]; then | ||
| echo "Starting container '${CONTAINER_NAME}'..." | ||
| docker start ${CONTAINER_NAME} | ||
| fi | ||
|
|
||
| # Open an interactive shell in the container | ||
| docker exec -it ${CONTAINER_NAME} /bin/bash | ||
| fi |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before midnight-node.sh could be run with arguments. It's going to ignore all arguments with this definition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the previous command it wants the container running...
What if we simply delete midnight-node.sh and just have midnight-shell.sh to simply assist with the registration part, then they can docker compose up midnight node?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated midnight-node script