Skip to content

Commit 81ef6ba

Browse files
committed
chore: add housekeeping files
1 parent 8789d95 commit 81ef6ba

24 files changed

+632
-200
lines changed

.github/FUNDING.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# These are supported funding model platforms
22

3-
github: [dr-orlovsky]
3+
github: [lnp-bp, RGB-WG, dr-orlovsky]

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
**/*.rs.bk
77

88
.idea
9-
.vscode
109

1110
*.swp
1211

.rustfmt.toml

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
1+
edition = "2021"
2+
version = "Two"
3+
14
max_width = 100
25
array_width = 100
36
attr_fn_like_width = 100
4-
comment_width = 100
5-
single_line_if_else_max_width = 100
7+
fn_call_width = 100
68

79
format_code_in_doc_comments = true
810
fn_single_line = true
911
format_macro_matchers = true
10-
format_strings = false
12+
format_macro_bodues = true
13+
format_strings = true
1114
merge_derives = false
1215
overflow_delimited_expr = true
1316
reorder_modules = false
1417
use_field_init_shorthand = true
1518
use_try_shorthand = true
16-
wrap_comments = false
19+
wrap_comments = true
1720
where_single_line = true
1821
unstable_features = true
22+
empty_item_single_line = true
23+
24+
binop_separator = "Back"
1925

20-
license_template_path = "license_header"
2126
imports_granularity = "Module"
2227
group_imports = "StdExternalCrate"

CODE_OF_CONDUCT.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ participation.
1515
Actions within the technical scope of the project (code quality, spamming etc),
1616
as well as interaction with other maintainers and contributors of course is
1717
a factor of the access to the project development and lifecycle. The decision in
18-
these cases will be maid by the project maintainers, with the right of veto or
18+
these cases will be made by the project maintainers, with the right of veto or
1919
overriding vote reserved for the original project author, Maxim Orlovsky.

CONTRIBUTING.md

+100-88
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,35 @@
1-
Contributing to LNP/BP projects
2-
===============================
1+
Contributing guidelines
2+
=======================
33

4-
:+1::tada:
5-
First and foremost, thanks for taking the time to contribute!
6-
:tada::+1:
7-
8-
The following is a set of guidelines for contributing to [LNP/BP Standards
9-
Association](https://lnp-bp.org) projects, which are hosted in the GitHub
10-
organizations listed in [readme](https://github.com/LNP-BP#Working-groups).
11-
These are mostly guidelines, not rules. Use your best judgment, and feel free to
12-
propose changes to this document in a pull request.
4+
Contributions are very welcome. When contributing code, please follow these
5+
simple guidelines.
136

147
#### Table Of Contents
15-
- [General](#general)
16-
- [Communication channels](#communication-channels)
17-
- [Asking questions](#asking-questions)
188
- [Contribution workflow](#contribution-workflow)
9+
* [Proposing changes](#proposing-changes)
1910
* [Preparing PRs](#preparing-prs)
2011
* [Peer review](#peer-review)
2112
- [Coding conventions](#coding-conventions)
2213
- [Security](#security)
2314
- [Testing](#testing)
2415
- [Going further](#going-further)
2516

17+
Overview
18+
--------
2619

27-
General
28-
-------
29-
The LNP/BP projects operate an open contributor model where anyone is welcome to
30-
contribute towards development in the form of peer review, documentation,
31-
testing and patches.
32-
33-
Anyone is invited to contribute without regard to technical experience,
34-
"expertise", OSS experience, age, or other concern. However, the development of
35-
standards & reference implementations demands a high-level of rigor, adversarial
36-
thinking, thorough testing and risk-minimization. Any bug may cost users real
37-
money. That being said, we deeply welcome people contributing for the first time
38-
to an open source project or pick up Rust while contributing. Don't be shy,
39-
you'll learn.
40-
41-
Communications Channels
42-
-----------------------
43-
Communication about LNP/BP standards & implementations happens primarily
44-
on #lnp-pb IRC chat on Freenode with the logs available at
45-
<http://gnusha.org/lnp-bp/>
46-
47-
Discussion about code base improvements happens in GitHub issues and on pull
48-
requests.
49-
50-
Major projects are tracked [here](https://github.com/orgs/LNP-BP/projects).
51-
Project roadmap is tracked in each repository GitHub milestones.
20+
* Before adding any code dependencies, check with the maintainers if this is okay.
21+
* Write properly formatted comments: they should be English sentences, eg:
5222

53-
Asking Questions
54-
----------------
55-
> **Note:** Please don't file an issue to ask a question. Each repository - or
56-
> GitHub organization has a "Discussions" with Q&A section; please post your
57-
> questions there. You'll get faster results by using this channel.
23+
// Return the current UNIX time.
5824

59-
Alternatively, we have a dedicated developer channel on IRC, #[email protected]
60-
where you may get helpful advice if you have questions.
25+
* Read the DCO and make sure all commits are signed off, using `git commit -s`.
26+
* Follow the guidelines when proposing code changes (see below).
27+
* Write properly formatted git commits (see below).
28+
* Run the tests with `cargo test --workspace --all-features`.
29+
* Make sure you run `rustfmt` on your code (see below details).
30+
* Please don't file an issue to ask a question. Each repository - or
31+
GitHub organization has a "Discussions" with Q&A section; please post your
32+
questions there. You'll get faster results by using this channel.
6133

6234
Contribution Workflow
6335
---------------------
@@ -67,39 +39,49 @@ facilitates social contribution, easy testing and peer review.
6739

6840
To contribute a patch, the workflow is a as follows:
6941

70-
1. Fork Repository
71-
2. Create topic branch
72-
3. Commit patches
42+
1. Fork Repository
43+
2. Create topic branch
44+
3. Commit patches
7345

74-
In general commits should be atomic and diffs should be easy to read. For this
75-
reason do not mix any formatting fixes or code moves with actual code changes.
76-
Further, each commit, individually, should compile and pass tests, in order to
46+
In general commits should be atomic and diffs should be easy to read. For this
47+
reason do not mix any formatting fixes or code moves with actual code changes.
48+
Further, each commit, individually, should compile and pass tests, in order to
7749
ensure git bisect and other automated tools function properly.
7850

79-
When adding a new feature thought must be given to the long term technical debt.
51+
When adding a new feature thought must be given to the long term technical debt.
8052
Every new features should be covered by unit tests.
8153

8254
When refactoring, structure your PR to make it easy to review and don't hesitate
8355
to split it into multiple small, focused PRs.
8456

85-
The Minimal Supported Rust Version is nightly for the period of active
86-
development; it is enforced by our Travis. Later we plan to fix to some specific
87-
Rust version after the initial library release.
88-
8957
Commits should cover both the issue fixed and the solution's rationale.
90-
These [guidelines](https://chris.beams.io/posts/git-commit/) should be kept in
58+
These [guidelines](https://chris.beams.io/posts/git-commit/) should be kept in
9159
mind.
9260

93-
To facilitate communication with other contributors, the project is making use
94-
of GitHub's "assignee" field. First check that no one is assigned and then
95-
comment suggesting that you're working on it. If someone is already assigned,
96-
don't hesitate to ask if the assigned party or previous commenters are still
61+
To facilitate communication with other contributors, the project is making use
62+
of GitHub's "assignee" field. First check that no one is assigned and then
63+
comment suggesting that you're working on it. If someone is already assigned,
64+
don't hesitate to ask if the assigned party or previous commenters are still
9765
working on it if it has been awhile.
9866

67+
### Proposing changes
68+
69+
When proposing changes via a pull-request or patch:
70+
71+
* Isolate changes in separate commits to make the review process easier.
72+
* Don't make unrelated changes, unless it happens to be an obvious improvement to
73+
code you are touching anyway ("boyscout rule").
74+
* Rebase on `master` when needed.
75+
* Keep your changesets small, specific and uncontroversial, so that they can be
76+
merged more quickly.
77+
* If the change is substantial or requires re-architecting certain parts of the
78+
codebase, write a proposal in English first, and get consensus on that before
79+
proposing the code changes.
80+
9981
### Preparing PRs
10082

101-
The main library development happens in the `master` branch. This branch must
102-
always compile without errors (using Travis CI). All external contributions are
83+
The main library development happens in the `master` branch. This branch must
84+
always compile without errors (using Travis CI). All external contributions are
10385
made within PRs into this branch.
10486

10587
Prerequisites that a PR must satisfy for merging into the `master` branch:
@@ -122,20 +104,60 @@ Additionally, to the `master` branch some repositories may have `develop` branch
122104
for any experimental developments. This branch may not compile and should not be
123105
used by any projects depending on the library.
124106

107+
### Writing Git commit messages
108+
109+
A properly formed git commit subject line should always be able to complete the
110+
following sentence:
111+
112+
If applied, this commit will _____
113+
114+
In addition, it should be capitalized and *must not* include a period.
115+
116+
For example, the following message is well formed:
117+
118+
Add support for .gif files
119+
120+
While these ones are **not**: `Adding support for .gif files`,
121+
`Added support for .gif files`.
122+
123+
When it comes to formatting, here's a model git commit message[1]:
124+
125+
Capitalized, short (50 chars or less) summary
126+
127+
More detailed explanatory text, if necessary. Wrap it to about 72
128+
characters or so. In some contexts, the first line is treated as the
129+
subject of an email and the rest of the text as the body. The blank
130+
line separating the summary from the body is critical (unless you omit
131+
the body entirely); tools like rebase can get confused if you run the
132+
two together.
133+
134+
Write your commit message in the imperative: "Fix bug" and not "Fixed bug"
135+
or "Fixes bug." This convention matches up with commit messages generated
136+
by commands like git merge and git revert.
137+
138+
Further paragraphs come after blank lines.
139+
140+
- Bullet points are okay, too.
141+
142+
- Typically a hyphen or asterisk is used for the bullet, followed by a
143+
single space, with blank lines in between, but conventions vary here.
144+
145+
- Use a hanging indent.
146+
125147
### Peer review
126148

127149
Anyone may participate in peer review which is expressed by comments in the pull
128150
request. Typically reviewers will review the code for obvious errors, as well as
129151
test out the patch set and opine on the technical merits of the patch. PR should
130-
be reviewed first on the conceptual level before focusing on code style or
152+
be reviewed first on the conceptual level before focusing on code style or
131153
grammar fixes.
132154

133155
Coding Conventions
134156
------------------
135-
Our CI enforces [clippy's](https://github.com/rust-lang/rust-clippy)
157+
Our CI enforces [clippy's](https://github.com/rust-lang/rust-clippy)
136158
[default linting](https://rust-lang.github.io/rust-clippy/rust-1.52.0/index.html)
137159
and [rustfmt](https://github.com/rust-lang/rustfmt) formatting defined by rules
138-
in [.rustfmt.toml](./.rustfmt.toml). The linter should be run with current
160+
in [.rustfmt.toml](./.rustfmt.toml). The linter should be run with current
139161
stable rust compiler, while formatter requires nightly version due to the use of
140162
unstable formatting parameters.
141163

@@ -150,35 +172,25 @@ cargo +nightly fmt --all
150172

151173
Security
152174
--------
153-
Security is the primary focus of LNP/BP libraries; disclosure of security
154-
vulnerabilities helps prevent user loss of funds. If you believe a vulnerability
155-
may affect other implementations, please inform them. Guidelines for a
156-
responsible disclosure can be found in [SECURITY.md](./SECURITY.md) file in the
157-
project root.
158-
159-
Note that some of LNP/BP projects are currently considered "pre-production".
160-
Such projects can be distinguished by the absence of `SECURITY.md`. In such
161-
cases there are no special handling of security issues; please simply open
175+
Responsible disclosure of security vulnerabilities helps prevent user loss of
176+
privacy. If you believe a vulnerability may affect other implementations, please
177+
inform them. Guidelines for a responsible disclosure can be found in
178+
[SECURITY.md](./SECURITY.md) file in the project root.
179+
180+
Note that some of our projects are currently considered "pre-production".
181+
Such projects can be distinguished by the absence of `SECURITY.md`. In such
182+
cases there are no special handling of security issues; please simply open
162183
an issue on GitHub.
163184

164-
Testing
165-
-------
166-
Related to the security aspect, LNP/BP developers take testing very seriously.
167-
Due to the modular nature of the project, writing new functional tests is easy
168-
and good test coverage of the codebase is an important goal.
169-
170-
Fuzzing is heavily encouraged: feel free to add related material under `fuzz/`
171-
172-
Mutation testing is planned; any contribution there would be warmly welcomed.
173-
174185
Going further
175186
-------------
176-
You may be interested in Jon Atack guide on
187+
You may be interested in Jon Atack guide on
177188
[How to review Bitcoin Core PRs][Review] and [How to make Bitcoin Core PRs][PR].
178-
While there are differences between the projects in terms of context and
189+
While there are differences between the projects in terms of context and
179190
maturity, many of the suggestions offered apply to this project.
180191

181192
Overall, have fun :)
182193

194+
[1]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
183195
[Review]: https://github.com/jonatack/bitcoin-development/blob/master/how-to-review-bitcoin-core-prs.md
184196
[PR]: https://github.com/jonatack/bitcoin-development/blob/master/how-to-make-bitcoin-core-prs.md

DCO

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Developer's Certificate of Origin 1.1
2+
Copyright © 2004, 2006 The Linux Foundation and its contributors.
3+
4+
---
5+
6+
By making a contribution to this project, I certify that:
7+
8+
(a) The contribution was created in whole or in part by me and I
9+
have the right to submit it under the open source license
10+
indicated in the file; or
11+
12+
(b) The contribution is based upon previous work that, to the best
13+
of my knowledge, is covered under an appropriate open source
14+
license and I have the right under that license to submit that
15+
work with modifications, whether created in whole or in part
16+
by me, under the same open source license (unless I am
17+
permitted to submit under a different license), as indicated
18+
in the file; or
19+
20+
(c) The contribution was provided directly to me by some other
21+
person who certified (a), (b) or (c) and I have not modified
22+
it.
23+
24+
(d) I understand and agree that this project and the contribution
25+
are public and that a record of the contribution (including all
26+
personal information I submit with it, including my sign-off) is
27+
maintained indefinitely and may be redistributed consistent with
28+
this project or the open source license(s) involved.

Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
#
66
# https://github.com/LukeMathWalker/cargo-chef
77

8-
ARG SRC_DIR=/usr/local/src/rgb-std
9-
ARG BUILDER_DIR=/srv/rgb-std
8+
ARG SRC_DIR=/usr/local/src/rgb-wallet
9+
ARG BUILDER_DIR=/srv/rgb-wallet
1010

1111
# Base image
1212
FROM rust:1.59.0-slim-bullseye as chef

0 commit comments

Comments
 (0)