Skip to content

Commit a8f1212

Browse files
fix: Ipfs.Api.PeerNode => Ipfs.Peer
1 parent 27e504c commit a8f1212

File tree

9 files changed

+49
-177
lines changed

9 files changed

+49
-177
lines changed

src/ConnectedPeer.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
namespace Ipfs.Api
88
{
99
/// <summary>
10-
/// A <see cref="PeerNode"/> that is connected to the local peer node.
10+
/// A <see cref="Peer"/> that is connected to the local peer node.
1111
/// </summary>
12-
public class ConnectedPeer : PeerNode
12+
public class ConnectedPeer : Peer
1313
{
1414
/// <summary>
1515
/// The <see cref="MultiAddress"/> that the peer is connected on.
1616
/// </summary>
1717
/// <remarks>
18-
/// The <b>MultiAddress</b> contains the IPFS <see cref="PeerNode.Id"/>, such as
18+
/// The <b>MultiAddress</b> contains the IPFS <see cref="Peer.Id"/>, such as
1919
/// <c>/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ</c>.
2020
/// </remarks>
2121
public MultiAddress ConnectedAddress { get; set; }

src/CoreApi/DhtApi.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ internal DhtApi(IpfsClient ipfs)
4343
/// <param name="cancel">
4444
/// Is used to stop the task. When cancelled, the <see cref="TaskCanceledException"/> is raised.
4545
/// </param>
46-
public Task<PeerNode> FindPeerAsync(string id, CancellationToken cancel = default(CancellationToken))
46+
public Task<Peer> FindPeerAsync(string id, CancellationToken cancel = default(CancellationToken))
4747
{
4848
return ipfs.IdAsync(id, cancel);
4949
}

src/CoreApi/GenericApi.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ public partial class IpfsClient
2525
/// <returns>
2626
/// Information on the peer node.
2727
/// </returns>
28-
public Task<PeerNode> IdAsync(string peer = null, CancellationToken cancel = default(CancellationToken))
28+
public Task<Peer> IdAsync(string peer = null, CancellationToken cancel = default(CancellationToken))
2929
{
30-
return DoCommandAsync<PeerNode>("id", cancel, peer);
30+
return DoCommandAsync<Peer>("id", cancel, peer);
3131
}
3232

3333
/// <summary>

src/CoreApi/SwarmApi.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ internal SwarmApi(IpfsClient ipfs)
3838
/// Is used to stop the task. When cancelled, the <see cref="TaskCanceledException"/> is raised.
3939
/// </param>
4040
/// <returns>A sequence of peer nodes.</returns>
41-
public async Task<IEnumerable<PeerNode>> AddressesAsync(CancellationToken cancel = default(CancellationToken))
41+
public async Task<IEnumerable<Peer>> AddressesAsync(CancellationToken cancel = default(CancellationToken))
4242
{
4343
var json = await ipfs.DoCommandAsync("swarm/addrs", cancel);
4444
return ((JObject)JObject.Parse(json)["Addrs"])
4545
.Properties()
46-
.Select(p => new PeerNode {
46+
.Select(p => new Peer {
4747
Id = p.Name,
4848
Addresses = ((JArray)p.Value)
4949
.Select(v => new MultiAddress((string)v))

src/IpfsApi.csproj

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
2-
3-
<PropertyGroup>
4-
<TargetFrameworks>netstandard14;netstandard2;net45</TargetFrameworks>
5-
<AssemblyName>Ipfs.Api</AssemblyName>
6-
<RootNamespace>Ipfs.Api</RootNamespace>
7-
<DocumentationFile>Ipfs.Api.xml</DocumentationFile>
8-
<DebugType>full</DebugType>
9-
10-
<!-- developer build is always 0.42 -->
11-
<AssemblyVersion>0.42</AssemblyVersion>
12-
<Version>0.42</Version>
13-
14-
<!-- Nuget specs -->
15-
<PackageId>Ipfs.Api</PackageId>
16-
<Authors>Richard Schneider</Authors>
17-
<Title>IPFS API</Title>
18-
<Description> Provides .Net client access to the InterPlanetary File System.</Description>
19-
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
20-
<PackageReleaseNotes></PackageReleaseNotes>
21-
<Copyright>© 2015-2017 Richard Schneider</Copyright>
22-
<PackageTags>ipfs peer-to-peer distributed file-system</PackageTags>
23-
<IncludeSymbols>True</IncludeSymbols>
24-
<PackageLicenseUrl>https://github.com/richardschneider/net-ipfs-api/blob/master/LICENSE</PackageLicenseUrl>
25-
<PackageProjectUrl>https://github.com/richardschneider/net-ipfs-api</PackageProjectUrl>
26-
<PackageIconUrl>https://github.com/ipfs/logo/blob/master/platform-icons/osx-menu-bar.png</PackageIconUrl>
27-
28-
</PropertyGroup>
29-
30-
<ItemGroup>
31-
<PackageReference Include="Ipfs.Core" Version="0.11.0" />
32-
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
33-
<PackageReference Include="System.Net.Http" Version="4.3.3" Condition="'$(TargetFramework)' == 'netstandard14'" />
34-
<PackageReference Include="System.Net.Http" Version="4.3.3" Condition="'$(TargetFramework)' == 'net45'" />
35-
</ItemGroup>
36-
37-
38-
</Project>
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFrameworks>netstandard14;netstandard2;net45</TargetFrameworks>
5+
<AssemblyName>Ipfs.Api</AssemblyName>
6+
<RootNamespace>Ipfs.Api</RootNamespace>
7+
<DocumentationFile>Ipfs.Api.xml</DocumentationFile>
8+
<DebugType>full</DebugType>
9+
10+
<!-- developer build is always 0.42 -->
11+
<AssemblyVersion>0.42</AssemblyVersion>
12+
<Version>0.42</Version>
13+
14+
<!-- Nuget specs -->
15+
<PackageId>Ipfs.Api</PackageId>
16+
<Authors>Richard Schneider</Authors>
17+
<Title>IPFS API</Title>
18+
<Description> Provides .Net client access to the InterPlanetary File System.</Description>
19+
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
20+
<PackageReleaseNotes></PackageReleaseNotes>
21+
<Copyright>© 2015-2017 Richard Schneider</Copyright>
22+
<PackageTags>ipfs peer-to-peer distributed file-system</PackageTags>
23+
<IncludeSymbols>True</IncludeSymbols>
24+
<PackageLicenseUrl>https://github.com/richardschneider/net-ipfs-api/blob/master/LICENSE</PackageLicenseUrl>
25+
<PackageProjectUrl>https://github.com/richardschneider/net-ipfs-api</PackageProjectUrl>
26+
<PackageIconUrl>https://github.com/ipfs/logo/blob/master/platform-icons/osx-menu-bar.png</PackageIconUrl>
27+
28+
</PropertyGroup>
29+
30+
<ItemGroup>
31+
<PackageReference Include="Ipfs.Core" Version="0.13.0" />
32+
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
33+
<PackageReference Include="System.Net.Http" Version="4.3.3" Condition="'$(TargetFramework)' == 'netstandard14'" />
34+
<PackageReference Include="System.Net.Http" Version="4.3.3" Condition="'$(TargetFramework)' == 'net45'" />
35+
</ItemGroup>
36+
37+
38+
</Project>

src/PeerNode.cs

Lines changed: 0 additions & 86 deletions
This file was deleted.

test/CoreApi/GenericApiTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ public void Local_Node_Info()
1515
{
1616
var ipfs = TestFixture.Ipfs;
1717
var node = ipfs.IdAsync().Result;
18-
Assert.IsInstanceOfType(node, typeof(PeerNode));
18+
Assert.IsInstanceOfType(node, typeof(Peer));
1919
}
2020

2121
[TestMethod]
2222
public void Mars_Node_Info()
2323
{
2424
var ipfs = TestFixture.Ipfs;
2525
var node = ipfs.IdAsync(marsId).Result;
26-
Assert.IsInstanceOfType(node, typeof(PeerNode));
26+
Assert.IsInstanceOfType(node, typeof(Peer));
2727
}
2828

2929
[TestMethod]

test/CoreApi/SwarmApiTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ await Task.WhenAll(peers
5050
.Take(1)
5151
.Select(async p =>
5252
{
53-
var peer = await ipfs.IdAsync(p.Id);
53+
var peer = await ipfs.IdAsync(p.Id.ToString()); // TODO: IdAsync should accept multihash
5454
Assert.AreNotEqual("", peer.PublicKey);
5555
}));
5656
}

test/PeerNodeTest.cs

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)