Commit 18d888ea authored by 贾浩@五瓣科技's avatar 贾浩@五瓣科技

use net discovery

parent 20fac126
...@@ -4,6 +4,7 @@ set -e ...@@ -4,6 +4,7 @@ set -e
N=${1:-2} N=${1:-2}
host_ip=$(ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' |grep '192.168')
cd ../mainchain/ cd ../mainchain/
rm -rf conf/deploy || true rm -rf conf/deploy || true
...@@ -50,13 +51,13 @@ do ...@@ -50,13 +51,13 @@ do
rm -fv $configFile rm -fv $configFile
echo "single-node: true" >> $configFile echo "single-node: true" >> $configFile
echo "enable-prom: true" >> $configFile echo "enable-prom: true" >> $configFile
echo "use-discovery: true" >> $configFile
echo "grpc-host: \"0.0.0.0\"" >> $configFile echo "grpc-host: \"0.0.0.0\"" >> $configFile
echo "grpc-port: 38010" >> $configFile echo "grpc-port: 38010" >> $configFile
echo "p2p-host-ip: \"172.99.1.$i\"" >> $configFile echo "p2p-host-ip: \"$host_ip\"" >> $configFile
if [ $i -eq 1 ]; then if [ $i -ne 1 ]; then
echo "p2p-priv-key: \"/etc/MetaNet/default-priv-key\"" >> $configFile echo "bootstrap-node: [\"enr:-JG4QBfRmluPkjjoW3TdOgSqEChosRGQTNB0E8dccbjPvrYIcu5iFlqmUYN_7zDITAgUGdyf1W0qhNHF64XleVC3YRWGAYusuIU5gmlkgnY0gmlwhMCoAdyJc2VjcDI1NmsxoQJ81pyuyqa2QoPztOPsCqpkcW1gJwUxOcSJuWr9VUNavIN0Y3CCdn6DdWRwgnZ-\"]" >> $configFile
else # decoded enr: /ip4/192.168.1.220/tcp/30334/p2p/16Uiu2HAm3pzLayNahJtkYHaxWFMibZ7RuyG8BRsdj1YQRvwWYKM5
echo "peer: [\"/ip4/192.168.1.220/tcp/30333/p2p/16Uiu2HAm3pzLayNahJtkYHaxWFMibZ7RuyG8BRsdj1YQRvwWYKM5\"]" >> $configFile
fi fi
done done
# net config end # net config end
...@@ -175,13 +176,14 @@ echo ' - meta' >> $compose ...@@ -175,13 +176,14 @@ echo ' - meta' >> $compose
echo "" >> $composefile echo "" >> $composefile
echo "" >> $composefile echo "" >> $composefile
echo " net:" >> $composefile echo " net:" >> $composefile
echo " image: 192.168.1.220:5000/metanet:v0.0.7" >> $composefile echo " image: 192.168.1.220:5000/metanet:v0.0.8" >> $composefile
echo " container_name: net" >> $composefile echo " container_name: net" >> $composefile
echo " entrypoint: /usr/bin/MetaNet -c /root/config.yaml > /root/net.log 2>&1" >> $composefile echo " entrypoint: /usr/bin/MetaNet -c /root/config.yaml > /root/net.log 2>&1" >> $composefile
echo "$resourcenebula" >> $composefile echo "$resourcenebula" >> $composefile
echo " ports:" >> $composefile echo " ports:" >> $composefile
echo " - \"$((38010)):38010\"" >> $composefile echo " - \"$((38010)):38010\"" >> $composefile
echo " - \"$((30333)):30333\"" >> $composefile echo " - \"$((30333)):30333\"" >> $composefile
echo " - \"$((30334)):30334/udp\"" >> $composefile
echo " volumes:" >> $composefile echo " volumes:" >> $composefile
echo " - ./data/net/$i:/root" >> $composefile echo " - ./data/net/$i:/root" >> $composefile
echo " networks:" >> $composefile echo " networks:" >> $composefile
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment