Skip to content

Commit

Permalink
[fix] Fix setup (#6)
Browse files Browse the repository at this point in the history
* fix deploy script

* fix Flask-Alchemy

* fix deploy script

* fix Flask-SQLAlchemy

* bump version

* change license
  • Loading branch information
petekaroon authored Aug 10, 2023
1 parent 630ea96 commit 2ff8a64
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from helpers.error_handler import ErrorHandler

app = Flask(__name__)
app.app_context().push()
app.config.from_object(DbConfig())
db = Database(app)
evm_chain_config = EvmChainConfig()
Expand Down
1 change: 1 addition & 0 deletions app/app_run_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ async def run_vrf_worker_local() -> None:
"""

app = Flask(__name__)
app.app_context().push()
app.config.from_object(DbConfig())
db = Database(app)
evm_chain_config = EvmChainConfig()
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[tool.poetry]
name = "vrf-worker-v1"
version = "0.1.1"
version = "0.1.2"
description = ""
authors = ["Band Protocol"]
license = "MIT License"
license = "Apache 2.0"

[tool.poetry.dependencies]
python = "3.10.x"
Expand Down
6 changes: 4 additions & 2 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ export BAND_RPC_ENDPOINTS=https://rpc.laozi-testnet6.bandchain.org
export BAND_PROOF_URLS=https://laozi-testnet6.bandchain.org/api/oracle/proof/
export BAND_PREPARE_GAS=100000
export BAND_EXECUTE_GAS=400000
export BAND_DS_FEE_LIMIT=48
export BAND_GAS_LIMIT=800000
export BAND_GAS_PRICE=0.0025
export MIN_COUNT=2
export ASK_COUNT=3
export VRF_PROVIDER_ADDRESS=
Expand All @@ -25,7 +27,6 @@ export MAX_RELAY_PROOF_GAS=1200000
export START_NONCE=0
export DISCORD_WEBHOOK=
export WHITELISTED_CALLERS=
export WORKER_FEE_BAND=5000
export BLOCK_DIFF=
export SUPPORT_EIP1559=
export DB_HOST=
Expand Down Expand Up @@ -62,7 +63,9 @@ gcloud run deploy $SERVICE_NAME \
--set-env-vars "^##^BAND_PROOF_URLS=$BAND_PROOF_URLS" \
--set-env-vars BAND_PREPARE_GAS=$BAND_PREPARE_GAS \
--set-env-vars BAND_EXECUTE_GAS=$BAND_EXECUTE_GAS \
--set-env-vars BAND_DS_FEE_LIMIT=$BAND_DS_FEE_LIMIT \
--set-env-vars BAND_GAS_LIMIT=$BAND_GAS_LIMIT \
--set-env-vars BAND_GAS_PRICE=$BAND_GAS_PRICE \
--set-env-vars MIN_COUNT=$MIN_COUNT \
--set-env-vars ASK_COUNT=$ASK_COUNT \
--set-env-vars VRF_PROVIDER_ADDRESS=$VRF_PROVIDER_ADDRESS \
Expand All @@ -72,7 +75,6 @@ gcloud run deploy $SERVICE_NAME \
--set-env-vars START_NONCE=$START_NONCE \
--set-env-vars DISCORD_WEBHOOK=$DISCORD_WEBHOOK \
--set-env-vars "^##^WHITELISTED_CALLERS=$WHITELISTED_CALLERS" \
--set-env-vars WORKER_FEE_BAND=$WORKER_FEE_BAND \
--set-env-vars BLOCK_DIFF=$BLOCK_DIFF \
--set-env-vars SUPPORT_EIP1559=$SUPPORT_EIP1559 \
--set-env-vars DB_HOST=$DB_HOST \
Expand Down
6 changes: 4 additions & 2 deletions scripts/deploy.sh.example
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ export BAND_RPC_ENDPOINTS=https://rpc.laozi-testnet6.bandchain.org
export BAND_PROOF_URLS=https://laozi-testnet6.bandchain.org/api/oracle/proof/
export BAND_PREPARE_GAS=100000
export BAND_EXECUTE_GAS=400000
export BAND_DS_FEE_LIMIT=48
export BAND_GAS_LIMIT=800000
export BAND_GAS_PRICE=0.0025
export MIN_COUNT=2
export ASK_COUNT=3
export VRF_PROVIDER_ADDRESS=0xd814466Bee0D793a4Ba1E90Fe275A2dE75184aB6
Expand All @@ -25,7 +27,6 @@ export MAX_RELAY_PROOF_GAS=1200000
export START_NONCE=0
export DISCORD_WEBHOOK=<DISCORD_WEBHOOK>
export WHITELISTED_CALLERS=0xE2f7Cf77DF70af8e92FF69B8Ffc92585C307a221
export WORKER_FEE_BAND=5000
export BLOCK_DIFF=10
export SUPPORT_EIP1559=True
export DB_HOST=<INSTANCE_HOST_PRIVATE_IP>
Expand Down Expand Up @@ -62,7 +63,9 @@ gcloud run deploy $SERVICE_NAME \
--set-env-vars "^##^BAND_PROOF_URLS=$BAND_PROOF_URLS" \
--set-env-vars BAND_PREPARE_GAS=$BAND_PREPARE_GAS \
--set-env-vars BAND_EXECUTE_GAS=$BAND_EXECUTE_GAS \
--set-env-vars BAND_DS_FEE_LIMIT=$BAND_DS_FEE_LIMIT \
--set-env-vars BAND_GAS_LIMIT=$BAND_GAS_LIMIT \
--set-env-vars BAND_GAS_PRICE=$BAND_GAS_PRICE \
--set-env-vars MIN_COUNT=$MIN_COUNT \
--set-env-vars ASK_COUNT=$ASK_COUNT \
--set-env-vars VRF_PROVIDER_ADDRESS=$VRF_PROVIDER_ADDRESS \
Expand All @@ -72,7 +75,6 @@ gcloud run deploy $SERVICE_NAME \
--set-env-vars START_NONCE=$START_NONCE \
--set-env-vars DISCORD_WEBHOOK=$DISCORD_WEBHOOK \
--set-env-vars "^##^WHITELISTED_CALLERS=$WHITELISTED_CALLERS" \
--set-env-vars WORKER_FEE_BAND=$WORKER_FEE_BAND \
--set-env-vars BLOCK_DIFF=$BLOCK_DIFF \
--set-env-vars SUPPORT_EIP1559=$SUPPORT_EIP1559 \
--set-env-vars DB_HOST=$DB_HOST \
Expand Down

0 comments on commit 2ff8a64

Please sign in to comment.