Git Product home page Git Product logo

electracore's Introduction

Electracore

Build Status Coverage Status

A pure, powerful core for your Electra project.

Electracore is a complete, native interface to the Electra network, and provides the core functionality needed to develop apps for Electra.

#Principles

Electra is a blockchain using the highly-secure and power efficient NIST5 algorithm. Combining temporary Proof-of-Work with high Proof-of-Stake, the Electra coin (ECA) is unique in its distribution. On June 16, 2017, Electra entered "Super Rewards Bonanza" stage for 24 hours (Blocks 11522-11810). During this time, 95% of the proof-of-work coins were mined. At block 11811, Electra swapped to Proof-of-Stake with an annual interest rate of 50% until block 112200. This created a gold-rush period, promoting the network (or was hoped to) and rapidly increasing the amount of ECA. The 30bil ECA is a soft limit, and will be controlled by the POS Block rewards.

Electracore unchains developers from fallible, centralized APIs, and provides the tools to interact with the real Electra network.

#Get Started

Electracore runs on node, and can be installed via npm:

npm install Electracore

It is a collection of objects useful to Litecoin applications; class-like idioms are enabled viaSoop. In most cases, a developer will require the object's class directly. For instance:

var Electracore = require('Electracore');
var Address = Electracore.Address;
var Transaction = Electracore.Transaction;
var PeerManager = Electracore.PeerManager;

#Examples

Examples are provided here Build the examples by installing and running gulp:

npm install -g gulp
gulp

Javascript files available at /examples folder.

#Security

Please use at your own risk.

Electracore is still under heavy development and not quite ready for "drop-in" production use. If you find a security issue, please email [email protected]

#Contributing

Electracore needs some developer love. Please send pull requests for bug fixes, code optimization, and ideas for improvement.

#Browser support

Building the browser bundle

To build Electracore full bundle for the browser (this is automatically executed after you run npm install):

node browser/build.js -a

This will generate a browser/bundle.js file which you can include in your HTML to use Electracore in the browser.

##Example browser usage

From example/simple.html

<!DOCTYPE html>
<html>
  <body>
    <script src="../browser/bundle.js"></script>
    <script>
      var Electracore = require('Electracore');
      var Address = Electracore.Address;
      var a = new Address('sgrHPw4aEPos8YJDNfefsUSjPYWc5fzpLE');
      console.log('sgrHPw4aEPos8YJDNfefsUSjPYWc5fzpLE is valid? '+a.isValid());
    </script>
  </body>
</html>

You can check a more complex usage example at examples/example.html.

Generating a customized browser bundle

To build the main Electracore bundle, run:

node browser/build.js -m

To build all features into the Electracore bundle (which will lead to a large file size), run:

node browser/build.js -a

To generate a customized Electracore bundle, you can specify which submodules you want to include in it with the -s option:

node browser/build.js -s Transaction,Address

This will generate a browser/bundle.js containing only the Transaction and Address class, with all their dependencies. Use this option if you are not using the whole Electracore library, to optimize the bundle size, script loading time, and general resource usage.

Tests

Run tests in node:

mocha

Or generate tests in the browser:

grunt shell

And then open test/index.html in your browser.

To run the code coverage report:

npm run-script coverage

And then open coverage/lcov-report/index.html in your browser.

#License

Bitcore Code released under the MIT license.

Copyright 2013-2014 BitPay, Inc. Bitcore is a trademark maintained by BitPay, Inc.

Bitdeli Badge

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.