Skip to content
This repository was archived by the owner on Dec 9, 2023. It is now read-only.

Commit d8808fe

Browse files
committed
Release v0.1
1 parent 25dca70 commit d8808fe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+935
-329
lines changed

.github/workflows/build.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
toolchains:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
toolchain: [ nightly, beta, stable, 1.41.1 ]
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: Install dependencies
21+
run: sudo apt-get install -y libzmq3-dev libpcre3-dev libpq-dev libssl-dev
22+
- name: Install rust ${{matrix.toolchain}}
23+
uses: actions-rs/toolchain@v1
24+
with:
25+
toolchain: ${{matrix.toolchain}}
26+
override: true
27+
- name: All features
28+
uses: actions-rs/cargo@v1
29+
with:
30+
command: build
31+
args: --workspace --all-targets --all-features
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Rust
1+
name: Lints
22

33
on:
44
push:
@@ -10,23 +10,18 @@ env:
1010
CARGO_TERM_COLOR: always
1111

1212
jobs:
13-
build:
13+
fmt:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v2
1717
- name: Install latest nightly
1818
uses: actions-rs/toolchain@v1
1919
with:
20-
toolchain: nightly-2020-10-12
21-
override: true
22-
components: rustfmt
23-
- name: Dependencies
24-
run: sudo apt-get install -y libzmq3-dev libpcre3-dev libpq-dev libssl-dev
25-
- name: Build
26-
run: cargo build --verbose
27-
- name: Run tests
28-
run: cargo test --verbose
20+
toolchain: nightly
21+
override: true
22+
components: rustfmt
2923
- uses: actions-rs/cargo@v1
24+
name: Lints
3025
with:
3126
command: fmt
3227
args: --all -- --check

.rustfmt.toml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
max_width = 80
2+
wrap_comments = true
3+
format_code_in_doc_comments = true

.travis.yml

-12
This file was deleted.

CHANGELOG.md

+26-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,38 @@
11
Change Log
22
==========
33

4+
v0.1.0
5+
------
6+
7+
### Core features
8+
- RGB Stash daemon operating client-validated data and managing their file
9+
storage
10+
- Fungible daemon operating RGB-20 assets and managing their storage (both file
11+
and SQLite)
12+
- RGB-20 asset issuance, invoicing, trnasfer and transfer acceptance
13+
- Command-line tool for daemons operations
14+
- Itegration functions packed as a compiled library
15+
16+
### New features since RC2
17+
- SQLite storage for assets cached data
18+
- Storage of public key tweaking information in PSBT
19+
- Support of Rust stable and old version up to 1.41.1
20+
- Update to the latest public releases of upstream bitcoin and LNP/BP libraries
21+
(migration from self-maintained forks)
22+
23+
### Breaking changes
24+
- Standard-compliant use of PSBT extension fields.
25+
- Removed requirements to specify fee for the transaction (it is now computed
26+
from PSBT data)
27+
28+
429
v0.1.0-rc.2
530
-----------
631

732
### Main updates
833
- FFI and demo apps are moved into a separate
934
[**RGB SDK**](https://github.com/LNP-BP/rgb-sdk) project
10-
- Big update and refactoring in RGB-20 achema (fungible assets)
35+
- Big update and refactoring in RGB-20 schema (fungible assets)
1136
* Multiple inflation rights with better control over total inflation
1237
* Epoch-based burn and burn-and-replace procedures; enhanced with UTXO set and
1338
versioned proofs of burn data, supporting up to 15 burn proof variants

CODE_OF_CONDUCT.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Code of Conduct
2+
3+
Out code of conduct is not to have a code of conduct. Restriction is the word
4+
of sin: free people writing free code take their own decisions and act in a
5+
way they like; taking all responsibility for the consequences.

CONTRIBUTING.md

+135
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
Contributing to LNP/BP Core Library
2+
===================================
3+
4+
The LNP/BP project operates an open contributor model where anyone is welcome to
5+
contribute towards development in the form of peer review, documentation,
6+
testing and patches.
7+
8+
Anyone is invited to contribute without regard to technical experience,
9+
"expertise", OSS experience, age, or other concern. However, the development of
10+
standards & reference implementations demands a high-level of rigor, adversarial
11+
thinking, thorough testing and risk-minimization. Any bug may cost users real
12+
money. That being said, we deeply welcome people contributing for the first time
13+
to an open source project or pick up Rust while contributing. Don't be shy,
14+
you'll learn.
15+
16+
Communications Channels
17+
-----------------------
18+
19+
Communication about LNP/BP standards & implementations happens primarily
20+
in #lnp-pb IRC chat on Freenode with the logs available at
21+
<http://gnusha.org/lnp-bp/>
22+
23+
Discussion about code base improvements happens in GitHub issues and on pull
24+
requests.
25+
26+
Major projects are tracked [here](https://github.com/orgs/LNP-BP/projects).
27+
Major milestones are tracked [here](https://github.com/LNP-BP/rgb-node/milestones).
28+
29+
Contribution Workflow
30+
---------------------
31+
32+
The codebase is maintained using the "contributor workflow" where everyone
33+
without exception contributes patch proposals using "pull requests". This
34+
facilitates social contribution, easy testing and peer review.
35+
36+
To contribute a patch, the workflow is a as follows:
37+
38+
1. Fork Repository
39+
2. Create topic branch
40+
3. Commit patches
41+
42+
In general commits should be atomic and diffs should be easy to read. For this
43+
reason do not mix any formatting fixes or code moves with actual code changes.
44+
Further, each commit, individually, should compile and pass tests, in order to
45+
ensure git bisect and other automated tools function properly.
46+
47+
When adding a new feature thought must be given to the long term technical debt.
48+
Every new features should be covered by unit tests.
49+
50+
When refactoring, structure your PR to make it easy to review and don't hesitate
51+
to split it into multiple small, focused PRs.
52+
53+
The Minimal Supported Rust Version is nightly for the period of active
54+
development; it is enforced by our Travis. Later we plan to fix to some specific
55+
Rust version after the initial library release.
56+
57+
Commits should cover both the issue fixed and the solution's rationale.
58+
These [guidelines](https://chris.beams.io/posts/git-commit/) should be kept in
59+
mind.
60+
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
65+
working on it if it has been awhile.
66+
67+
Branches information
68+
--------------------
69+
70+
The main library development happens in the `master` branch. This branch must
71+
always compile without errors (using Travis CI). All external contributions are
72+
made within PRs into this branch.
73+
74+
Each commitment within a PR to the `master` must
75+
* compile without errors;
76+
* contain all necessary tests for the introduced functional;
77+
* contain all docs.
78+
79+
Additionally to the `master` branch the repository has `develop` branch for any
80+
experimental developments. This branch may not compile and should not be used by
81+
any projects depending on `lnpbp` library.
82+
83+
84+
Peer review
85+
-----------
86+
87+
Anyone may participate in peer review which is expressed by comments in the pull
88+
request. Typically reviewers will review the code for obvious errors, as well as
89+
test out the patch set and opine on the technical merits of the patch. PR should
90+
be reviewed first on the conceptual level before focusing on code style or
91+
grammar fixes.
92+
93+
Coding Conventions
94+
------------------
95+
96+
Rust-fmt should be used as a coding style recommendations in general, with a
97+
default coding style. By default, Rustfmt uses a style which conforms to the
98+
[Rust style guide][style guide] that has been formalized through the [style RFC
99+
process][fmt rfcs]. It is also required to run `cargo fmt` to make the code
100+
formatted according to `rustfmt` parameters
101+
102+
103+
Security
104+
--------
105+
106+
Security is the primary focus of Rust-LNPBP; disclosure of security
107+
vulnerabilities helps prevent user loss of funds. If you believe a vulnerability
108+
may affect other implementations, please inform them.
109+
110+
Note that Rust-LNPBP is currently considered "pre-production" during this time,
111+
there is no special handling of security issues. Please simply open an issue on
112+
Github.
113+
114+
Testing
115+
-------
116+
117+
Related to the security aspect, Rust-LNPBP developers take testing very
118+
seriously. Due to the modular nature of the project, writing new functional
119+
tests is easy and good test coverage of the codebase is an important goal.
120+
Refactoring the project to enable fine-grained unit testing is also an ongoing
121+
effort.
122+
123+
Fuzzing is heavily encouraged: feel free to add related material under `fuzz/`
124+
125+
Mutation testing is planned; any contribution there would be warmly welcomed.
126+
127+
Going further
128+
-------------
129+
130+
You may be interested by Jon Atack guide on [How to review Bitcoin Core PRs](https://github.com/jonatack/bitcoin-development/blob/master/how-to-review-bitcoin-core-prs.md)
131+
and [How to make Bitcoin Core PRs](https://github.com/jonatack/bitcoin-development/blob/master/how-to-make-bitcoin-core-prs.md).
132+
While there are differences between the projects in terms of context and maturity, many
133+
of the suggestions offered apply to this project.
134+
135+
Overall, have fun :)

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ license = "MIT"
77
keywords = ["bitcoin", "node", "layer-2", "smart-contracts", "rgb"]
88
edition = "2018"
99
readme = "README.md"
10+
exclude = [".github", "/data", "/doc", "/test", "Dockerfile"]
1011

1112
[lib]
1213
name = "rgb"

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ARG BUILDER_DIR=/srv/rgb
22

33

4-
FROM rustlang/rust:nightly-slim as builder
4+
FROM rustlang/rust:stable-slim as builder
55

66
ARG SRC_DIR=/usr/local/src/rgb
77
ARG BUILDER_DIR

README.md

+14-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# RGB Node
22

3-
[![TravisCI](https://api.travis-ci.com/LNP-BP/rgb-node.svg?branch=master)](https://api.travis-ci.com/LNP-BP/rgb-node)
3+
![Build](https://github.com/LNP-BP/rgb-node/workflows/Build/badge.svg)
4+
![Lints](https://github.com/LNP-BP/rgb-node/workflows/Lints/badge.svg)
5+
6+
[![crates.io](https://meritbadge.herokuapp.com/rgb_node)](https://crates.io/crates/rgb_node)
7+
[![unsafe forbidden](https://img.shields.io/badge/unsafe-forbidden-success.svg)](https://github.com/rust-secure-code/safety-dance/)
8+
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
49

510
This is source for daemon executables and library that can run RGB backend. For
611
wallet and exchange integration please check an interface to it and demo
@@ -73,14 +78,17 @@ organization concept for module/file names:
7378
* `index/`, `storage/`, `cache/` – storage interfaces and engines;
7479
* `db/` – SQL-specific schema and code, if needed.
7580

81+
## Install
82+
83+
Minimum supported rust compiler version (MSRV): 1.41.1
84+
7685
### Local
7786

78-
To compile the node, please install [cargo](https://doc.rust-lang.org/cargo/)
79-
and [rustup](https://rustup.rs/), then run the following commands:
87+
To compile the node, please install [cargo](https://doc.rust-lang.org/cargo/),
88+
then run the following commands:
8089

8190
sudo apt update
8291
sudo apt install -y build-essential pkg-config libzmq3-dev libssl-dev libpq-dev cmake
83-
rustup default nightly
8492
git clone https://github.com/LNP-BP/rgb-node.git
8593
cd rgb-node
8694
cargo build --release
@@ -135,6 +143,8 @@ where `utxo` and the `blinding` must be values used in invoice generation
135143
In order to update the project dependencies, run `cargo update`.
136144
If any dependency updates, the `Cargo.lock` file will be updated, keeping
137145
track of the exact package version.
146+
138147
After an update, run tests (`cargo test`) and manually test the software
139148
in order to stimulate function calls from updated libraries.
149+
140150
If any problem arises, open an issue.

codecov.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
codecov:
2+
require_ci_to_pass: no
3+
4+
coverage:
5+
precision: 1
6+
round: nearest
7+
range: "0...95"
8+
# TODO: Update codecov default requirements after v0.1 release
9+
status:
10+
project:
11+
default:
12+
target: 0%
13+
threshold: 1%
14+
patch:
15+
default:
16+
target: 0%
17+
threshold: 1%

rust-toolchain

-1
This file was deleted.

src/api/fungible.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,15 @@ pub enum Request {
5353
}
5454

5555
#[derive(
56-
Clap, Clone, PartialEq, Serialize, Deserialize, StrictEncode, StrictDecode, Debug, Display,
56+
Clap,
57+
Clone,
58+
PartialEq,
59+
Serialize,
60+
Deserialize,
61+
StrictEncode,
62+
StrictDecode,
63+
Debug,
64+
Display,
5765
)]
5866
#[display(Debug)]
5967
pub struct Issue {

src/api/reply.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ pub enum Reply {
5454

5555
#[lnp_api(type = 0xFF0C)]
5656
Transfer(crate::api::reply::Transfer),
57-
//#[lnp_api(type = 0xFF0B)]
58-
//ValidationStatus(::lnpbp::rgb::validation::Status),
57+
/* #[lnp_api(type = 0xFF0B)]
58+
ValidationStatus(::lnpbp::rgb::validation::Status), */
5959
}
6060

6161
impl From<lnp::presentation::Error> for Reply {

src/cli/config.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ impl Config {
145145
.replace("{network}", &self.network.to_string())
146146
.replace("{data_dir}", self.data_dir.to_str().unwrap())
147147
.parse()
148-
.unwrap_or_else(|err| panic!("Error parsing parameter `{}`: {}", param, err))
148+
.unwrap_or_else(|err| {
149+
panic!("Error parsing parameter `{}`: {}", param, err)
150+
})
149151
}
150152
}

0 commit comments

Comments
 (0)