Compare commits

..

68 Commits

Author SHA1 Message Date
Sky Young
7550440913 Update flocore-node 2018-07-28 16:21:36 -07:00
Sky Young
ed43d5e66f
Update README.md 2018-07-26 12:16:52 -07:00
Sky Young
8f81ac0e61
Update README.md 2018-07-26 12:16:04 -07:00
Sky Young
fe5539c6c5 Update v 2018-06-08 15:50:17 -07:00
Sky Young
0ef61495a1 Update Dependencies 2018-06-08 15:49:46 -07:00
Sky Young
98009db449 Update packages 2018-05-22 13:15:43 -07:00
Sky Young
c053af5d1f Update package versions 2018-05-21 17:07:42 -07:00
Sky Young
72ca810c8c Update package versions again 2018-05-21 15:10:46 -07:00
Sky Young
96cd4e83da Update version number 2018-05-21 13:13:37 -07:00
Sky Young
b47c143c90 Import correct services 2018-05-21 13:13:32 -07:00
Sky Young
442306220a Update Package References 2018-04-30 11:02:44 -07:00
OstlerDev
16416357a2 Near unrestrained btc -> flo 2018-01-15 16:27:33 -08:00
Chris Kleeschulte
95dc8b2910
Bumped version. 2017-11-22 16:06:23 -05:00
Chris Kleeschulte
10257f7195
Bumped version. 2017-11-13 14:28:07 -05:00
Chris Kleeschulte
6a7b65ce19
Bumped version. 2017-11-13 09:58:20 -05:00
Chris Kleeschulte
3b2fbbf443
Bumped version. 2017-11-09 22:03:13 -05:00
Chris Kleeschulte
1956bdc8a8
Bumped version. 2017-11-09 17:18:59 -05:00
Chris Kleeschulte
4c5e5fdd29
Bumped version. 2017-11-08 09:43:00 -05:00
Chris Kleeschulte
b1988858be
Bumped version. 2017-11-07 21:43:29 -05:00
Chris Kleeschulte
bad6c55a3a
Bumped version. 2017-11-07 15:45:17 -05:00
Chris Kleeschulte
6d3e2fb5cf
Bumped version. 2017-11-07 13:28:57 -05:00
Chris Kleeschulte
d434fdb1d7
Bumped version. 2017-11-06 19:38:58 -05:00
Chris Kleeschulte
78ec4beb23
Bumped version. 2017-11-06 19:20:09 -05:00
Chris Kleeschulte
340d61fa4c
Bumped version. 2017-11-05 18:44:09 -05:00
Chris Kleeschulte
147a17e540
Bumped version. 2017-11-02 17:49:10 -04:00
Chris Kleeschulte
038f50f91d
Bumped version. 2017-11-02 13:54:19 -04:00
Chris Kleeschulte
8400b9980b
Bumped version. 2017-11-02 12:09:26 -04:00
Chris Kleeschulte
77a6028c81
Bumped version. 2017-11-01 16:07:36 -04:00
Chris Kleeschulte
a379821578
Bumped version. 2017-10-30 15:45:08 -04:00
Chris Kleeschulte
e2dd798b62
Bumped version. 2017-10-26 17:56:59 -04:00
Chris Kleeschulte
45ec2f4db5
Bumped version. 2017-10-26 17:16:44 -04:00
Chris Kleeschulte
c8f183153c
Bumped version. 2017-10-24 17:53:43 -04:00
Chris Kleeschulte
80375eb752
Bumped version. 2017-10-24 14:32:12 -04:00
Chris Kleeschulte
f62100d37d
Bump version 2017-10-20 13:22:55 -04:00
Chris Kleeschulte
c3ddeaff0c
Bumped version. 2017-10-18 19:23:28 -04:00
Chris Kleeschulte
63a15d0241
Added more to deploy script. 2017-10-16 17:44:08 -04:00
Chris Kleeschulte
70f2518409
Added a deploy script. 2017-10-13 16:29:51 -04:00
Chris Kleeschulte
2f2f4f0809
Bumped version. 2017-10-12 19:15:28 -04:00
Chris Kleeschulte
2eb0a6fbc2
Bumped version. 2017-10-12 18:02:56 -04:00
Chris Kleeschulte
f908ad99eb
Bumped version. 2017-10-12 15:17:46 -04:00
Chris Kleeschulte
843e3cb3bf
Slight improvement to release script. 2017-10-12 10:19:24 -04:00
Chris Kleeschulte
be4a09a226
Bumped version. 2017-10-11 17:25:15 -04:00
Chris Kleeschulte
dc19a0c0c9
Bumped version. 2017-10-11 16:42:03 -04:00
Chris Kleeschulte
e1d1cc3ba5
Added a release script. 2017-10-09 18:10:01 -04:00
Chris Kleeschulte
290e662b82
Bumped version. 2017-10-09 18:07:41 -04:00
Chris Kleeschulte
fa9fead231
Bumped version. 2017-10-08 15:50:05 -04:00
Chris Kleeschulte
bfaeead060
Bumped version. 2017-10-02 16:44:11 -04:00
Chris Kleeschulte
c6596ac15d
Bumped version. 2017-10-01 19:22:07 -04:00
Chris Kleeschulte
a4851a6e36
Bumped version. 2017-09-27 15:01:37 -04:00
Chris Kleeschulte
235323ea9a
Bumped version. 2017-09-26 12:48:28 -04:00
Chris Kleeschulte
1e7a05058a
Bumped version. 2017-09-24 12:47:28 -04:00
Chris Kleeschulte
f8038bc15c
Bumped version. 2017-09-12 13:30:43 -04:00
Chris Kleeschulte
92e824e48e
Bumped version. 2017-09-08 14:27:32 -04:00
Chris Kleeschulte
1ab84f1a0f
Bumped version. 2017-09-07 19:02:38 -04:00
Chris Kleeschulte
07224291aa
Bumped version. 2017-09-01 16:47:53 -04:00
Chris Kleeschulte
1d4c92df3c Bum 2017-09-01 16:47:14 -04:00
Chris Kleeschulte
0c00339275
Bumped version. 2017-08-31 15:29:42 -04:00
Chris Kleeschulte
c7a4cab7f5
Bumped version. 2017-08-30 18:43:26 -04:00
Chris Kleeschulte
bd9865739f
Added a friendly message about the minimum node version. 2017-08-30 18:41:33 -04:00
Chris Kleeschulte
d375771611
Bumped package. 2017-08-29 18:10:39 -04:00
Chris Kleeschulte
a51e0c73f4
Changed travis.yml to only build with latest node version. 2017-08-29 16:38:25 -04:00
Chris Kleeschulte
0e7032cf46
Bumpped to beta 3 2017-08-29 16:31:02 -04:00
Chris Kleeschulte
fdf4819bbc
Bumped version. 2017-08-29 16:14:46 -04:00
Jason Dreyzehner
65d41663d7 chore(release): 5.0.0-beta.1 2017-08-18 19:47:18 -04:00
Jason Dreyzehner
53e1ac3b9f build(package): use transitional bitcore-lib branch and blocks bitcore-node branch 2017-08-07 17:01:20 -04:00
Chris Kleeschulte
ad4e25ef1b
Bumped the version of bitcore-lib. 2017-05-17 15:25:22 -04:00
Gabe Gattis
e99e1636a3
Merge branch 'gpg'
PR #1417
2016-08-17 18:58:28 -04:00
Braydon Fuller
30926d624e
Update gpg keys 2016-08-17 18:52:15 -04:00
29 changed files with 4606 additions and 256 deletions

2
.gitignore vendored
View File

@ -18,3 +18,5 @@ report
build
tests.js
scripts/servers.*

20
.npmignore Normal file
View File

@ -0,0 +1,20 @@
*.swp
coverage
node_modules
browser/tests.js
docs/api
CONTRIBUTING.html
LICENSE.html
README.html
examples.html
npm-debug.log
apiref
bower_components
report
.DS_Store
build
tests.js

View File

@ -11,8 +11,7 @@ addons:
- gcc-4.8
- libzmq3-dev
node_js:
- '0.12'
- '4'
- '8'
install:
- npm install
script:

12
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,12 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "flocored",
"program": "${workspaceRoot}/bin/flocored"
}
]
}

View File

@ -1,14 +1,14 @@
Contributing to Bitcore
Contributing to Flocore
=======
We're working hard to make *bitcore* the most powerful JavaScript library for working with bitcoin. Our goal is to have *bitcore* be a library that can be used by anyone interested in bitcoin, and to level expertise differences with great design and documentation.
We're working hard to make *flocore* the most powerful JavaScript library for working with florincoin. Our goal is to have *flocore* be a library that can be used by anyone interested in florincoin, and to level expertise differences with great design and documentation.
## Community
If there are any questions, etc., please feel to ask in one of the community channels:
- https://labs.bitpay.com/c/bitcore (Support Forum)
- https://gitter.im/bitpay/bitcore (Development Chat)
- https://labs.bitpay.com/c/flocore (Support Forum)
- https://gitter.im/bitpay/flocore (Development Chat)
## Quick Checklist
@ -20,7 +20,7 @@ Ideally, please make sure to run:
## Design Guidelines
These are some global design goals in bitcore that any change must adhere.
These are some global design goals in flocore that any change must adhere.
### D1 - Naming Matters
@ -40,7 +40,7 @@ Write a test for all your code. We encourage Test Driven Development so we know
Interfaces should accept as many types of arguments as possible, so there's no mental tax on using them: we want to avoid questions such as "should I use a string here or a buffer?", "what happens if I'm not sure if the type of this variable is an Address instance or a string with it encoded in base-58?" or "what kind of object will I receive after calling this function?".
Accept a wide variety of use cases and arguments, always return an internal form of an object. For example, the class `PublicKey` can accept strings or buffers with a DER encoded public key (either compressed or uncompressed), another PublicKey, a PrivateKey, or a Point, an instance of the `elliptic.js` library with the point in bitcoin's elliptic curve that represents the public key.
Accept a wide variety of use cases and arguments, always return an internal form of an object. For example, the class `PublicKey` can accept strings or buffers with a DER encoded public key (either compressed or uncompressed), another PublicKey, a PrivateKey, or a Point, an instance of the `elliptic.js` library with the point in florincoin's elliptic curve that represents the public key.
### D4 - Consistency Everywhere
@ -91,7 +91,7 @@ var bufferUtil = require('./util/buffer');
#### G7 - Standard Methods
When possible, bitcore objects should have standard methods on an instance prototype:
When possible, flocore objects should have standard methods on an instance prototype:
* `toObject/toJSON` - A plain JavaScript object that `JSON.stringify` can call
* `toString` - A string representation of the instance
* `toBuffer` - A hex Buffer
@ -101,7 +101,7 @@ These should have a matching static method that can be used for instantiation:
* `fromString` - Should be able to instantiate with output from `toString`
* `fromBuffer` - Should likewise be able to instantiate from output from `toBuffer`
`JSON.stringify` and `JSON.parse` are expected to be handled outside of the scope of Bitcore methods. For example, calling `JSON.stringify` on an Bitcore object will behave as expected and call `transaction.toJSON()` and then stringify it:
`JSON.stringify` and `JSON.parse` are expected to be handled outside of the scope of Flocore methods. For example, calling `JSON.stringify` on an Flocore object will behave as expected and call `transaction.toJSON()` and then stringify it:
```javascript
var transactionString = JSON.stringify(transaction);
@ -116,7 +116,7 @@ var tx = new Transaction(data);
### Errors
#### E1 - Use bitcore.Errors
#### E1 - Use flocore.Errors
We've designed a structure for Errors to follow and are slowly migrating to it.
@ -206,14 +206,14 @@ Don't write long tests, write helper functions to make them be as short and conc
Inputs for tests should not be generated randomly. Also, the type and structure of outputs should be checked.
#### T3 - Require 'bitcore' and Look up Classes from There
#### T3 - Require 'flocore' and Look up Classes from There
This helps to make tests more useful as examples, and more independent of where they are placed. This also helps prevent forgetting to include all submodules in the bitcore object.
This helps to make tests more useful as examples, and more independent of where they are placed. This also helps prevent forgetting to include all submodules in the flocore object.
DO:
```javascript
var bitcore = require('../');
var PublicKey = bitcore.PublicKey;
var flocore = require('../');
var PublicKey = flocore.PublicKey;
```
DON'T:
```javascript
@ -246,7 +246,7 @@ git checkout -b remove/some-file
We expect pull requests to be rebased to the master branch before merging:
```sh
git remote add bitpay git@github.com:bitpay/bitcore.git
git remote add bitpay git@github.com:bitpay/flocore.git
git pull --rebase bitpay master
```
@ -258,11 +258,11 @@ git push origin your_branch_name
git push origin feature/some-new-stuff
git push origin fix/some-bug
```
Finally go to [github.com/bitpay/bitcore](https://github.com/bitpay/bitcore) in your web browser and issue a new pull request.
Finally go to [github.com/bitpay/flocore](https://github.com/bitpay/flocore) in your web browser and issue a new pull request.
Main contributors will review your code and possibly ask for changes before your code is pulled in to the main repository. We'll check that all tests pass, review the coding style, and check for general code correctness. If everything is OK, we'll merge your pull request and your code will be part of bitcore.
Main contributors will review your code and possibly ask for changes before your code is pulled in to the main repository. We'll check that all tests pass, review the coding style, and check for general code correctness. If everything is OK, we'll merge your pull request and your code will be part of flocore.
If you have any questions feel free to post them to
[github.com/bitpay/bitcore/issues](https://github.com/bitpay/bitcore/issues).
[github.com/bitpay/flocore/issues](https://github.com/bitpay/flocore/issues).
Thanks for your time and code!

View File

@ -1,12 +1,12 @@
# setup a centos image with bitcore binary components
# setup a centos image with flocore binary components
FROM centos:latest
MAINTAINER Chris Kleeschulte <chrisk@bitpay.com>
RUN yum -y install git curl which xz tar findutils
RUN groupadd bitcore
RUN useradd bitcore -m -s /bin/bash -g bitcore
ENV HOME /home/bitcore
USER bitcore
RUN groupadd flocore
RUN useradd flocore -m -s /bin/bash -g flocore
ENV HOME /home/flocore
USER flocore
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.29.0/install.sh | bash
RUN /bin/bash -l -c "nvm install v4 && nvm alias default v4"
RUN /bin/bash -l -c "npm install bitcore -g"
RUN /bin/bash -l -c "npm install flocore -g"

View File

@ -1,16 +1,16 @@
Copyright (c) 2013-2015 BitPay, Inc.
Parts of this software are based on Bitcoin Core
Copyright (c) 2009-2015 The Bitcoin Core developers
Parts of this software are based on Florincoin Core
Copyright (c) 2009-2015 The Florincoin Core developers
Parts of this software are based on fullnode
Copyright (c) 2014 Ryan X. Charles
Copyright (c) 2014 reddit, Inc.
Parts of this software are based on BitcoinJS
Parts of this software are based on FlorincoinJS
Copyright (c) 2011 Stefan Thomas <justmoon@members.fsf.org>
Parts of this software are based on BitcoinJ
Parts of this software are based on FlorincoinJ
Copyright (c) 2011 Google Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy

View File

@ -1,89 +1,93 @@
Bitcore
Flocore
=======
[![NPM Package](https://img.shields.io/npm/v/bitcore.svg?style=flat-square)](https://www.npmjs.org/package/bitcore)
[![Build Status](https://img.shields.io/travis/bitpay/bitcore.svg?branch=master&style=flat-square)](https://travis-ci.org/bitpay/bitcore)
[![NPM Package](https://img.shields.io/npm/v/flocore.svg?style=flat-square)](https://www.npmjs.org/package/flocore)
[![Build Status](https://img.shields.io/travis/bitpay/flocore.svg?branch=master&style=flat-square)](https://travis-ci.org/bitpay/flocore)
Infrastructure to build Bitcoin and blockchain-based applications for the next generation of financial technology.
Infrastructure to build Florincoin and blockchain-based applications for the next generation of financial technology.
**Note:** If you're looking for the Bitcore Library please see: https://github.com/bitpay/bitcore-lib
**Note:** If you're looking for the Flocore Library please see: https://github.com/bitpay/flocore-lib
## Getting Started
Before you begin you'll need to have Node.js v4 or v0.12 installed. There are several options for installation. One method is to use [nvm](https://github.com/creationix/nvm) to easily switch between different versions, or download directly from [Node.js](https://nodejs.org/).
Before you begin you'll need to have Node.js v8 installed. There are several options for installation. One method is to use [nvm](https://github.com/creationix/nvm) to easily switch between different versions, or download directly from [Node.js](https://nodejs.org/).
```bash
npm install -g bitcore
npm install -g flocore
```
### Running a Flocore server
Spin up a full node and join the network:
```bash
npm install -g bitcore
bitcored
npm install -g flocore
flocored
```
You can then view the Insight block explorer at the default location: `http://localhost:3001/insight`, and your configuration file will be found in your home directory at `~/.bitcore`.
You can then view the Insight block explorer at the default location: `http://localhost:3001/insight`, and your configuration file will be found in your home directory at `~/.flocore`.
### Using Flocore programmatically
Create a transaction:
```js
var bitcore = require('bitcore');
var transaction = new bitcore.Transaction();
var flocore = require('flocore');
var transaction = new flocore.Transaction();
var transaction.from(unspent).to(address, amount);
transaction.sign(privateKey);
```
## Applications
- [Node](https://github.com/bitpay/bitcore-node) - A full node with extended capabilities using Bitcoin Core
- [Node](https://github.com/bitpay/flocore-node) - A full node with extended capabilities using Florincoin Core
- [Insight API](https://github.com/bitpay/insight-api) - A blockchain explorer HTTP API
- [Insight UI](https://github.com/bitpay/insight) - A blockchain explorer web user interface
- [Wallet Service](https://github.com/bitpay/bitcore-wallet-service) - A multisig HD service for wallets
- [Wallet Client](https://github.com/bitpay/bitcore-wallet-client) - A client for the wallet service
- [CLI Wallet](https://github.com/bitpay/bitcore-wallet) - A command-line based wallet client
- [Angular Wallet Client](https://github.com/bitpay/angular-bitcore-wallet-client) - An Angular based wallet client
- [Copay](https://github.com/bitpay/copay) - An easy-to-use, multiplatform, multisignature, secure bitcoin wallet
- [Wallet Service](https://github.com/bitpay/flocore-wallet-service) - A multisig HD service for wallets
- [Wallet Client](https://github.com/bitpay/flocore-wallet-client) - A client for the wallet service
- [CLI Wallet](https://github.com/bitpay/flocore-wallet) - A command-line based wallet client
- [Angular Wallet Client](https://github.com/bitpay/angular-flocore-wallet-client) - An Angular based wallet client
- [Copay](https://github.com/bitpay/copay) - An easy-to-use, multiplatform, multisignature, secure florincoin wallet
## Libraries
- [Lib](https://github.com/bitpay/bitcore-lib) - All of the core Bitcoin primatives including transactions, private key management and others
- [Payment Protocol](https://github.com/bitpay/bitcore-payment-protocol) - A protocol for communication between a merchant and customer
- [P2P](https://github.com/bitpay/bitcore-p2p) - The peer-to-peer networking protocol
- [Mnemonic](https://github.com/bitpay/bitcore-mnemonic) - Implements mnemonic code for generating deterministic keys
- [Channel](https://github.com/bitpay/bitcore-channel) - Micropayment channels for rapidly adjusting bitcoin transactions
- [Message](https://github.com/bitpay/bitcore-message) - Bitcoin message verification and signing
- [ECIES](https://github.com/bitpay/bitcore-ecies) - Uses ECIES symmetric key negotiation from public keys to encrypt arbitrarily long data streams.
- [Lib](https://github.com/bitpay/flocore-lib) - All of the core Florincoin primatives including transactions, private key management and others
- [Payment Protocol](https://github.com/bitpay/flocore-payment-protocol) - A protocol for communication between a merchant and customer
- [P2P](https://github.com/bitpay/flocore-p2p) - The peer-to-peer networking protocol
- [Mnemonic](https://github.com/bitpay/flocore-mnemonic) - Implements mnemonic code for generating deterministic keys
- [Channel](https://github.com/bitpay/flocore-channel) - Micropayment channels for rapidly adjusting florincoin transactions
- [Message](https://github.com/bitpay/flocore-message) - Florincoin message verification and signing
- [ECIES](https://github.com/bitpay/flocore-ecies) - Uses ECIES symmetric key negotiation from public keys to encrypt arbitrarily long data streams.
## Documentation
The complete docs are hosted here: [bitcore documentation](http://bitcore.io/guide/). There's also a [bitcore API reference](http://bitcore.io/api/) available generated from the JSDocs of the project, where you'll find low-level details on each bitcore utility.
The complete docs are hosted here: [flocore documentation](http://flocore.io/guide/). There's also a [flocore API reference](http://flocore.io/api/) available generated from the JSDocs of the project, where you'll find low-level details on each flocore utility.
- [Read the Developer Guide](http://bitcore.io/guide/)
- [Read the API Reference](http://bitcore.io/api/)
- [Read the Developer Guide](http://flocore.io/guide/)
- [Read the API Reference](http://flocore.io/api/)
To get community assistance and ask for help with implementation questions, please use our [community forums](http://bitpaylabs.com/c/bitcore).
To get community assistance and ask for help with implementation questions, please use our [community forums](http://bitpaylabs.com/c/flocore).
## Security
We're using Bitcore in production, as are [many others](http://bitcore.io#projects), but please use common sense when doing anything related to finances! We take no responsibility for your implementation decisions.
We're using Flocore in production, as are [many others](http://flocore.io#projects), but please use common sense when doing anything related to finances! We take no responsibility for your implementation decisions.
If you find a security issue, please email security@bitpay.com.
## Contributing
Please send pull requests for bug fixes, code optimization, and ideas for improvement. For more information on how to contribute, please refer to our [CONTRIBUTING](https://github.com/bitpay/bitcore/blob/master/CONTRIBUTING.md) file.
Please send pull requests for bug fixes, code optimization, and ideas for improvement. For more information on how to contribute, please refer to our [CONTRIBUTING](https://github.com/bitpay/flocore/blob/master/CONTRIBUTING.md) file.
This will generate files named `bitcore.js` and `bitcore.min.js`.
This will generate files named `flocore.js` and `flocore.min.js`.
You can also use our pre-generated files, provided for each release along with a PGP signature by one of the project's maintainers. To get them, checkout a release commit (for example, https://github.com/bitpay/bitcore/commit/e33b6e3ba6a1e5830a079e02d949fce69ea33546 for v0.12.6).
You can also use our pre-generated files, provided for each release along with a PGP signature by one of the project's maintainers. To get them, checkout a release commit (for example, https://github.com/bitpay/flocore/commit/e33b6e3ba6a1e5830a079e02d949fce69ea33546 for v0.12.6).
To verify signatures, use the following PGP keys:
- @braydonf: https://pgp.mit.edu/pks/lookup?op=get&search=0x9BBF07CAC07A276D
- @kleetus: https://pgp.mit.edu/pks/lookup?op=get&search=0x33195D27EF6BDB7F
- @pnagurny: https://pgp.mit.edu/pks/lookup?op=get&search=0x0909B33F0AA53013
- @gabegattis: https://pgp.mit.edu/pks/lookup?op=get&search=0x441430987182732C `F3EA 8E28 29B4 EC93 88CB B0AA 4414 3098 7182 732C`
- @kleetus: https://pgp.mit.edu/pks/lookup?op=get&search=0x33195D27EF6BDB7F `F8B0 891C C459 C197 65C2 5043 3319 5D27 EF6B DB7F`
- @matiu: https://pgp.mit.edu/pks/lookup?op=get&search=0x9EDE6DE4DE531FAC `25CE ED88 A1B1 0CD1 12CD 4121 9EDE 6DE4 DE53 1FAC`
## License
Code released under [the MIT license](https://github.com/bitpay/bitcore/blob/master/LICENSE).
Code released under [the MIT license](https://github.com/bitpay/flocore/blob/master/LICENSE).
Copyright 2013-2015 BitPay, Inc. Bitcore is a trademark maintained by BitPay, Inc.
Copyright 2013-2017 BitPay, Inc. Flocore is a trademark maintained by BitPay, Inc.

View File

@ -1,7 +0,0 @@
#!/usr/bin/env node
var bitcore = require('bitcore-node/lib/cli/bitcore');
var path = require('path');
var servicesPath = path.resolve(__dirname, '../');
var additionalServices = ['insight-api', 'insight-ui'];
bitcore(servicesPath, additionalServices);

View File

@ -1,9 +0,0 @@
#!/usr/bin/env node
'use strict';
var path = require('path');
var bitcored = require('bitcore-node/lib/cli/bitcored');
var servicesPath = path.resolve(__dirname, '../');
var additionalServices = ['insight-api', 'insight-ui'];
bitcored(servicesPath, additionalServices);

11
bin/flocore Executable file
View File

@ -0,0 +1,11 @@
#!/usr/bin/env node
if (parseInt(process.version.split('.')[0].slice(1)) < 8) {
throw new Error('Flocore requires Node version 8 or higher.');
}
var flocore = require('flocore-node/lib/cli/flocore');
var path = require('path');
var servicesPath = path.resolve(__dirname, '../');
var additionalServices = ['flosight-api', 'flosight-ui'];
flocore(servicesPath, additionalServices);

13
bin/flocored Executable file
View File

@ -0,0 +1,13 @@
#!/usr/bin/env node
'use strict';
if (parseInt(process.version.split('.')[0].slice(1)) < 8) {
throw new Error('Flocore requires Node version 8 or higher.');
}
var path = require('path');
var flocored = require('flocore-node/lib/cli/flocored');
var servicesPath = path.resolve(__dirname, '../');
var additionalServices = ['flosight-api', 'flosight-ui'];
flocored(servicesPath, additionalServices);

View File

@ -1,18 +1,18 @@
{
"name": "bitcore",
"main": "./bitcore.min.js",
"name": "flocore",
"main": "./flocore.min.js",
"version": "0.13.5",
"homepage": "http://bitcore.io",
"homepage": "http://flocore.io",
"authors": [
"BitPay, Inc."
],
"description": "A pure, powerful core for your bitcoin project.",
"description": "A pure, powerful core for your florincoin project.",
"moduleType": [
"globals"
],
"keywords": [
"bitcoin",
"bitcore",
"florincoin",
"flocore",
"btc",
"satoshi"
],

View File

@ -1,5 +1,5 @@
var bitcoreTasks = require('bitcore-build');
var flocoreTasks = require('flocore-build');
bitcoreTasks();
flocoreTasks();

View File

@ -1,5 +1,5 @@
'use strict';
var bitcore = require('bitcore-lib');
var flocore = require('flocore-lib');
module.exports = bitcore;
module.exports = flocore;

3995
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,10 @@
{
"name": "bitcore",
"version": "4.1.0",
"description": "A platform to build bitcoin and blockchain-based applications.",
"name": "flocore",
"version": "5.0.0-beta.50",
"description": "A platform to build Florincoin and blockchain-based applications.",
"engines": {
"node": ">=8.0.0"
},
"author": "BitPay <dev@bitpay.com>",
"main": "index.js",
"scripts": {
@ -9,57 +12,12 @@
"build-deb": "./scripts/build-deb"
},
"bin": {
"bitcore": "./bin/bitcore",
"bitcored": "./bin/bitcored"
"flocore": "./bin/flocore",
"flocored": "./bin/flocored"
},
"contributors": [
{
"name": "Daniel Cousens",
"email": "bitcoin@dcousens.com"
},
{
"name": "Esteban Ordano",
"email": "eordano@gmail.com"
},
{
"name": "Gordon Hall",
"email": "gordon@bitpay.com"
},
{
"name": "Jeff Garzik",
"email": "jgarzik@bitpay.com"
},
{
"name": "Kyle Drake",
"email": "kyle@kyledrake.net"
},
{
"name": "Manuel Araoz",
"email": "manuelaraoz@gmail.com"
},
{
"name": "Matias Alejo Garcia",
"email": "ematiu@gmail.com"
},
{
"name": "Ryan X. Charles",
"email": "ryanxcharles@gmail.com"
},
{
"name": "Stefan Thomas",
"email": "moon@justmoon.net"
},
{
"name": "Stephen Pair",
"email": "stephen@bitpay.com"
},
{
"name": "Wei Lu",
"email": "luwei.here@gmail.com"
}
],
"keywords": [
"bitcoin",
"flo",
"florincoin",
"transaction",
"address",
"p2p",
@ -76,16 +34,13 @@
],
"repository": {
"type": "git",
"url": "https://github.com/bitpay/bitcore.git"
},
"browser": {
"request": "browser-request"
"url": "https://github.com/oipwg/flocore.git"
},
"dependencies": {
"bitcore-lib": "^0.13.14",
"bitcore-node": "bitpay/bitcore-node#4.0",
"insight-api": "^0.4.0",
"insight-ui": "^0.4.0"
"flocore-lib": "0.15.1",
"flocore-node": "5.0.0-beta.69",
"flosight-api": "^5.0.0-beta.67",
"flosight-ui": "^5.0.0-beta.71"
},
"license": "MIT",
"devDependencies": {

View File

@ -16,10 +16,10 @@ package_version=$(jq -r ".version" "${root_dir}/package.json")
package_maintainer=$(jq -r ".author" "${root_dir}/package.json")
package_description=$(jq -r ".description" "${root_dir}/package.json")
deb_dir="${root_dir}/build/bitcore_${package_version}_${package_arch}"
deb_dir="${root_dir}/build/flocore_${package_version}_${package_arch}"
log_title "Making Debian package:\n"
echo -e " Name: bitcore"
echo -e " Name: flocore"
echo -e " Version: ${package_version}"
echo -e " Maintainer: ${package_maintainer}"
echo -e " Description: ${package_description}"
@ -45,9 +45,9 @@ replace_vars() {
log_title "Setting up Debian package:"
mkdir -vp "$deb_dir/DEBIAN" \
"$deb_dir/etc/bitcore" \
"$deb_dir/usr/opt/bitcore" \
"$deb_dir/usr/opt/bitcore/bin" \
"$deb_dir/etc/flocore" \
"$deb_dir/usr/opt/flocore" \
"$deb_dir/usr/opt/flocore/bin" \
"$deb_dir/usr/bin"
mkdir -vp "$deb_dir/etc/init"
@ -55,36 +55,36 @@ mkdir -vp "$deb_dir/etc/systemd/system"
replace_vars "${root_dir}/scripts/debian/control" "$deb_dir/DEBIAN/control"
replace_vars "${root_dir}/scripts/debian/postinst" "$deb_dir/DEBIAN/postinst"
replace_vars "${root_dir}/scripts/debian/prerm" "$deb_dir/DEBIAN/prerm"
replace_vars "${root_dir}/scripts/debian/bitcore.conf" "$deb_dir/etc/init/bitcore.conf"
replace_vars "${root_dir}/scripts/debian/bitcore.service" "$deb_dir/etc/systemd/system/bitcore.service"
replace_vars "${root_dir}/scripts/debian/bitcore-bitcoind.conf" "$deb_dir/etc/init/bitcore-bitcoind.conf"
replace_vars "${root_dir}/scripts/debian/bitcore-bitcoind.service" "$deb_dir/etc/systemd/system/bitcore-bitcoind.service"
replace_vars "${root_dir}/scripts/debian/flocore.conf" "$deb_dir/etc/init/flocore.conf"
replace_vars "${root_dir}/scripts/debian/flocore.service" "$deb_dir/etc/systemd/system/flocore.service"
replace_vars "${root_dir}/scripts/debian/flocore-florincoind.conf" "$deb_dir/etc/init/flocore-florincoind.conf"
replace_vars "${root_dir}/scripts/debian/flocore-florincoind.service" "$deb_dir/etc/systemd/system/flocore-florincoind.service"
chmod -vR 0755 "$deb_dir/DEBIAN/"
log_title "Copying Bitcore"
log_title "Copying Flocore"
app_dir="$deb_dir/usr/opt/bitcore"
app_dir="$deb_dir/usr/opt/flocore"
cp -v "${root_dir}/bin/bitcored" "${app_dir}/bin/bitcored"
cp -v "${root_dir}/bin/bitcore" "${app_dir}/bin/bitcore"
chmod -vR 0755 "${app_dir}/bin/bitcore" "${app_dir}/bin/bitcored"
cp -v "${root_dir}/bin/flocored" "${app_dir}/bin/flocored"
cp -v "${root_dir}/bin/flocore" "${app_dir}/bin/flocore"
chmod -vR 0755 "${app_dir}/bin/flocore" "${app_dir}/bin/flocored"
cp -v "${root_dir}/package.json" "${app_dir}"
cp -v "${root_dir}/README.md" "${app_dir}"
cp -v "${root_dir}/index.js" "${app_dir}"
pushd "${deb_dir}/usr/bin"
ln -vs "../opt/bitcore/bin/bitcore"
ln -vs "../opt/bitcore/bin/bitcored"
ln -vs "../opt/bitcore/node_modules/.bin/bitcoind" "bitcore-bitcoind"
ln -vs "../opt/flocore/bin/flocore"
ln -vs "../opt/flocore/bin/flocored"
ln -vs "../opt/flocore/node_modules/.bin/florincoind" "flocore-florincoind"
popd
log_title "Installing Bitcore Modules"
log_title "Installing Flocore Modules"
pushd "${app_dir}"
VERIFY_BITCOIN_DOWNLOAD=1 npm install --production
echo "Cleanup Node.js addon binaries before packaging:"
find "${app_dir}" -type f -name '*.node' -print -delete
find "${app_dir}" -type f -name '*.o' -print -delete
echo "Cleanup intermediate files:"
rm -v "${deb_dir}/usr/opt/bitcore/node_modules/bitcore-node/bin/bitcoin-0.12.1-linux64.tar.gz"
rm -v "${deb_dir}/usr/opt/flocore/node_modules/flocore-node/bin/florincoin-0.12.1-linux64.tar.gz"
npm shrinkwrap --dev
popd

View File

@ -1,24 +0,0 @@
description "Bitcoin Core for Bitcore"
author "BitPay, Inc."
limit nofile 20000 30000
start on runlevel [2345]
stop on runlevel [016]
kill timeout 300
kill signal SIGINT
# user/group for bitcore daemon to run as
setuid bitcore
setgid bitcore
# home dir of the bitcore daemon user
env HOME=/home/bitcore
respawn
respawn limit 5 15
script
exec bitcore-bitcored -datadir=/home/bitcore/.bitcore/data/
end script

View File

@ -1,18 +1,18 @@
[Unit]
Description=Bitcoin Core for Bitcore
Description=Florincoin Core for Flocore
Requires=network.target
[Service]
Type=simple
WorkingDirectory=/usr/opt/bitcore
ExecStart=/usr/bin/bitcore-bitcoind -datadir=/home/bitcore/.bitcore/data/
WorkingDirectory=/usr/opt/flocore
ExecStart=/usr/bin/flocore-florincoind -datadir=/home/flocore/.flocore/data/
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
RestartSec=15
User=bitcore
ExecStartPre=/bin/mkdir -p /run/bitcore
ExecStartPre=/bin/chown bitcore:bitcore /run/bitcore
ExecStartPre=/bin/chmod 755 /run/bitcore
User=flocore
ExecStartPre=/bin/mkdir -p /run/flocore
ExecStartPre=/bin/chown flocore:flocore /run/flocore
ExecStartPre=/bin/chmod 755 /run/flocore
PermissionsStartOnly=true
TimeoutStopSec=300

View File

@ -1,4 +1,4 @@
description "Bitcore Daemon"
description "Flocore Daemon"
author "BitPay, Inc."
limit nofile 20000 30000
@ -9,16 +9,16 @@ stop on runlevel [016]
kill timeout 300
kill signal SIGINT
# user/group for bitcore daemon to run as
setuid bitcore
setgid bitcore
# user/group for flocore daemon to run as
setuid flocore
setgid flocore
# home dir of the bitcore daemon user
env HOME=/home/bitcore
# home dir of the flocore daemon user
env HOME=/home/flocore
respawn
respawn limit 5 15
script
exec bitcored
exec flocored
end script

View File

@ -4,15 +4,15 @@ Requires=network.target
[Service]
Type=simple
WorkingDirectory=/usr/opt/bitcore
ExecStart=/usr/opt/bitcore/bin/bitcored
WorkingDirectory=/usr/opt/flocore
ExecStart=/usr/opt/flocore/bin/flocored
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
RestartSec=15
User=bitcore
ExecStartPre=/bin/mkdir -p /run/bitcore
ExecStartPre=/bin/chown bitcore:bitcore /run/bitcore
ExecStartPre=/bin/chmod 755 /run/bitcore
User=flocore
ExecStartPre=/bin/mkdir -p /run/flocore
ExecStartPre=/bin/chown flocore:flocore /run/flocore
ExecStartPre=/bin/chmod 755 /run/flocore
PermissionsStartOnly=true
TimeoutStopSec=300

View File

@ -1,4 +1,4 @@
Package: bitcore
Package: flocore
Version: {{ deb_package_version }}
Section: base
Priority: optional

View File

@ -0,0 +1,24 @@
description "Florincoin Core for Flocore"
author "BitPay, Inc."
limit nofile 20000 30000
start on runlevel [2345]
stop on runlevel [016]
kill timeout 300
kill signal SIGINT
# user/group for flocore daemon to run as
setuid flocore
setgid flocore
# home dir of the flocore daemon user
env HOME=/home/flocore
respawn
respawn limit 5 15
script
exec flocore-flocored -datadir=/home/flocore/.flocore/data/
end script

View File

@ -3,35 +3,35 @@ set -e
set -o pipefail
# add group
if ! getent group | grep -q "^bitcore:" ; then
echo "Creating system group: bitcore"
groupadd --system bitcore
if ! getent group | grep -q "^flocore:" ; then
echo "Creating system group: flocore"
groupadd --system flocore
fi
# add user
if ! getent passwd | grep -q "^bitcore:"; then
echo "Creating bitcore system user"
useradd --gid "bitcore" --system -m bitcore
if ! getent passwd | grep -q "^flocore:"; then
echo "Creating flocore system user"
useradd --gid "flocore" --system -m flocore
fi
# build nodejs addons
cd "/usr/opt/bitcore"
cd "/usr/opt/flocore"
SKIP_BITCOIN_DOWNLOAD=1 npm rebuild
# setup data directory
mkdir -p "/home/bitcore/.bitcore/data"
chown -R bitcore:bitcore "/home/bitcore/.bitcore"
mkdir -p "/home/flocore/.flocore/data"
chown -R flocore:flocore "/home/flocore/.flocore"
# start bitcore
# start flocore
if hash service 2> /dev/null; then
service bitcore start || echo "bitcore could not be registered or started"
service flocore start || echo "flocore could not be registered or started"
elif hash start 2> /dev/null; then
start bitcore || echo "bitcore could not be registered or started"
start flocore || echo "flocore could not be registered or started"
elif hash systemctl 2> /dev/null; then
{
systemctl enable "bitcore.service" && \
systemctl start "bitcore.service"
} || echo "bitcore could not be registered or started"
systemctl enable "flocore.service" && \
systemctl start "flocore.service"
} || echo "flocore could not be registered or started"
else
echo 'Your system does not appear to use upstart or systemd, so bitcore could not be started'
echo 'Your system does not appear to use upstart or systemd, so flocore could not be started'
fi

View File

@ -4,11 +4,11 @@ set -e
set -o pipefail
if hash service 2> /dev/null; then
service bitcore stop || echo "bitcore wasn't running!"
service flocore stop || echo "flocore wasn't running!"
elif hash stop 2> /dev/null; then
stop "$service_name" || echo "bitcore wasn't running!"
stop "$service_name" || echo "flocore wasn't running!"
elif hash systemctl 2> /dev/null; then
systemctl disable "bitcore.service" || echo "bitcore wasn't running!"
systemctl disable "flocore.service" || echo "flocore wasn't running!"
else
echo "Your system does not appear to use upstart or systemd, so bitcore could not be stopped"
echo "Your system does not appear to use upstart or systemd, so flocore could not be stopped"
fi

102
scripts/deploy.sh Normal file
View File

@ -0,0 +1,102 @@
#!/bin/bash
set -e
############# variables ################
user=`whoami`
process=false
########################################
# deploys latest flocore to application servers over ssh
if [ -z "${1}" ]; then
echo 'no server file given, exiting.'
exit 1
fi
green="\033[38;5;40m"
magenta="\033[38;5;200m"
lightGreen="\033[38;5;112m"
white="\033[38;5;231m"
mustard="\033[38;5;214m"
grey="\033[38;5;7m"
reset="\033[0m"
ssh="ssh -tt -l${user} -p"
function execCmd() {
echo -e ${green}$cmd${reset}
echo "-------------------------------------------------"
if [ "${process}" = true ]; then
eval "${sshCmd}\"${cmd}\""
fi
}
function deploy () {
# stop the server
cmd="sudo service flocored stop"
execCmd
# run npm install -g flocore@beta
cmd="sudo su - flocore -c 'npm install -g flocore@beta'"
execCmd
# start server
cmd="sudo service flocored start"
execCmd
}
function monitor () {
eval "${sshCmd}\"${logCmd}\"" &
}
function closeout () {
PGID=$(ps -o pgid= $$ | grep -o [0-9]*)
kill -- -$PGID
exit 0
}
trap "closeout" SIGINT SIGTERM
while IFS='' read -r server || [[ -n "$server" ]]; do
if [[ "${server}" =~ ^\s*# ]]; then
continue
fi
echo "deploying to: $server"
IFS=':' read -ra url <<< "${server}"
port="${url[1]}"
host="${url[0]}"
logType="${url[2]}"
if [ -z "${port}" ]; then
port=22
fi
if [ -z "${logType}" ]; then
logCmd="sudo journalctl -f"
else
logCmd="sudo tail -f /var/log/upstart/flocored_testnet_new.log"
fi
sshCmd="${ssh}${port} ${host} "
monitor
deploy
sleep 10
done < "$1"
sleep 240
closeout

253
scripts/tag-and-release.sh Normal file
View File

@ -0,0 +1,253 @@
#!/bin/bash
set -e
######### Adjust these variables as needed ################
insightApiDir="${HOME}/source/insight-api"
insightUIDir="${HOME}/source/insight-ui"
flocoreDir="${HOME}/source/flocore"
flocoreNodeDir="${HOME}/source/flocore-node"
###########################################################
# given a string tag, make signed commits, push to relevant repos, create signed tags and publish to npm
bump_version () {
sed -i '' -e "s/\"version\"\: .*$/\"version\"\: \"${shortTag}\",/g" package.json
}
set_deps () {
sed -i '' -e "s/\"flocore-node\"\: .*$/\"flocore-node\"\: \"${shortTag}\",/g" package.json
sed -i '' -e "s/\"insight-api\"\: .*$/\"insight-api\"\: \"${shortTag}\",/g" package.json
sed -i '' -e "s/\"insight-ui\"\: .*$/\"insight-ui\"\: \"bitpay\/insight\#${tag}\"/g" package.json
}
tag="${1}"
shortTag=`echo "${tag}" | cut -c 2-`
if [ -z "${tag}" ]; then
echo ""
echo "No tag given, exiting."
exit 1
fi
#############################################
# flocore-node
#############################################
function flocoreNode() {
echo ""
echo "Starting with flocore-node..."
sleep 2
pushd "${flocoreNodeDir}"
sudo rm -fr node_modules
bump_version
npm install
git add .
git diff --staged
echo ""
echo -n 'Resume?: (Y/n): '
read ans
if [ "${ans}" == 'n' ]; then
echo "Exiting as requested."
exit 0
fi
echo ""
echo "Committing changes for flocore-node..."
sleep 2
git commit -S
echo ""
echo "Pushing changes to Github..."
git push origin master && git push upstream master
echo ""
echo "Signing a tag"
git tag -s "${tag}" -m"${tag}"
echo ""
echo "Pushing the tag to upstream..."
git push upstream "${tag}"
echo ""
echo "Publishing to npm..."
npm publish --tag beta
popd
}
#############################################
# insight-api
#############################################
function insightApi() {
echo ""
echo "Releasing insight-api..."
sleep 2
pushd "${insightApiDir}"
sudo rm -fr node_modules
bump_version
npm install
git add .
git diff --staged
echo ""
echo -n 'Resume?: (Y/n): '
read ans
if [ "${ans}" == 'n' ]; then
echo "Exiting as requested."
exit 0
fi
echo ""
echo "Committing changes for insight-api..."
sleep 2
git commit -S
echo ""
echo "Pushing changes to Github..."
git push origin master && git push upstream master
echo ""
echo "Signing a tag"
git tag -s "${tag}" -m"${tag}"
echo ""
echo "Pushing the tag to upstream..."
git push upstream "${tag}"
echo ""
echo "Publishing to npm..."
npm publish --tag beta
popd
}
#############################################
# insight-ui
#############################################
function insightUi() {
echo ""
echo "Releasing insight-ui..."
sleep 2
pushd "${insightUIDir}"
sudo rm -fr node_modules
bump_version
npm install
git add .
git diff --staged
echo ""
echo -n 'Resume?: (Y/n): '
read ans
if [ "${ans}" == 'n' ]; then
echo "Exiting as requested."
exit 0
fi
echo ""
echo "Committing changes for insight-ui..."
sleep 2
git commit -S
echo ""
echo "Pushing changes to Github..."
git push origin master && git push upstream master
echo ""
echo "Signing a tag"
git tag -s "${tag}" -m"${tag}"
echo ""
echo "Pushing the tag to upstream..."
git push upstream "${tag}"
echo ""
echo "Publishing to npm..."
npm publish --tag beta
popd
}
#############################################
# flocore
#############################################
function flocore() {
echo ""
echo "Releasing flocore..."
sleep 2
pushd "${flocoreDir}"
sudo rm -fr node_modules
bump_version
set_deps
npm install
git add .
git diff --staged
echo ""
echo -n 'Resume?: (Y/n): '
read ans
if [ "${ans}" == 'n' ]; then
echo "Exiting as requested."
exit 0
fi
echo ""
echo "Committing changes for flocore..."
sleep 2
git commit -S
echo ""
echo "Pushing changes to Github..."
git push origin master && git push upstream master
echo ""
echo "Signing a tag"
git tag -s "${tag}" -m"${tag}"
echo ""
echo "Pushing the tag to upstream..."
git push upstream "${tag}"
echo ""
echo "Publishing to npm..."
npm publish --tag beta
popd
echo "Completed releasing tag: ${tag}"
}
echo ""
echo "Tagging with ${tag}..."
echo "Assuming projects at ${HOME}/source..."
releases="${2}"
if [ -z "${releases}" ]; then
flocoreNode
insightApi
insightUi
flocore
else
eval "${releases}"
fi

View File

@ -1,27 +1,27 @@
'use strict';
var should = require('chai').should();
var bitcore = require('../');
var flocore = require('../');
describe('Library', function() {
it('should export primatives', function() {
should.exist(bitcore.crypto);
should.exist(bitcore.encoding);
should.exist(bitcore.util);
should.exist(bitcore.errors);
should.exist(bitcore.Address);
should.exist(bitcore.Block);
should.exist(bitcore.MerkleBlock);
should.exist(bitcore.BlockHeader);
should.exist(bitcore.HDPrivateKey);
should.exist(bitcore.HDPublicKey);
should.exist(bitcore.Networks);
should.exist(bitcore.Opcode);
should.exist(bitcore.PrivateKey);
should.exist(bitcore.PublicKey);
should.exist(bitcore.Script);
should.exist(bitcore.Transaction);
should.exist(bitcore.URI);
should.exist(bitcore.Unit);
should.exist(flocore.crypto);
should.exist(flocore.encoding);
should.exist(flocore.util);
should.exist(flocore.errors);
should.exist(flocore.Address);
should.exist(flocore.Block);
should.exist(flocore.MerkleBlock);
should.exist(flocore.BlockHeader);
should.exist(flocore.HDPrivateKey);
should.exist(flocore.HDPublicKey);
should.exist(flocore.Networks);
should.exist(flocore.Opcode);
should.exist(flocore.PrivateKey);
should.exist(flocore.PublicKey);
should.exist(flocore.Script);
should.exist(flocore.Transaction);
should.exist(flocore.URI);
should.exist(flocore.Unit);
});
});