Giter Club home page Giter Club logo

example-libdogecoin's Introduction

Implementing Libdogecoin

This repository contains an example of how to use libdogecoin in practice. In order to use the library, it must first be installed from the source code by executing the following command from the libdogecoin project directory:

TODO

Once the library is installed, any functions from libdogecoin that will be used in your project must be redeclared in a header file with the extern keyword, which should be included in any sources files that will call these functions. In the example files provided, all user-facing functions are declared within the file for reference, and are structured like so:

#include <stdbool.h>
#include <stdint.h>

// from ecc.c
extern void dogecoin_ecc_start();
extern void dogecoin_ecc_stop();

// from address.c
extern int generatePrivPubKeypair(char* wif_privkey, char* p2pkh_pubkey, bool is_testnet);
extern int generateHDMasterPubKeypair(char* wif_privkey_master, char* p2pkh_pubkey_master, bool is_testnet);

// ...

Note: if using any address functions which contain bool as a parameter type, you will need to include the header <stdbool.h> . If using verifyP2pkhAddress() you will need to include the <stdint.h> header which is responsible for the definition of the uint8_t type.

To compile your project and link it with the libdogecoin static library, you can run the following commands, where the -L flag signifies the path to any extra required libraries (libsecp256k1.a and libsecp256k1_precomputed.a). In addition, the -l flags denote all libraries that are required for compilation. The required libraries are the following:

  • dogecoin
  • secp256k1
  • secp256k1_precomputed
  • m
  • event

Altogether, the command to link and compile your project-- in its basic form-- will look similar to this:

gcc file.c -I./path/to/headers -L./path/to/libs -ldogecoin -lsecp256k1 -lsecp256k1_precomputed -lm -levent

A similar command can be found in the Makefile, which exports an executable called test that can be run with ./test .

example-libdogecoin's People

Contributors

jaxlotl avatar

Watchers

 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.