Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
f6eb74d0
Unverified
Commit
f6eb74d0
authored
Oct 30, 2023
by
Kelvin Fichter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: simplify loading environment vars
parent
a33ecb0d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
12 deletions
+9
-12
getting-started-config.sh
packages/contracts-bedrock/scripts/getting-started-config.sh
+9
-12
No files found.
packages/contracts-bedrock/scripts/getting-started-config.sh
View file @
f6eb74d0
...
@@ -6,21 +6,18 @@
...
@@ -6,21 +6,18 @@
# invalid JSON file when not filled in, which is annoying.
# invalid JSON file when not filled in, which is annoying.
reqenv
()
{
reqenv
()
{
local
var_name
=
"
$1
"
if
[
-z
"
${
!1
}
"
]
;
then
local
var_value
=
"
${
!var_name
}
"
echo
"Error: environment variable '
$1
' is undefined"
if
[
-z
"
$var_value
"
]
;
then
echo
"Error: environment variable
$var_name
is undefined"
exit
1
exit
1
fi
fi
echo
"
$var_value
"
}
}
#
Load
required environment variables
#
Check
required environment variables
GS_ADMIN_ADDRESS
=
$(
reqenv GS_ADMIN_ADDRESS
)
reqenv
"GS_ADMIN_ADDRESS"
GS_BATCHER_ADDRESS
=
$(
reqenv GS_BATCHER_ADDRESS
)
reqenv
"GS_BATCHER_ADDRESS"
GS_PROPOSER_ADDRESS
=
$(
reqenv GS_PROPOSER_ADDRESS
)
reqenv
"GS_PROPOSER_ADDRESS"
GS_SEQUENCER_ADDRESS
=
$(
reqenv GS_SEQUENCER_ADDRESS
)
reqenv
"GS_SEQUENCER_ADDRESS"
L1_RPC_URL
=
$(
reqenv L1_RPC_URL
)
reqenv
"L1_RPC_URL"
# Get the finalized block timestamp and hash
# Get the finalized block timestamp and hash
block
=
$(
cast block finalized
--rpc-url
$L1_RPC_URL
)
block
=
$(
cast block finalized
--rpc-url
$L1_RPC_URL
)
...
@@ -35,7 +32,7 @@ config=$(cat << EOL
...
@@ -35,7 +32,7 @@ config=$(cat << EOL
"l1StartingBlockTag": "
$blockhash
",
"l1StartingBlockTag": "
$blockhash
",
"l1ChainID":
5
,
"l1ChainID":
11155111
,
"l2ChainID": 42069,
"l2ChainID": 42069,
"l2BlockTime": 2,
"l2BlockTime": 2,
"l1BlockTime": 12,
"l1BlockTime": 12,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment