Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bifrost-technologies/solnet.ore
Solnet.Ore is a C# sdk and client for the Ore V2 program on Solana
https://github.com/bifrost-technologies/solnet.ore
csharp drillx net8 ore ore-cli pow solana solnet
Last synced: about 1 month ago
JSON representation
Solnet.Ore is a C# sdk and client for the Ore V2 program on Solana
- Host: GitHub
- URL: https://github.com/bifrost-technologies/solnet.ore
- Owner: Bifrost-Technologies
- License: mit
- Created: 2024-08-09T23:15:05.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-08-23T22:42:14.000Z (3 months ago)
- Last Synced: 2024-10-11T05:21:33.505Z (about 1 month ago)
- Topics: csharp, drillx, net8, ore, ore-cli, pow, solana, solnet
- Language: C#
- Homepage:
- Size: 34.2 KB
- Stars: 3
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Solnet.Ore
Solnet.Ore is a C# sdk and client for the Ore V2 program on Solana## How to use client example
```
using Solnet.Ore;
using Solnet.Ore.Accounts;
using Solnet.Ore.Models;
using Solnet.Programs.Utilities;
using Solnet.Wallet;//Miner is the sender, miner, and payer in this instance
Account miner = Account.FromSecretKey("SECRET_KEY_HERE");
string rpc_provider = "RPC_URL_HERE";
OreClient oreClient = new OreClient(rpc_provider);
var tokenaccount = AssociatedTokenAccountProgram.DeriveAssociatedTokenAccount(miner.PublicKey, PDALookup.FindMintPDA());
var proofRequest = await oreClient.GetProofAccountAsync(PDALookup.FindProofPDA(miner.PublicKey).address);
if (proofRequest != null)
{
Proof proof = proofRequest.ParsedResult;
long cut_off = await oreClient.GetCutoff(proof, 5);
string CurrentChallenge = new PublicKey(proof.Challenge).Key;
Console.WriteLine("Pool Balance: " + proof.Balance);
Console.WriteLine("Current Challenge: " + CurrentChallenge);
Console.WriteLine("Cut Off: " + Convert.ToDateTime(cut_off).ToShortTimeString());await oreClient.OpenProof(miner, miner, miner);
//Supply a real digest and nonce from drillx via API calls to your API controller to fill this in. Worker <-> API
Solution solution = new Solution
{
Digest = new byte[16],
Nonce = new byte[8],
};
await oreClient.MineOre(miner, solution);
await oreClient.ClaimOre(miner, tokenaccount, proof.Balance);
await oreClient.StakeOre(miner, proof.balance);Console.ReadKey();
}
```