forked from Eclipse247/nerva
-
Notifications
You must be signed in to change notification settings - Fork 0
/
stagenet
executable file
·102 lines (83 loc) · 3.48 KB
/
stagenet
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#!/bin/bash
dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
bindir=${dir}/builder/build/debug/bin
nd=${bindir}/nervad
nw=${bindir}/nerva-wallet-cli
nr=${bindir}/nerva-wallet-rpc
datadir=$(realpath ~/.nerva/stagenet)
addressA="NV1uKzZ6tjA6xhJ5zKRu2TGpvNvsmznNZgnJuhwHRv1jKzoCABvtDUgBdguJxWq1TSjDg9ge9zZ2c5r2CQZ4LTQD1dxntAmGW"
addressB="NV3QRL7PwFZWs6Xw9ERf4E5GgjCZgRf3JNmCvyXAV2GAKpKHMmDK8cPTwBqwQjVLMA2G9M5iwh3AJM1e4LzWjuXH2UngCq4hV"
# Creates a couple of wallets to use for the stagenet
function createwallets()
{
echo "exit" | ${nw} --stagenet --generate-new-wallet "${datadir}/wallet1.bin" --restore-deterministic-wallet \
--electrum-seed="seq atl unv sum peb tue bee rud sna roc dif fus wov tag bes den veg hov rap faw obv mup ran sea ran" \
--password "" --log-file ${datadir}/wallet1.log
echo "exit" | ${nw} --stagenet --generate-new-wallet "${datadir}/wallet2.bin" --restore-deterministic-wallet \
--electrum-seed="def lar tir gum and lee sid ope igu voi gel foc poa itc net esp muc jai vau win oat ele sci sir win" \
--password "" --log-file ${datadir}/wallet2.log
}
function startcliwallet()
{
${nw} --stagenet --wallet-file "${datadir}/wallet1.bin" --password "" --daemon-address 127.0.0.1:38081
}
function startcliwallet2()
{
${nw} --stagenet --wallet-file "${datadir}/wallet2.bin" --password "" --daemon-address 127.0.0.1:38081
}
function startrpcwallet()
{
${nr} --stagenet --wallet-file "${datadir}/wallet2.bin" --password "" --disable-rpc-login --rpc-bind-port 33333 --daemon-address 127.0.0.1:48081
}
# Starts 3 seed nodes for the stagenet
function start1()
{
${nd} --stagenet --no-igd --hide-my-port --data-dir "${datadir}/node1" --p2p-bind-port 28080 --rpc-bind-port 28081 --zmq-rpc-bind-port 28082 --rpc-restricted-bind-port 28083 \
--add-exclusive-node 127.0.0.1:38080 --add-exclusive-node 127.0.0.1:48080 --add-exclusive-node 127.0.0.1:58080 $1
}
function start2()
{
${nd} --stagenet --no-igd --hide-my-port --data-dir "${datadir}/node2" --p2p-bind-port 38080 --rpc-bind-port 38081 --zmq-rpc-bind-port 38082 --rpc-restricted-bind-port 38083 \
--add-exclusive-node 127.0.0.1:28080 --add-exclusive-node 127.0.0.1:48080 --add-exclusive-node 127.0.0.1:58080 --block-sync-size 1 $1
}
function start3()
{
${nd} --stagenet --no-igd --hide-my-port --data-dir "${datadir}/node3" --p2p-bind-port 48080 --rpc-bind-port 48081 --zmq-rpc-bind-port 48082 --rpc-restricted-bind-port 48083 \
--add-exclusive-node 127.0.0.1:28080 --add-exclusive-node 127.0.0.1:38080 --add-exclusive-node 127.0.0.1:58080 --block-sync-size 1 $1
}
function start4()
{
${nd} --stagenet --no-igd --hide-my-port --data-dir "${datadir}/node4" --p2p-bind-port 58080 --rpc-bind-port 58081 --zmq-rpc-bind-port 58082 --rpc-restricted-bind-port 58083 \
--add-exclusive-node 127.0.0.1:28080 --add-exclusive-node 127.0.0.1:38080 --add-exclusive-node 127.0.0.1:48080 --block-sync-size 1 --start-mining NV1uKzZ6tjA6xhJ5zKRu2TGpvNvsmznNZgnJuhwHRv1jKzoCABvtDUgBdguJxWq1TSjDg9ge9zZ2c5r2CQZ4LTQD1dxntAmGW --mining-threads 1
}
function pop4()
{
${bindir}/nerva-blockchain-import --stagenet --data-dir "${datadir}/node4" --pop-blocks $1
}
function pop()
{
killall nervad
rm -rf "${datadir}/node2"
rm -rf "${datadir}/node3"
rm -rf "${datadir}/node4"
${bindir}/nerva-blockchain-import --stagenet --data-dir "${datadir}/node1" --pop-blocks $1
}
function start()
{
start1 --detach
start2 --detach
start3 --detach
}
function init()
{
rm -rf ${datadir}
mkdir -p ${datadir}
createwallets
reset
}
function restart()
{
killall nervad
start
}
$1 $2