diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 8548f6e..5b766ff 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -32,16 +32,24 @@ jobs: - name: run ping run: cd docker && sudo -E make run-ping - - name: Run Walletshield + - name: run walletshield test probe + run: cd docker && sudo -E make walletshield-probe + + - name: Start walletshield run: | - cd docker && sudo -E make run-walletshield + cd docker + sudo -E make walletshield-start + sleep 10 + sudo -E make walletshield-logs - - name: Test Walletshield + - name: Test walletshield run: ./tests/e2e/walletshield/test.sh - - name: Stop the Walletshield + - name: Stop walletshield run: | - cd docker && sudo -E make stop-walletshield + cd docker + sudo -E make walletshield-logs + sudo -E make walletshield-stop - name: Stop the mixnet run: | diff --git a/.gitignore b/.gitignore index c99a270..efe2541 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,2 @@ apps/walletshield/walletshield -docker/*.stamp -docker/cache -docker/katzenpost -docker/voting_mixnet -genconfig/genconfig server_plugins/cbor_plugins/http_proxy/cmd/http_proxy/http_proxy diff --git a/Makefile b/Makefile index eca19cd..bcd838e 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ .PHONY: all app-walletshield http_proxy clean + all: app-walletshield http_proxy app-walletshield: diff --git a/apps/walletshield/main.go b/apps/walletshield/main.go index ee31c3d..b6a163c 100644 --- a/apps/walletshield/main.go +++ b/apps/walletshield/main.go @@ -18,23 +18,60 @@ import ( "github.com/charmbracelet/log" "github.com/fxamacker/cbor/v2" - "github.com/katzenpost/katzenpost/client" - "github.com/katzenpost/katzenpost/client/config" - "github.com/katzenpost/katzenpost/client/utils" + "github.com/katzenpost/hpqc/hash" + "github.com/katzenpost/hpqc/rand" + + "github.com/katzenpost/katzenpost/client2" + "github.com/katzenpost/katzenpost/client2/config" + "github.com/katzenpost/katzenpost/client2/thin" + sConstants "github.com/katzenpost/katzenpost/core/sphinx/constants" "github.com/0KnowledgeNetwork/opt/server_plugins/cbor_plugins/http_proxy" ) +var ( + timeout = time.Second * 200 + ProxyHTTPService = "http_proxy" +) + +func sendRequest(thin *thin.ThinClient, payload []byte) ([]byte, error) { + surbID := &[sConstants.SURBIDLength]byte{} + _, err := rand.Reader.Read(surbID[:]) + if err != nil { + panic(err) + } + + // Select a target service node and compute the DestinationIdHash + target, err := thin.GetService(ProxyHTTPService) + if err != nil { + panic(err) + } + nodeId := hash.Sum256(target.MixDescriptor.IdentityKey) + + timeoutCtx, _ := context.WithTimeout(context.TODO(), timeout) + return thin.BlockingSendMessage(timeoutCtx, payload, &nodeId, target.RecipientQueueID) +} + +type Server struct { + log *log.Logger + daemon *client2.Daemon + thin *thin.ThinClient +} + func main() { var logLevel string var listenAddr string + var listenAddrClient string var configPath string + var delayStart int var testProbe bool var testProbeCount int flag.StringVar(&configPath, "config", "", "file path of the client configuration TOML file") + flag.IntVar(&delayStart, "delay_start", 0, "max random seconds to delay start") flag.StringVar(&logLevel, "log_level", "DEBUG", "logging level could be set to: DEBUG, INFO, WARNING, ERROR, CRITICAL") flag.StringVar(&listenAddr, "listen", "", "local socket to listen HTTP on") + flag.StringVar(&listenAddrClient, "listen_client", "", "local network address for the client daemon") flag.BoolVar(&testProbe, "probe", false, "send test probes instead of handling requests") flag.IntVar(&testProbeCount, "probe_count", 1, "number of test probes to send") flag.Parse() @@ -56,30 +93,44 @@ func main() { Level: level, }) - // mixnet client + if delayStart > 0 { + d := rand.NewMath().Intn(delayStart) + mylog.Infof("Delaying start for %d seconds...", d) + time.Sleep(time.Duration(d) * time.Second) + } + + // start client2 daemon cfg, err := config.LoadFile(configPath) if err != nil { panic(err) } - c, err := client.New(cfg) + + if listenAddrClient != "" { + cfg.ListenAddress = listenAddrClient + } + + d, err := client2.NewDaemon(cfg) if err != nil { panic(err) } - session, err := c.NewTOFUSession(context.Background()) + err = d.Start() if err != nil { panic(err) } - ProxyHTTPService := "http_proxy" - desc, err := session.GetService(ProxyHTTPService) + + time.Sleep(time.Second * 3) // XXX ugly hack but works: FIXME + + thin := thin.NewThinClient(cfg) + err = thin.Dial() if err != nil { panic(err) } // http server server := &Server{ - log: mylog, - session: session, - target: desc, + log: mylog, + thin: thin, + daemon: d, } if testProbe { @@ -98,12 +149,6 @@ func main() { } } -type Server struct { - log *log.Logger - session *client.Session - target *utils.ServiceDescriptor -} - func (s *Server) Handler(w http.ResponseWriter, req *http.Request) { s.log.Infof("Received HTTP request for %s", req.URL) @@ -128,7 +173,7 @@ func (s *Server) Handler(w http.ResponseWriter, req *http.Request) { panic(err) } - rawReply, err := s.session.BlockingSendUnreliableMessage(s.target.Name, s.target.Provider, blob) + rawReply, err := sendRequest(s.thin, blob) if err != nil { s.log.Errorf("Failed to send message: %s", err) http.Error(w, "custom 404", http.StatusNotFound) @@ -176,7 +221,8 @@ func (s *Server) SendTestProbes(d time.Duration, testProbeCount int) { for { packetsTransmitted++ t := time.Now() - _, err := s.session.BlockingSendUnreliableMessage(s.target.Name, s.target.Provider, blob) + + _, err = sendRequest(s.thin, blob) elapsed := time.Since(t).Seconds() if err != nil { s.log.Errorf("Probe failed after %.2fs: %s", elapsed, err) @@ -189,13 +235,12 @@ func (s *Server) SendTestProbes(d time.Duration, testProbeCount int) { if elapsed > rttMax { rttMax = elapsed } - s.log.Infof("Probe response took %.2fs", elapsed) } packetLoss := float64(packetsTransmitted-packetsReceived) / float64(packetsTransmitted) * 100 rttAvg := rttTotal / float64(packetsReceived) - s.log.Infof("Probe packet transmitted/received/loss = %d/%d/%.1f%%", packetsTransmitted, packetsReceived, packetLoss) - s.log.Infof("Probe rtt min/avg/max = %.2f/%.2f/%.2f s", rttMin, rttAvg, rttMax) + s.log.Infof("Probe packet transmitted/received/loss = %d/%d/%.1f%% | rtt min/avg/max = %.2f/%.2f/%.2f s", + packetsTransmitted, packetsReceived, packetLoss, rttMin, rttAvg, rttMax) // probe indefinitely if testProbeCount is 0 if testProbeCount != 0 && packetsTransmitted >= testProbeCount { diff --git a/docker/Makefile b/docker/Makefile index d4d8ecf..7260358 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -1,102 +1,64 @@ -.PHONY: clean clean-local clean-local-dryrun clean-image-% clean-container-% clean-images test rootshell shell run-ping go-mod-tidy go-mod-upgrade help start run stop - -help: - @echo "These make targets allow you to control the test network:" - @echo " run - run the testnet in the foreground, until ctrl-C" - @echo " start - start the testnet in the background" - @echo " stop - stop the testnet" - @echo " wait - wait for testnet to have consensus" - @echo " watch - tail -F all logs" - @echo " status - show testnet consensus status" - @echo " show-latest-vote - does what it says" - @echo " run-ping - send a ping over the testnet" - @echo " run-walletshield - run walletshield app with testnet" - @echo " stop-walletshield - stop running walletshield" - @echo " clean-bin - stop, and delete compiled binaries" - @echo " clean-local - stop, and delete data and binaries" - @echo " clean-local-dryrun - show what clean-local would delete" - @echo " clean - the above, plus cleans includes go_deps images" - @echo - warped?=true mixes=3 auths=3 gateways=1 serviceNodes=1 -# Parameters -sr=0 -mu=0.005 -muMax=1000 -lP=0.001 -lPMax=1000 -lL=0.0005 -lLMax=1000 -lD=0.0005 -lDMax=3000 -lM=0.0005 -lMMax=100 -lGMax=1000 - UserForwardPayloadLength=30000 -# hybrid ctidh PQ can work here, but requires manually building ctidh. -nike=x25519 - -# kem can be Kyber1024-X448 or any of the other schemes at https://github.com/cloudflare/circl/blob/main/kem/schemes/schemes.go (and then nike must be unset) -kem= - -DISTROS=alpine debian distro=alpine -wirekem=xwing net_name=voting_mixnet -base_port=30000 -bind_addr=127.0.0.1 docker_compose_yml=$(net_name)/docker-compose.yml sh=$(shell if echo ${distro}|grep -q alpine; then echo sh; else echo bash; fi) -SHELL=/bin/bash cache_dir=cache - -# log_level can be DEBUG, INFO, NOTICE, WARNING, ERROR, CRITICAL log_level=DEBUG - docker=$(shell if which podman|grep -q .; then echo podman; else echo docker; fi) - ldflags="-buildid= -X github.com/katzenpost/katzenpost/core/epochtime.WarpedEpoch=${warped}" - uid?=$(shell [ "$$SUDO_UID" != "" ] && echo "$$SUDO_UID" || id -u) gid?=$(shell [ "$$SUDO_GID" != "" ] && echo "$$SUDO_GID" || id -g) - -opt_workspace=/go/opt -katzenpost_workspace=/go/katzenpost -katzenpost_dir=./katzenpost -katzenpost_version=$(shell grep -E '^ github.com/katzenpost/katzenpost ' ../go.mod | awk '{print $$2}') - docker_user?=$(shell if echo ${docker}|grep -q podman; then echo 0:0; else echo ${uid}:${gid}; fi) -docker_args=--user ${docker_user} --volume $(shell readlink -f $(katzenpost_dir)):$(katzenpost_workspace) --workdir $(katzenpost_workspace) -v $(shell readlink -f .)/$(cache_dir)/go:/go/ -v $(shell readlink -f .)/$(cache_dir)/root_cache:/root/.cache - -opt_docker_args=--user ${docker_user} --volume $(shell readlink -f ..):$(opt_workspace) --workdir $(opt_workspace) - -replace_name=$(shell if echo ${docker}|grep -q podman; then echo " --replace --name"; else echo " --name"; fi) -i_if_podman=$(shell if echo ${docker}|grep -q podman; then echo " -i"; else echo; fi) -mount_net_name=-v `pwd`/$(net_name):/$(net_name) - -docker_compose_v1_or_v2?= $(shell [ -e /usr/libexec/docker/cli-plugins/docker-compose ] && echo /usr/libexec/docker/cli-plugins/docker-compose || echo docker-compose) -docker_compose?= $(shell if which podman|grep -q .; then echo DOCKER_HOST="unix://$$XDG_RUNTIME_DIR/podman/podman.sock" $(docker_compose_v1_or_v2); else echo $(docker_compose_v1_or_v2); fi) - -make_args=--no-print-directory net_name=$(net_name) docker=$(docker) distro=$(distro) warped=$(warped) docker_user=$(docker_user) +docker_args=--user ${docker_user} --volume $(shell readlink -f $(katzenpost_dir)):/go/katzenpost --workdir /go/katzenpost -v $(shell readlink -f $(katzenpost_dir))/docker/$(cache_dir)/go:/go/ -e GOCACHE=/go/cache +mount_net_name=-v $(katzenpost_dir)/docker/$(net_name):/$(net_name) +mount_opt=-v $(shell readlink -f ..):/go/opt +docker_run_sh=$(docker) run ${docker_args} $(mount_net_name) $(mount_opt) --rm katzenpost-$(distro)_base $(sh) -c -$(net_name): - mkdir -vp $(net_name) - -$(cache_dir): $(cache_dir)/go $(cache_dir)/root_cache +katzenpost_dir=/tmp/katzenpost.opt +katzenpost_version=$(shell grep -E '^ github.com/katzenpost/katzenpost ' ../go.mod | awk '{print $$2}') +net_dir=$(katzenpost_dir)/docker/$(net_name) + +# export variables to the environment for consumption by invoked Makefile(s) +export + +define SERVICENODE_PLUGINS + [[ServiceNode.CBORPluginKaetzchen]] + Capability = "http_proxy" + Endpoint = "http_proxy" + Command = "/$(net_name)/http_proxy.$(distro)" + MaxConcurrency = 1 + Disable = false + [ServiceNode.CBORPluginKaetzchen.Config] + config = "/$(net_name)/servicenode1/http_proxy_config.toml" + log_dir = "/$(net_name)/servicenode1" +endef + +.PHONY: help +help: + @echo + @echo "These make targets allow you to control custom apps:" + @echo " walletshield-start - start walletshield client" + @echo " walletshield-logs - show walletshield logs" + @echo " walletshield-stop - stop walletshield client" + @echo " walletshield-probe - run walletshield test probe" + @$(MAKE) -e -C $(katzenpost_dir)/docker $@ -$(cache_dir)/go: - mkdir -vp $(cache_dir)/go +.PHONY: custom-binaries +custom-binaries: $(net_dir)/http_proxy.$(distro) -$(cache_dir)/root_cache: - mkdir -vp $(cache_dir)/root_cache +.PHONY: custom-config +custom-config: + printf '%s\n' "$$SERVICENODE_PLUGINS" | sed -i '/^\[ServiceNode\]/r /dev/stdin' $(net_dir)/servicenode1/katzenpost.toml +.PHONY: clone-katzenpost clone-katzenpost: if [ ! -d "$(katzenpost_dir)" ]; then \ git clone \ @@ -107,153 +69,41 @@ clone-katzenpost: $(katzenpost_dir); \ fi -$(docker_compose_yml): ../genconfig/main.go $(distro)_base.stamp | $(net_name) $(cache_dir) - $(docker) run ${opt_docker_args} --rm katzenpost-$(distro)_base \ - $(sh) -c 'cd genconfig && go build && cd ../docker \ - && ../genconfig/genconfig -wirekem $(wirekem) -a ${bind_addr} -nv ${auths} -n ${mixes} -gateways ${gateways} \ - -serviceNodes ${serviceNodes} \ - -sr ${sr} -mu ${mu} -muMax ${muMax} -lP ${lP} -lPMax ${lPMax} -lL ${lL} \ - -lLMax ${lLMax} -lD ${lD} -lDMax ${lDMax} -lM ${lM} -lMMax ${lMMax} \ - -S .$(distro) -v -o ./$(net_name) -b /$(net_name) -P $(base_port) \ - -nike "$(nike)" -kem "$(kem)" -d katzenpost-$(distro)_base \ - -UserForwardPayloadLength $(UserForwardPayloadLength) -log_level $(log_level)' - -$(net_name)/running.stamp: - make $(make_args) start +$(net_dir)/http_proxy.$(distro): $(katzenpost_dir)/docker/$(distro)_base.stamp | $(net_name) $(cache_dir) + $(docker_run_sh) 'cd /go/opt/server_plugins/cbor_plugins/http_proxy/cmd/http_proxy ; go build -trimpath -ldflags ${ldflags} && mv http_proxy /$(net_name)/http_proxy.$(distro)' + cp ../server_plugins/cbor_plugins/http_proxy/http_proxy_config.toml $(net_dir)/servicenode1/ -run: $(docker_compose_yml) $(net_name)/server.$(distro) $(net_name)/voting.$(distro) - cd $(net_name) && touch running.stamp \ - && DOCKER_USER=${docker_user} $(docker_compose) up --remove-orphans - cd $(net_name) && rm -v running.stamp +$(net_dir)/walletshield.$(distro): $(katzenpost_dir)/docker/$(distro)_base.stamp | $(net_name) $(cache_dir) + $(docker_run_sh) 'cd /go/opt/apps/walletshield ; go build -trimpath -ldflags ${ldflags} && mv walletshield /$(net_name)/walletshield.$(distro)' -start: clone-katzenpost $(docker_compose_yml) $(net_name)/http_proxy.$(distro) $(net_name)/server.$(distro) $(net_name)/voting.$(distro) - cd $(net_name); DOCKER_USER=${docker_user} $(docker_compose) up --remove-orphans -d; $(docker_compose) top - touch $(net_name)/running.stamp +.PHONY: walletshield-probe +walletshield-probe: $(net_dir)/walletshield.$(distro) $(net_dir)/running.stamp | $(cache_dir) + $(docker) run --network=host $(docker_args) $(mount_net_name) --rm katzenpost-$(distro)_base \ + /$(net_name)/walletshield.$(distro) -config /$(net_name)/client2/client.toml -log_level DEBUG -probe --probe_count 3 -stop: - [ -e $(net_name) ] && cd $(net_name) && $(docker_compose) down --remove-orphans; rm -fv running.stamp +.PHONY: walletshield-start +walletshield-start: $(net_dir)/walletshield.$(distro) $(net_dir)/running.stamp | $(cache_dir) + $(docker) run -d --network=host $(docker_args) $(mount_net_name) --name walletshield katzenpost-$(distro)_base \ + /$(net_name)/walletshield.$(distro) -config /$(net_name)/client2/client.toml -listen :7070 -log_level DEBUG -watch: - tail -F $(net_name)/*/*.log +.PHONY: walletshield-logs +walletshield-logs: + $(docker) logs --tail=100 walletshield -status: - @[ -d $(net_name) ] || (echo "./$(net_name)/ does not exist" && false) - tail -10 $(net_name)/auth1/katzenpost.log - @echo - @du -hs ./$(net_name) - @echo "Current time: $$(TZ=UTC date "+%H:%M:%S %Z") (compare to log timestamps to see if they are current)" - @cat $(net_name)/auth1/katzenpost.log |grep Genesis|tail -1|while read a b c d; do \ - echo "Network appears to have been running for $$(($$b - $$d)) consecutive epochs:"; \ - grep 'Consensus made' $(net_name)/auth1/katzenpost.log; \ - done|grep . || (echo "(no consensus yet; exiting with error)" && false) - -show-latest-vote: - @grep -A30 'Ready to send' voting_mixnet/auth1/katzenpost.log |tail -30|sed /Sending/q - -wait: $(net_name)/running.stamp | $(cache_dir) - $(docker) run --network=host ${docker_args} $(mount_net_name) --rm katzenpost-$(distro)_base \ - /$(net_name)/fetch.$(distro) -f /$(net_name)/client/client.toml - -debian_base.stamp: - $(docker) run $(replace_name) katzenpost_debian_base docker.io/golang:bullseye $(sh) -c "echo -e 'deb https://deb.debian.org/debian bullseye main\ndeb https://deb.debian.org/debian bullseye-updates main\ndeb https://deb.debian.org/debian-security bullseye-security main' > /etc/apt/sources.list && cat /etc/apt/sources.list && apt update && apt upgrade -y && apt install -y pv && adduser katzenpost --gecos '' --disabled-password && apt update && apt upgrade -y" - $(docker) commit katzenpost_debian_base katzenpost-debian_base - $(docker) rm katzenpost_debian_base - touch $@ - -alpine_base.stamp: - $(docker) run $(replace_name) katzenpost_alpine_base docker.io/golang:alpine sh -c 'adduser katzenpost --gecos "" --disabled-password && apk update && apk upgrade && apk add gcc musl-dev make pv' \ - && $(docker) commit katzenpost_alpine_base katzenpost-alpine_base \ - && $(docker) rm katzenpost_alpine_base - touch $@ - -go-mod-tidy: $(distro)_base.stamp | $(net_name) $(cache_dir) - $(docker) run ${docker_args} katzenpost-$(distro)_base \ - $(sh) -c "go mod tidy" - -go-mod-upgrade: $(distro)_base.stamp | $(net_name) $(cache_dir) - $(docker) run ${docker_args} katzenpost-$(distro)_base \ - $(sh) -c 'go get -d -u ./... && go mod tidy' - -$(net_name)/server.$(distro): $(distro)_base.stamp $(docker_compose_yml) | $(net_name) $(cache_dir) - $(docker) run ${docker_args} $(mount_net_name) --rm katzenpost-$(distro)_base \ - $(sh) -c 'cd server && make $(make_args) testnet-build testnet-install' - -$(net_name)/voting.$(distro): $(distro)_base.stamp $(docker_compose_yml) | $(net_name) $(cache_dir) - $(docker) run ${docker_args} $(mount_net_name) --rm katzenpost-$(distro)_base \ - $(sh) -c 'cd authority && make $(make_args) cmd/voting/voting cmd/fetch/fetch && \ - mv cmd/voting/voting /$(net_name)/voting.$(distro) && \ - mv cmd/fetch/fetch /$(net_name)/fetch.$(distro)' - -$(net_name)/ping.$(distro): $(distro)_base.stamp | $(net_name) $(cache_dir) - $(docker) run ${docker_args} $(mount_net_name) --rm katzenpost-$(distro)_base \ - $(sh) -c 'cd ping && go mod verify && go build -ldflags ${ldflags} && \ - mv ping /$(net_name)/ping.$(distro)' - -$(net_name)/http_proxy.$(distro): $(distro)_base.stamp | $(net_name) $(cache_dir) - $(docker) run $(opt_docker_args) $(mount_net_name) katzenpost-$(distro)_base \ - $(sh) -c 'cd $(opt_workspace)/server_plugins/cbor_plugins/http_proxy/cmd/http_proxy && go mod verify && go build -ldflags ${ldflags} && \ - mv http_proxy /$(net_name)/http_proxy.$(distro)' - cp ../server_plugins/cbor_plugins/http_proxy/http_proxy_config.toml ./$(net_name)/servicenode1/ - -clean-images: stop - @-for distro in $(DISTROS); do \ - make $(make_args) distro=$$distro clean-container-$${distro}_base; \ - make $(make_args) distro=$$distro clean-image-$${distro}_base; \ - done \ +.PHONY: walletshield-stop +walletshield-stop: + -$(docker) stop walletshield && $(docker) rm walletshield -clean-container-%: - -@$(docker) stop $(i_if_podman) $(patsubst clean-container-%,katzenpost_%,$@) - -@$(docker) rm $(i_if_podman) $(patsubst clean-container-%,katzenpost_%,$@) - -clean-image-%: - -$(docker) rmi $(patsubst clean-image-%,katzenpost-%,$@) - -rm -fv $(patsubst clean-image-%,%,$@).stamp - -clean-bin: stop - rm -vf ./$(net_name)/*.$(distro) - -clean-local: clean-bin - git clean -f -x $(net_name) - git status . - -clean-local-dryrun: - git clean -n -x $(net_name) - -clean: clean-images clean-local - rm -rfv $(cache_dir) - -$(docker) ps -a|grep katzenpost|cat - -$(docker) images|grep katzenpost|cat +.PHONY: clean +clean: walletshield-stop + $(MAKE) -e -C $(katzenpost_dir)/docker $@ rm -rf $(katzenpost_dir) -$(net_name)/walletshield.$(distro): $(distro)_base.stamp $(net_name)/http_proxy.$(distro) | $(net_name) $(cache_dir) - $(docker) run $(opt_docker_args) $(mount_net_name) katzenpost-$(distro)_base \ - $(sh) -c 'cd $(opt_workspace)/apps/walletshield && go mod verify && go build -ldflags ${ldflags} && \ - mv walletshield /$(net_name)/walletshield.$(distro)' - -run-walletshield: $(net_name)/walletshield.$(distro) $(net_name)/running.stamp | $(cache_dir) - $(docker) run -d --network=host $(opt_docker_args) $(mount_net_name) --name walletshield --rm katzenpost-$(distro)_base \ - /$(net_name)/walletshield.$(distro) -config /$(net_name)/client/client.toml -listen :7070 -log_level DEBUG - -stop-walletshield: - $(docker) stop walletshield - -run-ping: $(net_name)/ping.$(distro) $(net_name)/running.stamp | $(cache_dir) - $(docker) run --network=host ${docker_args} $(mount_net_name) --rm katzenpost-$(distro)_base \ - /$(net_name)/ping.$(distro) -c /$(net_name)/client/client.toml -s echo -printDiff -n 1 - -shell: $(distro)_base.stamp | $(net_name) $(cache_dir) - $(docker) run --network=host ${docker_args} $(mount_net_name) -w /$(net_name) --rm -it katzenpost-$(distro)_base $(sh) - -# this is for running with docker, where we are root outside and (except for -# here) non-root inside. When using podman, we are rootless outside and uid 0 -# inside already, so this target is never needed. -rootshell: $(distro)_base.stamp - $(docker) run --network=host --user 0:0 -v $(shell readlink -f ..):/go/katzenpost --rm -it katzenpost-$(distro)_base $(sh) - -test: wait - cd ../client && make $(make_args) testargs=$(testargs) dockerdockertest - cd ../catshadow && make $(make_args) testargs=$(testargs) dockerdockertest - cd ../memspool && make $(make_args) testargs=$(testargs) dockerdockertest +# start the testnet in the background with the local customizations +start: clone-katzenpost $(docker_compose_yml) custom-config custom-binaries + $(MAKE) -e -C $(katzenpost_dir)/docker $@ -check-go-version: - podman run --rm katzenpost-alpine_base go version +# pass through all other targets to katzenpost/docker/Makefile +%: clone-katzenpost + @echo ">> Passing '$@' to $(katzenpost_dir)/docker/Makefile" + $(MAKE) -e -C $(katzenpost_dir)/docker $@ diff --git a/genconfig/main.go b/genconfig/main.go deleted file mode 100644 index 3e411a2..0000000 --- a/genconfig/main.go +++ /dev/null @@ -1,754 +0,0 @@ -// genconfig.go - Katzenpost self contained test network. -// Copyright (C) 2022 Yawning Angel, David Stainton, Masala -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package main - -import ( - "flag" - "fmt" - "io" - "log" - "os" - "path/filepath" - "sort" - - "github.com/BurntSushi/toml" - - "github.com/katzenpost/hpqc/hash" - "github.com/katzenpost/hpqc/kem" - kempem "github.com/katzenpost/hpqc/kem/pem" - kemschemes "github.com/katzenpost/hpqc/kem/schemes" - "github.com/katzenpost/hpqc/nike/schemes" - "github.com/katzenpost/hpqc/sign" - signpem "github.com/katzenpost/hpqc/sign/pem" - signSchemes "github.com/katzenpost/hpqc/sign/schemes" - - vConfig "github.com/katzenpost/katzenpost/authority/voting/server/config" - cConfig "github.com/katzenpost/katzenpost/client/config" - "github.com/katzenpost/katzenpost/core/sphinx/geo" - sConfig "github.com/katzenpost/katzenpost/server/config" -) - -const ( - basePort = 30000 - bindAddr = "127.0.0.1" - nrLayers = 3 - nrNodes = 6 - nrGateways = 1 - nrServiceNodes = 1 - nrAuthorities = 3 -) - -type katzenpost struct { - baseDir string - outDir string - binSuffix string - logLevel string - logWriter io.Writer - - ratchetNIKEScheme string - wireKEMScheme string - pkiSignatureScheme sign.Scheme - sphinxGeometry *geo.Geometry - votingAuthConfigs []*vConfig.Config - authorities map[[32]byte]*vConfig.Authority - authIdentity sign.PublicKey - - nodeConfigs []*sConfig.Config - basePort uint16 - lastPort uint16 - bindAddr string - nodeIdx int - clientIdx int - gatewayIdx int - serviceNodeIdx int - hasPanda bool -} - -type AuthById []*vConfig.Authority - -func (a AuthById) Len() int { return len(a) } -func (a AuthById) Swap(i, j int) { a[i], a[j] = a[j], a[i] } -func (a AuthById) Less(i, j int) bool { return a[i].Identifier < a[j].Identifier } - -type NodeById []*vConfig.Node - -func (a NodeById) Len() int { return len(a) } -func (a NodeById) Swap(i, j int) { a[i], a[j] = a[j], a[i] } -func (a NodeById) Less(i, j int) bool { return a[i].Identifier < a[j].Identifier } - -func (s *katzenpost) genClientCfg() error { - os.Mkdir(filepath.Join(s.outDir, "client"), 0700) - cfg := new(cConfig.Config) - - cfg.RatchetNIKEScheme = s.ratchetNIKEScheme - cfg.WireKEMScheme = s.wireKEMScheme - cfg.PKISignatureScheme = s.pkiSignatureScheme.Name() - cfg.SphinxGeometry = s.sphinxGeometry - - s.clientIdx++ - - // Logging section. - cfg.Logging = &cConfig.Logging{File: "", Level: s.logLevel} - - // UpstreamProxy section - cfg.UpstreamProxy = &cConfig.UpstreamProxy{Type: "none"} - - // VotingAuthority section - - peers := make([]*vConfig.Authority, 0) - for _, peer := range s.authorities { - peers = append(peers, peer) - } - - sort.Sort(AuthById(peers)) - - cfg.VotingAuthority = &cConfig.VotingAuthority{Peers: peers} - - // Debug section - cfg.Debug = &cConfig.Debug{DisableDecoyTraffic: true} - err := saveCfg(cfg, s.outDir) - if err != nil { - return err - } - return nil -} - -func write(f *os.File, str string, args ...interface{}) { - str = fmt.Sprintf(str, args...) - _, err := f.WriteString(str) - - if err != nil { - log.Fatal(err) - } -} - -func (s *katzenpost) genNodeConfig(isGateway, isServiceNode bool, isVoting bool) error { - const serverLogFile = "katzenpost.log" - - n := fmt.Sprintf("mix%d", s.nodeIdx+1) - if isGateway { - n = fmt.Sprintf("gateway%d", s.gatewayIdx+1) - } else if isServiceNode { - n = fmt.Sprintf("servicenode%d", s.serviceNodeIdx+1) - } - - cfg := new(sConfig.Config) - cfg.SphinxGeometry = s.sphinxGeometry - - // Server section. - cfg.Server = new(sConfig.Server) - cfg.Server.WireKEM = s.wireKEMScheme - cfg.Server.PKISignatureScheme = s.pkiSignatureScheme.Name() - cfg.Server.Identifier = n - cfg.Server.Addresses = []string{fmt.Sprintf("%s:%d", s.bindAddr, s.lastPort)} - cfg.Server.DataDir = filepath.Join(s.baseDir, n) - - os.Mkdir(filepath.Join(s.outDir, cfg.Server.Identifier), 0700) - - cfg.Server.IsGatewayNode = isGateway - cfg.Server.IsServiceNode = isServiceNode - if isGateway { - cfg.Management = new(sConfig.Management) - cfg.Management.Enable = true - cfg.Server.AltAddresses = map[string][]string{ - "TCP": []string{fmt.Sprintf("localhost:%d", s.lastPort)}, - } - } - if isServiceNode { - cfg.Management = new(sConfig.Management) - cfg.Management.Enable = true - } - // Enable Metrics endpoint - s.lastPort += 1 - cfg.Server.MetricsAddress = fmt.Sprintf("127.0.0.1:%d", s.lastPort) - - // Debug section. - cfg.Debug = new(sConfig.Debug) - cfg.Debug.SendDecoyTraffic = false - - // PKI section. - if isVoting { - authorities := make([]*vConfig.Authority, 0, len(s.authorities)) - i := 0 - for _, auth := range s.authorities { - authorities = append(authorities, auth) - i += 1 - } - - sort.Sort(AuthById(authorities)) - cfg.PKI = &sConfig.PKI{ - Voting: &sConfig.Voting{ - Authorities: authorities, - }, - } - } - - // Logging section. - cfg.Logging = new(sConfig.Logging) - cfg.Logging.File = serverLogFile - cfg.Logging.Level = s.logLevel - - if isServiceNode { - // Enable the thwack interface. - s.serviceNodeIdx++ - - // configure an entry provider or a spool storage provider - cfg.ServiceNode = &sConfig.ServiceNode{} - - httpProxyCfg := &sConfig.CBORPluginKaetzchen{ - Capability: "http_proxy", - Endpoint: "http_proxy", - Command: s.baseDir + "/http_proxy" + s.binSuffix, - MaxConcurrency: 1, - Config: map[string]interface{}{ - "log_dir": s.baseDir + "/" + cfg.Server.Identifier, - "config": s.baseDir + "/" + cfg.Server.Identifier + "/" + "http_proxy_config.toml", - }, - } - cfg.ServiceNode.CBORPluginKaetzchen = []*sConfig.CBORPluginKaetzchen{httpProxyCfg} - - echoCfg := new(sConfig.Kaetzchen) - echoCfg.Capability = "echo" - echoCfg.Endpoint = "+echo" - cfg.ServiceNode.Kaetzchen = append(cfg.ServiceNode.Kaetzchen, echoCfg) - } else if isGateway { - s.gatewayIdx++ - cfg.Gateway = &sConfig.Gateway{} - } else { - s.nodeIdx++ - } - s.nodeConfigs = append(s.nodeConfigs, cfg) - s.lastPort++ - _ = cfgIdKey(cfg, s.outDir) - return cfg.FixupAndValidate() -} - -func (s *katzenpost) genVotingAuthoritiesCfg(numAuthorities int, parameters *vConfig.Parameters, nrLayers int, wirekem string) error { - - configs := []*vConfig.Config{} - - // initial generation of key material for each authority - s.authorities = make(map[[32]byte]*vConfig.Authority) - for i := 1; i <= numAuthorities; i++ { - cfg := new(vConfig.Config) - cfg.SphinxGeometry = s.sphinxGeometry - cfg.Server = &vConfig.Server{ - WireKEMScheme: s.wireKEMScheme, - PKISignatureScheme: s.pkiSignatureScheme.Name(), - Identifier: fmt.Sprintf("auth%d", i), - Addresses: []string{fmt.Sprintf("%s:%d", s.bindAddr, s.lastPort)}, - DataDir: filepath.Join(s.baseDir, fmt.Sprintf("auth%d", i)), - } - os.Mkdir(filepath.Join(s.outDir, cfg.Server.Identifier), 0700) - s.lastPort += 1 - cfg.Logging = &vConfig.Logging{ - Disable: false, - File: "katzenpost.log", - Level: s.logLevel, - } - cfg.Parameters = parameters - cfg.Debug = &vConfig.Debug{ - Layers: nrLayers, - MinNodesPerLayer: 1, - GenerateOnly: false, - } - configs = append(configs, cfg) - idKey := cfgIdKey(cfg, s.outDir) - linkKey := cfgLinkKey(cfg, s.outDir, wirekem) - authority := &vConfig.Authority{ - Identifier: fmt.Sprintf("auth%d", i), - IdentityPublicKey: idKey, - LinkPublicKey: linkKey, - WireKEMScheme: wirekem, - PKISignatureScheme: s.pkiSignatureScheme.Name(), - Addresses: cfg.Server.Addresses, - } - s.authorities[hash.Sum256From(idKey)] = authority - } - - // tell each authority about it's peers - for i := 0; i < numAuthorities; i++ { - peers := []*vConfig.Authority{} - for _, peer := range s.authorities { - peers = append(peers, peer) - } - sort.Sort(AuthById(peers)) - configs[i].Authorities = peers - } - s.votingAuthConfigs = configs - return nil -} - -func (s *katzenpost) genAuthorizedNodes() ([]*vConfig.Node, []*vConfig.Node, []*vConfig.Node, error) { - mixes := []*vConfig.Node{} - gateways := []*vConfig.Node{} - serviceNodes := []*vConfig.Node{} - for _, nodeCfg := range s.nodeConfigs { - node := &vConfig.Node{ - Identifier: nodeCfg.Server.Identifier, - IdentityPublicKeyPem: filepath.Join("../", nodeCfg.Server.Identifier, "identity.public.pem"), - } - if nodeCfg.Server.IsGatewayNode { - gateways = append(gateways, node) - } else if nodeCfg.Server.IsServiceNode { - serviceNodes = append(serviceNodes, node) - } else { - mixes = append(mixes, node) - } - } - sort.Sort(NodeById(mixes)) - sort.Sort(NodeById(gateways)) - sort.Sort(NodeById(serviceNodes)) - - return gateways, serviceNodes, mixes, nil -} - -func main() { - var err error - nrLayers := flag.Int("L", nrLayers, "Number of layers.") - nrNodes := flag.Int("n", nrNodes, "Number of mixes.") - - nrGateways := flag.Int("gateways", nrGateways, "Number of gateways.") - nrServiceNodes := flag.Int("serviceNodes", nrServiceNodes, "Number of providers.") - - voting := flag.Bool("v", false, "Generate voting configuration") - nrVoting := flag.Int("nv", nrAuthorities, "Generate voting configuration") - baseDir := flag.String("b", "", "Path to use as baseDir option") - basePort := flag.Int("P", basePort, "First port number to use") - bindAddr := flag.String("a", bindAddr, "Address to bind to") - outDir := flag.String("o", "", "Path to write files to") - dockerImage := flag.String("d", "katzenpost-go_mod", "Docker image for compose-compose") - binSuffix := flag.String("S", "", "suffix for binaries in docker-compose.yml") - logLevel := flag.String("log_level", "DEBUG", "logging level could be set to: DEBUG, INFO, NOTICE, WARNING, ERROR, CRITICAL") - omitTopology := flag.Bool("D", false, "Dynamic topology (omit fixed topology definition)") - wirekem := flag.String("wirekem", "", "Name of the KEM Scheme to be used with wire protocol") - kem := flag.String("kem", "", "Name of the KEM Scheme to be used with Sphinx") - nike := flag.String("nike", "x25519", "Name of the NIKE Scheme to be used with Sphinx") - ratchetNike := flag.String("ratchetNike", "x25519", "Name of the NIKE Scheme to be used with the doubleratchet") - UserForwardPayloadLength := flag.Int("UserForwardPayloadLength", 2000, "UserForwardPayloadLength") - pkiSignatureScheme := flag.String("pkiScheme", "Ed25519", "PKI Signature Scheme to be used") - - sr := flag.Uint64("sr", 0, "Sendrate limit") - mu := flag.Float64("mu", 0.005, "Inverse of mean of per hop delay.") - muMax := flag.Uint64("muMax", 1000, "Maximum delay for Mu.") - lP := flag.Float64("lP", 0.001, "Inverse of mean for client send rate LambdaP") - lPMax := flag.Uint64("lPMax", 1000, "Maximum delay for LambdaP.") - lL := flag.Float64("lL", 0.0005, "Inverse of mean of loop decoy send rate LambdaL") - lLMax := flag.Uint64("lLMax", 1000, "Maximum delay for LambdaL") - lD := flag.Float64("lD", 0.0005, "Inverse of mean of drop decoy send rate LambdaD") - lDMax := flag.Uint64("lDMax", 3000, "Maximum delay for LambaD") - lM := flag.Float64("lM", 0.2, "Inverse of mean of mix decoy send rate") - lMMax := flag.Uint64("lMMax", 100, "Maximum delay for LambdaM") - lGMax := flag.Uint64("lGMax", 100, "Maximum delay for LambdaM") - - flag.Parse() - - if *wirekem == "" { - log.Fatal("wire KEM must be set") - } - - if *kem == "" && *nike == "" { - log.Fatal("either nike or kem must be set") - } - if *kem != "" && *nike != "" { - log.Fatal("nike and kem flags cannot both be set") - } - - if *ratchetNike == "" { - log.Fatal("ratchetNike must be set") - } - - parameters := &vConfig.Parameters{ - SendRatePerMinute: *sr, - Mu: *mu, - MuMaxDelay: *muMax, - LambdaP: *lP, - LambdaPMaxDelay: *lPMax, - LambdaL: *lL, - LambdaLMaxDelay: *lLMax, - LambdaD: *lD, - LambdaDMaxDelay: *lDMax, - LambdaM: *lM, - LambdaMMaxDelay: *lMMax, - LambdaGMaxDelay: *lGMax, - } - - s := &katzenpost{} - - s.ratchetNIKEScheme = *ratchetNike - - s.wireKEMScheme = *wirekem - if kemschemes.ByName(*wirekem) == nil { - log.Fatal("invalid wire KEM scheme") - } - - s.baseDir = *baseDir - s.outDir = *outDir - s.binSuffix = *binSuffix - s.basePort = uint16(*basePort) - s.lastPort = s.basePort + 1 - s.bindAddr = *bindAddr - s.logLevel = *logLevel - - nrHops := *nrLayers + 2 - - if *nike != "" { - nikeScheme := schemes.ByName(*nike) - if nikeScheme == nil { - log.Fatalf("failed to resolve nike scheme %s", *nike) - } - s.sphinxGeometry = geo.GeometryFromUserForwardPayloadLength( - nikeScheme, - *UserForwardPayloadLength, - true, - nrHops, - ) - } - if *kem != "" { - kemScheme := kemschemes.ByName(*kem) - if kemScheme == nil { - log.Fatalf("failed to resolve kem scheme %s", *kem) - } - s.sphinxGeometry = geo.KEMGeometryFromUserForwardPayloadLength( - kemScheme, - *UserForwardPayloadLength, - true, - nrHops, - ) - } - if *pkiSignatureScheme != "" { - signScheme := signSchemes.ByName(*pkiSignatureScheme) - if signScheme == nil { - log.Fatalf("failed to resolve pki signature scheme %s", *pkiSignatureScheme) - } - s.pkiSignatureScheme = signScheme - } - - os.Mkdir(s.outDir, 0700) - os.Mkdir(filepath.Join(s.outDir, s.baseDir), 0700) - - if *voting { - // Generate the voting authority configurations - err := s.genVotingAuthoritiesCfg(*nrVoting, parameters, *nrLayers, *wirekem) - if err != nil { - log.Fatalf("getVotingAuthoritiesCfg failed: %s", err) - } - } - - // Generate the gateway configs. - for i := 0; i < *nrGateways; i++ { - if err = s.genNodeConfig(true, false, *voting); err != nil { - log.Fatalf("Failed to generate provider config: %v", err) - } - } - // Generate the service node configs. - for i := 0; i < *nrServiceNodes; i++ { - if err = s.genNodeConfig(false, true, *voting); err != nil { - log.Fatalf("Failed to generate provider config: %v", err) - } - } - - // Generate the mix node configs. - for i := 0; i < *nrNodes; i++ { - if err = s.genNodeConfig(false, false, *voting); err != nil { - log.Fatalf("Failed to generate node config: %v", err) - } - } - // Generate the authority config - if *voting { - gateways, serviceNodes, mixes, err := s.genAuthorizedNodes() - if err != nil { - panic(err) - } - for _, vCfg := range s.votingAuthConfigs { - vCfg.Mixes = mixes - vCfg.GatewayNodes = gateways - vCfg.ServiceNodes = serviceNodes - if *omitTopology == false { - vCfg.Topology = new(vConfig.Topology) - vCfg.Topology.Layers = make([]vConfig.Layer, 0) - for i := 0; i < *nrLayers; i++ { - vCfg.Topology.Layers = append(vCfg.Topology.Layers, *new(vConfig.Layer)) - vCfg.Topology.Layers[i].Nodes = make([]vConfig.Node, 0) - } - for j := range mixes { - layer := j % *nrLayers - vCfg.Topology.Layers[layer].Nodes = append(vCfg.Topology.Layers[layer].Nodes, *mixes[j]) - } - } - } - for _, vCfg := range s.votingAuthConfigs { - if err := saveCfg(vCfg, *outDir); err != nil { - log.Fatalf("Failed to saveCfg of authority with %s", err) - } - } - } - // write the mixes keys and configs to disk - for _, v := range s.nodeConfigs { - if err := saveCfg(v, *outDir); err != nil { - log.Fatalf("saveCfg failure: %s", err) - } - } - - err = s.genClientCfg() - if err != nil { - log.Fatalf("%s", err) - } - - err = s.genDockerCompose(*dockerImage) - if err != nil { - log.Fatalf("%s", err) - } - - err = s.genPrometheus() - if err != nil { - log.Fatalf("%s", err) - } -} - -func identifier(cfg interface{}) string { - switch cfg.(type) { - case *cConfig.Config: - return "client" - case *sConfig.Config: - return cfg.(*sConfig.Config).Server.Identifier - case *vConfig.Config: - return cfg.(*vConfig.Config).Server.Identifier - default: - log.Fatalf("identifier() passed unexpected type") - return "" - } -} - -func toml_name(cfg interface{}) string { - switch cfg.(type) { - case *cConfig.Config: - return "client" - case *sConfig.Config: - return "katzenpost" - case *vConfig.Config: - return "authority" - default: - log.Fatalf("toml_name() passed unexpected type") - return "" - } -} - -func saveCfg(cfg interface{}, outDir string) error { - fileName := filepath.Join(outDir, identifier(cfg), fmt.Sprintf("%s.toml", toml_name(cfg))) - log.Printf("writing %s", fileName) - f, err := os.Create(fileName) - if err != nil { - return fmt.Errorf("os.Create(%s) failed: %s", fileName, err) - } - defer f.Close() - - // Serialize the descriptor. - enc := toml.NewEncoder(f) - return enc.Encode(cfg) -} - -func cfgIdKey(cfg interface{}, outDir string) sign.PublicKey { - var priv, public string - var pkiSignatureScheme string - switch cfg.(type) { - case *sConfig.Config: - priv = filepath.Join(outDir, cfg.(*sConfig.Config).Server.Identifier, "identity.private.pem") - public = filepath.Join(outDir, cfg.(*sConfig.Config).Server.Identifier, "identity.public.pem") - pkiSignatureScheme = cfg.(*sConfig.Config).Server.PKISignatureScheme - case *vConfig.Config: - priv = filepath.Join(outDir, cfg.(*vConfig.Config).Server.Identifier, "identity.private.pem") - public = filepath.Join(outDir, cfg.(*vConfig.Config).Server.Identifier, "identity.public.pem") - pkiSignatureScheme = cfg.(*vConfig.Config).Server.PKISignatureScheme - default: - panic("wrong type") - } - - scheme := signSchemes.ByName(pkiSignatureScheme) - if scheme == nil { - panic("invalid PKI signature scheme " + pkiSignatureScheme) - } - - idPubKey, err := signpem.FromPublicPEMFile(public, scheme) - if err == nil { - return idPubKey - } - idPubKey, idKey, err := scheme.GenerateKey() - log.Printf("writing %s", priv) - signpem.PrivateKeyToFile(priv, idKey) - log.Printf("writing %s", public) - signpem.PublicKeyToFile(public, idPubKey) - return idPubKey -} - -func cfgLinkKey(cfg interface{}, outDir string, kemScheme string) kem.PublicKey { - var linkpriv string - var linkpublic string - - switch cfg.(type) { - case *vConfig.Config: - linkpriv = filepath.Join(outDir, cfg.(*vConfig.Config).Server.Identifier, "link.private.pem") - linkpublic = filepath.Join(outDir, cfg.(*vConfig.Config).Server.Identifier, "link.public.pem") - default: - panic("wrong type") - } - - linkPubKey, linkPrivKey, err := kemschemes.ByName(kemScheme).GenerateKeyPair() - if err != nil { - panic(err) - } - - log.Printf("writing %s", linkpriv) - err = kempem.PrivateKeyToFile(linkpriv, linkPrivKey) - if err != nil { - panic(err) - } - log.Printf("writing %s", linkpublic) - err = kempem.PublicKeyToFile(linkpublic, linkPubKey) - if err != nil { - panic(err) - } - return linkPubKey -} - -func (s *katzenpost) genPrometheus() error { - dest := filepath.Join(s.outDir, "prometheus.yml") - log.Printf("writing %s", dest) - - f, err := os.Create(dest) - - if err != nil { - log.Fatal(err) - } - - defer f.Close() - - write(f, ` -scrape_configs: -- job_name: katzenpost - scrape_interval: 1s - static_configs: - - targets: -`) - - for _, cfg := range s.nodeConfigs { - write(f, ` - %s -`, cfg.Server.MetricsAddress) - } - return nil -} - -func (s *katzenpost) genDockerCompose(dockerImage string) error { - dest := filepath.Join(s.outDir, "docker-compose.yml") - log.Printf("writing %s", dest) - f, err := os.Create(dest) - - if err != nil { - log.Fatal(err) - } - - defer f.Close() - - gateways, serviceNodes, mixes, err := s.genAuthorizedNodes() - - if err != nil { - log.Fatal(err) - } - - write(f, `version: "2" - -services: -`) - for _, p := range gateways { - write(f, ` - %s: - restart: "no" - image: %s - volumes: - - ./:%s - command: %s/server%s -f %s/%s/katzenpost.toml - network_mode: host - - depends_on:`, p.Identifier, dockerImage, s.baseDir, s.baseDir, s.binSuffix, s.baseDir, p.Identifier) - for _, authCfg := range s.votingAuthConfigs { - write(f, ` - - %s`, authCfg.Server.Identifier) - } - } - - for _, p := range serviceNodes { - write(f, ` - %s: - restart: "no" - image: %s - volumes: - - ./:%s - command: %s/server%s -f %s/%s/katzenpost.toml - network_mode: host - - depends_on:`, p.Identifier, dockerImage, s.baseDir, s.baseDir, s.binSuffix, s.baseDir, p.Identifier) - for _, authCfg := range s.votingAuthConfigs { - write(f, ` - - %s`, authCfg.Server.Identifier) - } - } - - for i := range mixes { - // mixes in this form don't have their identifiers, because that isn't - // part of the consensus. if/when that is fixed this could use that - // identifier; instead it duplicates the definition of the name format - // here. - write(f, ` - mix%d: - restart: "no" - image: %s - volumes: - - ./:%s - command: %s/server%s -f %s/mix%d/katzenpost.toml - network_mode: host - depends_on:`, i+1, dockerImage, s.baseDir, s.baseDir, s.binSuffix, s.baseDir, i+1) - for _, authCfg := range s.votingAuthConfigs { - // is this depends_on stuff actually necessary? - // there was a bit more of it before this function was regenerating docker-compose.yaml... - write(f, ` - - %s`, authCfg.Server.Identifier) - } - } - for _, authCfg := range s.votingAuthConfigs { - write(f, ` - %s: - restart: "no" - image: %s - volumes: - - ./:%s - command: %s/voting%s -f %s/%s/authority.toml - network_mode: host -`, authCfg.Server.Identifier, dockerImage, s.baseDir, s.baseDir, s.binSuffix, s.baseDir, authCfg.Server.Identifier) - } - - write(f, ` - %s: - restart: "no" - image: %s - volumes: - - ./:%s - command: --config.file="%s/prometheus.yml" - network_mode: host -`, "metrics", "docker.io/prom/prometheus", s.baseDir, s.baseDir) - - return nil -} diff --git a/go.mod b/go.mod index 29a354c..57826c6 100644 --- a/go.mod +++ b/go.mod @@ -3,23 +3,25 @@ module github.com/0KnowledgeNetwork/opt go 1.22.3 require ( - github.com/BurntSushi/toml v1.3.2 + github.com/BurntSushi/toml v1.4.0 github.com/carlmjohnson/versioninfo v0.22.5 github.com/charmbracelet/log v0.4.0 - github.com/fxamacker/cbor/v2 v2.6.0 - github.com/katzenpost/hpqc v0.0.35 - github.com/katzenpost/katzenpost v0.0.35 + github.com/fxamacker/cbor/v2 v2.7.0 + github.com/katzenpost/hpqc v0.0.45 + github.com/katzenpost/katzenpost v0.0.38 gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473 ) require ( - codeberg.org/vula/highctidh v1.0.2024052900 // indirect + codeberg.org/vula/highctidh v1.0.2024092800 // indirect filippo.io/edwards25519 v1.0.0 // indirect filippo.io/mlkem768 v0.0.0-20240221181710-5ce91625fdc1 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/charmbracelet/lipgloss v0.10.0 // indirect github.com/go-faster/xor v1.0.0 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect + github.com/go-task/slim-sprig/v3 v3.0.0 // indirect + github.com/google/pprof v0.0.0-20240903155634-a8630aee4ab9 // indirect github.com/henrydcase/nobs v0.0.0-20230313231516-25b66236df73 // indirect github.com/katzenpost/chacha20 v0.0.0-20190910113340-7ce890d6a556 // indirect github.com/katzenpost/circl v1.3.9-0.20240222183521-1cd9a34e9a0c // indirect @@ -34,20 +36,23 @@ require ( github.com/muesli/termenv v0.15.2 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oasisprotocol/deoxysii v0.0.0-20220228165953-2091330c22b7 // indirect - github.com/pkg/errors v0.9.1 // indirect + github.com/onsi/ginkgo/v2 v2.20.2 // indirect + github.com/quic-go/qpack v0.5.1 // indirect + github.com/quic-go/quic-go v0.47.0 // indirect github.com/rfjakob/eme v1.1.2 // indirect github.com/rivo/uniseg v0.4.7 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/x448/float16 v0.8.4 // indirect - gitlab.com/elixxir/crypto v0.0.9 // indirect - gitlab.com/xx_network/crypto v0.0.6 // indirect gitlab.com/yawning/aez.git v0.0.0-20211027044916-e49e68abd344 // indirect gitlab.com/yawning/bsaes.git v0.0.0-20190805113838-0a714cd429ec // indirect gitlab.com/yawning/x448.git v0.0.0-20221003101044-617eb9b7d9b7 // indirect - go.etcd.io/bbolt v1.3.8 // indirect - golang.org/x/crypto v0.21.0 // indirect - golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect - golang.org/x/net v0.23.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/text v0.14.0 // indirect + go.etcd.io/bbolt v1.3.10 // indirect + go.uber.org/mock v0.4.0 // indirect + golang.org/x/crypto v0.27.0 // indirect + golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e // indirect + golang.org/x/mod v0.21.0 // indirect + golang.org/x/net v0.29.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/text v0.18.0 // indirect + golang.org/x/tools v0.24.0 // indirect ) diff --git a/go.sum b/go.sum index afabacd..4b3a254 100644 --- a/go.sum +++ b/go.sum @@ -1,11 +1,11 @@ -codeberg.org/vula/highctidh v1.0.2024052900 h1:cnJsUGj+ryIWTLsWR2xgs2ZvYKriUW9zF7aYDnWwBKM= -codeberg.org/vula/highctidh v1.0.2024052900/go.mod h1:admvznk7GhsrDih/BMy7jbIv9Y86U9vj7S5FVoquF/g= +codeberg.org/vula/highctidh v1.0.2024092800 h1:mvAQCDPgTTwo0/w1ZztxOEKp8CnH2+q5zf+3vKR79Jc= +codeberg.org/vula/highctidh v1.0.2024092800/go.mod h1:admvznk7GhsrDih/BMy7jbIv9Y86U9vj7S5FVoquF/g= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= filippo.io/mlkem768 v0.0.0-20240221181710-5ce91625fdc1 h1:xbdqh5aDZeO0XqW896qVjKnAqRji9nkIwmsBEEbCA10= filippo.io/mlkem768 v0.0.0-20240221181710-5ce91625fdc1/go.mod h1:mIEHrcJ2xBlJRQwnRO0ujmZ+Rt6m6eNeCPq8E3Wkths= -github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= -github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0= +github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= github.com/carlmjohnson/versioninfo v0.22.5 h1:O00sjOLUAFxYQjlN/bzYTuZiS0y6fWDQjMRvwtKgwwc= @@ -19,22 +19,30 @@ github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBS github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/fxamacker/cbor/v2 v2.6.0 h1:sU6J2usfADwWlYDAFhZBQ6TnLFBHxgesMrQfQgk1tWA= -github.com/fxamacker/cbor/v2 v2.6.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= +github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= +github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/go-faster/xor v1.0.0 h1:2o8vTOgErSGHP3/7XwA5ib1FTtUsNtwCoLLBjl31X38= github.com/go-faster/xor v1.0.0/go.mod h1:x5CaDY9UKErKzqfRfFZdfu+OSTfoZny3w5Ak7UxcipQ= github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/pprof v0.0.0-20240903155634-a8630aee4ab9 h1:q5g0N9eal4bmJwXHC5z0QCKs8qhS35hFfq0BAYsIwZI= +github.com/google/pprof v0.0.0-20240903155634-a8630aee4ab9/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= github.com/henrydcase/nobs v0.0.0-20230313231516-25b66236df73 h1:d3rq/Tz+RJ5h1xk6Lt3jbObJN3WhvZm7rV41OCIzUyI= github.com/henrydcase/nobs v0.0.0-20230313231516-25b66236df73/go.mod h1:ptK2MJqVLVEa/V/oK8n+MEyUDCSjSylW+jeNmCG1DJo= github.com/katzenpost/chacha20 v0.0.0-20190910113340-7ce890d6a556 h1:9gHByAWH1LydGefFGorN1ZBRZ/Oz9iozdzMvRTWpyRw= github.com/katzenpost/chacha20 v0.0.0-20190910113340-7ce890d6a556/go.mod h1:d9kxwmGOcutgP6bQwr2xaLInaW5yJsxsoPRyUIG0J/E= github.com/katzenpost/circl v1.3.9-0.20240222183521-1cd9a34e9a0c h1:FYy03rLIjdyjklBOI6YSCb3q7OubTx0dVDWYOgDsvA8= github.com/katzenpost/circl v1.3.9-0.20240222183521-1cd9a34e9a0c/go.mod h1:+EBrwiGYs9S+qZqaqxujN1CReTNCMAG6p+31KkEDeeA= -github.com/katzenpost/hpqc v0.0.35 h1:5o6KC2lCG2t7QUOpLloQn4sdSEZ8CH8HdWrdRw5LrLI= -github.com/katzenpost/hpqc v0.0.35/go.mod h1:QxsoI3+qXXmDAzAy7FkPZtVAUR4/KiG2bkdt+/9t42Y= -github.com/katzenpost/katzenpost v0.0.35 h1:LnggbU7p/Gc3asaGjT4cIKYrjiBXZMFkzrrni2BxjS4= -github.com/katzenpost/katzenpost v0.0.35/go.mod h1:LEnkfiCViuqdwSKBPF7N2iyLLoQjg14oFzo4eZqwXBI= +github.com/katzenpost/hpqc v0.0.45 h1:CiNTvwUe7CaGdIeA0tEtHY+O3CKk6lTgdAb4iQfSy4k= +github.com/katzenpost/hpqc v0.0.45/go.mod h1:yMxuQLTjgzgHdvQlJIbWFiusyizyMW94fpH6wxTTur8= +github.com/katzenpost/katzenpost v0.0.38 h1:0sf47PIl5kQwBH0xCDWSB0qq7V9i9aJkQmMTD0VXauQ= +github.com/katzenpost/katzenpost v0.0.38/go.mod h1:+aRwtsFwBT7GTU9Mj07MlQ3QoM4XQ6YLP/w0/j1gOHc= github.com/katzenpost/nyquist v0.0.10 h1:rh9TCEXCsutsg+cvbV6ASVFnzSAYBisWQ3fnwQSPa34= github.com/katzenpost/nyquist v0.0.10/go.mod h1:tyK92JiCptgsaE0iUAMlt5W2v2Rdw6mnUpIdIidIGHo= github.com/katzenpost/sntrup4591761 v0.0.0-20231024131303-8755eb1986b8 h1:TsKxH0x2RUwf5rBw67k15bqVM3oVbexA9oaTZQLIy3Y= @@ -58,52 +66,63 @@ github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a h1:dl github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= github.com/oasisprotocol/deoxysii v0.0.0-20220228165953-2091330c22b7 h1:1102pQc2SEPp5+xrS26wEaeb26sZy6k9/ZXlZN+eXE4= github.com/oasisprotocol/deoxysii v0.0.0-20220228165953-2091330c22b7/go.mod h1:UqoUn6cHESlliMhOnKLWr+CBH+e3bazUPvFj1XZwAjs= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/onsi/ginkgo/v2 v2.20.2 h1:7NVCeyIWROIAheY21RLS+3j2bb52W0W82tkberYytp4= +github.com/onsi/ginkgo/v2 v2.20.2/go.mod h1:K9gyxPIlb+aIvnZ8bd9Ak+YP18w3APlR+5coaZoE2ag= +github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k= +github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/quic-go/qpack v0.5.1 h1:giqksBPnT/HDtZ6VhtFKgoLOWmlyo9Ei6u9PqzIMbhI= +github.com/quic-go/qpack v0.5.1/go.mod h1:+PC4XFrEskIVkcLzpEkbLqq1uCoxPhQuvK5rH1ZgaEg= +github.com/quic-go/quic-go v0.47.0 h1:yXs3v7r2bm1wmPTYNLKAAJTHMYkPEsfYJmTazXrCZ7Y= +github.com/quic-go/quic-go v0.47.0/go.mod h1:3bCapYsJvXGZcipOHuu7plYtaV6tnF+z7wIFsU0WK9E= github.com/rfjakob/eme v1.1.2 h1:SxziR8msSOElPayZNFfQw4Tjx/Sbaeeh3eRvrHVMUs4= github.com/rfjakob/eme v1.1.2/go.mod h1:cVvpasglm/G3ngEfcfT/Wt0GwhkuO32pf/poW6Nyk1k= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= -gitlab.com/elixxir/crypto v0.0.9 h1:vt7+yRvGd/G9VtpQCaXa7EKPmHTgThf2hXbzZ1vlU6I= -gitlab.com/elixxir/crypto v0.0.9/go.mod h1:KV3F+kO0VVusLIKPqSKMk4HZ4yQiS12SaIsOXg9LJb0= -gitlab.com/xx_network/crypto v0.0.6 h1:+C44rBhclcbWrGa5EOic5yDF3NrXAbXScCb/mXmm3Ro= -gitlab.com/xx_network/crypto v0.0.6/go.mod h1:C69/+XTiqJvKkYzcyA47+LdxvAofl9AzR/Nyo36y9hs= gitlab.com/yawning/aez.git v0.0.0-20211027044916-e49e68abd344 h1:eICJMpqnDkO4nQv+GWtXcE45CFum/ni3jhcE+acBjQk= gitlab.com/yawning/aez.git v0.0.0-20211027044916-e49e68abd344/go.mod h1:/WDFxZLKGy+NQc+nqvQg2O0rW1HeWNHSelVv5fwEL8s= gitlab.com/yawning/bsaes.git v0.0.0-20190805113838-0a714cd429ec h1:FpfFs4EhNehiVfzQttTuxanPIT43FtkkCFypIod8LHo= gitlab.com/yawning/bsaes.git v0.0.0-20190805113838-0a714cd429ec/go.mod h1:BZ1RAoRPbCxum9Grlv5aeksu2H8BiKehBYooU2LFiOQ= gitlab.com/yawning/x448.git v0.0.0-20221003101044-617eb9b7d9b7 h1:ITrNVw6uSwSdEap0RR4us4RV1CHPBHvBZApENRcDk3c= gitlab.com/yawning/x448.git v0.0.0-20221003101044-617eb9b7d9b7/go.mod h1:BC2R0OW0tAYTMNLB4UMXwkk7WKokoDZP5n73hyLPyCo= -go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA= -go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= -golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI= -golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo= -golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= -golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +go.etcd.io/bbolt v1.3.10 h1:+BqfJTcCzTItrop8mq/lbzL8wSGtj94UO/3U31shqG0= +go.etcd.io/bbolt v1.3.10/go.mod h1:bK3UQLPJZly7IlNmV7uVHJDxfe5aK9Ll93e/74Y9oEQ= +go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= +go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= +golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= +golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= +golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e h1:I88y4caeGeuDQxgdoFPUq097j7kNfw6uvuiNxUBfcBk= +golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= +golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= +golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= +golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= +golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190902133755-9109b7679e13/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= +golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= +golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= +golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473 h1:6D+BvnJ/j6e222UW8s2qTSe3wGBtvo0MbVQG/c5k8RE= gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473/go.mod h1:N1eN2tsCx0Ydtgjl4cqmbRCsY4/+z4cYDeqwZTk6zog= diff --git a/tests/e2e/walletshield/bitcoin/testnet/out.json b/tests/e2e/walletshield/bitcoin/testnet/out.json index 78a877e..669fcc1 100644 --- a/tests/e2e/walletshield/bitcoin/testnet/out.json +++ b/tests/e2e/walletshield/bitcoin/testnet/out.json @@ -1 +1 @@ -{"result":"0000010ebfa3c6193793701c198392e21bdb8bc9fb2032f0d74a628d36e9a75e","error":null,"id":"test"} \ No newline at end of file +{"id":"test","result":"0000010ebfa3c6193793701c198392e21bdb8bc9fb2032f0d74a628d36e9a75e","error":null} \ No newline at end of file diff --git a/tests/e2e/walletshield/secret/out.json b/tests/e2e/walletshield/secret/out.json index ee8361f..2d4bfba 100644 --- a/tests/e2e/walletshield/secret/out.json +++ b/tests/e2e/walletshield/secret/out.json @@ -1 +1 @@ -{"jsonrpc":"2.0","id":1,"error":{"code":-32603,"message":"Internal error","data":"tx (0F7EB4E7B103075176DF50F51760430C1D3D13A0BCD84D40178D3417BE7D142D810BBF40F3B0BD081E740F5003D85EFB) not found"}} \ No newline at end of file +{"id":1,"jsonrpc":"2.0","error":{"code":-32603,"message":"Internal error","data":"tx (0F7EB4E7B103075176DF50F51760430C1D3D13A0BCD84D40178D3417BE7D142D810BBF40F3B0BD081E740F5003D85EFB) not found"}} \ No newline at end of file diff --git a/tests/e2e/walletshield/solana/devnet/out.json b/tests/e2e/walletshield/solana/devnet/out.json index 28fc4d4..816fc83 100644 --- a/tests/e2e/walletshield/solana/devnet/out.json +++ b/tests/e2e/walletshield/solana/devnet/out.json @@ -1 +1 @@ -{"jsonrpc":"2.0","result":"EtWTRABZaYq6iMfeYKouRu166VU2xqa1wcaWoxPkrZBG","id":1} +{"id":1,"jsonrpc":"2.0","result":"EtWTRABZaYq6iMfeYKouRu166VU2xqa1wcaWoxPkrZBG"} \ No newline at end of file