diff --git a/multidim-interop/impl/dotnet/v1.0/Program.cs b/multidim-interop/impl/dotnet/v1.0/Program.cs index 8c3e796b5..eae577911 100644 --- a/multidim-interop/impl/dotnet/v1.0/Program.cs +++ b/multidim-interop/impl/dotnet/v1.0/Program.cs @@ -22,7 +22,8 @@ int testTimeoutSeconds = int.Parse(Environment.GetEnvironmentVariable("test_timeout_seconds") ?? "180"); - IPeerFactory peerFactory = new TestPlansPeerFactoryBuilder(transport, muxer, security).Build(); + TestPlansPeerFactoryBuilder builder = new TestPlansPeerFactoryBuilder(transport, muxer, security); + IPeerFactory peerFactory = builder.Build(); Log($"Connecting to redis at {redisAddr}..."); ConnectionMultiplexer redis = ConnectionMultiplexer.Connect(redisAddr); @@ -30,7 +31,7 @@ if (isDialer) { - ILocalPeer localPeer = peerFactory.Create(localAddr: $"/ip4/0.0.0.0/tcp/0"); + ILocalPeer localPeer = peerFactory.Create(localAddr: builder.MakeAddress()); string? listenerAddr = null; while ((listenerAddr = db.ListRightPop("listenerAddr")) is null) { @@ -65,9 +66,9 @@ ip = addresses.First().Address.ToString()!; } Log("Starting to listen..."); - ILocalPeer localPeer = peerFactory.Create(localAddr: $"/ip4/{ip}/tcp/0"); + ILocalPeer localPeer = peerFactory.Create(localAddr: builder.MakeAddress(ip)); IListener listener = await localPeer.ListenAsync(localPeer.Address); - listener.OnConnection += async (peer) => Log($"Connected {peer.Address}"); + listener.OnConnection += (peer) => { Log($"Connected {peer.Address}"); return Task.CompletedTask; }; Log($"Listening on {listener.Address}"); db.ListRightPush(new RedisKey("listenerAddr"), new RedisValue(localPeer.Address.ToString())); await Task.Delay(testTimeoutSeconds * 1000); @@ -116,12 +117,14 @@ protected override ProtocolStack BuildStack() ProtocolStack stack = transport switch { "tcp" => Over(), + "quic-v1" => Over(), _ => throw new NotImplementedException(), }; + stack = stack.Over(); + if (!stacklessProtocols.Contains(transport)) { - stack = stack.Over(); stack = security switch { "noise" => stack.Over(), @@ -139,4 +142,11 @@ protected override ProtocolStack BuildStack() return stack.AddAppLayerProtocol() .AddAppLayerProtocol(); } + + public string MakeAddress(string ip = "0.0.0.0", string port = "0") => transport switch + { + "tcp" => $"/ip4/{ip}/tcp/{port}", + "quic-v1" => $"/ip4/{ip}/udp/{port}/quic-v1", + _ => throw new NotImplementedException(), + }; } diff --git a/multidim-interop/impl/dotnet/v1.0/TestPlansApp.csproj b/multidim-interop/impl/dotnet/v1.0/TestPlansApp.csproj index a7ee0d581..03fdcb88e 100644 --- a/multidim-interop/impl/dotnet/v1.0/TestPlansApp.csproj +++ b/multidim-interop/impl/dotnet/v1.0/TestPlansApp.csproj @@ -7,6 +7,7 @@ enable true true + True @@ -15,13 +16,14 @@ - - - - - - - + + + + + + + + diff --git a/multidim-interop/impl/dotnet/v1.0/packages.lock.json b/multidim-interop/impl/dotnet/v1.0/packages.lock.json index 28af8c197..4a5f50e46 100644 --- a/multidim-interop/impl/dotnet/v1.0/packages.lock.json +++ b/multidim-interop/impl/dotnet/v1.0/packages.lock.json @@ -36,79 +36,92 @@ }, "Nethermind.Libp2p.Core": { "type": "Direct", - "requested": "[1.0.0-preview.27, )", - "resolved": "1.0.0-preview.27", - "contentHash": "QJ54Eokt+dFz9vVejXQiNeWX+Etw7z+zWLux5pgQoaQbwrtAUYfoqni8oGBUl6I94yCVQnqRv8mqg7wYODSiQg==", + "requested": "[1.0.0-preview.29, )", + "resolved": "1.0.0-preview.29", + "contentHash": "HMllE4gIxjYL/hpkC+bHPa2KFsrQFkFRYeO2mdIkaDbWY6UAs8nZ8mVe2gQ30QVYPBUPDxPoQZ7MtwpxcPnQEw==", "dependencies": { "BouncyCastle.Cryptography": "2.2.1", "Google.Protobuf": "3.24.1", "Microsoft.Extensions.DependencyInjection": "7.0.0", "Microsoft.Extensions.DependencyInjection.Abstractions": "7.0.0", "Microsoft.Extensions.Logging.Abstractions": "7.0.1", - "Multiformats.Hash": "1.5.0", + "Multiformats.Hash": "1.5.0-preview.29", "SimpleBase": "4.0.0" } }, "Nethermind.Libp2p.Protocols.Identify": { "type": "Direct", - "requested": "[1.0.0-preview.27, )", - "resolved": "1.0.0-preview.27", - "contentHash": "sZs4Wg7GPZQoeGs3WiwEWqdjtAv9+drVTrLm9/rs9BVARXuYdkuAVVZhz/i0CsMzpSy3oMQtz6BiQ784VqVZPg==", + "requested": "[1.0.0-preview.29, )", + "resolved": "1.0.0-preview.29", + "contentHash": "1LzFsm6xxq5nviLnXcjVUUe3AJrmwjykZoRUYSemGW229U+i/2lHHjPtJwY0/QNjKRxzcNJyNDmAfCQoZ5OM1A==", "dependencies": { "Google.Protobuf": "3.24.1", "Microsoft.Extensions.Logging.Abstractions": "7.0.1", - "Nethermind.Libp2p.Core": "1.0.0-preview.27", - "Nethermind.Libp2p.Protocols.IpTcp": "1.0.0-preview.27" + "Nethermind.Libp2p.Core": "1.0.0-preview.29", + "Nethermind.Libp2p.Protocols.IpTcp": "1.0.0-preview.29" } }, "Nethermind.Libp2p.Protocols.IpTcp": { "type": "Direct", - "requested": "[1.0.0-preview.27, )", - "resolved": "1.0.0-preview.27", - "contentHash": "w0JHXa4mN+O5bfiDeSXJb/NPdzNs7mLMgqZLWOrqt3rLkVCVIje0jWscNL1IN24QGr+0BWYAgPt7034NZBM7Hw==", + "requested": "[1.0.0-preview.29, )", + "resolved": "1.0.0-preview.29", + "contentHash": "cHIvnkbjr1fBxpONz0+LXHHPmqfGmdFSYfLrf1ZDzkcnE3IWhYa+NW2VbWpowC7Ys9hGT2h8fiidsopiXlRAzw==", "dependencies": { "Microsoft.Extensions.Logging.Abstractions": "7.0.1", - "Nethermind.Libp2p.Core": "1.0.0-preview.27" + "Nethermind.Libp2p.Core": "1.0.0-preview.29" } }, "Nethermind.Libp2p.Protocols.Multistream": { "type": "Direct", - "requested": "[1.0.0-preview.27, )", - "resolved": "1.0.0-preview.27", - "contentHash": "ozEWB4ckQVb1W8R07AaDsge4yb1tp1k50jIoZyvVvE9EhYstchbP4HkjboTarJ2jae9iC2Xtc5Wd0lucI8f3OA==", + "requested": "[1.0.0-preview.29, )", + "resolved": "1.0.0-preview.29", + "contentHash": "155kz2rHX3JG1bGlWFwRxYBZ8Zq6HIoCpDPvuE7WMzqZIKINe8+iP6Ogqzjb2oHEQHH1z5k+PHfoqWkhdrNSAw==", "dependencies": { - "Nethermind.Libp2p.Core": "1.0.0-preview.27" + "Nethermind.Libp2p.Core": "1.0.0-preview.29" } }, "Nethermind.Libp2p.Protocols.Noise": { "type": "Direct", - "requested": "[1.0.0-preview.27, )", - "resolved": "1.0.0-preview.27", - "contentHash": "zsDrlevkXpdzJyDitR5WZOLovSPPgvMDmwVpqKBgOqxngy11kjXyjAIz6k9z8sbjcw9wRcgBGMtrpg4+T3h9EA==", + "requested": "[1.0.0-preview.29, )", + "resolved": "1.0.0-preview.29", + "contentHash": "7kg23PxfAcJzgOwIXwiG1GlCyP1i820VJTlSQ3l9u8Lplg3bM+UN1x8u6lmBQfFwUIkdbjv4WH6y9hKOFlMq3A==", "dependencies": { "BouncyCastle.Cryptography": "2.2.1", "Google.Protobuf": "3.24.1", - "Nethermind.Libp2p.Core": "1.0.0-preview.27", + "Multiformats.Hash": "1.5.0-preview.29", + "Nethermind.Libp2p.Core": "1.0.0-preview.29", "Noise.NET": "1.0.0" } }, "Nethermind.Libp2p.Protocols.Ping": { "type": "Direct", - "requested": "[1.0.0-preview.27, )", - "resolved": "1.0.0-preview.27", - "contentHash": "lutGn++FJ3VdcAxD7VzLbrtORcVLi9+UKaokXzDI8nSOY9NEJyw8H4/I7QH9ZYhK4tscPOqeF7vDU7KSkboDEw==", + "requested": "[1.0.0-preview.29, )", + "resolved": "1.0.0-preview.29", + "contentHash": "gA3iscXDptJnQayGg9iSWnkkRnQ1UR15sgrxEDIKw7hQgV9tKG5vM7uxWJ/8tgbKOJSmf4f2SDqmEqj/u/1H2Q==", "dependencies": { - "Nethermind.Libp2p.Core": "1.0.0-preview.27" + "Nethermind.Libp2p.Core": "1.0.0-preview.29" + } + }, + "Nethermind.Libp2p.Protocols.Quic": { + "type": "Direct", + "requested": "[1.0.0-preview.29, )", + "resolved": "1.0.0-preview.29", + "contentHash": "eIAjkWo3FAnljyWX14WefvHDBH8kXGWDUNU1+m2pAU01352bDvx0mEZMxZvZkL9xtqMbeFyRFmewn38VMFNwYw==", + "dependencies": { + "BouncyCastle.Cryptography": "2.2.1", + "Microsoft.Extensions.Logging.Abstractions": "7.0.1", + "Multiformats.Hash": "1.5.0-preview.29", + "Nethermind.Libp2p.Core": "1.0.0-preview.29" } }, "Nethermind.Libp2p.Protocols.Yamux": { "type": "Direct", - "requested": "[1.0.0-preview.27, )", - "resolved": "1.0.0-preview.27", - "contentHash": "ODwlrNc0Yz665wUSzXgCgNxXJ1y/jiCSCAmF1b0AtRTFpwbTClplGEZpDKcXQcnM+tQDzeHMX5VDrmNvELLToQ==", + "requested": "[1.0.0-preview.29, )", + "resolved": "1.0.0-preview.29", + "contentHash": "YesEdnovydPyPesPBdsRT+Uxcb28k2ho9nKlS28d7S8MC04LUiNZRnFxqQXPUUEPgB/qpILwDzDE0gqiTit+Rg==", "dependencies": { "Microsoft.Extensions.Logging.Abstractions": "7.0.1", - "Nethermind.Libp2p.Core": "1.0.0-preview.27" + "Nethermind.Libp2p.Core": "1.0.0-preview.29" } }, "NRedisStack": {