-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·31 lines (24 loc) · 873 Bytes
/
setup.sh
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
#!/bin/bash
# save as setup.sh in decentralized-social-media directory
# Start from the project root
cd "$(dirname "$0")"
# Ensure fabric-samples is in the parent directory
if [ ! -d "../fabric-samples" ]; then
echo "Error: fabric-samples directory not found in parent directory"
exit 1
fi
# Start Fabric test network
cd ../fabric-samples/test-network
./network.sh down
./network.sh up createChannel -c mychannel -ca
# Deploy chaincode
./network.sh deployCC -ccn social_media -ccp ../../decentralized-social-media/chaincode/social_media -ccl go
# Copy connection profile
mkdir -p ../../decentralized-social-media/network
cp organizations/peerOrganizations/org1.example.com/connection-org1.yaml ../../decentralized-social-media/network/
# Start IPFS daemon
# ipfs daemon &
# Setup backend
cd ../../decentralized-social-media/backend
go mod tidy
go run main.go