Skip to content

Commit

Permalink
update from main (#89)
Browse files Browse the repository at this point in the history
* Bump YamlDotNet from 11.2.1 to 12.3.1 in /src/chia-dotnet (#65)

Bumps [YamlDotNet](https://github.com/aaubry/YamlDotNet) from 11.2.1 to 12.3.1.
- [Release notes](https://github.com/aaubry/YamlDotNet/releases)
- [Commits](aaubry/YamlDotNet@v11.2.1...v12.3.1)

---
updated-dependencies:
- dependency-name: YamlDotNet
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump Newtonsoft.Json from 13.0.1 to 13.0.2 in /src/chia-dotnet (#60)

Bumps [Newtonsoft.Json](https://github.com/JamesNK/Newtonsoft.Json) from 13.0.1 to 13.0.2.
- [Release notes](https://github.com/JamesNK/Newtonsoft.Json/releases)
- [Commits](JamesNK/Newtonsoft.Json@13.0.1...13.0.2)

---
updated-dependencies:
- dependency-name: Newtonsoft.Json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update README.md (#77)

* Bump YamlDotNet from 12.3.1 to 13.1.1 in /src/chia-dotnet (#79)

Bumps [YamlDotNet](https://github.com/aaubry/YamlDotNet) from 12.3.1 to 13.1.1.
- [Release notes](https://github.com/aaubry/YamlDotNet/releases)
- [Commits](aaubry/YamlDotNet@v12.3.1...v13.1.1)

---
updated-dependencies:
- dependency-name: YamlDotNet
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* remove rate limited wallet types and methods (#81)

* Update dependabot.yml (#82)

* Update codeql-analysis.yml to v2

* Update README.md (#84)

* Ignore jetbrains .idea folder https://rider-support.jetbrains.com/hc/en-us/articles/207097529-What-is-the-idea-folder- (#85)

Co-authored-by: kev <kev@darkhorse>

* added initial get-block-spends (#83)

* added initial get-block-spends

* Recommended PR changes

---------

Co-authored-by: kev <kev@darkhorse>
Co-authored-by: Don Kackman <[email protected]>

* Dto (#86)

* up through Mirror

* first pass done

* Remove blockspend.cs and use existing model CoinSpend (#87)

Co-authored-by: kev <kev@darkhorse>

* Key management (#88)

* get_key

* get_keys

* set_label

* delete_label

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: KevinOnFrontEnd <[email protected]>
Co-authored-by: kev <kev@darkhorse>
  • Loading branch information
4 people authored Aug 3, 2023
1 parent d8d3e3e commit 686fa86
Show file tree
Hide file tree
Showing 54 changed files with 563 additions and 240 deletions.
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates


version: 2
updates:
- package-ecosystem: "nuget" # See documentation for possible values
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -54,7 +54,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -68,4 +68,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore

# Jetbrains rider
.idea/

# User-specific files
*.rsuser
*.suo
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
A [.net](https://dotnet.microsoft.com/download/dotnet/6.0) client library for [chia](https://github.com/Chia-Network/chia-blockchain)™ RPC interfaces that runs on linux and windows.

[![build](https://github.com/dkackman/chia-dotnet/actions/workflows/dotnet.yml/badge.svg)](https://github.com/dkackman/chia-dotnet/actions)
[![CodeQL](https://github.com/dkackman/chia-dotnet/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/dkackman/chia-dotnet/actions/workflows/codeql-analysis.yml)
[![CodeQL](https://github.com/dkackman/chia-dotnet/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/dkackman/chia-dotnet/actions/workflows/github-code-scanning/codeql)
[![NuGet](https://img.shields.io/nuget/dt/chia-dotnet)](https://www.nuget.org/packages/chia-dotnet/)

## Getting Started
Expand All @@ -17,7 +17,7 @@ https://dkackman.github.io/chia-dotnet/
- Coverage of all of chia's rpc endpoints
- Daemon, Full Node, Farmer, Harvester, Wallet, Plotter, Crawler
- Coverage of all of the methods at each endpoint
- as of 1.3.5 (if you find something missing please create an issue)
- as of 1.4.0 (if you find something missing please create an issue)
- Static types for chia input and outputs
- Supports connecting via the `daemon` on `wss` or directly to each service with `https`
- both `https` and `wss` use tha same interfaces so switching is seamless
Expand Down
22 changes: 12 additions & 10 deletions src/chia-dotnet.tests/Factory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ namespace chia.dotnet.tests
/// </summary>
internal static class Factory
{
// this is the ip address or name of the chia node under test
private const string NodeHostAddress = "chiapas";
// this is the ip address of the chia node
private const string NodeHostAddress = "127.0.0.1";

public static HttpRpcClient CreateDirectRpcClientFromHardcodedLocation(int port, string endpointName)
{
Expand All @@ -22,12 +22,13 @@ public static HttpRpcClient CreateDirectRpcClientFromHardcodedLocation(int port,
Uri = new Uri($"https://{NodeHostAddress}:{port}"),
//CertPath = @"\\wsl$/Ubuntu-20.04/home/don/.chia/mainnet/config/ssl/full_node/private_full_node.crt",
//KeyPath = @"\\wsl$/Ubuntu-20.04/home/don/.chia/mainnet/config/ssl/full_node/private_full_node.key",
//CertPath = @"{Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}\.rchia\certs\chiapas\private_daemon.crt",
//KeyPath = @"{Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}\.rchia\certs\chiapas\private_daemon.key",
CertPath = $@"{Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}\.rchia\certs\{NodeHostAddress}\private_{endpointName}.crt",
KeyPath = $@"{Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}\.rchia\certs\{NodeHostAddress}\private_{endpointName}.key",
//CertPath = @"{Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}\.rchia\certs\chiapas\private_full_node.crt",
//KeyPath = @"{Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}\.rchia\certs\chiapas\private_full_node.key",

//CertPath = @"C:\Users\dkack\.rchia\certs\chiapas\private_daemon.crt",
//KeyPath = @"C:\Users\dkack\.rchia\certs\chiapas\private_daemon.key",
// CertPath = $@"/home/kev/.chia/mainnet/config/ssl/daemon/private_{endpointName}.crt",
// KeyPath = $@"/home/kev/.chia/mainnet/config/ssl/daemon/private_{endpointName}.key",
//CertPath = @"C:\Users\dkack\.rchia\certs\chiapas\private_full_node.crt",
//KeyPath = @"C:\Users\dkack\.rchia\certs\chiapas\private_full_node.key",
};

return new HttpRpcClient(endpoint);
Expand All @@ -47,8 +48,9 @@ public static WebSocketRpcClient CreateWebsocketClient()
var endpoint = new EndpointInfo()
{
Uri = new Uri($"wss://{NodeHostAddress}:55400"),
CertPath = $@"{Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}\.rchia\certs\{NodeHostAddress}\private_daemon.crt",
KeyPath = $@"{Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}\.rchia\certs\{NodeHostAddress}\private_daemon.key",
// CertPath = $@"/home/kev/.chia/mainnet/config/ssl/daemon/private_daemon.crt",
// KeyPath = $@"/home/kev/.chia/mainnet/config/ssl/daemon/private_daemon.key",

//CertPath = @"\\wsl$\Ubuntu-20.04\home\don\.chia\mainnet\config\ssl\daemon\private_daemon.crt",
//KeyPath = @"\\wsl$\Ubuntu-20.04\home\don\.chia\mainnet\config\ssl\daemon\private_daemon.key",
//CertPath = @"\\wsl.localhost\Ubuntu\home\don\.chia\mainnet\config\ssl\daemon\private_daemon.crt",
Expand Down
15 changes: 15 additions & 0 deletions src/chia-dotnet.tests/FullNodeProxyTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,21 @@ public async Task GetAdditionsAndRemovals()

Assert.IsNotNull(additionsAndRemovals);
}


[TestMethod()]
public async Task GetBlockSpends()
{
// Arrange
var header = "0xaa8425c198253b96a15c40e32ef4c1fd36e751f0ff9a90199e8751df381eac71"; //hash from today

// Act
using var cts = new CancellationTokenSource(15000);
var spends = await _theFullNode.GetBlockSpends(header, cts.Token);

// Assert
Assert.IsNotNull(spends);
}

[TestMethod()]
public async Task GetAllMempoolItems()
Expand Down
11 changes: 11 additions & 0 deletions src/chia-dotnet/ChiaTypes/AmountFilter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System.Collections.Generic;

namespace chia.dotnet
{
public record AmountFilter
{
public IEnumerable<ulong> Values { get; init; } = new List<ulong>();

public FilterMode Mode { get; init; } = FilterMode.Exlude;
}
}
11 changes: 11 additions & 0 deletions src/chia-dotnet/ChiaTypes/AmountWithPuzzlehash.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System.Collections.Generic;

namespace chia.dotnet
{
public record AmountWithPuzzlehash
{
public IEnumerable<TransactionType> Values { get; init; } = new List<TransactionType>();

public FilterMode Mode { get; init; } = FilterMode.Exlude;
}
}
12 changes: 0 additions & 12 deletions src/chia-dotnet/ChiaTypes/Announcement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,4 @@ public record Announcement
public string Message { get; init; } = string.Empty;
public string MorphBytes { get; init; } = string.Empty;
}
public record CoinAnnouncement
{
public string CoinId { get; init; } = string.Empty;
public string Message { get; init; } = string.Empty;
public string MorphBytes { get; init; } = string.Empty;
}
public record PuzzleAnnouncement
{
public string PuzzleHash { get; init; } = string.Empty;
public string Message { get; init; } = string.Empty;
public string MorphBytes { get; init; } = string.Empty;
}
}
10 changes: 10 additions & 0 deletions src/chia-dotnet/ChiaTypes/AutoClaimSettings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace chia.dotnet
{
public record AutoClaimSettings
{
public bool Enabled { get; init; }
public ulong TxFee { get; init; }
public ulong MinAmount { get; init; }
public ushort BatchSize { get; init; }
}
}
11 changes: 11 additions & 0 deletions src/chia-dotnet/ChiaTypes/BlockchainState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,23 @@ namespace chia.dotnet
/// </summary>
public record BlockchainState
{
public string NodeId { get; init; } = string.Empty;
public ulong Difficulty { get; init; }
public bool GenesisChallengeInitiated { get; init; }
public int MempoolSize { get; init; }
public int MempoolCost { get; init; }
public ulong MempoolFees { get; init; }
public MempoolMinFees MempoolMinFees { get; init; } = new();
public int MempoolMaxTotalCost { get; init; }
public int BlockMaxCost { get; init; }
public BlockRecord? Peak { get; init; }
public BigInteger Space { get; init; }
public ulong SubSlotIters { get; init; }
public SyncState Sync { get; init; } = new();
}

public record MempoolMinFees
{
public double Cost5000000 { get; init; }
}
}
9 changes: 9 additions & 0 deletions src/chia-dotnet/ChiaTypes/CoinAnnouncement.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace chia.dotnet
{
public record CoinAnnouncement
{
public string CoinId { get; init; } = string.Empty;
public string Message { get; init; } = string.Empty;
public string MorphBytes { get; init; } = string.Empty;
}
}
8 changes: 8 additions & 0 deletions src/chia-dotnet/ChiaTypes/CoinRecordOrder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace chia.dotnet
{
public enum CoinRecordOrder : byte
{
ConfirmedHeight = 1,
SpentHight = 2
}
}
8 changes: 8 additions & 0 deletions src/chia-dotnet/ChiaTypes/CoinType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace chia.dotnet
{
public enum CoinType : byte
{
Normal = 0,
Clawback = 1
}
}
11 changes: 11 additions & 0 deletions src/chia-dotnet/ChiaTypes/FarmerRewards.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace chia.dotnet
{
public record FarmerRewards
{
public ulong FarmedAmount { get; init; }
public ulong PoolRewardAmount { get; init; }
public ulong FarmerRewardAmount { get; init; }
public ulong FeeAmount { get; init; }
public ulong LastHeightFarmed { get; init; }
}
}
8 changes: 8 additions & 0 deletions src/chia-dotnet/ChiaTypes/FilterMode.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace chia.dotnet
{
public enum FilterMode : byte
{
Include = 1,
Exlude = 2
}
}
11 changes: 11 additions & 0 deletions src/chia-dotnet/ChiaTypes/HashFilter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System.Collections.Generic;

namespace chia.dotnet
{
public record HashFilter
{
public IEnumerable<string> Values { get; init; } = new List<string>();

public FilterMode Mode { get; init; } = FilterMode.Exlude;
}
}
12 changes: 12 additions & 0 deletions src/chia-dotnet/ChiaTypes/InternalNode.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace chia.dotnet
{
public record InternalNode
{
public string Hash { get; init; } = string.Empty;
public string LeftHash { get; init; } = string.Empty;
public string RightHash { get; init; } = string.Empty;
// TODO - need test case for serialization for this - tuple might not be the right type
public (string, string) Pair { get; init; } = new();
public string Atom { get; init; } = string.Empty;
}
}
10 changes: 10 additions & 0 deletions src/chia-dotnet/ChiaTypes/KeyData.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace chia.dotnet
{
public record KeyData
{
public uint Fingerprint { get; init; }
public string PublicKey { get; init; } = string.Empty;
public string? Label { get; init; }
public KeyDataSecrets? Secrets { get; init; }
}
}
11 changes: 11 additions & 0 deletions src/chia-dotnet/ChiaTypes/KeyDataSecrets.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System.Collections.Generic;

namespace chia.dotnet
{
public record KeyDataSecrets
{
public IEnumerable<string> Mnemonic { get; init; } = new List<string>();
public string Bytes { get; init; } = string.Empty;
public PrivateKey PrivateKey { get; init; } = new();
}
}
9 changes: 9 additions & 0 deletions src/chia-dotnet/ChiaTypes/Layer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace chia.dotnet
{
public record Layer
{
public Side OtherHashSide { get; init; }
public string OtherHash { get; init; } = string.Empty;
public string CombinedHash { get; init; } = string.Empty;
}
}
9 changes: 9 additions & 0 deletions src/chia-dotnet/ChiaTypes/LineageProof.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace chia.dotnet
{
public record LineageProof
{
public string? ParentName { get; init; }
public string? InnerPuzzleHash { get; init; }
public ulong? Amount { get; init; }
}
}
13 changes: 13 additions & 0 deletions src/chia-dotnet/ChiaTypes/Mirror.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System.Collections.Generic;

namespace chia.dotnet
{
public record Mirror
{
public string CoinId { get; init; } = string.Empty;
public string LauncherId { get; init; } = string.Empty;
public ulong Amount { get; init; }
public IEnumerable<string> Urls { get; init; } = new List<string>();
public bool Ours { get; init; } = true;
}
}
Loading

0 comments on commit 686fa86

Please sign in to comment.