Coder Social home page Coder Social logo

casper-net-sdk's Introduction

Casper .NET SDK

GitHub version NuGet version

build-and-test workflow

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.

Get started

The Casper.Network.SDK for .NET is published as a nuget package in nuget.org.

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 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:

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 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.

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'

Create a workspace in Gitpod

Click the button to start coding in Gitpod with an online IDE.

Open in Gitpod

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.