Skip to content

Commit

Permalink
Mtsitrin/186 allow cors access (#187)
Browse files Browse the repository at this point in the history
* added bin/ to gitignore

* allows to set CORS in setup script
  • Loading branch information
mtsitrin authored Jan 31, 2023
1 parent 2fb077b commit 987e334
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
dymension-testnet.pem
vue/
release/
bin/
.idea/
.vscode/
.DS_Store
Binary file removed bin/dymd
Binary file not shown.
8 changes: 8 additions & 0 deletions scripts/setup_local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ P2P_ADDRESS=${P2P_ADDRESS:-"0.0.0.0:36656"}
GRPC_ADDRESS=${GRPC_ADDRESS:-"0.0.0.0:8090"}
GRPC_WEB_ADDRESS=${GRPC_WEB_ADDRESS:-"0.0.0.0:8091"}
API_ADDRESS=${API_ADDRESS:-"0.0.0.0:1317"}
UNSAFE_CORS=${UNSAFE_CORS:-""}

TOKEN_AMOUNT=${TOKEN_AMOUNT:-"1000000000000udym"} #1M DYM (1e6dym == 1e12udym)
STAKING_AMOUNT=${STAKING_AMOUNT:-"670000000000udym"} #67% is staked (inflation goal)
Expand Down Expand Up @@ -74,6 +75,13 @@ sed -i'' -e 's/^minimum-gas-prices *= .*/minimum-gas-prices = "0udym"/' "$APP_CO
sed -i'' -e '/\[api\]/,+3 s/enable *= .*/enable = true/' "$APP_CONFIG_FILE"
sed -i'' -e "/\[api\]/,+9 s/address *= .*/address = \"tcp:\/\/$API_ADDRESS\"/" "$APP_CONFIG_FILE"

if [ -n "$UNSAFE_CORS" ]; then
echo "Setting CORS"
sed -ie 's/enabled-unsafe-cors.*$/enabled-unsafe-cors = true/' "$APP_CONFIG_FILE"
sed -ie 's/enable-unsafe-cors.*$/enabled-unsafe-cors = true/' "$APP_CONFIG_FILE"
sed -ie 's/cors_allowed_origins.*$/cors_allowed_origins = ["*"]/' "$TENDERMINT_CONFIG_FILE"
fi


if [ "$HUB_PEERS" != "" ]; then
printf "\n======================================================================================================\n"
Expand Down

0 comments on commit 987e334

Please sign in to comment.