https://github.com/make-software/casper-net-sdk
.NET SDK to interact with the Casper Network nodes via RPC
https://github.com/make-software/casper-net-sdk
blockchain casper-network dotnet sdk
Last synced: about 1 year ago
JSON representation
.NET SDK to interact with the Casper Network nodes via RPC
- Host: GitHub
- URL: https://github.com/make-software/casper-net-sdk
- Owner: make-software
- License: apache-2.0
- Created: 2021-10-11T04:00:58.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2025-03-27T11:32:22.000Z (about 1 year ago)
- Last Synced: 2025-03-27T11:45:38.574Z (about 1 year ago)
- Topics: blockchain, casper-network, dotnet, sdk
- Language: C#
- Homepage:
- Size: 1.59 MB
- Stars: 13
- Watchers: 9
- Forks: 14
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# Casper .NET SDK
[](https://badge.fury.io/gh/make-software%2Fcasper-net-sdk) [](https://badge.fury.io/nu/casper.network.sdk)

The Casper .NET SDK allows developers to interact with the Casper Network using the .NET languages. The project itself is being developed with C#.
## Documentation
The SDK documentation, examples and tutorials can be found [here](https://make-software.github.io/casper-net-sdk/).
## Get started
The Casper.Network.SDK for .NET is published as a nuget package in [nuget.org](https://www.nuget.org/packages/Casper.Network.SDK).
To add a reference to the SDK in your project, use the Package Manager in Visual Studio or the `dotnet` cli tool.
### Package Manager (Windows)
```
Install-Package Casper.Network.SDK
```
### dotnet cli tool (Windows/Mac/Linux)
```
dotnet add package Casper.Network.SDK
```
## Run a Casper node locally with NCTL
[NCTL](https://github.com/casper-network/casper-node/tree/release-1.4.3/utils/nctl) is a CLI application to control one or multiple Casper networks locally. Many developers wish to spin up relatively small test networks to localize their testing before deploying to the blockchain.
To simplify even more the set up of a local network, you may run NCTL within a docker container. To start a container and publish the ports of one the nodes, write the following command:
```bash
docker run --rm -it --name mynctl -d -p 11101:11101 -p 14101:14101 -p 18101:18101 makesoftware/casper-nctl
```
Refer to the [`casper-nctl-docker`](https://github.com/make-software/casper-nctl-docker/) repository for further details on how to use NCTL with docker.
## Build/Test instructions
To build this library, install .NET 5.0 or higher and build with command:
```
dotnet build --configuration Release
```
To run the tests, use this command:
```
dotnet test --filter 'TestCategory!~NCTL'
```
On Windows use a PowerShell terminal to run the tests.
To test against `netstandard2.0` framework, launch the tests as follows:
```
TEST_FRAMEWORK=netstandard2.0 dotnet test --filter 'TestCategory!~NCTL'
```
### Integration tests
The command above excludes integration tests. If you're running a Casper network locally with NCTL, follow these steps to run the integrations tests:
1. Copy the faucet key from your NCTL environment to `Casper.Network.SDK.Test/TestData/faucetact.pem`. If you're running the NCTL docker image, activate nctl commands and run `nctl-view-faucet-secret-key > Casper.Network.SDK.Test/TestData/faucetact.pem`.
2. Adjust, if needed, the IPs and ports in the file `Casper.Network.SDK.Test/TestData/test.runsettings`.
3. Run the tests:
```
dotnet test --settings Casper.Network.SDK.Test/test.runsettings --filter 'TestCategory~NCTL'
```
NOTE: Make sure your NCTL network has booted up and nodes are emitting blocks before running the tests.
To test against `netstandard2.0` framework, launch the tests as follows:
```
TEST_FRAMEWORK=netstandard2.0 dotnet test --settings Casper.Network.SDK.Test/test.runsettings --filter 'TestCategory~NCTL'
```
## Create a workspace in Gitpod
Click the button to start coding in Gitpod with an online IDE.
[](https://gitpod.io/#https://github.com/make-software/casper-net-sdk)