Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
metadeploy
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nebula
metadeploy
Commits
e5021e16
Commit
e5021e16
authored
Dec 12, 2023
by
贾浩@五瓣科技
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update ramdom peerid
parent
80f172ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
22 deletions
+11
-22
host.sh
host/host.sh
+11
-22
No files found.
host/host.sh
View file @
e5021e16
...
@@ -6,8 +6,7 @@ isSeed=0
...
@@ -6,8 +6,7 @@ isSeed=0
withParam
=
0
withParam
=
0
input_string_my_ip
=
""
input_string_my_ip
=
""
input_string_connected_ip
=
""
input_string_connected_ip
=
""
input_string_enr
=
""
input_string_static_peer
=
""
if
[
$#
-eq
3
]
;
then
if
[
$#
-eq
3
]
;
then
...
@@ -47,7 +46,7 @@ if [ $# -eq 4 ]; then
...
@@ -47,7 +46,7 @@ if [ $# -eq 4 ]; then
datadir
=
${
1
:-
./data/
}
datadir
=
${
1
:-
./data/
}
input_string_my_ip
=
${
2
}
input_string_my_ip
=
${
2
}
input_string_connected_ip
=
${
3
}
input_string_connected_ip
=
${
3
}
input_string_
en
r
=
${
4
}
input_string_
static_pee
r
=
${
4
}
regex
=
'^([0-9]{1,3}\.){3}[0-9]{1,3}$'
regex
=
'^([0-9]{1,3}\.){3}[0-9]{1,3}$'
while
true
while
true
do
do
...
@@ -74,16 +73,16 @@ if [ $# -eq 4 ]; then
...
@@ -74,16 +73,16 @@ if [ $# -eq 4 ]; then
do
do
break
break
echo
"peer----------------"
echo
"peer----------------"
echo
${
input_string_
en
r
##*/
}
echo
${
input_string_
static_pee
r
##*/
}
echo
${
input_string_
en
r
##*/
}
|
wc
-L
echo
${
input_string_
static_pee
r
##*/
}
|
wc
-L
if
[
$(
echo
${
input_string_
en
r
##*/
}
|
wc
-L
)
-eq
53
]
;
then
if
[
$(
echo
${
input_string_
static_pee
r
##*/
}
|
wc
-L
)
-eq
53
]
;
then
break
break
fi
fi
echo
${
input_string_
en
r
}
" is not a valid peer id"
echo
${
input_string_
static_pee
r
}
" is not a valid peer id"
echo
"please input your p2p peer id: "
echo
"please input your p2p peer id: "
read
input_string_
en
r
read
input_string_
static_pee
r
done
done
fi
fi
...
@@ -146,10 +145,10 @@ echo "isSeed " $isSeed
...
@@ -146,10 +145,10 @@ echo "isSeed " $isSeed
echo
"withParam "
$withParam
echo
"withParam "
$withParam
echo
"input_string_my_ip "
$input_string_my_ip
echo
"input_string_my_ip "
$input_string_my_ip
echo
"input_string_connected_ip "
$input_string_connected_ip
echo
"input_string_connected_ip "
$input_string_connected_ip
echo
"input_string_
enr "
$input_string_en
r
echo
"input_string_
static_peer "
$input_string_static_pee
r
s
eedEnr
=
$input_string_en
r
s
taticPeer
=
$input_string_static_pee
r
myIpAddr
=
$input_string_my_ip
myIpAddr
=
$input_string_my_ip
connectedSentryIp
=
$input_string_connected_ip
connectedSentryIp
=
$input_string_connected_ip
...
@@ -215,18 +214,8 @@ do
...
@@ -215,18 +214,8 @@ do
echo
"grpc-port: 38010"
>>
$configFile
echo
"grpc-port: 38010"
>>
$configFile
echo
"p2p-host-ip:
\"
$myIpAddr
\"
"
>>
$configFile
echo
"p2p-host-ip:
\"
$myIpAddr
\"
"
>>
$configFile
if
[
$i
-eq
1
]
;
then
if
[
$i
-ne
1
]
;
then
private_key
=
$(
python3
-c
"print(hex(0xa5b18000b95e9e8e2afe5d49355b48c99aeee9e986ddc144af848847afdccccc)[2:])"
)
echo
"peer: [
\"
${
staticPeer
}
\"
]"
>>
$configFile
echo
$private_key
>
$configPath
/private-key
echo
"p2p-priv-key:
\"
/root/private-key
\"
"
>>
$configFile
else
echo
"input net index"
read
netIndex
echo
"your net index is
$netIndex
"
private_key
=
$(
python3
-c
"print(hex(0xa5b18000b95e9e8e2afe5d49355b48c99aeee9e986ddc144af848847afdccccc +
$netIndex
)[2:])"
)
echo
$private_key
>
$configPath
/private-key
echo
"p2p-priv-key:
\"
/root/private-key
\"
"
>>
$configFile
echo
"peer: [
\"
${
seedEnr
}
\"
]"
>>
$configFile
fi
fi
# echo "peer: \"$ipAddr\"" >> $configFile
# echo "peer: \"$ipAddr\"" >> $configFile
# peer: ["要连接的peerid"]
# peer: ["要连接的peerid"]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment