Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
burrow
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hang Yu
burrow
Commits
be6622f8
Commit
be6622f8
authored
9 years ago
by
Ethan Buchman
Browse files
Options
Downloads
Patches
Plain Diff
fetch > install, cleanup
parent
8792c0e1
No related branches found
No related tags found
Loading
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
DOCKER/chain_install.sh
+4
-10
4 additions, 10 deletions
DOCKER/chain_install.sh
DOCKER/chain_run.sh
+1
-8
1 addition, 8 deletions
DOCKER/chain_run.sh
DOCKER/config.toml
+3
-3
3 additions, 3 deletions
DOCKER/config.toml
DOCKER/start.sh
+7
-12
7 additions, 12 deletions
DOCKER/start.sh
with
15 additions
and
33 deletions
DOCKER/chain_
fetch
.sh
→
DOCKER/chain_
install
.sh
+
4
−
10
View file @
be6622f8
#! /bin/sh
#! /bin/sh
ifExit
(){
#-----------------------------------------------------------------------
if
[
$?
-ne
0
]
;
then
# get genesis, seed, copy config
echo
$1
exit
1
fi
}
# fetching a chain means grabbing its genesis.json (from etcb) and putting it in the right folder
# etcb chain (given by $NODE_ADDR)
# we also copy in the config.toml, and update grab the seed node from etcb
## get chain id for main reference chain (given by NODE_ADDR)
REFS_CHAIN_ID
=
$(
mintinfo
--node-addr
$NODE_ADDR
genesis chain_id
)
REFS_CHAIN_ID
=
$(
mintinfo
--node-addr
$NODE_ADDR
genesis chain_id
)
ifExit
"Error fetching default chain id from
$NODE_ADDR
"
ifExit
"Error fetching default chain id from
$NODE_ADDR
"
REFS_CHAIN_ID
=
$(
echo
"
$REFS_CHAIN_ID
"
|
tr
-d
'"'
)
# remove surrounding quotes
REFS_CHAIN_ID
=
$(
echo
"
$REFS_CHAIN_ID
"
|
tr
-d
'"'
)
# remove surrounding quotes
...
@@ -49,6 +42,7 @@ echo "Host name: ${HOST_NAME}"
...
@@ -49,6 +42,7 @@ echo "Host name: ${HOST_NAME}"
sed
-i
"s/^
\(
moniker
\s
*=
\s
*
\)
.*
\$
/
\1\"
$HOST_NAME
\"
/"
"
${
CHAIN_DIR
}
/config.toml"
sed
-i
"s/^
\(
moniker
\s
*=
\s
*
\)
.*
\$
/
\1\"
$HOST_NAME
\"
/"
"
${
CHAIN_DIR
}
/config.toml"
ifExit
"Error setting host name in config.toml"
ifExit
"Error setting host name in config.toml"
#-----------------------------------------------------------------------
# would be nice if we could stop syncing once we're caught up ...
# would be nice if we could stop syncing once we're caught up ...
echo
"Running mint in
${
CHAIN_DIR
}
"
echo
"Running mint in
${
CHAIN_DIR
}
"
...
...
This diff is collapsed.
Click to expand it.
DOCKER/chain_run.sh
+
1
−
8
View file @
be6622f8
#! /bin/bash
#! /bin/sh
ifExit
(){
if
[
$?
-ne
0
]
;
then
echo
$1
exit
1
fi
}
# if no CHAIN_ID, get that off the main test net
# if no CHAIN_ID, get that off the main test net
if
[[
!
$CHAIN_ID
]]
;
then
if
[[
!
$CHAIN_ID
]]
;
then
...
...
This diff is collapsed.
Click to expand it.
DOCKER/config.toml
+
3
−
3
View file @
be6622f8
# This is a TOML config file.
# This is a TOML config file.
# For more information, see https://github.com/toml-lang/toml
# For more information, see https://github.com/toml-lang/toml
moniker
=
"eris_
db
"
moniker
=
"eris_
chains
"
node_laddr
=
"0.0.0.0:46656"
node_laddr
=
"0.0.0.0:46656"
seeds
=
"
interblock.io:46656
"
seeds
=
""
fast_sync
=
tru
e
fast_sync
=
fals
e
db_backend
=
"leveldb"
db_backend
=
"leveldb"
log_level
=
"debug"
log_level
=
"debug"
rpc_laddr
=
"0.0.0.0:46657"
rpc_laddr
=
"0.0.0.0:46657"
This diff is collapsed.
Click to expand it.
DOCKER/start.sh
+
7
−
12
View file @
be6622f8
...
@@ -7,6 +7,9 @@ ifExit(){
...
@@ -7,6 +7,9 @@ ifExit(){
fi
fi
}
}
#------------------------------------------------
# set and export directories
#############################################
#############################################
# We expect the following env vars to be set
# We expect the following env vars to be set
# $CHAIN_ID
# $CHAIN_ID
...
@@ -19,6 +22,7 @@ ifExit(){
...
@@ -19,6 +22,7 @@ ifExit(){
# and eg. $CONTAINER_NAME
# and eg. $CONTAINER_NAME
CHAIN_DIR
=
"/home/
$USER
/.eris/blockchains/
$CHAIN_ID
"
CHAIN_DIR
=
"/home/
$USER
/.eris/blockchains/
$CHAIN_ID
"
# set the tendermint directory
TMROOT
=
$CHAIN_DIR
TMROOT
=
$CHAIN_DIR
if
[
!
-d
"
$CHAIN_DIR
"
]
;
then
if
[
!
-d
"
$CHAIN_DIR
"
]
;
then
...
@@ -43,26 +47,17 @@ export NODE_ADDR
...
@@ -43,26 +47,17 @@ export NODE_ADDR
export
ECM_PATH
# set by Dockerfile
export
ECM_PATH
# set by Dockerfile
#-----------------------------------------------------------------------
# either we are fetching a chain for the first time,
# either we are fetching a chain for the first time,
# creating one from scratch, or running one we already have
# creating one from scratch, or running one we already have
CMD
=
$1
CMD
=
$1
case
$CMD
in
case
$CMD
in
"
fetch
"
)
$ECM_PATH
/chain_
fetch
.sh
"
install
"
)
$ECM_PATH
/chain_
install
.sh
;;
;;
"new"
)
$ECM_PATH
/chain_new.sh
"new"
)
$ECM_PATH
/chain_new.sh
;;
;;
"run"
)
$ECM_PATH
/chain_run.sh
"run"
)
$ECM_PATH
/chain_run.sh
;;
;;
*
)
echo
"Enter a command for starting the chain (
fetch
, new, run)"
*
)
echo
"Enter a command for starting the chain (
install
, new, run)"
;;
;;
esac
esac
#--------------------------------------------------------------------------------
# XXX: assume for now the chain_id is always given
#
## if no CHAIN_ID given, use the ref chain
#if [ ! $CHAIN_ID ]; then
# CHAIN_ID=$REFS_CHAIN_ID
#fi
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment