diff options
author | Rasmus Dahlberg <rasmus.dahlberg@kau.se> | 2021-03-16 16:29:24 +0100 |
---|---|---|
committer | Rasmus Dahlberg <rasmus.dahlberg@kau.se> | 2021-03-16 16:29:24 +0100 |
commit | 453a0c38516496052c5f570691c74516c8675e2d (patch) | |
tree | f56648b1073dc327b0cd1cc25e371cd5ebefa00d /client/cmd/example.sh | |
parent | 9f7690327f8d74abdd86232546a154ab8408d174 (diff) |
added additional basic client commands
Diffstat (limited to 'client/cmd/example.sh')
-rwxr-xr-x | client/cmd/example.sh | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/client/cmd/example.sh b/client/cmd/example.sh new file mode 100755 index 0000000..beac26e --- /dev/null +++ b/client/cmd/example.sh @@ -0,0 +1,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 |