From 43fbddf016f94f4ba006d82c9a67dca61b5852a1 Mon Sep 17 00:00:00 2001 From: Gab <24553253+gabrix73@users.noreply.github.com> Date: Fri, 14 Aug 2026 20:39:22 +0200 Subject: Complete Nym and YAMN transport integration --- katzenpost/cmd/yamn-submit/main.go | 73 -------------------------------------- 1 file changed, 73 deletions(-) delete mode 100644 katzenpost/cmd/yamn-submit/main.go (limited to 'katzenpost/cmd/yamn-submit') diff --git a/katzenpost/cmd/yamn-submit/main.go b/katzenpost/cmd/yamn-submit/main.go deleted file mode 100644 index cde35f9..0000000 --- a/katzenpost/cmd/yamn-submit/main.go +++ /dev/null @@ -1,73 +0,0 @@ -package main - -import ( - "encoding/json" - "errors" - "flag" - "fmt" - "io" - "os" - "time" - - "git.virebent.art/virebent/yamnweb/katzenpost/dispatcher" - "github.com/katzenpost/hpqc/hash" - clientconfig "github.com/katzenpost/katzenpost/client/config" - "github.com/katzenpost/katzenpost/client/thin" -) - -const capability = "yamn-dispatch-v1" - -func run() error { - var configPath string - var settle time.Duration - flag.StringVar(&configPath, "config", "thinclient.toml", "thin-client configuration") - flag.DurationVar(&settle, "settle", 2*time.Second, "time allowed for kpclientd to queue frames") - flag.Parse() - - input, err := io.ReadAll(io.LimitReader(os.Stdin, dispatcher.MaxEnvelopeBytes*2)) - if err != nil { - return fmt.Errorf("read envelope: %w", err) - } - var envelope dispatcher.Envelope - if err := json.Unmarshal(input, &envelope); err != nil { - return errors.New("invalid envelope input") - } - encoded, err := dispatcher.EncodeEnvelope(envelope) - if err != nil { - return err - } - frames, err := dispatcher.SplitEnvelope(encoded) - if err != nil { - return err - } - - config, err := thin.LoadFile(configPath) - if err != nil { - return fmt.Errorf("load thin-client config: %w", err) - } - client := thin.NewThinClient(config, &clientconfig.Logging{Level: "ERROR", Disable: true}) - defer client.Close() - if err := client.Dial(); err != nil { - return fmt.Errorf("connect to kpclientd: %w", err) - } - service, err := client.GetService(capability) - if err != nil { - return fmt.Errorf("find dispatcher service: %w", err) - } - destination := hash.Sum256(service.MixDescriptor.IdentityKey) - for _, frame := range frames { - if err := client.SendMessageWithoutReply(frame, &destination, service.RecipientQueueID); err != nil { - return fmt.Errorf("send frame: %w", err) - } - } - time.Sleep(settle) - fmt.Fprintln(os.Stdout, "accepted") - return nil -} - -func main() { - if err := run(); err != nil { - fmt.Fprintf(os.Stderr, "submission failed: %v\n", err) - os.Exit(1) - } -} -- cgit v1.2.3