From 6be0c047b74206c99584b767ed14c31723d885fd Mon Sep 17 00:00:00 2001 From: Esteban Ordano Date: Wed, 17 Dec 2014 16:27:20 -0300 Subject: [PATCH] Update index for the documentation --- docs/{ => helpers}/PaymentProtocol.md | 4 +- docs/index.html | 212 -------------------------- docs/index.md | 53 +++---- docs/{ => models}/PublicKey.md | 6 +- docs/navigation.md | 12 +- docs/{models => networking}/Peer.md | 0 docs/{ => networking}/Pool.md | 6 +- lib/transaction/transaction.js | 7 +- 8 files changed, 43 insertions(+), 257 deletions(-) rename docs/{ => helpers}/PaymentProtocol.md (98%) delete mode 100644 docs/index.html rename docs/{ => models}/PublicKey.md (94%) rename docs/{models => networking}/Peer.md (100%) rename docs/{ => networking}/Pool.md (92%) diff --git a/docs/PaymentProtocol.md b/docs/helpers/PaymentProtocol.md similarity index 98% rename from docs/PaymentProtocol.md rename to docs/helpers/PaymentProtocol.md index 7acb5f6ad..83906efa5 100644 --- a/docs/PaymentProtocol.md +++ b/docs/helpers/PaymentProtocol.md @@ -1,3 +1,5 @@ +# > `bitcore.PaymentProtocol` + # Payment Protocol `PaymentProtocol` and associated functions and methods will serialize, deserialize, sign and verify payment protocol messages both in Node.js and web browsers. Both X.509 and [bitcoin identity protocol](https://en.bitcoin.it/wiki/Identity_protocol_v1) are supported. For detailed technical information, please view [BIP70](https://github.com/bitcoin/bips/blob/master/bip-0070.mediawiki). @@ -176,4 +178,4 @@ var payment = new PaymentProtocol().makePayment(decodedPayment); var tx = payment.message.transactions[0]; ``` -For detailed diagram of the exchange of messages, please see the [Protocol section of BIP70](https://github.com/bitcoin/bips/blob/master/bip-0070.mediawiki#protocol). \ No newline at end of file +For detailed diagram of the exchange of messages, please see the [Protocol section of BIP70](https://github.com/bitcoin/bips/blob/master/bip-0070.mediawiki#protocol). diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index c0b0f69de..000000000 --- a/docs/index.html +++ /dev/null @@ -1,212 +0,0 @@ - - - - - Bitcore | Core for your bitcoin projects - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - diff --git a/docs/index.md b/docs/index.md index 3aa9063e2..524671c02 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,39 +1,28 @@ # Bitcore v0.8 -## Description +## Addresses and Key Management -A pure, powerful core for your bitcoin project. +* [Addresses](models/Address.md) +* [Using different networks](helpers/Networks.md) +* [Private Keys](models/PrivateKey.md) and [Public Keys](models/PublicKey.md) +* [Hierarchically-derived Private and Public Keys](models/Hierarchical.md) -Bitcore is a complete, native interface to the bitcoin network, and provides the core functionality needed to develop apps for bitcoin. +## Payment handling +* [Using different Units](helpers/Unit.md) +* [Acknowledging and Requesting payments: Bitcoin URIs](helpers/URI.md) +* [Payment Protocol Support](helpers/PaymentProtocol.md) +* [The Transaction Class](models/Transaction.md) -## Main Features +## Bitcoin internals +* [Scripts](models/Script.md) +* [Block](models/Block.md) -* Cross platform -* All core bitcoin functionality -* Open-source -* Payment protocol support -* Private and public key management +## Networking +* [Interface to the Bitcoin P2P network](networking/Peer.md) +* [Managing a pool of peers](networking/Pool.md) +* [Connecting to a bitcoind instance through JSON-RPC](networking/JSONRPC.md) - -## Get Started - -Use it on `Node.js`: - -``` -npm install bitcore -``` - -Use it client side on the browser: - -``` -bower install bitcore -``` - - -## Projects using Bitcore - -* Copay -* Insight -* enBitcoins -* BitBox -* Multi-signature Paper Wallet +## Extra +* [Crypto](helpers/Crypto.md) +* [Encoding](helpers/Encoding.md) +* [ECIES](helpers/ECIES.md) diff --git a/docs/PublicKey.md b/docs/models/PublicKey.md similarity index 94% rename from docs/PublicKey.md rename to docs/models/PublicKey.md index a89d0b62b..442e27c58 100644 --- a/docs/PublicKey.md +++ b/docs/models/PublicKey.md @@ -1,4 +1,6 @@ -# Public Key +# > `bitcore.PublicKey` + +## Description Represents a bitcoin public key and is needed to be able to receive bitcoin, as is usually represented as a bitcoin [Address](Address.md), see the official [Bitcoin Wiki](https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses). A PublicKey in Bitcore is an immutable object and can be instantiated from a [Point](Crypto.md), string, [PrivateKey](PrivateKey.md), Buffer and a [BN](Crypto.md). @@ -28,4 +30,4 @@ if (PublicKey.isValid('02a1633cafcc01ebfb6d78e39f687a1f0995c62fc95f51ead10a02ee0 } ``` -Note: It's important to note that there are two possible ways to represent public key, the standard is *compressed* and includes the x value and parity (as represented above in the documentation). There is also a longer version that is *uncompressed* which includes both x and y values, and using this can generate a different bitcoin address, so it's important to note this possibility, however it's discouraged to be used. \ No newline at end of file +Note: It's important to note that there are two possible ways to represent public key, the standard is *compressed* and includes the x value and parity (as represented above in the documentation). There is also a longer version that is *uncompressed* which includes both x and y values, and using this can generate a different bitcoin address, so it's important to note this possibility, however it's discouraged to be used. diff --git a/docs/navigation.md b/docs/navigation.md index 33325f2c0..d215c8443 100644 --- a/docs/navigation.md +++ b/docs/navigation.md @@ -1,13 +1,14 @@ # Bitcore -[About](index.md) +[Index](index.md) + [Models]() * [Address](models/Address.md) * [Block](models/Block.md) * [Hierarchical](models/Hierarchical.md) -* [Peer](models/Peer.md) * [Private Key](models/Privatekey.md) +* [Public Key](models/Publickey.md) * [Script](models/Script.md) * [Transaction](models/Transaction.md) @@ -15,8 +16,15 @@ * [Crypto](helpers/Crypto.md) * [Encoding](helpers/Encoding.md) +* [Payment Protocol](helpers/PaymentProtocol.md) * [Networks](helpers/Networks.md) * [Unit](helpers/Unit.md) * [URI](helpers/URI.md) +[Networking]() + +* [Peer](networking/Peer.md) +* [Pool](networking/Pool.md) +* [JSON-RPC](networking/JSONRPC.md) + [Examples](examples.md) diff --git a/docs/models/Peer.md b/docs/networking/Peer.md similarity index 100% rename from docs/models/Peer.md rename to docs/networking/Peer.md diff --git a/docs/Pool.md b/docs/networking/Pool.md similarity index 92% rename from docs/Pool.md rename to docs/networking/Pool.md index 08d3c9557..16221421e 100644 --- a/docs/Pool.md +++ b/docs/networking/Pool.md @@ -1,4 +1,6 @@ -# Pool +# > `bitcore.transport.Pool` + +## Pool A pool maintains a connection of [Peers](Peer.md). A pool will discover peers via DNS seeds, as well as when peer addresses are announced through the network. @@ -25,4 +27,4 @@ pool.disconnect() ``` -For more information about Peer events, please read the [Peer](Peer.md) documentation. Peer events are relayed to the pool, a peer event `inv` in the pool would be `peerinv`. When a peer is disconnected the pool will try to connect to the list of known addresses to maintain connection. \ No newline at end of file +For more information about Peer events, please read the [Peer](Peer.md) documentation. Peer events are relayed to the pool, a peer event `inv` in the pool would be `peerinv`. When a peer is disconnected the pool will try to connect to the list of known addresses to maintain connection. diff --git a/lib/transaction/transaction.js b/lib/transaction/transaction.js index 5adc86e1b..3ac45b343 100644 --- a/lib/transaction/transaction.js +++ b/lib/transaction/transaction.js @@ -520,7 +520,7 @@ Transaction.prototype.sign = function(privateKey, sigtype) { return this; }; -Transaction.prototype._getPrivateKeySignatures = function(privKey, sigtype) { +Transaction.prototype.getSignatures = function(privKey, sigtype) { privKey = new PrivateKey(privKey); sigtype = sigtype || Signature.SIGHASH_ALL; var transaction = this; @@ -549,10 +549,6 @@ Transaction.prototype.applySignature = function(signature) { return this; }; -Transaction.prototype.getSignatures = function(privKey, sigtype) { - return this._getPrivateKeySignatures(privKey, sigtype); -}; - Transaction.prototype.isFullySigned = function() { return _.all(_.map(this.inputs, function(input) { return input.isFullySigned(); @@ -571,7 +567,6 @@ Transaction.prototype.verifySignature = function(sig, pubkey, nin, subscript) { return Sighash.verify(this, sig, pubkey, nin, subscript); }; - /** * Check that a transaction passes basic sanity tests. If not, return a string * describing the error. This function contains the same logic as