Giter VIP home page Giter VIP logo

mfcoin-php's Introduction

mfcoin-php

To the horror, a simple library for sending requests to the MFCoin node via JSON RPC in terrible and outdated PHP (you need more jokes about PHP, write me, add to readme)

Have fun

  1. How to install

    composer require sagleft/mfcoin-php
  2. Initialize MFCoin connection/object:

    $mfcoin = new MFCoin\Client('username','password');

    Optionally, you can specify a host, port. Default is HTTP on localhost port 22824.

    $mfcoin = new MFCoin\Client('username','password','localhost','22824');

    If you wish to make an SSL connection you can set an optional CA certificate or leave blank

    $mfcoin->setSSL('/full/path/to/mycertificate.cert');
  3. Make calls to mfcoind as methods for your object. Examples:

    $mfcoin->getinfo();
    
    $mfcoin->getrawtransaction('7ce62a44093ee359d86a1707ecf362925afcc918ba38c837dfa42f89572a6816',1);
    
    $mfcoin->getblock('fbbb5b7f32e562387dc377c24c99778ced80ca726a3cd4bb3bcb13b652f3f6e1');
  4. You can look at other methods in the MFCoin wallet by typing the "help" command or use:

    print_r($mfcoin->help());

Additional Info

  • When a call fails for any reason, it will return false and put the error message in $mfcoin->error

  • The HTTP status code can be found in $mfcoin->status and will either be a valid HTTP status code or will be 0 if cURL was unable to connect.

  • The full response (not usually needed) is stored in $mfcoin->response while the raw JSON is stored in $mfcoin->raw_response


image

mfcoin-php's People

Contributors

sagleft avatar aceat64 avatar axelay avatar wqeqwew avatar

Watchers

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