-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.sh
executable file
·120 lines (100 loc) · 5.23 KB
/
build.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
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
AIKEN=$1
aiken() {
${AIKEN} $*
}
set -e
echo "Software versions:"
echo " Git commit = $(git rev-parse HEAD)"
echo " Aiken Version = $(aiken --version)"
echo
echo "File hashes:"
SHA256=$(cat validators/oracle.ak | sha256sum | cut -f 1 -d ' ')
echo " validators/oracle.ak = ${SHA256}"
SHA256=$(cat validators/order.ak | sha256sum | cut -f 1 -d ' ')
echo " validators/order.ak = ${SHA256}"
SHA256=$(cat validators/pool_stake.ak | sha256sum | cut -f 1 -d ' ')
echo " validators/pool_stake.ak = ${SHA256}"
SHA256=$(cat validators/pool.ak | sha256sum | cut -f 1 -d ' ')
echo " validators/pool.ak = ${SHA256}"
SHA256=$(cat validators/settings.ak | sha256sum | cut -f 1 -d ' ')
echo " validators/settings.ak = ${SHA256}"
SHA256=$(cat validators/stake.ak | sha256sum | cut -f 1 -d ' ')
echo " validators/stake.ak = ${SHA256}"
echo
SHA256=$(cat lib/shared.ak | sha256sum | cut -f 1 -d ' ')
echo " lib/shared.ak = ${SHA256}"
SHA256=$(cat lib/types/oracle.ak | sha256sum | cut -f 1 -d ' ')
echo " lib/types/oracle.ak = ${SHA256}"
SHA256=$(cat lib/types/order.ak | sha256sum | cut -f 1 -d ' ')
echo " lib/types/order.ak = ${SHA256}"
SHA256=$(cat lib/types/pool.ak | sha256sum | cut -f 1 -d ' ')
echo " lib/types/pool.ak = ${SHA256}"
SHA256=$(cat lib/types/settings.ak | sha256sum | cut -f 1 -d ' ')
echo " lib/types/settings.ak = ${SHA256}"
SHA256=$(cat lib/calculation/deposit.ak | sha256sum | cut -f 1 -d ' ')
echo " lib/calculation/deposit.ak = ${SHA256}"
SHA256=$(cat lib/calculation/donation.ak | sha256sum | cut -f 1 -d ' ')
echo " lib/calculation/donation.ak = ${SHA256}"
SHA256=$(cat lib/calculation/process.ak | sha256sum | cut -f 1 -d ' ')
echo " lib/calculation/process.ak = ${SHA256}"
SHA256=$(cat lib/calculation/record.ak | sha256sum | cut -f 1 -d ' ')
echo " lib/calculation/record.ak = ${SHA256}"
SHA256=$(cat lib/calculation/shared.ak | sha256sum | cut -f 1 -d ' ')
echo " lib/calculation/shared.ak = ${SHA256}"
SHA256=$(cat lib/calculation/strategy.ak | sha256sum | cut -f 1 -d ' ')
echo " lib/calculation/strategy.ak = ${SHA256}"
SHA256=$(cat lib/calculation/swap.ak | sha256sum | cut -f 1 -d ' ')
echo " lib/calculation/swap.ak = ${SHA256}"
SHA256=$(cat lib/calculation/withdrawal.ak | sha256sum | cut -f 1 -d ' ')
echo " lib/calculation/withdrawal.ak = ${SHA256}"
aiken build &> /dev/null
PROTOCOL_BOOT_TX="382b27b28c70343161f9abebdab78264e0fd7271baf3bb88ca04b52e5f0067ef"
PROTOCOL_BOOT_IX="01"
PROTOCOL_BOOT_UTXO="d8799fd8799f5820${PROTOCOL_BOOT_TX}ff${PROTOCOL_BOOT_IX}ff"
aiken blueprint apply -v settings.spend $PROTOCOL_BOOT_UTXO 2> /dev/null > tmp
mv tmp plutus.json
aiken blueprint apply -v settings.mint $PROTOCOL_BOOT_UTXO 2> /dev/null > tmp
mv tmp plutus.json
SETTINGS_SCRIPT_HASH="$(aiken blueprint policy -v settings.mint 2> /dev/null)"
aiken blueprint apply -v pool.manage "581c${SETTINGS_SCRIPT_HASH}" 2> /dev/null > tmp
mv tmp plutus.json
MANAGE_STAKE_SCRIPT_HASH="$(aiken blueprint policy -v pool.manage 2> /dev/null)"
aiken blueprint apply -v pool.spend "581c${MANAGE_STAKE_SCRIPT_HASH}" 2> /dev/null > tmp
mv tmp plutus.json
aiken blueprint apply -v pool.spend "581c${SETTINGS_SCRIPT_HASH}" 2> /dev/null > tmp
mv tmp plutus.json
aiken blueprint apply -v pool.mint "581c${MANAGE_STAKE_SCRIPT_HASH}" 2> /dev/null > tmp
mv tmp plutus.json
aiken blueprint apply -v pool.mint "581c${SETTINGS_SCRIPT_HASH}" 2> /dev/null > tmp
mv tmp plutus.json
POOL_SCRIPT_HASH="$(aiken blueprint policy -v pool.mint 2> /dev/null)"
aiken blueprint apply -v stake.stake "581c${POOL_SCRIPT_HASH}" 2> /dev/null > tmp
mv tmp plutus.json
aiken blueprint apply -v pool_stake.stake "581c${SETTINGS_SCRIPT_HASH}" 2> /dev/null > tmp
mv tmp plutus.json
aiken blueprint apply -v pool_stake.stake "00" 2> /dev/null > tmp
mv tmp plutus.json
aiken blueprint apply -v oracle.spend "581c${POOL_SCRIPT_HASH}" 2> /dev/null > tmp
mv tmp plutus.json
aiken blueprint apply -v oracle.mint "581c${POOL_SCRIPT_HASH}" 2> /dev/null > tmp
mv tmp plutus.json
STAKE_SCRIPT_HASH="$(aiken blueprint policy -v stake.stake 2> /dev/null)"
aiken blueprint apply -v order.spend "581c${STAKE_SCRIPT_HASH}" 2> /dev/null > tmp
mv tmp plutus.json
ORACLE_SCRIPT_HASH="$(aiken blueprint policy -v oracle.mint 2> /dev/null)"
POOL_STAKE_SCRIPT_HASH="$(aiken blueprint policy -v pool_stake.stake 2> /dev/null)"
ORDER_SCRIPT_HASH="$(aiken blueprint hash -v order.spend 2> /dev/null)"
echo
echo "Parameters:"
echo -e " PROTOCOL_BOOT_UTXO = \e[32m ${PROTOCOL_BOOT_TX}#${PROTOCOL_BOOT_IX} \e[0m"
echo
echo "Script Hashes:"
echo -e " Settings Script Hash / Policy = \e[32m ${SETTINGS_SCRIPT_HASH} \e[0m"
echo -e " Pool Script Hash / Policy = \e[32m ${POOL_SCRIPT_HASH} \e[0m"
echo -e " Pool Stake Script Hash = \e[32m ${POOL_STAKE_SCRIPT_HASH} \e[0m"
echo -e " Manage Stake Script Hash = \e[32m ${MANAGE_STAKE_SCRIPT_HASH} \e[0m"
echo -e " Order Stake Script Hash = \e[32m ${STAKE_SCRIPT_HASH} \e[0m"
echo -e " Order Script Hash = \e[32m ${ORDER_SCRIPT_HASH} \e[0m"
echo -e " Oracle Script Hash = \e[32m ${ORACLE_SCRIPT_HASH} \e[0m"
echo
echo