aboutsummaryrefslogtreecommitdiff
path: root/client/cmd/example.sh
blob: beac26e9ac0d9a2b1b0348dc9b6afc397d5bc1c1 (plain)
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
#!/bin/bash

echo "fetching sth..."
go run get-sth/main.go --logtostderr -v 3 | tee sth1.output
echo "" && sleep 1

echo "adding an entry..."
go run add-entry/main.go --logtostderr -v 3 \
	--identifier "example.sh v0.0.1-$(cat /dev/urandom | base64 | head -c 10)" \
	--checksum $(sha256sum example.sh) | tee add-entry.output
echo "" && sleep 1

echo "fetching another sth..."
go run get-sth/main.go --logtostderr -v 3 | tee sth2.output
echo "" && sleep 1

echo "verifying inclusion..."
go run get-proof-by-hash/main.go --logtostderr -v 3 \
	--leaf_hash $(cat add-entry.output | awk '{print $3}') \
	--sth $(cat sth2.output | awk '{print $2}')
echo "" && sleep 1

echo "verifying consistency..."
go run get-consistency-proof/main.go --logtostderr -v 3 \
	--first $(cat sth1.output | awk '{print $2}') \
	--second $(cat sth2.output | awk '{print $2}')
echo "" && sleep 1

echo "fetching the log's first entry..."
go run get-entries/main.go --logtostderr -v 3 --start 0 --end 0
echo ""

rm *.output