-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy_and_run.sh
More file actions
39 lines (32 loc) · 971 Bytes
/
deploy_and_run.sh
File metadata and controls
39 lines (32 loc) · 971 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
# Load environment variables
set -a
if [ -f .env ]; then
source .env
else
echo "Warning: .env file not found. Using environment variables."
fi
set +a
# Check if required environment variables are set
if [ -z "$SKALE_ENDPOINT" ]; then
echo "Error: SKALE_ENDPOINT is not set. Please set it as an environment variable."
exit 1
fi
if [ -z "$PRIVATE_KEY" ]; then
echo "Error: PRIVATE_KEY is not set. Please set it as an environment variable."
exit 1
fi
# Deploy the smart contract
echo "Deploying the smart contract..."
npx hardhat run scripts/deploy.js --network skale
# Check if the deployment was successful
if [ ! -f "contract-address.txt" ]; then
echo "Error: Contract deployment failed. contract-address.txt not found."
exit 1
fi
# Install required Python packages
echo "Installing required Python packages..."
pip install -r requirements.txt
# Start the Flask server
echo "Starting the Flask server..."
python main.py