Skip to content

Commit

Permalink
fix blockchain start
Browse files Browse the repository at this point in the history
  • Loading branch information
jbsv committed Mar 27, 2024
1 parent 9460a3a commit c416c7c
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 42 deletions.
5 changes: 3 additions & 2 deletions server/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ module go.dedis.ch/hbt/server

go 1.21

// replace go.dedis.ch/dela => ../../dela
replace go.dedis.ch/purb-db => ../../purb-db
replace go.dedis.ch/dela => ../../dela

//replace go.dedis.ch/purb-db => ../../purb-db

require (
github.com/gorilla/mux v1.8.1
Expand Down
4 changes: 2 additions & 2 deletions server/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsr
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d h1:splanxYIlg+5LfHAM6xpdFEAYOk8iySO56hMFq6uLyA=
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
go.dedis.ch/dela v0.0.0-20231011144949-4677467c030c h1:3qMO3ewks1QptS5GJyz59HYprgBEVUjk+9BWI6vEsRc=
go.dedis.ch/dela v0.0.0-20231011144949-4677467c030c/go.mod h1:Oh/WK8JMO0POQg7nR3u436u+HwsZwPqPzDWAasgmFAU=
go.dedis.ch/fixbuf v1.0.3 h1:hGcV9Cd/znUxlusJ64eAlExS+5cJDIyTyEG+otu5wQs=
go.dedis.ch/fixbuf v1.0.3/go.mod h1:yzJMt34Wa5xD37V5RTdmp38cz3QhMagdGoem9anUalw=
go.dedis.ch/kyber/v3 v3.0.4/go.mod h1:OzvaEnPvKlyrWyp3kGXlFdp7ap1VC6RkZDTaPikqhsQ=
Expand All @@ -145,6 +143,8 @@ go.dedis.ch/protobuf v1.0.5/go.mod h1:eIV4wicvi6JK0q/QnfIEGeSFNG0ZeB24kzut5+HaRL
go.dedis.ch/protobuf v1.0.7/go.mod h1:pv5ysfkDX/EawiPqcW3ikOxsL5t+BqnV6xHSmE79KI4=
go.dedis.ch/protobuf v1.0.11 h1:FTYVIEzY/bfl37lu3pR4lIj+F9Vp1jE8oh91VmxKgLo=
go.dedis.ch/protobuf v1.0.11/go.mod h1:97QR256dnkimeNdfmURz0wAMNVbd1VmLXhG1CrTYrJ4=
go.dedis.ch/purb-db v0.0.1 h1:JzZDdkd9t1wuW2X8jHXBMoakctzBkc5EW36VXev42+M=
go.dedis.ch/purb-db v0.0.1/go.mod h1:AFLiJofwHp8w9ZzG9I/Mpy7fKlsHKK13oAish6U0NuQ=
go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ=
go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw=
go.mongodb.org/mongo-driver v1.13.2 h1:0BCe7YmG5KyiujRFA4xcU9071IFe4OFE4S3azDrsqz4=
Expand Down
2 changes: 1 addition & 1 deletion server/scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ tmux new-window -t ${S} -n smc

./start_chain.sh -t ${L}
#./start_registry.sh -t ${L}
./start_smc.sh -t ${L}
#./start_smc.sh -t ${L}
#tmux send-keys -t ${S}:smc.0 "./publish_roster.sh" C-m

# attach to session
Expand Down
72 changes: 36 additions & 36 deletions server/scripts/start_chain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ do
proxy=$((PROXY + i))
echo -e "${GREEN}creating node #${i} on port ${p}${NC}"
# session s, window 0, panes 1 to N
tmux send-keys -t ${S}:${W}.${i} "LLVL=${L} LOGF=./${W}${i}.log chaincli --config /tmp/${W}${i} start --listen tcp://127.0.0.1:${p} --noTLS --proxyaddr 127.0.0.1:${proxy}" C-m
tmux send-keys -t ${S}:${W}.${i} "LLVL=${L} LOGF=./${W}${i}.log chaincli --config /tmp/${W}${i} \
start --listen tcp://127.0.0.1:${p} --proxyaddr localhost:${proxy} --public grpc://localhost:${p} \
--routing tree --noTLS" C-m
sleep 1
i=$((i + 1));
done
Expand All @@ -71,48 +73,46 @@ echo -e "${GREEN}[CONNECT]${NC} ${N} nodes and exchange certificates"
i=2;
p=$((P + 1))
sleep 1
chaincli --config /tmp/${W}1 minogrpc token
TOKEN=$(chaincli --config /tmp/${W}1 minogrpc token)
echo -e "${GREEN}token: ${TOKEN}${NC}"
while [ ${i} -le ${N} ]
do
echo -e "joining node ${i} on master pane ${MASTERPANE}"
tmux send-keys -t "${MASTERPANE}" "chaincli --config /tmp/${W}${i} minogrpc join --address //127.0.0.1:${p} ${TOKEN}" C-m
tmux send-keys -t "${MASTERPANE}" "chaincli --config /tmp/${W}${i} minogrpc join \
--address grpc://127.0.0.1:${p} $(chaincli --config /tmp/${W}1 minogrpc token)" C-m
sleep 1
i=$((i + 1));
done


#echo -e "${GREEN}[CHAIN]${NC} ${N} nodes"
#i=1;
#m=""
#while [ ${i} -le ${N} ]
#do
# m="${m} --member \$(chaincli --config /tmp/${W}${i} ordering export)"
# i=$((i + 1));
#done
#tmux send-keys -t "${MASTERPANE}" "chaincli --config /tmp/${W}1 ordering setup ${m}" C-m
#
#
#echo -e "${GREEN}[ACCESS]${NC} setup access rights on each node"
#i=1;
#while [ ${i} -le ${N} ]
#do
# tmux send-keys -t "${MASTERPANE}" "chaincli --config /tmp/${W}${i} access add \
# --identity $(crypto bls signer read --path ${KEYFILE} --format BASE64_PUBKEY)" C-m
# i=$((i + 1));
#done
#
#
#echo -e "${GREEN}[GRANT]${NC} grant access for node 1 on the chain"
## sent to master pane
#tmux send-keys -t "${MASTERPANE}" "chaincli --config /tmp/${W}1 pool add \
# --key ${KEYFILE} \
# --args go.dedis.ch/dela.ContractArg --args go.dedis.ch/dela.Access \
# --args access:grant_id --args 0200000000000000000000000000000000000000000000000000000000000000 \
# --args access:grant_contract --args go.dedis.ch/dela.Value \
# --args access:grant_command --args all \
# --args access:identity --args $(crypto bls signer read --path ${KEYFILE} --format BASE64_PUBKEY) \
# --args access:command --args GRANT" C-m
echo -e "${GREEN}[CHAIN]${NC} ${N} nodes"
i=1;
m=""
while [ ${i} -le ${N} ]
do
m="${m} --member \$(chaincli --config /tmp/${W}${i} ordering export)"
i=$((i + 1));
done
tmux send-keys -t "${MASTERPANE}" "chaincli --config /tmp/${W}1 ordering setup ${m}" C-m


echo -e "${GREEN}[ACCESS]${NC} setup access rights on each node"
i=1;
while [ ${i} -le ${N} ]
do
tmux send-keys -t "${MASTERPANE}" "chaincli --config /tmp/${W}${i} access add \
--identity $(crypto bls signer read --path ${KEYFILE} --format BASE64_PUBKEY)" C-m
i=$((i + 1));
done


echo -e "${GREEN}[GRANT]${NC} grant access for node 1 on the chain"
# sent to master pane
tmux send-keys -t "${MASTERPANE}" "chaincli --config /tmp/${W}1 pool add \
--key ${KEYFILE} \
--args go.dedis.ch/dela.ContractArg --args go.dedis.ch/dela.Access \
--args access:grant_id --args 0200000000000000000000000000000000000000000000000000000000000000 \
--args access:grant_contract --args go.dedis.ch/dela.Value \
--args access:grant_command --args all \
--args access:identity --args $(crypto bls signer read --path ${KEYFILE} --format BASE64_PUBKEY) \
--args access:command --args GRANT" C-m

tmux select-pane -t "${MASTERPANE}"
2 changes: 1 addition & 1 deletion server/scripts/teardown.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ S=hbt # session name
echo -e "${GREEN}[TMUX tear down]${NC}"

#./stop_registry.sh
./stop_smc.sh
#./stop_smc.sh
./stop_chain.sh

tmux kill-session -t ${S}
Expand Down

0 comments on commit c416c7c

Please sign in to comment.