Skip to content

Commit

Permalink
mkdir in generate for existing guild environments
Browse files Browse the repository at this point in the history
  • Loading branch information
TrevorBenson committed Nov 15, 2023
1 parent 0f0b938 commit 5121646
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scripts/cnode-helper-scripts/mithril-client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
# Do NOT modify code below #
######################################

U_ID=$(id -u)
G_ID=$(id -g)

#####################
# Functions #
#####################
Expand All @@ -35,6 +38,10 @@ usage() {

generate_environment_file() {
if [[ -n "${POOL_NAME}" ]] && [[ "${POOL_NAME}" != "CHANGE_ME" ]]; then
if [[ -d "${CNODE_HOME}/mithril/data-stores" ]]; then
sudo mkdir -p "${CNODE_HOME}"/mithril/data-stores
sudo chown -R "$U_ID":"$G_ID" "${CNODE_HOME}"/mithril 2>/dev/null
fi
export ERA_READER_ADDRESS=https://raw.githubusercontent.com/input-output-hk/mithril/main/mithril-infra/configuration/${RELEASE}-${NETWORK_NAME,,}/era.addr
export ERA_READER_VKEY=https://raw.githubusercontent.com/input-output-hk/mithril/main/mithril-infra/configuration/${RELEASE}-${NETWORK_NAME,,}/era.vkey
bash -c "cat <<-'EOF' > ${CNODE_HOME}/mithril/mithril.env
Expand Down
7 changes: 7 additions & 0 deletions scripts/cnode-helper-scripts/mithril-signer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
# Do NOT modify code below #
######################################

U_ID=$(id -u)
G_ID=$(id -g)

#####################
# Functions #
#####################
Expand Down Expand Up @@ -81,6 +84,10 @@ generate_environment_file() {
fi

# Generate the full set of environment variables required by Mithril signer use case
if [[ -d "${CNODE_HOME}/mithril/data-stores" ]]; then
sudo mkdir -p "${CNODE_HOME}"/mithril/data-stores
sudo chown -R "$U_ID":"$G_ID" "${CNODE_HOME}"/mithril 2>/dev/null
fi
export ERA_READER_ADDRESS=https://raw.githubusercontent.com/input-output-hk/mithril/main/mithril-infra/configuration/${RELEASE}-${NETWORK_NAME,,}/era.addr
export ERA_READER_VKEY=https://raw.githubusercontent.com/input-output-hk/mithril/main/mithril-infra/configuration/${RELEASE}-${NETWORK_NAME,,}/era.vkey
sudo bash -c "cat <<-'EOF' > ${CNODE_HOME}/mithril/mithril.env
Expand Down

0 comments on commit 5121646

Please sign in to comment.