From 453a0c38516496052c5f570691c74516c8675e2d Mon Sep 17 00:00:00 2001 From: Rasmus Dahlberg Date: Tue, 16 Mar 2021 16:29:24 +0100 Subject: added additional basic client commands --- client/cmd/example.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 client/cmd/example.sh (limited to 'client/cmd/example.sh') 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 -- cgit v1.2.3