Compare commits
1 Commits
master
...
bitcore-no
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
41c8ea0de6 |
2
.gitignore
vendored
2
.gitignore
vendored
@ -18,5 +18,3 @@ report
|
|||||||
build
|
build
|
||||||
|
|
||||||
tests.js
|
tests.js
|
||||||
|
|
||||||
scripts/servers.*
|
|
||||||
|
|||||||
20
.npmignore
20
.npmignore
@ -1,20 +0,0 @@
|
|||||||
*.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
|
|
||||||
@ -11,7 +11,8 @@ addons:
|
|||||||
- gcc-4.8
|
- gcc-4.8
|
||||||
- libzmq3-dev
|
- libzmq3-dev
|
||||||
node_js:
|
node_js:
|
||||||
- '8'
|
- '0.12'
|
||||||
|
- '4'
|
||||||
install:
|
install:
|
||||||
- npm install
|
- npm install
|
||||||
script:
|
script:
|
||||||
|
|||||||
12
.vscode/launch.json
vendored
12
.vscode/launch.json
vendored
@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"version": "0.2.0",
|
|
||||||
"configurations": [
|
|
||||||
|
|
||||||
{
|
|
||||||
"type": "node",
|
|
||||||
"request": "launch",
|
|
||||||
"name": "flocored",
|
|
||||||
"program": "${workspaceRoot}/bin/flocored"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@ -1,14 +1,14 @@
|
|||||||
Contributing to Flocore
|
Contributing to Bitcore
|
||||||
=======
|
=======
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
## Community
|
## Community
|
||||||
|
|
||||||
If there are any questions, etc., please feel to ask in one of the community channels:
|
If there are any questions, etc., please feel to ask in one of the community channels:
|
||||||
|
|
||||||
- https://labs.bitpay.com/c/flocore (Support Forum)
|
- https://labs.bitpay.com/c/bitcore (Support Forum)
|
||||||
- https://gitter.im/bitpay/flocore (Development Chat)
|
- https://gitter.im/bitpay/bitcore (Development Chat)
|
||||||
|
|
||||||
## Quick Checklist
|
## Quick Checklist
|
||||||
|
|
||||||
@ -20,7 +20,7 @@ Ideally, please make sure to run:
|
|||||||
|
|
||||||
## Design Guidelines
|
## Design Guidelines
|
||||||
|
|
||||||
These are some global design goals in flocore that any change must adhere.
|
These are some global design goals in bitcore that any change must adhere.
|
||||||
|
|
||||||
### D1 - Naming Matters
|
### 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?".
|
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 florincoin'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 bitcoin's elliptic curve that represents the public key.
|
||||||
|
|
||||||
### D4 - Consistency Everywhere
|
### D4 - Consistency Everywhere
|
||||||
|
|
||||||
@ -91,7 +91,7 @@ var bufferUtil = require('./util/buffer');
|
|||||||
|
|
||||||
#### G7 - Standard Methods
|
#### G7 - Standard Methods
|
||||||
|
|
||||||
When possible, flocore objects should have standard methods on an instance prototype:
|
When possible, bitcore objects should have standard methods on an instance prototype:
|
||||||
* `toObject/toJSON` - A plain JavaScript object that `JSON.stringify` can call
|
* `toObject/toJSON` - A plain JavaScript object that `JSON.stringify` can call
|
||||||
* `toString` - A string representation of the instance
|
* `toString` - A string representation of the instance
|
||||||
* `toBuffer` - A hex Buffer
|
* `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`
|
* `fromString` - Should be able to instantiate with output from `toString`
|
||||||
* `fromBuffer` - Should likewise be able to instantiate from output from `toBuffer`
|
* `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 Flocore methods. For example, calling `JSON.stringify` on an Flocore 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 Bitcore methods. For example, calling `JSON.stringify` on an Bitcore object will behave as expected and call `transaction.toJSON()` and then stringify it:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
var transactionString = JSON.stringify(transaction);
|
var transactionString = JSON.stringify(transaction);
|
||||||
@ -116,7 +116,7 @@ var tx = new Transaction(data);
|
|||||||
|
|
||||||
### Errors
|
### Errors
|
||||||
|
|
||||||
#### E1 - Use flocore.Errors
|
#### E1 - Use bitcore.Errors
|
||||||
|
|
||||||
We've designed a structure for Errors to follow and are slowly migrating to it.
|
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.
|
Inputs for tests should not be generated randomly. Also, the type and structure of outputs should be checked.
|
||||||
|
|
||||||
#### T3 - Require 'flocore' and Look up Classes from There
|
#### T3 - Require 'bitcore' 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 flocore 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 bitcore object.
|
||||||
|
|
||||||
DO:
|
DO:
|
||||||
```javascript
|
```javascript
|
||||||
var flocore = require('../');
|
var bitcore = require('../');
|
||||||
var PublicKey = flocore.PublicKey;
|
var PublicKey = bitcore.PublicKey;
|
||||||
```
|
```
|
||||||
DON'T:
|
DON'T:
|
||||||
```javascript
|
```javascript
|
||||||
@ -246,7 +246,7 @@ git checkout -b remove/some-file
|
|||||||
|
|
||||||
We expect pull requests to be rebased to the master branch before merging:
|
We expect pull requests to be rebased to the master branch before merging:
|
||||||
```sh
|
```sh
|
||||||
git remote add bitpay git@github.com:bitpay/flocore.git
|
git remote add bitpay git@github.com:bitpay/bitcore.git
|
||||||
git pull --rebase bitpay master
|
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 feature/some-new-stuff
|
||||||
git push origin fix/some-bug
|
git push origin fix/some-bug
|
||||||
```
|
```
|
||||||
Finally go to [github.com/bitpay/flocore](https://github.com/bitpay/flocore) in your web browser and issue a new pull request.
|
Finally go to [github.com/bitpay/bitcore](https://github.com/bitpay/bitcore) 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 flocore.
|
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.
|
||||||
|
|
||||||
If you have any questions feel free to post them to
|
If you have any questions feel free to post them to
|
||||||
[github.com/bitpay/flocore/issues](https://github.com/bitpay/flocore/issues).
|
[github.com/bitpay/bitcore/issues](https://github.com/bitpay/bitcore/issues).
|
||||||
|
|
||||||
Thanks for your time and code!
|
Thanks for your time and code!
|
||||||
|
|||||||
12
Dockerfile
12
Dockerfile
@ -1,12 +1,12 @@
|
|||||||
# setup a centos image with flocore binary components
|
# setup a centos image with bitcore binary components
|
||||||
FROM centos:latest
|
FROM centos:latest
|
||||||
MAINTAINER Chris Kleeschulte <chrisk@bitpay.com>
|
MAINTAINER Chris Kleeschulte <chrisk@bitpay.com>
|
||||||
RUN yum -y install git curl which xz tar findutils
|
RUN yum -y install git curl which xz tar findutils
|
||||||
RUN groupadd flocore
|
RUN groupadd bitcore
|
||||||
RUN useradd flocore -m -s /bin/bash -g flocore
|
RUN useradd bitcore -m -s /bin/bash -g bitcore
|
||||||
ENV HOME /home/flocore
|
ENV HOME /home/bitcore
|
||||||
USER flocore
|
USER bitcore
|
||||||
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.29.0/install.sh | bash
|
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 "nvm install v4 && nvm alias default v4"
|
||||||
RUN /bin/bash -l -c "npm install flocore -g"
|
RUN /bin/bash -l -c "npm install bitcore -g"
|
||||||
|
|
||||||
|
|||||||
8
LICENSE
8
LICENSE
@ -1,16 +1,16 @@
|
|||||||
Copyright (c) 2013-2015 BitPay, Inc.
|
Copyright (c) 2013-2015 BitPay, Inc.
|
||||||
|
|
||||||
Parts of this software are based on Florincoin Core
|
Parts of this software are based on Bitcoin Core
|
||||||
Copyright (c) 2009-2015 The Florincoin Core developers
|
Copyright (c) 2009-2015 The Bitcoin Core developers
|
||||||
|
|
||||||
Parts of this software are based on fullnode
|
Parts of this software are based on fullnode
|
||||||
Copyright (c) 2014 Ryan X. Charles
|
Copyright (c) 2014 Ryan X. Charles
|
||||||
Copyright (c) 2014 reddit, Inc.
|
Copyright (c) 2014 reddit, Inc.
|
||||||
|
|
||||||
Parts of this software are based on FlorincoinJS
|
Parts of this software are based on BitcoinJS
|
||||||
Copyright (c) 2011 Stefan Thomas <justmoon@members.fsf.org>
|
Copyright (c) 2011 Stefan Thomas <justmoon@members.fsf.org>
|
||||||
|
|
||||||
Parts of this software are based on FlorincoinJ
|
Parts of this software are based on BitcoinJ
|
||||||
Copyright (c) 2011 Google Inc.
|
Copyright (c) 2011 Google Inc.
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
|||||||
80
README.md
80
README.md
@ -1,93 +1,89 @@
|
|||||||
Flocore
|
Bitcore
|
||||||
=======
|
=======
|
||||||
|
|
||||||
[](https://www.npmjs.org/package/flocore)
|
[](https://www.npmjs.org/package/bitcore)
|
||||||
[](https://travis-ci.org/bitpay/flocore)
|
[](https://travis-ci.org/bitpay/bitcore)
|
||||||
|
|
||||||
Infrastructure to build Florincoin and blockchain-based applications for the next generation of financial technology.
|
Infrastructure to build Bitcoin and blockchain-based applications for the next generation of financial technology.
|
||||||
|
|
||||||
**Note:** If you're looking for the Flocore Library please see: https://github.com/bitpay/flocore-lib
|
**Note:** If you're looking for the Bitcore Library please see: https://github.com/bitpay/bitcore-lib
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
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/).
|
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/).
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm install -g flocore
|
npm install -g bitcore
|
||||||
```
|
```
|
||||||
|
|
||||||
### Running a Flocore server
|
|
||||||
|
|
||||||
Spin up a full node and join the network:
|
Spin up a full node and join the network:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm install -g flocore
|
npm install -g bitcore
|
||||||
flocored
|
bitcored
|
||||||
```
|
```
|
||||||
|
|
||||||
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`.
|
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`.
|
||||||
|
|
||||||
### Using Flocore programmatically
|
|
||||||
|
|
||||||
Create a transaction:
|
Create a transaction:
|
||||||
```js
|
```js
|
||||||
var flocore = require('flocore');
|
var bitcore = require('bitcore');
|
||||||
var transaction = new flocore.Transaction();
|
var transaction = new bitcore.Transaction();
|
||||||
var transaction.from(unspent).to(address, amount);
|
var transaction.from(unspent).to(address, amount);
|
||||||
transaction.sign(privateKey);
|
transaction.sign(privateKey);
|
||||||
```
|
```
|
||||||
|
|
||||||
## Applications
|
## Applications
|
||||||
|
|
||||||
- [Node](https://github.com/bitpay/flocore-node) - A full node with extended capabilities using Florincoin Core
|
- [Node](https://github.com/bitpay/bitcore-node) - A full node with extended capabilities using Bitcoin Core
|
||||||
- [Insight API](https://github.com/bitpay/insight-api) - A blockchain explorer HTTP API
|
- [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
|
- [Insight UI](https://github.com/bitpay/insight) - A blockchain explorer web user interface
|
||||||
- [Wallet Service](https://github.com/bitpay/flocore-wallet-service) - A multisig HD service for wallets
|
- [Wallet Service](https://github.com/bitpay/bitcore-wallet-service) - A multisig HD service for wallets
|
||||||
- [Wallet Client](https://github.com/bitpay/flocore-wallet-client) - A client for the wallet service
|
- [Wallet Client](https://github.com/bitpay/bitcore-wallet-client) - A client for the wallet service
|
||||||
- [CLI Wallet](https://github.com/bitpay/flocore-wallet) - A command-line based wallet client
|
- [CLI Wallet](https://github.com/bitpay/bitcore-wallet) - A command-line based wallet client
|
||||||
- [Angular Wallet Client](https://github.com/bitpay/angular-flocore-wallet-client) - An Angular 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 florincoin wallet
|
- [Copay](https://github.com/bitpay/copay) - An easy-to-use, multiplatform, multisignature, secure bitcoin wallet
|
||||||
|
|
||||||
## Libraries
|
## Libraries
|
||||||
|
|
||||||
- [Lib](https://github.com/bitpay/flocore-lib) - All of the core Florincoin primatives including transactions, private key management and others
|
- [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/flocore-payment-protocol) - A protocol for communication between a merchant and customer
|
- [Payment Protocol](https://github.com/bitpay/bitcore-payment-protocol) - A protocol for communication between a merchant and customer
|
||||||
- [P2P](https://github.com/bitpay/flocore-p2p) - The peer-to-peer networking protocol
|
- [P2P](https://github.com/bitpay/bitcore-p2p) - The peer-to-peer networking protocol
|
||||||
- [Mnemonic](https://github.com/bitpay/flocore-mnemonic) - Implements mnemonic code for generating deterministic keys
|
- [Mnemonic](https://github.com/bitpay/bitcore-mnemonic) - Implements mnemonic code for generating deterministic keys
|
||||||
- [Channel](https://github.com/bitpay/flocore-channel) - Micropayment channels for rapidly adjusting florincoin transactions
|
- [Channel](https://github.com/bitpay/bitcore-channel) - Micropayment channels for rapidly adjusting bitcoin transactions
|
||||||
- [Message](https://github.com/bitpay/flocore-message) - Florincoin message verification and signing
|
- [Message](https://github.com/bitpay/bitcore-message) - Bitcoin 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.
|
- [ECIES](https://github.com/bitpay/bitcore-ecies) - Uses ECIES symmetric key negotiation from public keys to encrypt arbitrarily long data streams.
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
- [Read the Developer Guide](http://flocore.io/guide/)
|
- [Read the Developer Guide](http://bitcore.io/guide/)
|
||||||
- [Read the API Reference](http://flocore.io/api/)
|
- [Read the API Reference](http://bitcore.io/api/)
|
||||||
|
|
||||||
To get community assistance and ask for help with implementation questions, please use our [community forums](http://bitpaylabs.com/c/flocore).
|
To get community assistance and ask for help with implementation questions, please use our [community forums](http://bitpaylabs.com/c/bitcore).
|
||||||
|
|
||||||
## Security
|
## Security
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
If you find a security issue, please email security@bitpay.com.
|
If you find a security issue, please email security@bitpay.com.
|
||||||
|
|
||||||
## Contributing
|
## 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/flocore/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/bitcore/blob/master/CONTRIBUTING.md) file.
|
||||||
|
|
||||||
This will generate files named `flocore.js` and `flocore.min.js`.
|
This will generate files named `bitcore.js` and `bitcore.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/flocore/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/bitcore/commit/e33b6e3ba6a1e5830a079e02d949fce69ea33546 for v0.12.6).
|
||||||
|
|
||||||
To verify signatures, use the following PGP keys:
|
To verify signatures, use the following PGP keys:
|
||||||
- @gabegattis: https://pgp.mit.edu/pks/lookup?op=get&search=0x441430987182732C `F3EA 8E28 29B4 EC93 88CB B0AA 4414 3098 7182 732C`
|
- @braydonf: https://pgp.mit.edu/pks/lookup?op=get&search=0x9BBF07CAC07A276D
|
||||||
- @kleetus: https://pgp.mit.edu/pks/lookup?op=get&search=0x33195D27EF6BDB7F `F8B0 891C C459 C197 65C2 5043 3319 5D27 EF6B DB7F`
|
- @kleetus: https://pgp.mit.edu/pks/lookup?op=get&search=0x33195D27EF6BDB7F
|
||||||
- @matiu: https://pgp.mit.edu/pks/lookup?op=get&search=0x9EDE6DE4DE531FAC `25CE ED88 A1B1 0CD1 12CD 4121 9EDE 6DE4 DE53 1FAC`
|
- @pnagurny: https://pgp.mit.edu/pks/lookup?op=get&search=0x0909B33F0AA53013
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Code released under [the MIT license](https://github.com/bitpay/flocore/blob/master/LICENSE).
|
Code released under [the MIT license](https://github.com/bitpay/bitcore/blob/master/LICENSE).
|
||||||
|
|
||||||
Copyright 2013-2017 BitPay, Inc. Flocore is a trademark maintained by BitPay, Inc.
|
Copyright 2013-2015 BitPay, Inc. Bitcore is a trademark maintained by BitPay, Inc.
|
||||||
|
|||||||
7
bin/bitcore
Executable file
7
bin/bitcore
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
#!/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);
|
||||||
9
bin/bitcored
Executable file
9
bin/bitcored
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
#!/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
11
bin/flocore
@ -1,11 +0,0 @@
|
|||||||
#!/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
13
bin/flocored
@ -1,13 +0,0 @@
|
|||||||
#!/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);
|
|
||||||
12
bower.json
12
bower.json
@ -1,18 +1,18 @@
|
|||||||
{
|
{
|
||||||
"name": "flocore",
|
"name": "bitcore",
|
||||||
"main": "./flocore.min.js",
|
"main": "./bitcore.min.js",
|
||||||
"version": "0.13.5",
|
"version": "0.13.5",
|
||||||
"homepage": "http://flocore.io",
|
"homepage": "http://bitcore.io",
|
||||||
"authors": [
|
"authors": [
|
||||||
"BitPay, Inc."
|
"BitPay, Inc."
|
||||||
],
|
],
|
||||||
"description": "A pure, powerful core for your florincoin project.",
|
"description": "A pure, powerful core for your bitcoin project.",
|
||||||
"moduleType": [
|
"moduleType": [
|
||||||
"globals"
|
"globals"
|
||||||
],
|
],
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"florincoin",
|
"bitcoin",
|
||||||
"flocore",
|
"bitcore",
|
||||||
"btc",
|
"btc",
|
||||||
"satoshi"
|
"satoshi"
|
||||||
],
|
],
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
|
|
||||||
var flocoreTasks = require('flocore-build');
|
var bitcoreTasks = require('bitcore-build');
|
||||||
|
|
||||||
flocoreTasks();
|
bitcoreTasks();
|
||||||
|
|||||||
4
index.js
4
index.js
@ -1,5 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var flocore = require('flocore-lib');
|
var bitcore = require('bitcore-lib');
|
||||||
|
|
||||||
module.exports = flocore;
|
module.exports = bitcore;
|
||||||
|
|||||||
3995
package-lock.json
generated
3995
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
75
package.json
75
package.json
@ -1,10 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "flocore",
|
"name": "bitcore",
|
||||||
"version": "5.0.0-beta.50",
|
"version": "4.1.0",
|
||||||
"description": "A platform to build Florincoin and blockchain-based applications.",
|
"description": "A platform to build bitcoin and blockchain-based applications.",
|
||||||
"engines": {
|
|
||||||
"node": ">=8.0.0"
|
|
||||||
},
|
|
||||||
"author": "BitPay <dev@bitpay.com>",
|
"author": "BitPay <dev@bitpay.com>",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@ -12,12 +9,57 @@
|
|||||||
"build-deb": "./scripts/build-deb"
|
"build-deb": "./scripts/build-deb"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"flocore": "./bin/flocore",
|
"bitcore": "./bin/bitcore",
|
||||||
"flocored": "./bin/flocored"
|
"bitcored": "./bin/bitcored"
|
||||||
},
|
},
|
||||||
|
"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": [
|
"keywords": [
|
||||||
"flo",
|
"bitcoin",
|
||||||
"florincoin",
|
|
||||||
"transaction",
|
"transaction",
|
||||||
"address",
|
"address",
|
||||||
"p2p",
|
"p2p",
|
||||||
@ -34,13 +76,16 @@
|
|||||||
],
|
],
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/oipwg/flocore.git"
|
"url": "https://github.com/bitpay/bitcore.git"
|
||||||
|
},
|
||||||
|
"browser": {
|
||||||
|
"request": "browser-request"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"flocore-lib": "0.15.1",
|
"bitcore-lib": "^0.13.14",
|
||||||
"flocore-node": "5.0.0-beta.69",
|
"bitcore-node": "bitpay/bitcore-node#4.0",
|
||||||
"flosight-api": "^5.0.0-beta.67",
|
"insight-api": "^0.4.0",
|
||||||
"flosight-ui": "^5.0.0-beta.71"
|
"insight-ui": "^0.4.0"
|
||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@ -16,10 +16,10 @@ package_version=$(jq -r ".version" "${root_dir}/package.json")
|
|||||||
package_maintainer=$(jq -r ".author" "${root_dir}/package.json")
|
package_maintainer=$(jq -r ".author" "${root_dir}/package.json")
|
||||||
package_description=$(jq -r ".description" "${root_dir}/package.json")
|
package_description=$(jq -r ".description" "${root_dir}/package.json")
|
||||||
|
|
||||||
deb_dir="${root_dir}/build/flocore_${package_version}_${package_arch}"
|
deb_dir="${root_dir}/build/bitcore_${package_version}_${package_arch}"
|
||||||
|
|
||||||
log_title "Making Debian package:\n"
|
log_title "Making Debian package:\n"
|
||||||
echo -e " Name: flocore"
|
echo -e " Name: bitcore"
|
||||||
echo -e " Version: ${package_version}"
|
echo -e " Version: ${package_version}"
|
||||||
echo -e " Maintainer: ${package_maintainer}"
|
echo -e " Maintainer: ${package_maintainer}"
|
||||||
echo -e " Description: ${package_description}"
|
echo -e " Description: ${package_description}"
|
||||||
@ -45,9 +45,9 @@ replace_vars() {
|
|||||||
|
|
||||||
log_title "Setting up Debian package:"
|
log_title "Setting up Debian package:"
|
||||||
mkdir -vp "$deb_dir/DEBIAN" \
|
mkdir -vp "$deb_dir/DEBIAN" \
|
||||||
"$deb_dir/etc/flocore" \
|
"$deb_dir/etc/bitcore" \
|
||||||
"$deb_dir/usr/opt/flocore" \
|
"$deb_dir/usr/opt/bitcore" \
|
||||||
"$deb_dir/usr/opt/flocore/bin" \
|
"$deb_dir/usr/opt/bitcore/bin" \
|
||||||
"$deb_dir/usr/bin"
|
"$deb_dir/usr/bin"
|
||||||
|
|
||||||
mkdir -vp "$deb_dir/etc/init"
|
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/control" "$deb_dir/DEBIAN/control"
|
||||||
replace_vars "${root_dir}/scripts/debian/postinst" "$deb_dir/DEBIAN/postinst"
|
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/prerm" "$deb_dir/DEBIAN/prerm"
|
||||||
replace_vars "${root_dir}/scripts/debian/flocore.conf" "$deb_dir/etc/init/flocore.conf"
|
replace_vars "${root_dir}/scripts/debian/bitcore.conf" "$deb_dir/etc/init/bitcore.conf"
|
||||||
replace_vars "${root_dir}/scripts/debian/flocore.service" "$deb_dir/etc/systemd/system/flocore.service"
|
replace_vars "${root_dir}/scripts/debian/bitcore.service" "$deb_dir/etc/systemd/system/bitcore.service"
|
||||||
replace_vars "${root_dir}/scripts/debian/flocore-florincoind.conf" "$deb_dir/etc/init/flocore-florincoind.conf"
|
replace_vars "${root_dir}/scripts/debian/bitcore-bitcoind.conf" "$deb_dir/etc/init/bitcore-bitcoind.conf"
|
||||||
replace_vars "${root_dir}/scripts/debian/flocore-florincoind.service" "$deb_dir/etc/systemd/system/flocore-florincoind.service"
|
replace_vars "${root_dir}/scripts/debian/bitcore-bitcoind.service" "$deb_dir/etc/systemd/system/bitcore-bitcoind.service"
|
||||||
chmod -vR 0755 "$deb_dir/DEBIAN/"
|
chmod -vR 0755 "$deb_dir/DEBIAN/"
|
||||||
|
|
||||||
log_title "Copying Flocore"
|
log_title "Copying Bitcore"
|
||||||
|
|
||||||
app_dir="$deb_dir/usr/opt/flocore"
|
app_dir="$deb_dir/usr/opt/bitcore"
|
||||||
|
|
||||||
cp -v "${root_dir}/bin/flocored" "${app_dir}/bin/flocored"
|
cp -v "${root_dir}/bin/bitcored" "${app_dir}/bin/bitcored"
|
||||||
cp -v "${root_dir}/bin/flocore" "${app_dir}/bin/flocore"
|
cp -v "${root_dir}/bin/bitcore" "${app_dir}/bin/bitcore"
|
||||||
chmod -vR 0755 "${app_dir}/bin/flocore" "${app_dir}/bin/flocored"
|
chmod -vR 0755 "${app_dir}/bin/bitcore" "${app_dir}/bin/bitcored"
|
||||||
cp -v "${root_dir}/package.json" "${app_dir}"
|
cp -v "${root_dir}/package.json" "${app_dir}"
|
||||||
cp -v "${root_dir}/README.md" "${app_dir}"
|
cp -v "${root_dir}/README.md" "${app_dir}"
|
||||||
cp -v "${root_dir}/index.js" "${app_dir}"
|
cp -v "${root_dir}/index.js" "${app_dir}"
|
||||||
pushd "${deb_dir}/usr/bin"
|
pushd "${deb_dir}/usr/bin"
|
||||||
ln -vs "../opt/flocore/bin/flocore"
|
ln -vs "../opt/bitcore/bin/bitcore"
|
||||||
ln -vs "../opt/flocore/bin/flocored"
|
ln -vs "../opt/bitcore/bin/bitcored"
|
||||||
ln -vs "../opt/flocore/node_modules/.bin/florincoind" "flocore-florincoind"
|
ln -vs "../opt/bitcore/node_modules/.bin/bitcoind" "bitcore-bitcoind"
|
||||||
popd
|
popd
|
||||||
|
|
||||||
log_title "Installing Flocore Modules"
|
log_title "Installing Bitcore Modules"
|
||||||
pushd "${app_dir}"
|
pushd "${app_dir}"
|
||||||
VERIFY_BITCOIN_DOWNLOAD=1 npm install --production
|
VERIFY_BITCOIN_DOWNLOAD=1 npm install --production
|
||||||
echo "Cleanup Node.js addon binaries before packaging:"
|
echo "Cleanup Node.js addon binaries before packaging:"
|
||||||
find "${app_dir}" -type f -name '*.node' -print -delete
|
find "${app_dir}" -type f -name '*.node' -print -delete
|
||||||
find "${app_dir}" -type f -name '*.o' -print -delete
|
find "${app_dir}" -type f -name '*.o' -print -delete
|
||||||
echo "Cleanup intermediate files:"
|
echo "Cleanup intermediate files:"
|
||||||
rm -v "${deb_dir}/usr/opt/flocore/node_modules/flocore-node/bin/florincoin-0.12.1-linux64.tar.gz"
|
rm -v "${deb_dir}/usr/opt/bitcore/node_modules/bitcore-node/bin/bitcoin-0.12.1-linux64.tar.gz"
|
||||||
npm shrinkwrap --dev
|
npm shrinkwrap --dev
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
|||||||
24
scripts/debian/bitcore-bitcoind.conf
Normal file
24
scripts/debian/bitcore-bitcoind.conf
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
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
|
||||||
@ -1,18 +1,18 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Florincoin Core for Flocore
|
Description=Bitcoin Core for Bitcore
|
||||||
Requires=network.target
|
Requires=network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
WorkingDirectory=/usr/opt/flocore
|
WorkingDirectory=/usr/opt/bitcore
|
||||||
ExecStart=/usr/bin/flocore-florincoind -datadir=/home/flocore/.flocore/data/
|
ExecStart=/usr/bin/bitcore-bitcoind -datadir=/home/bitcore/.bitcore/data/
|
||||||
ExecReload=/bin/kill -HUP $MAINPID
|
ExecReload=/bin/kill -HUP $MAINPID
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=15
|
RestartSec=15
|
||||||
User=flocore
|
User=bitcore
|
||||||
ExecStartPre=/bin/mkdir -p /run/flocore
|
ExecStartPre=/bin/mkdir -p /run/bitcore
|
||||||
ExecStartPre=/bin/chown flocore:flocore /run/flocore
|
ExecStartPre=/bin/chown bitcore:bitcore /run/bitcore
|
||||||
ExecStartPre=/bin/chmod 755 /run/flocore
|
ExecStartPre=/bin/chmod 755 /run/bitcore
|
||||||
PermissionsStartOnly=true
|
PermissionsStartOnly=true
|
||||||
TimeoutStopSec=300
|
TimeoutStopSec=300
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
description "Flocore Daemon"
|
description "Bitcore Daemon"
|
||||||
author "BitPay, Inc."
|
author "BitPay, Inc."
|
||||||
|
|
||||||
limit nofile 20000 30000
|
limit nofile 20000 30000
|
||||||
@ -9,16 +9,16 @@ stop on runlevel [016]
|
|||||||
kill timeout 300
|
kill timeout 300
|
||||||
kill signal SIGINT
|
kill signal SIGINT
|
||||||
|
|
||||||
# user/group for flocore daemon to run as
|
# user/group for bitcore daemon to run as
|
||||||
setuid flocore
|
setuid bitcore
|
||||||
setgid flocore
|
setgid bitcore
|
||||||
|
|
||||||
# home dir of the flocore daemon user
|
# home dir of the bitcore daemon user
|
||||||
env HOME=/home/flocore
|
env HOME=/home/bitcore
|
||||||
|
|
||||||
respawn
|
respawn
|
||||||
respawn limit 5 15
|
respawn limit 5 15
|
||||||
|
|
||||||
script
|
script
|
||||||
exec flocored
|
exec bitcored
|
||||||
end script
|
end script
|
||||||
|
|||||||
@ -4,15 +4,15 @@ Requires=network.target
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
WorkingDirectory=/usr/opt/flocore
|
WorkingDirectory=/usr/opt/bitcore
|
||||||
ExecStart=/usr/opt/flocore/bin/flocored
|
ExecStart=/usr/opt/bitcore/bin/bitcored
|
||||||
ExecReload=/bin/kill -HUP $MAINPID
|
ExecReload=/bin/kill -HUP $MAINPID
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=15
|
RestartSec=15
|
||||||
User=flocore
|
User=bitcore
|
||||||
ExecStartPre=/bin/mkdir -p /run/flocore
|
ExecStartPre=/bin/mkdir -p /run/bitcore
|
||||||
ExecStartPre=/bin/chown flocore:flocore /run/flocore
|
ExecStartPre=/bin/chown bitcore:bitcore /run/bitcore
|
||||||
ExecStartPre=/bin/chmod 755 /run/flocore
|
ExecStartPre=/bin/chmod 755 /run/bitcore
|
||||||
PermissionsStartOnly=true
|
PermissionsStartOnly=true
|
||||||
TimeoutStopSec=300
|
TimeoutStopSec=300
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
Package: flocore
|
Package: bitcore
|
||||||
Version: {{ deb_package_version }}
|
Version: {{ deb_package_version }}
|
||||||
Section: base
|
Section: base
|
||||||
Priority: optional
|
Priority: optional
|
||||||
|
|||||||
@ -1,24 +0,0 @@
|
|||||||
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
|
|
||||||
@ -3,35 +3,35 @@ set -e
|
|||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
# add group
|
# add group
|
||||||
if ! getent group | grep -q "^flocore:" ; then
|
if ! getent group | grep -q "^bitcore:" ; then
|
||||||
echo "Creating system group: flocore"
|
echo "Creating system group: bitcore"
|
||||||
groupadd --system flocore
|
groupadd --system bitcore
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# add user
|
# add user
|
||||||
if ! getent passwd | grep -q "^flocore:"; then
|
if ! getent passwd | grep -q "^bitcore:"; then
|
||||||
echo "Creating flocore system user"
|
echo "Creating bitcore system user"
|
||||||
useradd --gid "flocore" --system -m flocore
|
useradd --gid "bitcore" --system -m bitcore
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# build nodejs addons
|
# build nodejs addons
|
||||||
cd "/usr/opt/flocore"
|
cd "/usr/opt/bitcore"
|
||||||
SKIP_BITCOIN_DOWNLOAD=1 npm rebuild
|
SKIP_BITCOIN_DOWNLOAD=1 npm rebuild
|
||||||
|
|
||||||
# setup data directory
|
# setup data directory
|
||||||
mkdir -p "/home/flocore/.flocore/data"
|
mkdir -p "/home/bitcore/.bitcore/data"
|
||||||
chown -R flocore:flocore "/home/flocore/.flocore"
|
chown -R bitcore:bitcore "/home/bitcore/.bitcore"
|
||||||
|
|
||||||
# start flocore
|
# start bitcore
|
||||||
if hash service 2> /dev/null; then
|
if hash service 2> /dev/null; then
|
||||||
service flocore start || echo "flocore could not be registered or started"
|
service bitcore start || echo "bitcore could not be registered or started"
|
||||||
elif hash start 2> /dev/null; then
|
elif hash start 2> /dev/null; then
|
||||||
start flocore || echo "flocore could not be registered or started"
|
start bitcore || echo "bitcore could not be registered or started"
|
||||||
elif hash systemctl 2> /dev/null; then
|
elif hash systemctl 2> /dev/null; then
|
||||||
{
|
{
|
||||||
systemctl enable "flocore.service" && \
|
systemctl enable "bitcore.service" && \
|
||||||
systemctl start "flocore.service"
|
systemctl start "bitcore.service"
|
||||||
} || echo "flocore could not be registered or started"
|
} || echo "bitcore could not be registered or started"
|
||||||
else
|
else
|
||||||
echo 'Your system does not appear to use upstart or systemd, so flocore could not be started'
|
echo 'Your system does not appear to use upstart or systemd, so bitcore could not be started'
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -4,11 +4,11 @@ set -e
|
|||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
if hash service 2> /dev/null; then
|
if hash service 2> /dev/null; then
|
||||||
service flocore stop || echo "flocore wasn't running!"
|
service bitcore stop || echo "bitcore wasn't running!"
|
||||||
elif hash stop 2> /dev/null; then
|
elif hash stop 2> /dev/null; then
|
||||||
stop "$service_name" || echo "flocore wasn't running!"
|
stop "$service_name" || echo "bitcore wasn't running!"
|
||||||
elif hash systemctl 2> /dev/null; then
|
elif hash systemctl 2> /dev/null; then
|
||||||
systemctl disable "flocore.service" || echo "flocore wasn't running!"
|
systemctl disable "bitcore.service" || echo "bitcore wasn't running!"
|
||||||
else
|
else
|
||||||
echo "Your system does not appear to use upstart or systemd, so flocore could not be stopped"
|
echo "Your system does not appear to use upstart or systemd, so bitcore could not be stopped"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -1,102 +0,0 @@
|
|||||||
#!/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
|
|
||||||
@ -1,253 +0,0 @@
|
|||||||
#!/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
|
|
||||||
|
|
||||||
@ -1,27 +1,27 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var should = require('chai').should();
|
var should = require('chai').should();
|
||||||
var flocore = require('../');
|
var bitcore = require('../');
|
||||||
|
|
||||||
describe('Library', function() {
|
describe('Library', function() {
|
||||||
it('should export primatives', function() {
|
it('should export primatives', function() {
|
||||||
should.exist(flocore.crypto);
|
should.exist(bitcore.crypto);
|
||||||
should.exist(flocore.encoding);
|
should.exist(bitcore.encoding);
|
||||||
should.exist(flocore.util);
|
should.exist(bitcore.util);
|
||||||
should.exist(flocore.errors);
|
should.exist(bitcore.errors);
|
||||||
should.exist(flocore.Address);
|
should.exist(bitcore.Address);
|
||||||
should.exist(flocore.Block);
|
should.exist(bitcore.Block);
|
||||||
should.exist(flocore.MerkleBlock);
|
should.exist(bitcore.MerkleBlock);
|
||||||
should.exist(flocore.BlockHeader);
|
should.exist(bitcore.BlockHeader);
|
||||||
should.exist(flocore.HDPrivateKey);
|
should.exist(bitcore.HDPrivateKey);
|
||||||
should.exist(flocore.HDPublicKey);
|
should.exist(bitcore.HDPublicKey);
|
||||||
should.exist(flocore.Networks);
|
should.exist(bitcore.Networks);
|
||||||
should.exist(flocore.Opcode);
|
should.exist(bitcore.Opcode);
|
||||||
should.exist(flocore.PrivateKey);
|
should.exist(bitcore.PrivateKey);
|
||||||
should.exist(flocore.PublicKey);
|
should.exist(bitcore.PublicKey);
|
||||||
should.exist(flocore.Script);
|
should.exist(bitcore.Script);
|
||||||
should.exist(flocore.Transaction);
|
should.exist(bitcore.Transaction);
|
||||||
should.exist(flocore.URI);
|
should.exist(bitcore.URI);
|
||||||
should.exist(flocore.Unit);
|
should.exist(bitcore.Unit);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user