From ca29384b6319eb2b7bc9de50dffeacb5fcc25c71 Mon Sep 17 00:00:00 2001 From: Esteban Ordano Date: Tue, 23 Dec 2014 10:23:51 -0300 Subject: [PATCH] Add index for documentation --- README.md | 2 +- docs/guide/index.md | 87 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 docs/guide/index.md diff --git a/README.md b/README.md index cf45d7d..312f49f 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ A pure and powerful JavaScript Bitcoin API. ## Principles -Bitcoin is a powerful new peer-to-peer platform for the next generation of financial technology. The decentralized nature of the Bitcoin network allows for highly resilient bitcoin infrastructure, and the developer community needs reliable, open-source tools to implement bitcoin apps and services. +Bitcoin is a powerful new peer-to-peer platform for the next generation of financial technology. The decentralized nature of the Bitcoin network allows for highly resilient bitcoin infrastructure, and the developer community needs reliable, open-source tools to implement bitcoin apps and services. Bitcore provides a powerful API to Bitcoin. ## Get Started diff --git a/docs/guide/index.md b/docs/guide/index.md new file mode 100644 index 0000000..a426dd5 --- /dev/null +++ b/docs/guide/index.md @@ -0,0 +1,87 @@ +# Bitcore v0.8 + +Welcome to the documentation for bictore, a pure and powerful JavaScript Bitcoin API. + +## Principles + +Bitcoin is a powerful new peer-to-peer platform for the next generation of financial technology. The decentralized nature of the Bitcoin network allows for highly resilient bitcoin infrastructure, and the developer community needs reliable, open-source tools to implement bitcoin apps and services. Bitcore provides a powerful API to Bitcoin. + +To get started, just `npm install bitcore` or `bower install bitcore`. + +# Documentation Index + +## Addresses and Key Management + +* [Addresses](address.md) +* [Using different networks](networks.md) +* [Private Keys](privatekey.md) and [Public Keys](publickey.md) +* [Hierarchically-derived Private and Public Keys](hierarchical.md) + +## Payment handling +* [Using different Units](unit.md) +* [Acknowledging and Requesting payments: Bitcoin URIs](uri.md) +* [Payment Protocol Support](paymentprotocol.md) +* [The Transaction Class](transaction.md) + +## Bitcoin internals +* [Scripts](script.md) +* [Block](block.md) + +## Networking +* [Interface to the Bitcoin P2P network](peer.md) +* [Managing a pool of peers](pool.md) +* [Connecting to a bitcoind instance through JSON-RPC](jsonrpc.md) + +## Extra +* [Crypto](crypto.md) +* [Encoding](encoding.md) +* [ECIES](ecies.md) + +# Examples + +## Create a Private Key + +``` +var privKey = new bitcore.PrivateKey(); +``` + +## Create an Address +``` +var privKey = new bitcore.PrivateKey(); +var address = privKey.toAddress(); +``` + +## Create a Multisig Address +``` +// Build a 2-of-3 address from public keys +var P2SHAddress = new bitcore.Address([publicKey1, publicKey2, publicKey3], 2); +``` + +## Request a Payment +``` +var paymentInfo = { + address: '1DNtTk4PUCGAdiNETAzQFWZiy2fCHtGnPx', + amount: 120000 //satoshis +}; +var uri = new bitcore.URI(paymentInfo).toString(); +``` + +## Create a Transaction +``` +var transaction = new Transaction() + .from(utxos) // Feed information about what unspend outputs one can use + .to(address, amount) // Add an output with the given amount of satoshis + .change(address) // Sets up a change address where the rest of the funds will go + .sign(privkeySet) // Signs all the inputs it can +``` + +## Connect to the Network +``` +var peer = new Peer('5.9.85.34'); + +peer.on('inv', function(message) { + // new invetory +}); + +peer.connect(); +```