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

test: working multisig join script #3

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@

.PHONY: build-keri
build-keri:
@docker buildx build --platform=linux/amd64 -f images/keripy.dockerfile --tag weboftrust/keri:1.1.14 .
@docker buildx build --platform=linux/arm64 -f images/keripy.dockerfile --tag weboftrust/keri:1.1.14-arm64 .
@docker buildx build --platform=linux/amd64 -f images/keripy.dockerfile --tag weboftrust/keri:1.1.15 .
@docker buildx build --platform=linux/arm64 -f images/keripy.dockerfile --tag weboftrust/keri:1.1.15-arm64 .

.PHONY: build-witness-demo
build-witness-demo:
@@docker buildx build --platform=linux/amd64 -f images/witness.demo.dockerfile --tag weboftrust/keri-witness-demo:1.1.14 .
@@docker buildx build --platform=linux/arm64 -f images/witness.demo.dockerfile --tag weboftrust/keri-witness-demo:1.1.14-arm64 .
@@docker buildx build --platform=linux/amd64 -f images/witness.demo.dockerfile --tag weboftrust/keri-witness-demo:1.1.15 .
@@docker buildx build --platform=linux/arm64 -f images/witness.demo.dockerfile --tag weboftrust/keri-witness-demo:1.1.15-arm64 .

.PHONY: publish-keri
publish-keri:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ to get a version string similar to the following:
### Local installation - Docker build
Run `make build-keri` to build your docker image.

Then run `docker run --pull=never -it --entrypoint /bin/bash weboftrust/keri:1.1.14` and you can run `kli version` from within the running container to play with KERIpy.
Then run `docker run --pull=never -it --entrypoint /bin/bash weboftrust/keri:1.1.15` and you can run `kli version` from within the running container to play with KERIpy.

Make sure the image tag matches the version used in the `Makefile`.
We use `--pull=never` to ensure that docker does not implicitly pull a remote image and relies on the local image tagged during `make build-keri`.
Expand Down
41 changes: 20 additions & 21 deletions images/keripy.dockerfile
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
# Builder layer
FROM python:3.10-alpine as builder
ARG BASE=python:3.10.14-alpine3.20

# Install compilation dependencies
RUN apk --no-cache add \
bash \
FROM ${BASE} as builder

RUN apk add --no-cache bash

SHELL ["/bin/bash", "-c"]

RUN apk add --no-cache \
curl \
build-base \
alpine-sdk \
libffi-dev \
libsodium \
libsodium-dev

SHELL ["/bin/bash", "-c"]
libsodium-dev

# Setup Rust for blake3 dependency build
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"

WORKDIR /keripy

RUN python -m venv venv

ENV PATH=/keripy/venv/bin:${PATH}

RUN pip install --upgrade pip && \
mkdir /keripy/src
RUN pip install --upgrade pip
RUN mkdir /keripy/src

# Copy Python dependency files in
COPY requirements.txt setup.py ./
# Set up Rust environment and install Python dependencies
# Must source the Cargo environment for the blake3 library to see
# the Rust intallation during requirements install
RUN . ${HOME}/.cargo/env && \
pip install -r requirements.txt

RUN . ${HOME}/.cargo/env
RUN pip install -r requirements.txt

# Runtime layer
FROM python:3.10.13-alpine3.18
FROM ${BASE}

RUN apk --no-cache add \
bash \
Expand All @@ -44,7 +44,6 @@ WORKDIR /keripy
COPY --from=builder /keripy /keripy
COPY src/ src/

ENV PATH=/keripy/venv/bin:${PATH}

ENV PATH="/keripy/venv/bin:${PATH}"

ENTRYPOINT [ "kli" ]
Empty file removed keri/cf/demo-witness-oobis.json
Empty file.
9 changes: 9 additions & 0 deletions rootgartest/keri/cf/main/wan.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"wan": {
"dt": "2022-01-20T12:57:59.823350+00:00",
"curls": ["tcp://192.168.1.4:5632/", "http://192.168.1.4:5642/"]
},
"dt": "2022-01-20T12:57:59.823350+00:00",
"iurls": [
]
}
9 changes: 9 additions & 0 deletions rootgartest/keri/cf/main/wes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"wes": {
"dt": "2022-01-20T12:57:59.823350+00:00",
"curls": ["tcp://192.168.1.4:5634/", "http://192.168.1.4:5644/"]
},
"dt": "2022-01-20T12:57:59.823350+00:00",
"iurls": [
]
}
9 changes: 9 additions & 0 deletions rootgartest/keri/cf/main/wil.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"wil": {
"dt": "2022-01-20T12:57:59.823350+00:00",
"curls": ["tcp://192.168.1.4:5633/", "http://192.168.1.4:5643/"]
},
"dt": "2022-01-20T12:57:59.823350+00:00",
"iurls": [
]
}
9 changes: 9 additions & 0 deletions rootgartest/keri/cf/main/wit.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"wit": {
"dt": "2022-01-20T12:57:59.823350+00:00",
"curls": ["tcp://192.168.1.4:5635/", "http://192.168.1.4:5645/"]
},
"dt": "2022-01-20T12:57:59.823350+00:00",
"iurls": [
]
}
9 changes: 9 additions & 0 deletions rootgartest/keri/cf/main/wub.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"wub": {
"dt": "2022-01-20T12:57:59.823350+00:00",
"curls": ["tcp://192.168.1.4:5636/", "http://192.168.1.4:5646/"]
},
"dt": "2022-01-20T12:57:59.823350+00:00",
"iurls": [
]
}
9 changes: 9 additions & 0 deletions rootgartest/keri/cf/main/wyz.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"wyz": {
"dt": "2022-01-20T12:57:59.823350+00:00",
"curls": ["tcp://192.168.1.4:5637/", "http://192.168.1.4:5647/"]
},
"dt": "2022-01-20T12:57:59.823350+00:00",
"iurls": [
]
}
8 changes: 8 additions & 0 deletions rootgartest/keri/cf/rootgar-test-oobis.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"dt": "2022-01-20T12:57:59.823350+00:00",
"iurls": [
"http://192.168.1.4:5642/oobi/BBilc4-L3tFUnfM_wJr4S4OJanAv_VmF_dJNN6vkf2Ha/controller?name=Wan&tag=witness",
"http://192.168.1.4:5643/oobi/BLskRTInXnMxWaGqcpSyMgo0nYbalW99cGZESrz3zapM/controller?name=Wes&tag=witness",
"http://192.168.1.4:5644/oobi/BIKKuvBwpmDVA4Ds-EpL5bt9OqPzWPja2LigFYZN2YfX/controller?name=Wil&tag=witness"
]
}
Empty file.
104 changes: 83 additions & 21 deletions scripts/demo/basic/multisig-join.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,58 +4,120 @@
# To run the following scripts, open another console window and run:
# $ kli witness demo

kli init --name multisigj1 --salt 0ACDEyMzQ1Njc4OWxtbm9aBc --nopasscode --config-dir "${KERI_SCRIPT_DIR}" --config-file demo-witness-oobis
kli incept --name multisigj1 --alias multisigj1 --file ${KERI_DEMO_SCRIPT_DIR}/data/multisig-1-sample.json

kli init --name multisigj2 --salt 0ACDEyMzQ1Njc4OWdoaWpsaw --nopasscode --config-dir "${KERI_SCRIPT_DIR}" --config-file demo-witness-oobis
kli incept --name multisigj2 --alias multisigj2 --file ${KERI_DEMO_SCRIPT_DIR}/data/multisig-2-sample.json

kli oobi resolve --name multisigj1 --oobi-alias multisigj2 --oobi http://127.0.0.1:5642/oobi/EKJ6tNVUGbdaiwx2nWDCFXG-_PY_AzESOcoKlm0kRNP3/witness/BBilc4-L3tFUnfM_wJr4S4OJanAv_VmF_dJNN6vkf2Ha
kli oobi resolve --name multisigj2 --oobi-alias multisigj1 --oobi http://127.0.0.1:5642/oobi/EFY7MixHb0so4WFFHw6btOPc5qeeWfPm7v5MJWcdcbyG/witness/BBilc4-L3tFUnfM_wJr4S4OJanAv_VmF_dJNN6vkf2Ha
# EFY7MixHb0so4WFFHw6btOPc5qeeWfPm7v5MJWcdcbyG
MS1=EFY7MixHb0so4WFFHw6btOPc5qeeWfPm7v5MJWcdcbyG
kli init --name multisigj1 --salt 0ACDEyMzQ1Njc4OWxtbm9aBc \
--passcode "DoB26Fj4x9LboAFWJra17O" \
--config-dir "${KERI_SCRIPT_DIR}" --config-file demo-witness-oobis
kli incept --name multisigj1 --alias multisigj1 \
--passcode "DoB26Fj4x9LboAFWJra17O" \
--file ${KERI_DEMO_SCRIPT_DIR}/data/multisig-1-sample.json

# EKJ6tNVUGbdaiwx2nWDCFXG-_PY_AzESOcoKlm0kRNP3
MS2=EKJ6tNVUGbdaiwx2nWDCFXG-_PY_AzESOcoKlm0kRNP3
kli init --name multisigj2 --salt 0ACDEyMzQ1Njc4OWdoaWpsaw \
--passcode "DoB26Fj4x9LboAFWJra17O" \
--config-dir "${KERI_SCRIPT_DIR}" --config-file demo-witness-oobis
kli incept --name multisigj2 --alias multisigj2 \
--passcode "DoB26Fj4x9LboAFWJra17O" \
--file ${KERI_DEMO_SCRIPT_DIR}/data/multisig-2-sample.json

# EKxxKVNmC3M_u3eDF6Nw6MjRlRx1s_9Y-DV234UtkqAF
MS3=EKxxKVNmC3M_u3eDF6Nw6MjRlRx1s_9Y-DV234UtkqAF
kli init --name multisigj3 --salt 0ADR4R9kW_3ZvbwWGnA5YVah \
--passcode "DoB26Fj4x9LboAFWJra17O" \
--config-dir "${KERI_SCRIPT_DIR}" --config-file demo-witness-oobis
kli incept --name multisigj3 --alias multisigj3\
--passcode "DoB26Fj4x9LboAFWJra17O" \
--file ${KERI_DEMO_SCRIPT_DIR}/data/multisig-3-sample.json

kli oobi resolve --name multisigj1 --oobi-alias multisigj2 \
--passcode "DoB26Fj4x9LboAFWJra17O" \
--oobi http://127.0.0.1:5642/oobi/$MS2/witness/BBilc4-L3tFUnfM_wJr4S4OJanAv_VmF_dJNN6vkf2Ha
kli oobi resolve --name multisigj1 --oobi-alias multisigj3 \
--passcode "DoB26Fj4x9LboAFWJra17O" \
--oobi http://127.0.0.1:5642/oobi/$MS3/witness/BBilc4-L3tFUnfM_wJr4S4OJanAv_VmF_dJNN6vkf2Ha
kli oobi resolve --name multisigj2 --oobi-alias multisigj1 \
--passcode "DoB26Fj4x9LboAFWJra17O" \
--oobi http://127.0.0.1:5642/oobi/$MS1/witness/BBilc4-L3tFUnfM_wJr4S4OJanAv_VmF_dJNN6vkf2Ha
kli oobi resolve --name multisigj2 --oobi-alias multisigj3 \
--passcode "DoB26Fj4x9LboAFWJra17O" \
--oobi http://127.0.0.1:5642/oobi/$MS3/witness/BBilc4-L3tFUnfM_wJr4S4OJanAv_VmF_dJNN6vkf2Ha
kli oobi resolve --name multisigj3 --oobi-alias multisigj2 \
--passcode "DoB26Fj4x9LboAFWJra17O" \
--oobi http://127.0.0.1:5642/oobi/$MS2/witness/BBilc4-L3tFUnfM_wJr4S4OJanAv_VmF_dJNN6vkf2Ha
kli oobi resolve --name multisigj3 --oobi-alias multisigj1 \
--passcode "DoB26Fj4x9LboAFWJra17O" \
--oobi http://127.0.0.1:5642/oobi/$MS1/witness/BBilc4-L3tFUnfM_wJr4S4OJanAv_VmF_dJNN6vkf2Ha

PID_LIST=""

kli multisig incept --name multisigj1 --alias multisigj1 --group multisig --file ${KERI_DEMO_SCRIPT_DIR}/data/multisig-join-sample.json &
kli multisig incept --name multisigj1 --alias multisigj1 --group multisig \
--passcode "DoB26Fj4x9LboAFWJra17O" \
--file ${KERI_DEMO_SCRIPT_DIR}/data/multisig-join-sample.json &
pid=$!
PID_LIST+=" $pid"

kli multisig join --name multisigj2 --passcode "DoB26Fj4x9LboAFWJra17O" --auto &
pid=$!
PID_LIST+=" $pid"

kli multisig join --name multisigj2 --auto &
kli multisig join --name multisigj3 --passcode "DoB26Fj4x9LboAFWJra17O" --auto &
pid=$!
PID_LIST+=" $pid"

wait $PID_LIST

kli status --name multisigj1 --alias multisig
kli status --name multisigj1 --alias multisig --passcode "DoB26Fj4x9LboAFWJra17O"

kli rotate --name multisigj1 --alias multisigj1 --passcode "DoB26Fj4x9LboAFWJra17O"
kli rotate --name multisigj2 --alias multisigj2 --passcode "DoB26Fj4x9LboAFWJra17O"
kli rotate --name multisigj3 --alias multisigj3 --passcode "DoB26Fj4x9LboAFWJra17O"

kli rotate --name multisigj1 --alias multisigj1
kli query --name multisigj2 --alias multisigj2 --prefix EFY7MixHb0so4WFFHw6btOPc5qeeWfPm7v5MJWcdcbyG
kli rotate --name multisigj2 --alias multisigj2
kli query --name multisigj1 --alias multisigj1 --prefix EKJ6tNVUGbdaiwx2nWDCFXG-_PY_AzESOcoKlm0kRNP3
kli query --name multisigj1 --alias multisigj1 --prefix $MS2 --passcode "DoB26Fj4x9LboAFWJra17O"
kli query --name multisigj1 --alias multisigj1 --prefix $MS3 --passcode "DoB26Fj4x9LboAFWJra17O"
kli query --name multisigj2 --alias multisigj2 --prefix $MS1 --passcode "DoB26Fj4x9LboAFWJra17O"
kli query --name multisigj2 --alias multisigj2 --prefix $MS3 --passcode "DoB26Fj4x9LboAFWJra17O"
kli query --name multisigj3 --alias multisigj3 --prefix $MS1 --passcode "DoB26Fj4x9LboAFWJra17O"
kli query --name multisigj3 --alias multisigj3 --prefix $MS2 --passcode "DoB26Fj4x9LboAFWJra17O"

PID_LIST=""

kli multisig rotate --name multisigj1 --alias multisig --smids EKJ6tNVUGbdaiwx2nWDCFXG-_PY_AzESOcoKlm0kRNP3 --smids EFY7MixHb0so4WFFHw6btOPc5qeeWfPm7v5MJWcdcbyG --isith '["1/2", "1/2"]' --nsith '["1/2", "1/2"]' --rmids EKJ6tNVUGbdaiwx2nWDCFXG-_PY_AzESOcoKlm0kRNP3 --rmids EFY7MixHb0so4WFFHw6btOPc5qeeWfPm7v5MJWcdcbyG &
kli multisig rotate --name multisigj1 --alias multisig \
--passcode "DoB26Fj4x9LboAFWJra17O" \
--smids $MS2 --smids $MS1 --smids $MS3 \
--isith '["1/2", "1/2", "1/2"]' \
--nsith '["1/2", "1/2", "1/2"]' \
--rmids $MS2 --rmids $MS1 --rmids $MS3 &
pid=$!
PID_LIST+=" $pid"

kli multisig join --name multisigj2 --auto &
kli multisig join --name multisigj2 --passcode "DoB26Fj4x9LboAFWJra17O" --auto &
pid=$!
PID_LIST+=" $pid"

kli multisig join --name multisigj3 --passcode "DoB26Fj4x9LboAFWJra17O" --auto &
pid=$!
PID_LIST+=" $pid"

wait $PID_LIST

kli status --name multisigj1 --alias multisig
kli status --name multisigj1 --alias multisig --passcode "DoB26Fj4x9LboAFWJra17O"

PID_LIST=""

kli multisig interact --name multisigj1 --alias multisig --data '{"d": "potato"}' &
kli multisig interact --name multisigj1 --alias multisig --passcode "DoB26Fj4x9LboAFWJra17O" --data '{"d": "potato"}' &
pid=$!
PID_LIST+=" $pid"

kli multisig join --name multisigj2 --passcode "DoB26Fj4x9LboAFWJra17O" --auto &
pid=$!
PID_LIST+=" $pid"

kli multisig join --name multisigj2 --auto &
kli multisig join --name multisigj3 --passcode "DoB26Fj4x9LboAFWJra17O" --auto &
pid=$!
PID_LIST+=" $pid"

wait $PID_LIST

kli status --name multisigj1 --alias multisig
kli status --name multisigj1 --alias multisig --passcode "DoB26Fj4x9LboAFWJra17O"
Loading
Loading