-
Notifications
You must be signed in to change notification settings - Fork 0
/
mint_assets.sh
executable file
·59 lines (43 loc) · 1.31 KB
/
mint_assets.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
#!/bin/bash
# Create a batch of assets
# TAPCMD="$HOME/tap/tap/tapcli-debug -n regtest --tapddir $HOME/regtest_tapd"
TAPCMD="$HOME/tap/tap/tapcli-debug -n testnet --tapddir $HOME/testnet_tapd"
ASSET_MINT="$TAPCMD a m"
MINT_FINALIZE="$TAPCMD a m f"
MINE_BLOCK="bitcoin-cli -regtest -generate 1"
BASE_NAME="punk"
META_FILE_SUFFIX=".png"
META_FILE="$(pwd)"/"$BASE_NAME"/
NUM_IMAGES=$(ls "$(pwd)"/"$BASE_NAME"/ | wc -l)
mint_group_anchor() {
$ASSET_MINT --type collectible --supply 1 --name $1 --meta_file_path $2 --enable_emission
}
mint_grouped_asset() {
$ASSET_MINT --type collectible --supply 1 --name $1 --meta_file_path $2 --group_anchor $3
}
finalize_batch() {
$MINT_FINALIZE
sleep 10
$MINE_BLOCK
sleep 1
$MINE_BLOCK
}
echo "$NUM_IMAGES"
STARTVAL=100
# ENDVAL=NUM_IMAGES
ENDVAL=1100
GROUP_ANCHOR="$BASE_NAME""$STARTVAL"
for ((i=STARTVAL; i<ENDVAL; i++)); do
FULL_META_FILE="$META_FILE$i$META_FILE_SUFFIX"
ASSET_NAME="$BASE_NAME$i"
if ((i == STARTVAL)); then
mint_group_anchor "$ASSET_NAME" "$FULL_META_FILE"
else
mint_grouped_asset "$ASSET_NAME" "$FULL_META_FILE" "$GROUP_ANCHOR"
fi
if ((i % 50 == 0)); then
echo "Submitted $i mint requests."
fi
done
echo "Finalizing batch."
finalize_batch