Coder Social home page Coder Social logo

ark-cpp's Introduction

Ark for Machines v0.8

language version License: MIT
environment
environment
environment
environment

Build Status

Build status

Not production ready.

Supported Boards

What can this do?

GET information from the Ark Blockchain using Arduino boards.
Create models of basic Ark "types." (e.g. Accounts, Blocks, Delegates, Peers, etc)

What CAN'T this do (yet)?

Generate Ark Addresses & Signatures.
Create Signed transaction for broadcast to the Ark Ecosystem.

How to use this

  1. Define the network

ARK::Network devnet = ARK::Constants::Networks::Devnet::model;

or

ARK::Network devnet {
"578e820911f24e039733b45e4882b73e301f813a0d2c31330dafda84534ffa23",
"DARK",
"DѦ",
"https://dexplorer.ark.io/",
30
};

  1. Create the manager instance

ARK::API::Manager arkManager(devnet)

  1. Use manager to get info from the Ark Blockchain

auto status = arkManager.loaderStatus() Serial.print(status) prints {
"success":true,
"loaded":false,
"now":2348744,
"blocksCount":0
}

Examples

Get VendorField of a given Transaction ID using the ESP8266

/*
* demo_sketch.ino
*/

#include <ESP8266WiFi.h>

const char* ssid = "yourSSID";
const char* password = "yourWiFiPassword";

void testVendorField()
{
  Network devnet = Constants::Networks::Model::Devnet;
  ARK::API::Manager arkManager(devnet);

  Hash txID = "4e68a917d06382ce335656eef5560a537fc806ecadf3972c5221b86babecc63e";

  auto vendorField = arkManager.getVendorField(txID);
    Serial.print("\nvendorField: ");
    Serial.println(vendorField);
}

void setup()
{
  Serial.begin(115200);
  reportFreeHeap();
  WiFi.mode(WIFI_STA);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED)
  {
    delay(500);
    Serial.print(".");
  }
  Serial.println();

  testVendorField();
}

void loop(){}

vendorField: 1ARK-GOLang is saying whoop whooop

Get Ark Account from a given Ark Address

  Address darkAddress("DHQ4Fjsyiop3qBR4otAjAu6cBHkgRELqGA");
  auto account = arkManager.account(darkAddress);
    Serial.print("\naccount: ");
    Serial.println(account);

account:
address: DHQ4Fjsyiop3qBR4otAjAu6cBHkgRELqGA
unconfirmedBalance: 106914.85341862
balance: 106914.85341862
publicKey: 0275776018638e5c40f1b922901e96cac2caa734585ef302b4a2801ee9a338a456
unconfirmedSignature: 1
secondSignature: 1
secondPublicKey: 03ad2a481719c80571061f0c941d57e91c928700d8dd132726edfc0bf9c4cb2869
multisignatures:
u_multisignatures:

todo

  • API

    • add models & constants
    • add static endpoints
    • Network manager
    • Network Client
    • API Gets
    • API Posts
      • test api posts
      • finish api posts
    • Error Handling
      • test error handling
      • finish error handling
  • Crypto

    • Test Crypto
      • test sha256
      • test bigint
      • test secp256k1 ECDSA
      • test ripemd160
      • test base58
      • test Address generation
      • test Signing/Signature Generation
    • Add Crypto
      • add sha256
      • add bigint
      • add secp256k1 ECDSA
      • add ripemd160
      • add base58
      • add Address generation
      • add Signing/Signature Generation
  • TODO

    • Documentation
    • Handle Large Callbacks

ark-cpp's People

Contributors

ciband avatar per1234 avatar sleepdefic1t avatar

Stargazers

 avatar

Watchers

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