Skip to content

Commit bed0702

Browse files
committed
Merge branch 'bitcore-documentation' of https://github.com/escottalexander/bitcore
2 parents 380870b + 373c00a commit bed0702

File tree

10 files changed

+217
-355
lines changed

10 files changed

+217
-355
lines changed

Contributing.md

+63-37
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,86 @@
1-
# Git Workflow
1+
# Submitting Issues
2+
## Bug Reports
23

3-
This project is a monorepo that uses lerna to link dependencies.
4+
A bug is a _demonstrable problem_ that is caused by the code in the repository.
5+
Good bug reports are extremely helpful - thank you!
46

5-
https://github.com/lerna/lerna
7+
Guidelines for bug reports:
68

7-
This mono repo should contain the commits from all of the packages.
9+
1. **Use the GitHub issue search** — Check if the issue has already been
10+
reported. If it already exists, consider leaving a comment with any extra clarifying
11+
details about your situation that might help us narrow in on the nature of the problem.
812

9-
Each package has it's own repo.
13+
2. **Check if the issue has already been fixed** — In the event that you are don't
14+
have the latest, try to reproduce it using the latest changes in the `master` branch.
1015

11-
## Packages
16+
3. **Submit a clear and detailed issue** — Please try to be as detailed as possible
17+
in your report. Please include the following:
18+
- Your environment, OS and/or browsers facing the issue
19+
- Steps to reproduce the issue
20+
- Specific errors thrown, stack trace etc.
21+
- The behaviour you expect vs what it's doing
1222

13-
Each package is in the packages directory.
1423

15-
Code changes that touch multiple modules should be done on the bitcore repo.
16-
This way one branch can update multiple modules.
24+
## Feature Requests
1725

18-
Lengthy developments on a single package should be done on that package's repo.
19-
Once the package is at a good point, it should be merged into the monorepo
26+
Feature requests are welcome. But take a moment to find out whether your idea
27+
fits with the scope and aims of the project. It's up to *you* to make a strong
28+
case to convince the project's developers of the merits of this feature. Please
29+
provide as much detail and context as possible.
2030

21-
## Updating Packages From Their Own Repo
2231

23-
The monorepo packages can be updated via git subtrees, then submitted to the bitcore repo as a MR
32+
# Contributing Code
2433

25-
Example:
34+
Good pull requests - patches, improvements, new features - are a fantastic
35+
help. They should remain focused in scope and avoid containing unrelated
36+
commits.
2637

27-
```sh
28-
git co -b feature/bitcore-node-update
29-
git subtree pull --prefix=packages/bitcore-node git@github.com:bitpay/bitcore-node.git branchToPull
30-
git push -u origin feature/bitcore-node-update
31-
# Create MR from origin:feature/bitcore-node-update to upstream:bitcore
32-
```
38+
Please adhere to the coding conventions used throughout this monorepo (indentation,
39+
accurate comments, etc.) and any other requirements (such as test coverage).
3340

34-
## Updating Repos from Bitcore Package
41+
Follow this process:
3542

36-
Changes to the mono repo can be pushed to the package repo.
43+
1. [Fork](http://help.github.com/fork-a-repo/) the project, clone your fork,
44+
and configure the remotes:
3745

38-
```sh
39-
git subtree push --prefix=packages/bitcore-node git@github.com:micahriggan/bitcore-node.git branchToPush
40-
```
46+
```bash
47+
# Clone your fork of the repo into the current directory
48+
git clone https://github.com/<your-username>/bitcore
49+
# Navigate to the newly cloned directory
50+
cd bitcore
51+
# Assign the original repo to a remote called "upstream"
52+
git remote add upstream https://github.com/bitpay/bitcore
53+
```
4154

42-
## Adding New Packages from Existing Repos
55+
2. If you cloned a while ago, get the latest changes from upstream:
4356

44-
Packages can be added via Lerna or via git subtrees.
57+
```bash
58+
git checkout master
59+
git pull upstream master
60+
```
4561

46-
```sh
47-
lerna import ~/somedir/path-to-bitcore-repo --flatten
48-
# OR
49-
git subtree add --prefix=packages/bitcore-repo-to-add git@github.com:bitpay/bitcore-repo-to-add.git branchToAdd
50-
```
62+
3. Create a new feature branch (off the `master` branch) to
63+
contain your feature, change, or fix:
5164

52-
This will merge all of the commits into the bitcore history
65+
```bash
66+
git checkout -b <feature-branch-name>
67+
```
5368

54-
## Dev Dependencies
69+
4. Write code and commit your changes in logical chunks.
5570

56-
Dev dependencies that are used on multiple packages can be hoisted to the top-level
71+
5. Locally merge (or rebase) the upstream `master` branch into your feature branch:
72+
73+
```bash
74+
git pull [--rebase] upstream master
75+
```
76+
77+
6. Push your feature branch up to your fork:
78+
79+
```bash
80+
git push origin <feature-branch-name>
81+
```
82+
83+
7. [Open a Merge Request](https://help.github.com/articles/using-pull-requests/)
84+
with a clear title and description from your fork to the base repository (bitpay/bitcore - master).
5785

58-
Linters, formatters, and other standards can be defined top-level for the monorepo
5986

60-
This allows reuse of eslint/tslint/prettier standards for all projects.

README.md

+11-158
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# Bitcore
2-
3-
1+
# Bitcore Monorepo
42

53
<p align="center">
64
<img alt="npm" src="https://img.shields.io/npm/v/bitcore-lib">
@@ -11,158 +9,8 @@
119
<img src="https://circleci.com/gh/bitpay/bitcore.svg?style=shield" alt="master build">
1210
</p>
1311

14-
15-
1612
**Infrastructure to build Bitcoin and blockchain-based applications for the next generation of financial technology.**
1713

18-
## Getting Started
19-
20-
### Requirements
21-
22-
- Trusted P2P Peer
23-
- MongoDB Server >= v3.4
24-
- make g++ gcc
25-
26-
### Checkout the repo
27-
28-
29-
```sh
30-
git clone git@github.com:bitpay/bitcore.git
31-
git checkout master
32-
npm install
33-
```
34-
35-
## Setup Guide
36-
37-
### 1. Setup Bitcore config
38-
39-
<details>
40-
<summary>Example bitcore.config.json</summary>
41-
<br>
42-
43-
```json
44-
{
45-
"bitcoreNode": {
46-
"chains": {
47-
"BTC": {
48-
"mainnet": {
49-
"chainSource": "p2p",
50-
"trustedPeers": [
51-
{
52-
"host": "127.0.0.1",
53-
"port": 20008
54-
}
55-
],
56-
"rpc": {
57-
"host": "127.0.0.1",
58-
"port": 20009,
59-
"username": "username",
60-
"password": "password"
61-
}
62-
},
63-
"regtest": {
64-
"chainSource": "p2p",
65-
"trustedPeers": [
66-
{
67-
"host": "127.0.0.1",
68-
"port": 20020
69-
}
70-
],
71-
"rpc": {
72-
"host": "127.0.0.1",
73-
"port": 20021,
74-
"username": "username",
75-
"password": "password"
76-
}
77-
}
78-
},
79-
"BCH": {
80-
"mainnet": {
81-
"parentChain": "BTC",
82-
"forkHeight": 478558,
83-
"trustedPeers": [
84-
{
85-
"host": "127.0.0.1",
86-
"port": 30008
87-
}
88-
],
89-
"rpc": {
90-
"host": "127.0.0.1",
91-
"port": 30009,
92-
"username": "username",
93-
"password": "password"
94-
}
95-
},
96-
"regtest": {
97-
"chainSource": "p2p",
98-
"trustedPeers": [
99-
{
100-
"host": "127.0.0.1",
101-
"port": 30020
102-
}
103-
],
104-
"rpc": {
105-
"host": "127.0.0.1",
106-
"port": 30021,
107-
"username": "username",
108-
"password": "password"
109-
}
110-
}
111-
}
112-
}
113-
}
114-
}
115-
```
116-
117-
</details>
118-
119-
### 2. Setup Bitcoin Node
120-
121-
<details>
122-
<summary>Example Bitcoin Mainnet Config</summary>
123-
124-
```sh
125-
whitelist=127.0.0.1
126-
txindex=0
127-
listen=1
128-
server=1
129-
irc=1
130-
upnp=1
131-
132-
# Make sure port & rpcport matches the
133-
# bitcore.config.json ports for BTC mainnet
134-
135-
# if using Bitcoin Core v0.17+ prefix
136-
# [main]
137-
138-
port=20008
139-
rpcport=20009
140-
rpcallowip=127.0.0.1
141-
142-
rpcuser=username
143-
rpcpassword=password
144-
```
145-
146-
</details>
147-
148-
### 3. Run Bitcoin node
149-
150-
<details>
151-
<summary>Example Starting a Bitcoin Node</summary>
152-
153-
```sh
154-
# Path to your bitcoin application and path to the config above
155-
/Applications/Bitcoin-Qt.app/Contents/MacOS/Bitcoin-Qt -datadir=/Users/username/blockchains/bitcoin-core/networks/mainnet/
156-
```
157-
158-
</details>
159-
160-
### 4. Start Bitcore
161-
162-
```sh
163-
npm run node
164-
```
165-
16614
## Applications
16715

16816
- [Bitcore Node](packages/bitcore-node) - A full node with extended capabilities using Bitcoin Core
@@ -176,12 +24,15 @@ npm run node
17624

17725
- [Bitcore Channel](https://github.com/bitpay/bitcore-channel) - Micropayment channels for rapidly adjusting bitcoin transactions
17826
- [Bitcore ECIES](https://github.com/bitpay/bitcore-ecies) - Uses ECIES symmetric key negotiation from public keys to encrypt arbitrarily long data streams
179-
- [Bitcore Lib](packages/bitcore-lib) - A pure and powerful JavaScript Bitcoin library
180-
- [Bitcore Lib Cash](packages/bitcore-lib-cash) - A pure and powerful JavaScript Bitcoin Cash library
27+
- [Bitcore Lib](packages/bitcore-lib) - A powerful JavaScript library for Bitcoin
28+
- [Bitcore Lib Cash](packages/bitcore-lib-cash) - A powerful JavaScript library for Bitcoin Cash
29+
- [Bitcore Lib Doge](packages/bitcore-lib-doge) - A powerful JavaScript library for Dogecoin
30+
- [Bitcore Lib Litecoin](packages/bitcore-lib-ltc) - A powerful JavaScript library for Litecoin
18131
- [Bitcore Message](https://github.com/bitpay/bitcore-message) - Bitcoin message verification and signing
18232
- [Bitcore Mnemonic](packages/bitcore-mnemonic) - Implements mnemonic code for generating deterministic keys
183-
- [Bitcore P2P](packages/bitcore-p2p) - The peer-to-peer networking protocol for BTC
184-
- [Bitcore P2P Cash](packages/bitcore-p2p-cash) - The peer-to-peer networking protocol for BCH
33+
- [Bitcore P2P](packages/bitcore-p2p) - The peer-to-peer networking protocol for Bitcoin
34+
- [Bitcore P2P Cash](packages/bitcore-p2p-cash) - The peer-to-peer networking protocol for Bitcoin Cash
35+
- [Bitcore P2P Doge](packages/bitcore-p2p-doge) **DEPRECATED**[^1] - The peer-to-peer networking protocol for Dogecoin
18536
- [Crypto Wallet Core](packages/crypto-wallet-core) - A coin-agnostic wallet library for creating transactions, signing, and address derivation
18637

18738
## Extras
@@ -197,4 +48,6 @@ See [CONTRIBUTING.md](https://github.com/bitpay/bitcore/blob/master/Contributing
19748

19849
Code released under [the MIT license](https://github.com/bitpay/bitcore/blob/master/LICENSE).
19950

200-
Copyright 2013-2019 BitPay, Inc. Bitcore is a trademark maintained by BitPay, Inc.
51+
Copyright 2013-2022 BitPay, Inc. Bitcore is a trademark maintained by BitPay, Inc.
52+
53+
[^1]: The Bitcore P2P Doge library is no longer maintained as all the core functionality is contained in Bitcore P2P

0 commit comments

Comments
 (0)