From 16416357a2f51fe77d984a3c0fa46c160497e71e Mon Sep 17 00:00:00 2001 From: OstlerDev Date: Mon, 15 Jan 2018 16:27:33 -0800 Subject: [PATCH] Near unrestrained btc -> flo --- .vscode/launch.json | 4 +- CONTRIBUTING.md | 34 ++++++------- Dockerfile | 12 ++--- LICENSE | 8 +-- README.md | 68 ++++++++++++------------- bin/{bitcore => flocore} | 6 +-- bin/{bitcored => flocored} | 6 +-- bower.json | 12 ++--- gulpfile.js | 4 +- index.js | 4 +- package-lock.json | 46 ++++++++--------- package.json | 21 ++++---- scripts/build-deb | 38 +++++++------- scripts/debian/bitcore-bitcoind.conf | 24 --------- scripts/debian/bitcore-bitcoind.service | 14 ++--- scripts/debian/bitcore.conf | 14 ++--- scripts/debian/bitcore.service | 12 ++--- scripts/debian/control | 2 +- scripts/debian/flocore-florincoind.conf | 24 +++++++++ scripts/debian/postinst | 32 ++++++------ scripts/debian/prerm | 8 +-- scripts/deploy.sh | 12 ++--- scripts/tag-and-release.sh | 30 +++++------ test/index.js | 38 +++++++------- 24 files changed, 237 insertions(+), 236 deletions(-) rename bin/{bitcore => flocore} (57%) rename bin/{bitcored => flocored} (58%) delete mode 100644 scripts/debian/bitcore-bitcoind.conf create mode 100644 scripts/debian/flocore-florincoind.conf diff --git a/.vscode/launch.json b/.vscode/launch.json index 2bbf66c..710c97b 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -5,8 +5,8 @@ { "type": "node", "request": "launch", - "name": "bitcored", - "program": "${workspaceRoot}/bin/bitcored" + "name": "flocored", + "program": "${workspaceRoot}/bin/flocored" } ] } diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5bdadfe..95defcb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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! diff --git a/Dockerfile b/Dockerfile index f6510b7..b005262 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 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" diff --git a/LICENSE b/LICENSE index af14a12..1ac6894 100644 --- a/LICENSE +++ b/LICENSE @@ -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 -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 diff --git a/README.md b/README.md index b3fc13b..e738e6a 100644 --- a/README.md +++ b/README.md @@ -1,81 +1,81 @@ -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 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 ``` 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`. 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: - @gabegattis: https://pgp.mit.edu/pks/lookup?op=get&search=0x441430987182732C `F3EA 8E28 29B4 EC93 88CB B0AA 4414 3098 7182 732C` @@ -84,6 +84,6 @@ To verify signatures, use the following PGP keys: ## 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-2017 BitPay, Inc. Bitcore is a trademark maintained by BitPay, Inc. +Copyright 2013-2017 BitPay, Inc. Flocore is a trademark maintained by BitPay, Inc. diff --git a/bin/bitcore b/bin/flocore similarity index 57% rename from bin/bitcore rename to bin/flocore index 631d2ce..f9c7a9a 100755 --- a/bin/bitcore +++ b/bin/flocore @@ -1,11 +1,11 @@ #!/usr/bin/env node if (parseInt(process.version.split('.')[0].slice(1)) < 8) { - throw new Error('Bitcore requires Node version 8 or higher.'); + throw new Error('Flocore requires Node version 8 or higher.'); } -var bitcore = require('bitcore-node/lib/cli/bitcore'); +var flocore = require('flocore-node/lib/cli/flocore'); var path = require('path'); var servicesPath = path.resolve(__dirname, '../'); var additionalServices = ['insight-api', 'insight-ui']; -bitcore(servicesPath, additionalServices); +flocore(servicesPath, additionalServices); diff --git a/bin/bitcored b/bin/flocored similarity index 58% rename from bin/bitcored rename to bin/flocored index 0e4dc14..5b0ffd2 100755 --- a/bin/bitcored +++ b/bin/flocored @@ -3,11 +3,11 @@ 'use strict'; if (parseInt(process.version.split('.')[0].slice(1)) < 8) { - throw new Error('Bitcore requires Node version 8 or higher.'); + throw new Error('Flocore requires Node version 8 or higher.'); } var path = require('path'); -var bitcored = require('bitcore-node/lib/cli/bitcored'); +var flocored = require('flocore-node/lib/cli/flocored'); var servicesPath = path.resolve(__dirname, '../'); var additionalServices = ['insight-api', 'insight-ui']; -bitcored(servicesPath, additionalServices); +flocored(servicesPath, additionalServices); diff --git a/bower.json b/bower.json index 2909312..3e00aa4 100644 --- a/bower.json +++ b/bower.json @@ -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" ], diff --git a/gulpfile.js b/gulpfile.js index a22eb1c..1512e32 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,5 +1,5 @@ -var bitcoreTasks = require('bitcore-build'); +var flocoreTasks = require('flocore-build'); -bitcoreTasks(); +flocoreTasks(); diff --git a/index.js b/index.js index c5f05c5..99dc2f4 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,5 @@ 'use strict'; -var bitcore = require('bitcore-lib'); +var flocore = require('flocore-lib'); -module.exports = bitcore; +module.exports = flocore; diff --git a/package-lock.json b/package-lock.json index de2f3df..70d87e3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "bitcore", + "name": "flocore", "version": "5.0.0-beta.44", "lockfileVersion": 1, "requires": true, @@ -326,14 +326,14 @@ "safe-buffer": "5.1.1" } }, - "bitcoind-rpc": { + "florincoind-rpc": { "version": "0.6.0", - "resolved": "https://registry.npmjs.org/bitcoind-rpc/-/bitcoind-rpc-0.6.0.tgz", + "resolved": "https://registry.npmjs.org/florincoind-rpc/-/florincoind-rpc-0.6.0.tgz", "integrity": "sha1-sRMsBNzc5tNT1SDI8C3a+PmB+zQ=" }, - "bitcore-lib": { + "flocore-lib": { "version": "5.0.0-beta.1", - "resolved": "https://registry.npmjs.org/bitcore-lib/-/bitcore-lib-5.0.0-beta.1.tgz", + "resolved": "https://registry.npmjs.org/flocore-lib/-/flocore-lib-5.0.0-beta.1.tgz", "integrity": "sha512-y8aCkNJQieCPacLpW9wdg6Un2iAC/5Nt7g/lRHhK6PwrXw7dxXwc7eZOd87oPGn6bAd4jBd8YTCqIqwpf3UQsA==", "requires": { "bn.js": "2.0.4", @@ -397,9 +397,9 @@ } } }, - "bitcore-lib-cash": { + "flocore-lib-cash": { "version": "0.15.1", - "resolved": "https://registry.npmjs.org/bitcore-lib-cash/-/bitcore-lib-cash-0.15.1.tgz", + "resolved": "https://registry.npmjs.org/flocore-lib-cash/-/flocore-lib-cash-0.15.1.tgz", "integrity": "sha512-2fftReEqbkohCwiblBGteEX5S7lc6oTGM1QyDr6rz88QA7xLqhtVkT9hWrwirZfw6H4IfApS2gAAtHGExCqMsw==", "requires": { "bn.js": "4.11.8", @@ -410,17 +410,17 @@ "lodash": "4.17.4" } }, - "bitcore-message": { + "flocore-message": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/bitcore-message/-/bitcore-message-1.0.4.tgz", + "resolved": "https://registry.npmjs.org/flocore-message/-/flocore-message-1.0.4.tgz", "integrity": "sha1-QMJHnRtPvcUboKbvF6RqfA5ImFM=", "requires": { - "bitcore-lib": "0.13.19" + "flocore-lib": "0.13.19" }, "dependencies": { - "bitcore-lib": { + "flocore-lib": { "version": "0.13.19", - "resolved": "https://registry.npmjs.org/bitcore-lib/-/bitcore-lib-0.13.19.tgz", + "resolved": "https://registry.npmjs.org/flocore-lib/-/flocore-lib-0.13.19.tgz", "integrity": "sha1-SK8em9oQBnwasWJjRyta3SAA89w=", "requires": { "bn.js": "2.0.4", @@ -486,16 +486,16 @@ } } }, - "bitcore-node": { + "flocore-node": { "version": "5.0.0-beta.44", - "resolved": "https://registry.npmjs.org/bitcore-node/-/bitcore-node-5.0.0-beta.44.tgz", + "resolved": "https://registry.npmjs.org/flocore-node/-/flocore-node-5.0.0-beta.44.tgz", "integrity": "sha512-WQ3moUNzfyxi/lKspaB5yWhmAzuBMAoEs2RBC4eXGu/SbrQQoUsHFy5ZqOWKLHueZEDlIX4WtsD0OBlQYfYQpw==", "requires": { "async": "2.5.0", "bcoin": "github:bitpay/bcoin#46ecd2c4ed3b7fbcadd9cfe10b0f5d64e4c5088d", - "bitcoind-rpc": "0.6.0", - "bitcore-lib": "5.0.0-beta.1", - "bitcore-p2p": "5.0.0-beta.1", + "florincoind-rpc": "0.6.0", + "flocore-lib": "5.0.0-beta.1", + "flocore-p2p": "5.0.0-beta.1", "bn.js": "4.11.8", "body-parser": "1.17.2", "colors": "1.1.2", @@ -621,13 +621,13 @@ } } }, - "bitcore-p2p": { + "flocore-p2p": { "version": "5.0.0-beta.1", - "resolved": "https://registry.npmjs.org/bitcore-p2p/-/bitcore-p2p-5.0.0-beta.1.tgz", + "resolved": "https://registry.npmjs.org/flocore-p2p/-/flocore-p2p-5.0.0-beta.1.tgz", "integrity": "sha512-PePFFuPmrHIr4G7IHWAcFge8jo0PvXvaDS9DYGP3EYLeoYT0SQ5d4UtHIGCOrc4xdn7XaibiuMkHlv6PNCpLaw==", "requires": { "bcoin": "github:bcoin-org/bcoin#886008a1822ce1da7fa8395ee7db4bcc1750a28a", - "bitcore-lib": "5.0.0-beta.1", + "flocore-lib": "5.0.0-beta.1", "bloom-filter": "0.2.0", "buffers": "github:bitpay/node-buffers#04f4c4264e0d105db2b99b786843ed64f23230d8", "socks5-client": "0.3.6" @@ -1673,9 +1673,9 @@ "JSONStream": "1.3.1", "async": "2.5.0", "bcoin": "github:bcoin-org/bcoin#886008a1822ce1da7fa8395ee7db4bcc1750a28a", - "bitcore-lib": "5.0.0-beta.1", - "bitcore-lib-cash": "0.15.1", - "bitcore-message": "1.0.4", + "flocore-lib": "5.0.0-beta.1", + "flocore-lib-cash": "0.15.1", + "flocore-message": "1.0.4", "body-parser": "1.17.2", "compression": "1.7.0", "lodash": "2.4.2", diff --git a/package.json b/package.json index 290c30b..f0bdc24 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { - "name": "bitcore", + "name": "flocore", "version": "5.0.0-beta.44", - "description": "A platform to build bitcoin and blockchain-based applications.", + "description": "A platform to build Florincoin and blockchain-based applications.", "engines": { "node": ">=8.0.0" }, @@ -12,11 +12,12 @@ "build-deb": "./scripts/build-deb" }, "bin": { - "bitcore": "./bin/bitcore", - "bitcored": "./bin/bitcored" + "flocore": "./bin/flocore", + "flocored": "./bin/flocored" }, "keywords": [ - "bitcoin", + "flo", + "florincoin", "transaction", "address", "p2p", @@ -33,13 +34,13 @@ ], "repository": { "type": "git", - "url": "https://github.com/bitpay/bitcore.git" + "url": "https://github.com/oipwg/flocore.git" }, "dependencies": { - "bitcore-lib": "5.0.0-beta.1", - "bitcore-node": "5.0.0-beta.44", - "insight-api": "5.0.0-beta.44", - "insight-ui": "bitpay/insight#v5.0.0-beta.44" + "flocore-lib": "5.0.0-beta.1", + "flocore-node": "5.0.0-beta.44", + "flosight-api": "5.0.0-beta.44", + "flosight-ui": "bitpay/insight#v5.0.0-beta.44" }, "license": "MIT", "devDependencies": { diff --git a/scripts/build-deb b/scripts/build-deb index 162ebfc..b71bc74 100755 --- a/scripts/build-deb +++ b/scripts/build-deb @@ -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 diff --git a/scripts/debian/bitcore-bitcoind.conf b/scripts/debian/bitcore-bitcoind.conf deleted file mode 100644 index b07bccb..0000000 --- a/scripts/debian/bitcore-bitcoind.conf +++ /dev/null @@ -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 diff --git a/scripts/debian/bitcore-bitcoind.service b/scripts/debian/bitcore-bitcoind.service index 8c1ab19..13bacf5 100644 --- a/scripts/debian/bitcore-bitcoind.service +++ b/scripts/debian/bitcore-bitcoind.service @@ -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 diff --git a/scripts/debian/bitcore.conf b/scripts/debian/bitcore.conf index a534786..1028466 100644 --- a/scripts/debian/bitcore.conf +++ b/scripts/debian/bitcore.conf @@ -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 diff --git a/scripts/debian/bitcore.service b/scripts/debian/bitcore.service index dc83ed6..00e836b 100644 --- a/scripts/debian/bitcore.service +++ b/scripts/debian/bitcore.service @@ -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 diff --git a/scripts/debian/control b/scripts/debian/control index 8ad6825..990dd32 100644 --- a/scripts/debian/control +++ b/scripts/debian/control @@ -1,4 +1,4 @@ -Package: bitcore +Package: flocore Version: {{ deb_package_version }} Section: base Priority: optional diff --git a/scripts/debian/flocore-florincoind.conf b/scripts/debian/flocore-florincoind.conf new file mode 100644 index 0000000..e7105b4 --- /dev/null +++ b/scripts/debian/flocore-florincoind.conf @@ -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 diff --git a/scripts/debian/postinst b/scripts/debian/postinst index 63ec2eb..142df1a 100644 --- a/scripts/debian/postinst +++ b/scripts/debian/postinst @@ -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 diff --git a/scripts/debian/prerm b/scripts/debian/prerm index 23bbee6..76ec6cf 100644 --- a/scripts/debian/prerm +++ b/scripts/debian/prerm @@ -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 diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 0c89453..0150c26 100644 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -8,7 +8,7 @@ process=false ######################################## -# deploys latest bitcore to application servers over ssh +# deploys latest flocore to application servers over ssh if [ -z "${1}" ]; then echo 'no server file given, exiting.' @@ -37,15 +37,15 @@ function execCmd() { function deploy () { # stop the server - cmd="sudo service bitcored stop" + cmd="sudo service flocored stop" execCmd - # run npm install -g bitcore@beta - cmd="sudo su - bitcore -c 'npm install -g bitcore@beta'" + # run npm install -g flocore@beta + cmd="sudo su - flocore -c 'npm install -g flocore@beta'" execCmd # start server - cmd="sudo service bitcored start" + cmd="sudo service flocored start" execCmd } @@ -87,7 +87,7 @@ while IFS='' read -r server || [[ -n "$server" ]]; do if [ -z "${logType}" ]; then logCmd="sudo journalctl -f" else - logCmd="sudo tail -f /var/log/upstart/bitcored_testnet_new.log" + logCmd="sudo tail -f /var/log/upstart/flocored_testnet_new.log" fi sshCmd="${ssh}${port} ${host} " diff --git a/scripts/tag-and-release.sh b/scripts/tag-and-release.sh index 2c89c46..ebcb3fb 100644 --- a/scripts/tag-and-release.sh +++ b/scripts/tag-and-release.sh @@ -5,8 +5,8 @@ set -e insightApiDir="${HOME}/source/insight-api" insightUIDir="${HOME}/source/insight-ui" -bitcoreDir="${HOME}/source/bitcore" -bitcoreNodeDir="${HOME}/source/bitcore-node" +flocoreDir="${HOME}/source/flocore" +flocoreNodeDir="${HOME}/source/flocore-node" ########################################################### @@ -17,7 +17,7 @@ bump_version () { } set_deps () { - sed -i '' -e "s/\"bitcore-node\"\: .*$/\"bitcore-node\"\: \"${shortTag}\",/g" package.json + 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 } @@ -33,13 +33,13 @@ fi ############################################# -# bitcore-node +# flocore-node ############################################# -function bitcoreNode() { +function flocoreNode() { echo "" - echo "Starting with bitcore-node..." + echo "Starting with flocore-node..." sleep 2 - pushd "${bitcoreNodeDir}" + pushd "${flocoreNodeDir}" sudo rm -fr node_modules bump_version @@ -58,7 +58,7 @@ function bitcoreNode() { fi echo "" - echo "Committing changes for bitcore-node..." + echo "Committing changes for flocore-node..." sleep 2 git commit -S @@ -183,13 +183,13 @@ function insightUi() { } ############################################# -# bitcore +# flocore ############################################# -function bitcore() { +function flocore() { echo "" - echo "Releasing bitcore..." + echo "Releasing flocore..." sleep 2 - pushd "${bitcoreDir}" + pushd "${flocoreDir}" sudo rm -fr node_modules bump_version @@ -210,7 +210,7 @@ function bitcore() { fi echo "" - echo "Committing changes for bitcore..." + echo "Committing changes for flocore..." sleep 2 git commit -S @@ -243,10 +243,10 @@ echo "Assuming projects at ${HOME}/source..." releases="${2}" if [ -z "${releases}" ]; then - bitcoreNode + flocoreNode insightApi insightUi - bitcore + flocore else eval "${releases}" fi diff --git a/test/index.js b/test/index.js index 375244f..d563815 100644 --- a/test/index.js +++ b/test/index.js @@ -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); }); });