-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy_backend_only.sh
More file actions
55 lines (42 loc) Β· 1.6 KB
/
deploy_backend_only.sh
File metadata and controls
55 lines (42 loc) Β· 1.6 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
echo "π Deploying Backend Only (Skip Internet Identity)"
echo "================================================="
cd icp_backend
# Step 1: Deploy only your supply chain backend
echo "π¦ Deploying supply chain backend only..."
dfx deploy supply_chain_backend
# Step 2: Set up Internet Identity manually
echo "π Setting up Internet Identity manually..."
# Create Internet Identity canister
dfx canister create internet_identity --specified-id rdmx6-jaaaa-aaaaa-aaadq-cai
# Download Internet Identity wasm
echo "π₯ Downloading Internet Identity wasm..."
curl -L -o internet_identity.wasm.gz \
"https://github.com/dfinity/internet-identity/releases/latest/download/internet_identity_dev.wasm.gz"
gunzip internet_identity.wasm.gz
# Install Internet Identity
echo "π§ Installing Internet Identity..."
dfx canister install internet_identity --wasm internet_identity.wasm --argument '(null)'
# Clean up
rm -f internet_identity.wasm
# Step 3: Get canister IDs
SUPPLY_CHAIN_ID=$(dfx canister id supply_chain_backend)
II_CANISTER_ID=$(dfx canister id internet_identity)
echo ""
echo "β
Deployment Complete!"
echo "======================="
echo "Supply Chain: $SUPPLY_CHAIN_ID"
echo "Internet Identity: $II_CANISTER_ID"
# Step 4: Update environment
cd ..
cat > .env.local << EOF
NEXT_PUBLIC_DFX_NETWORK=local
NEXT_PUBLIC_SUPPLY_CHAIN_CANISTER_ID=$SUPPLY_CHAIN_ID
NEXT_PUBLIC_INTERNET_IDENTITY_CANISTER_ID=$II_CANISTER_ID
EOF
echo ""
echo "π URLs:"
echo "β’ App: http://localhost:3000"
echo "β’ Internet Identity: http://$II_CANISTER_ID.localhost:4943"
echo ""
echo "π Ready to use! Run: npm run dev"