Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update provision tree script in k8s to use createtree #2676

Merged
merged 1 commit into from
Feb 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 4 additions & 15 deletions examples/deployment/kubernetes/provision_tree.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,18 @@ fi

# Set up tunnel:
PORT=35791
export LOG_URL="http://127.0.0.1:${PORT}"
export LOG_RPC="http://127.0.0.1:${PORT}"

echo kubectl port-forward service/trillian-log-service ${PORT}:8091
kubectl port-forward service/trillian-log-service ${PORT}:8091 &
echo kubectl port-forward service/trillian-log-service ${PORT}:8090
kubectl port-forward service/trillian-log-service ${PORT}:8090 &
trap "kill %1" 0 1 2 3 4 6 9 15

sleep 3

echo "Creating tree..."
# TODO(al): use cmd/createtree instead.
TREE=$(curl -sb -X POST ${LOG_URL}/v1beta1/trees -d '{ "tree":{ "tree_state":"ACTIVE", "tree_type":"LOG", "hash_strategy":"RFC6962_SHA256", "signature_algorithm":"ECDSA", "max_root_duration":"0", "hash_algorithm":"SHA256" }, "key_spec":{ "ecdsa_params":{ "curve":"P256" } } }')

echo $TREE

TREEID=$(echo ${TREE} | jq -r .tree_id)
TREEID=$(go run github.com/google/trillian/cmd/createtree --admin_server=${LOG_RPC})

echo "Created tree ${TREEID}:"
echo ${TREE} | jq

echo "Initialising tree ${TREEID}:"
STH=$(curl -s -X POST ${LOG_URL}/v1beta1/logs/${TREEID}:init)
echo "Created STH:"
echo ${STH} | jq

# stop port-forwarding
kill %1