Merge branch 'distro' into protocol

This commit is contained in:
херетик
2023-02-25 20:01:56 +00:00
4 changed files with 12 additions and 11 deletions

View File

@@ -8,6 +8,6 @@ func init() {
var seedCommand = &cobra.Command{
Use: "seed",
Short: "Commands related to seeding",
Long: `Commands related to seeding.`,
Short: "run and manage your seed node",
Long: `run and manage your seed node`,
}

View File

@@ -17,7 +17,7 @@ func getNetworkInstance(opts *dialOptions) (net *netstack.Net, err error) {
var tunnel tun.Device
if tunnel, net, err = netstack.CreateNetTUN([]netip.Addr{netip.MustParseAddr(opts.peerRPCIP)}, []netip.Addr{}, 1420); check(err) {
if tunnel, net, err = netstack.CreateNetTUN([]netip.Addr{netip.MustParseAddr(opts.peerRPCIP)}, []netip.Addr{}, opts.mtu); check(err) {
return nil, err
}
@@ -43,14 +43,14 @@ func Run(ctx context.Context) {
var err error
var conn *grpc.ClientConn
conn, err = Dial("unix:///tmp/indra.sock")
//conn, err = Dial("unix:///tmp/indra.sock")
//conn, err = DialContext(ctx,
// "noise://0.0.0.0:18222",
// WithPrivateKey("Aj9CfbE1pXEVxPfjSaTwdY3B4kYHbwsTSyT3nrc34ATN"),
// WithPeer("G52UmsQpUmN2zFMkJaP9rwCvqQJzi1yHKA9RTrLJTk9f"),
// WithKeepAliveInterval(5),
//)
conn, err = DialContext(ctx,
"noise://0.0.0.0:18222",
WithPrivateKey("Aj9CfbE1pXEVxPfjSaTwdY3B4kYHbwsTSyT3nrc34ATN"),
WithPeer("G52UmsQpUmN2zFMkJaP9rwCvqQJzi1yHKA9RTrLJTk9f"),
WithKeepAliveInterval(5),
)
if err != nil {
check(err)

View File

@@ -28,7 +28,7 @@ func DialContext(ctx context.Context, target string, opts ...DialOption) (conn *
return nil, errors.New("Unsupported protocol. Only unix:// or noise://")
}
dialOpts := &dialOptions{peerRPCIP: "192.168.37.2"}
dialOpts := &dialOptions{peerRPCIP: "192.168.37.2", mtu: 1420}
for _, opt := range opts {
opt.apply(dialOpts)

View File

@@ -7,6 +7,7 @@ type dialOptions struct {
peerPubKey RPCPublicKey
peerRPCIP string
keepAliveInterval int
mtu int
}
// DialOption configures how we set up the connection.