forked from godwokenrises/godwoken-kicker
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add godwoken readonly node and enable mem-pool p2p sync (godwok…
…enrises#276) * feat: add godwoken readonly node and enable mem-pool p2p sync * fix godwoken readonly port don't conflict with v0 * web3-indexer use readonly node RPC * web3-indexer depends on godwoken-readonly healthy * Bump godwoken-prebuilds to refs/pull/721/merge This image was built by Flouse/godwoken-docker-prebuilds@f03dd56. Co-authored-by: Flouse <[email protected]>
- Loading branch information
Yin Guanhao
authored
Jun 14, 2022
1 parent
7e1872f
commit 0577349
Showing
7 changed files
with
88 additions
and
24 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
|
||
set -o errexit | ||
|
||
WORKSPACE="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" | ||
CONFIG_DIR="$WORKSPACE/config" | ||
|
||
function generate-godwoken-readonly-config() { | ||
log "start" | ||
if [ -s "$CONFIG_DIR/godwoken-config-readonly.toml" ]; then | ||
log "$CONFIG_DIR/godwoken-config-readonly.toml already exists, skip" | ||
return 0 | ||
fi | ||
|
||
cp $CONFIG_DIR/godwoken-config.toml $CONFIG_DIR/godwoken-config-readonly.toml | ||
|
||
sed -i 's#^node_mode = .*$#node_mode = '"'$GODWOKEN_MODE'"'#' $CONFIG_DIR/godwoken-config-readonly.toml | ||
sed -i 's#^path = .*$#path = '"'$STORE_PATH'"'#' $CONFIG_DIR/godwoken-config-readonly.toml | ||
sed -i 's@listen = "/ip4/.*"@dial = ["/dns4/godwoken/tcp/9999"]@' $CONFIG_DIR/godwoken-config-readonly.toml | ||
|
||
log "Generate file \"$CONFIG_DIR/godwoken-config-readonly.toml\"" | ||
} | ||
|
||
function log() { | ||
echo "[${FUNCNAME[1]}] $1" | ||
} | ||
|
||
function main() { | ||
godwoken --version | ||
gw-tools --version | ||
|
||
# Setup Godwoken-readonly at the first time | ||
generate-godwoken-readonly-config | ||
|
||
exec godwoken run -c $CONFIG_DIR/godwoken-config-readonly.toml | ||
} | ||
|
||
main "$@" |
This file contains 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 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 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