Skip to content
This repository was archived by the owner on Feb 7, 2024. It is now read-only.

Commit 0a07e21

Browse files
committed
Function for swarm/connect endpoint
1 parent 678a362 commit 0a07e21

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

shell.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,3 +594,16 @@ func (s *Shell) SwarmPeers(ctx context.Context) (*SwarmConnInfos, error) {
594594
err := s.Request("swarm/peers").Exec(ctx, &v)
595595
return v, err
596596
}
597+
598+
type swarmConnection struct {
599+
Strings []string
600+
}
601+
602+
// SwarmConnect opens a swarm connection to a specific address.
603+
func (s *Shell) SwarmConnect(ctx context.Context, addr string) error {
604+
var conn *swarmConnection
605+
err := s.Request("swarm/connect").
606+
Arguments(addr).
607+
Exec(ctx, &conn)
608+
return err
609+
}

0 commit comments

Comments
 (0)