Coder Social home page Coder Social logo

rust-dashcore-rpc's Introduction

Status

Rust RPC client for Dash Core JSON-RPC

This is a Rust RPC client library for calling the Dash Core JSON-RPC API. It provides a layer of abstraction over rust-jsonrpc and makes it easier to talk to the Dash JSON-RPC interface

This git package compiles into two crates.

  1. dashcore-rpc - contains an implementation of an rpc client that exposes the Dash Core JSON-RPC APIs as rust functions.

  2. dashcore-rpc-json - contains rust data structures that represent the json responses from the Dash Core JSON-RPC APIs. dashcore-rpc depends on this.

Usage

Given below is an example of how to connect to the Dash Core JSON-RPC for a Dash Core node running on localhost and print out the hash of the latest block.

It assumes that the node has password authentication setup, the RPC interface is enabled at port 8332 and the node is set up to accept RPC connections.

extern crate dashcore_rpc;

use dashcore_rpc::{Auth, Client, RpcApi};

fn main() {

    let rpc = Client::new(
        "localhost:19998",
                          Auth::UserPass("<FILL RPC USERNAME>".to_string(),
                                         "<FILL RPC PASSWORD>".to_string())).unwrap();
    let best_block_hash = rpc.get_best_block_hash().unwrap();
    println!("best block hash: {}", best_block_hash);
}

See client/examples/ for more usage examples.

Supported Dash Core Versions

The following versions are officially supported and automatically tested:

  • 0.18.0
  • 0.18.1
  • 0.19.0.1
  • 0.19.1
  • 0.20.0
  • 0.20.1
  • 0.21.0

Minimum Supported Rust Version (MSRV)

This library should always compile with any combination of features on Rust 1.29.

Because some dependencies have broken the build in minor/patch releases, to compile with 1.29.0 you will need to run the following version-pinning command:

cargo update --package "cc" --precise "1.0.41"
cargo update --package "log:0.4.x" --precise "0.4.13" # x being the highest patch version, currently 14
cargo update --package "cfg-if" --precise "0.1.9"
cargo update --package "serde_json" --precise "1.0.39"
cargo update --package "serde" --precise "1.0.98"
cargo update --package "serde_derive" --precise "1.0.98"
cargo update --package "byteorder" --precise "1.3.4"

rust-dashcore-rpc's People

Contributors

stevenroose avatar mayoreee avatar quantumexplorer avatar dpc avatar shotonoff avatar shesek avatar rcasatta avatar sgeisler avatar jawid-h avatar romanz avatar markin-io avatar shumkov avatar tibo-lg avatar justinmoon avatar 0xb10c avatar atul9 avatar jharveyb avatar proofofkeags avatar lklimek avatar nkostoulas avatar panleone avatar tnull avatar d4nte avatar gregdhill avatar notmandatory avatar practicalswift avatar

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.