Giter Site home page Giter Site logo

rgb-wg / rgb-node Goto Github PK

View Code? Open in Web Editor NEW
147.0 25.0 47.0 1.82 MB

RGB node - the official server-side implementation

Home Page: https://rgb.tech

License: MIT License

Rust 71.18% Dockerfile 0.85% Shell 13.05% PowerShell 14.93%
bitcoin lnp-bp smart-contracts client-side-validation rgb lightning lightning-network

rgb-node's People

Contributors

afilini avatar atul9 avatar azuchi avatar claudiosdc avatar crisdut avatar cryptoquick avatar dependabot[bot] avatar dr-orlovsky avatar goosie avatar inaltoasinistra avatar isghe avatar jasonvdb avatar jharveyb avatar louneskmt avatar maxhillebrand avatar monaka avatar nicbus avatar radworx avatar rajarshimaitra avatar st333p avatar ukolovaolga avatar zidagar avatar zoedberg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rgb-node's Issues

Create convenience function for accessing asset information

While it is possible to get asset information directly from cache file (stored in YAML format and always kept up to date by RGB daemon), it is desirable to have a convenience function that will return to the wallet all information about assets available.

Right now to access the data on the assets an app using RGB Node must read YAML file or SQLite database directly. That was a design decision (allowing UI construction flexibility, since data are somehow multidimensional and it’s hard to predict which specific queries they will run agains asset data). However, for simple UI it will be nice to have a direct “asset reading API” in i8n mod alongside transfer and isseue functions, that for instance (1) lists all asset ids, (2) allows to get list of outpoints with amount of assets on them for particular asset, (3) allows to get list of all assets with amounts on specific output.

A similar path exists: `electrum_client::serde`

I get an error while trying to install rgb-node by using the local install instructions and even when taking
image
the docker path:
sudo apt update
sudo apt install -y build-essential pkg-config libzmq3-dev libssl-dev libpq-dev cmake
git clone https://github.com/LNP-BP/rgb-node.git
cd rgb-node
cargo build --release

I got the error:

error[E0432]: unresolved import serde
--> src/api/fungible.rs:15:5
|
15 | use serde::{Deserialize, Serialize};
| ^^^^^ help: a similar path exists: electrum_client::serde

error[E0432]: unresolved import serde
--> src/util/seal_spec.rs:16:5

Trying Docker

image

handle library updates

As partially discussed in #35, we need to properly handle library updates.

Currently the Cargo.lock file is not committed (it's git-ignored), meaning that shared "reproducible" builds are not possible.
As described here committing the lock file is important when the library has to be built directly by a user (as in the case of building the android bindings).

The only drawback I see in doing this is that the project developers will have to commit eventual updates of the file.

As an alternative, we should document that running cargo update may be necessary when re-building an updated version of this library.

The drawback here is that a user could still incur in issues when re-building the library and then have to check the documentation looking for a solution.

Broken build because of mismatched types

Maybe related to PR

error[E0308]: mismatched types
   --> src/cli/fungible.rs:302:27
    |
302 |                 blinding: blinding_factor,
    |                           ^^^^^^^^^^^^^^^ expected `u64`, found `u32`

warning: use of deprecated item 'std::vec::Vec::<T>::remove_item': Removing the first item equal to a needle is already easily possible with iterators and the current Vec methods. Furthermore, having a method for one particular case of removal (linear search, only the first item, no swap remove) but not for others is inconsistent. This method will be removed soon.
   --> src/contracts/fungible/data/asset.rs:171:21
    |
171 |         allocations.remove_item(&old_allocation).is_some()
    |                     ^^^^^^^^^^^
    |
    = note: `#[warn(deprecated)]` on by default

error[E0308]: mismatched types
  --> src/contracts/fungible/data/outcoins.rs:52:27
   |
52 |                 blinding: entropy,
   |                           ^^^^^^^ expected `u64`, found `u32`

error[E0308]: mismatched types
  --> src/contracts/fungible/data/outcoins.rs:58:27
   |
58 |                 blinding: entropy,
   |                           ^^^^^^^ expected `u64`, found `u32`

error[E0308]: mismatched types
  --> src/util/seal_spec.rs:42:27
   |
42 |                 blinding: entropy,
   |                           ^^^^^^^ expected `u64`, found `u32`

error[E0308]: mismatched types
  --> src/util/seal_spec.rs:48:27
   |
48 |                 blinding: entropy,
   |                           ^^^^^^^ expected `u64`, found `u32`

error: aborting due to 5 previous errors; 1 warning emitted

For more information about this error, try `rustc --explain E0308`.
error: could not compile `rgb_node`.

asset ticker lenght: consistency between regex and error message

The following function validates the asset ticker format (in src/api/fungible.rs):

fn ticker_validator(name: &str) -> Result<(), String> {
    let re = Regex::new(r"^[A-Z]{3,8}$").expect("Regex parse failure");
    if !re.is_match(&name) {
        Err(
            "Ticker name must be between 2 and 8 chars, contain no spaces and \
            consist only of capital letters\
            "
            .to_string(),
        )
[...]

Which is the correct minimum asset ticker length, 2 or 3?

Build issues of lnpbp/master for rgb-node

While building rgb-node with lnpbp master branch, the following cargo error is occuring.

Cargo.toml:

lnpbp = { git = "https://github.com/LNP-BP/rust-lnpbp", branch = "master", features = ["lnp", "url", "websockets"] }

cargo error:

error: failed to select a version for `cmake`.
    ... required by package `zeromq-src v0.1.10+4.3.2`
    ... which is depended on by `zmq-sys v0.11.0`
    ... which is depended on by `zmq v0.9.2`
    ... which is depended on by `lnpbp v0.2.0-beta.2`
    ... which is depended on by `lnpbp_services v0.2.0-beta.2`
    ... which is depended on by `rgb_node v0.2.0-beta.3 (/home/raj/github-repo/rgb-node)`
versions that meet the requirements `=0.1.44` are: 0.1.44

all possible versions conflict with previously selected packages.

  previously selected package `cmake v0.1.43`
    ... which is depended on by `zeromq-src v0.1.10+4.3.2 (https://github.com/LNP-BP/zeromq-src-rs?branch=fix/cmake#e95a4e68)`
    ... which is depended on by `lnpbp v0.2.0-beta.3 (https://github.com/LNP-BP/rust-lnpbp?branch=master#4d064975)`
    ... which is depended on by `rgb_node v0.2.0-beta.3 (/home/raj/github-repo/rgb-node)`

failed to select a version for `cmake` which could resolve this conflict

Not sure what's happening here, seems like cmake requires different versions for different crates?

panick error when trying to transfer on an invoice

Are we (@Goosie and I) doing something wrong?

So we made a psbt with

bitcoin-cli --testnet createpsbt "[{\"txid\":\"0f1782599ea413b9d256b641849fab286916e68d7794a6db34cf11da7bc032c5\",\"vout\":0}]" [{\"$TO\":0.00001}]
result:

cHNidP8BAFMCAAAAAcUywHvaEc8026aUd43mFmkoq5+EQbZW0rkTpJ5ZghcPAAAAAAD/////AegDAAAAAAAAF6kU+i09h7WGCQuXxIU/EBflDCAPpIeHAAAAAAAAAA==

and converted the result from base64 encoding to binary (in ~/Downloads/downloadBINARY.psbt )

then we tried:

./rgb-cli -d ~/.rgb fungible transfer "rgb20:txo16m5gpagl3rdkj0wv5rp5fqz6fawgurhrtwalyl5xx7k6tkmc9lxqqsfxf4?asset=rgb153f8cp6aj8n5lhu3r7w6e8rj59p66srcelqncdwlh55lry832t5sdt53vt&amount=1000" ~/Downloads/downloadBINARY.psbt 100 consignment.dat updatedBINARY.psbt -vvvvv

result:

[2020-09-23T14:27:35Z INFO  rgb::cli::fungible] Transferring asset ...
[2020-09-23T14:27:35Z DEBUG rgb::cli::fungible] TransferCli { inputs: [], allocate: [], invoice: Invoice { contract_id: e952f190f129bddf353cc1cf7840ad43a1729cac9d1f91df4fe7915d077c52a4, outpoint: BlindedUtxo(cc2f78dba5ad37867ef2bb5be30e8e5c4f5a8044c3a0cc3d69db881ff580e8d6), amount: 1000.0 }, prototype: "/home/rsk/Downloads/downloadBINARY.psbt", fee: 100, consignment: "consignment.dat", transaction: "updatedBINARY.psbt" }
[2020-09-23T14:27:35Z DEBUG rgb::cli::fungible] Reading partially-signed transaction from file "/home/rsk/Downloads/downloadBINARY.psbt"
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/cli/fungible.rs:450:50
stack backtrace:
   0:     0x555c4e598f40 - std::backtrace_rs::backtrace::libunwind::trace::ha1eabb142084ea37
                               at /rustc/7e6d6e5f535321c2223f044caba16f97b825009c/library/std/src/../../backtrace/src/backtrace/libunwind.rs:96
   1:     0x555c4e598f40 - std::backtrace_rs::backtrace::trace_unsynchronized::hbb8825661d997281
                               at /rustc/7e6d6e5f535321c2223f044caba16f97b825009c/library/std/src/../../backtrace/src/backtrace/mod.rs:66
   2:     0x555c4e598f40 - std::sys_common::backtrace::_print_fmt::h26d850e2f7183914
                               at /rustc/7e6d6e5f535321c2223f044caba16f97b825009c/library/std/src/sys_common/backtrace.rs:79
   3:     0x555c4e598f40 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h3834b06f68a2b012
                               at /rustc/7e6d6e5f535321c2223f044caba16f97b825009c/library/std/src/sys_common/backtrace.rs:58
   4:     0x555c4e5bb12c - core::fmt::write::h3a043650ba7bf668
                               at /rustc/7e6d6e5f535321c2223f044caba16f97b825009c/library/core/src/fmt/mod.rs:1117
   5:     0x555c4e594ab5 - std::io::Write::write_fmt::h9c0c8944a1898139
                               at /rustc/7e6d6e5f535321c2223f044caba16f97b825009c/library/std/src/io/mod.rs:1510
   6:     0x555c4e59b320 - std::sys_common::backtrace::_print::h693c0c2cc41d4d10
                               at /rustc/7e6d6e5f535321c2223f044caba16f97b825009c/library/std/src/sys_common/backtrace.rs:61
   7:     0x555c4e59b320 - std::sys_common::backtrace::print::h213be73e5670b8ea
                               at /rustc/7e6d6e5f535321c2223f044caba16f97b825009c/library/std/src/sys_common/backtrace.rs:48
   8:     0x555c4e59b320 - std::panicking::default_hook::{{closure}}::h2d49a3361cc4e7ea
                               at /rustc/7e6d6e5f535321c2223f044caba16f97b825009c/library/std/src/panicking.rs:200
   9:     0x555c4e59b06c - std::panicking::default_hook::hd41fbdeba93207ba
                               at /rustc/7e6d6e5f535321c2223f044caba16f97b825009c/library/std/src/panicking.rs:219
  10:     0x555c4e59b983 - std::panicking::rust_panic_with_hook::hcab398664b4bd473
                               at /rustc/7e6d6e5f535321c2223f044caba16f97b825009c/library/std/src/panicking.rs:569
  11:     0x555c4e59b559 - std::panicking::begin_panic_handler::{{closure}}::h7512c6f2998ba93d
                               at /rustc/7e6d6e5f535321c2223f044caba16f97b825009c/library/std/src/panicking.rs:476
  12:     0x555c4e5993ac - std::sys_common::backtrace::__rust_end_short_backtrace::h1a25d7e7e1864d3d
                               at /rustc/7e6d6e5f535321c2223f044caba16f97b825009c/library/std/src/sys_common/backtrace.rs:153
  13:     0x555c4e59b519 - rust_begin_unwind
                               at /rustc/7e6d6e5f535321c2223f044caba16f97b825009c/library/std/src/panicking.rs:475
  14:     0x555c4e5b8db1 - core::panicking::panic_fmt::h019ad16a92ccd092
                               at /rustc/7e6d6e5f535321c2223f044caba16f97b825009c/library/core/src/panicking.rs:85
  15:     0x555c4e5b8cfd - core::panicking::panic::hf72d67b706869386
                               at /rustc/7e6d6e5f535321c2223f044caba16f97b825009c/library/core/src/panicking.rs:50
  16:     0x555c4e207402 - rgb::cli::fungible::TransferCli::exec::h45acbc688aa50e53
  17:     0x555c4e201bc7 - rgb::cli::fungible::Command::exec::hc6761a1c4a7ef95d
  18:     0x555c4e2c1db0 - rgb::cli::config::Command::exec::h429a7ec2e1d86361
  19:     0x555c4e1740a9 - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h7c3296ae971a2305
  20:     0x555c4e17df15 - std::thread::local::LocalKey<T>::with::hcef2969ceead2cc5
  21:     0x555c4e17f8fd - tokio::runtime::enter::Enter::block_on::hd54f6966b06fda3d
  22:     0x555c4e170fd9 - tokio::runtime::thread_pool::ThreadPool::block_on::h0c22bc7ab91e2777
  23:     0x555c4e1726dc - tokio::runtime::context::enter::h3db656b7deb29bfd
  24:     0x555c4e17fa9d - tokio::runtime::handle::Handle::enter::hfda293a84833d405
  25:     0x555c4e176fff - rgb_cli::main::h58be21efd758f43d
  26:     0x555c4e1715d3 - std::sys_common::backtrace::__rust_begin_short_backtrace::hf5567830c1f50079
  27:     0x555c4e1715f5 - std::rt::lang_start::{{closure}}::h0afb3331119951de
  28:     0x555c4e59bd92 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::hde9814ae740a85dc
                               at /rustc/7e6d6e5f535321c2223f044caba16f97b825009c/library/core/src/ops/function.rs:265
  29:     0x555c4e59bd92 - std::panicking::try::do_call::h3026bab8cd7540d7
                               at /rustc/7e6d6e5f535321c2223f044caba16f97b825009c/library/std/src/panicking.rs:373
  30:     0x555c4e59bd92 - std::panicking::try::h852bb5e5a66f7f84
                               at /rustc/7e6d6e5f535321c2223f044caba16f97b825009c/library/std/src/panicking.rs:337
  31:     0x555c4e59bd92 - std::panic::catch_unwind::hfeb0f3dddf7c6a72
                               at /rustc/7e6d6e5f535321c2223f044caba16f97b825009c/library/std/src/panic.rs:394
  32:     0x555c4e59bd92 - std::rt::lang_start_internal::h32f0ac6e87476559
                               at /rustc/7e6d6e5f535321c2223f044caba16f97b825009c/library/std/src/rt.rs:51
  33:     0x555c4e177102 - main
  34:     0x7f82ced9a840 - __libc_start_main
  35:     0x555c4e16aa89 - _start
  36:                0x0 - <unknown>
[2020-09-23T14:27:35Z DEBUG zmq] socket dropped
[2020-09-23T14:27:35Z DEBUG zmq] context dropped

Android library build error

Trying to build the android library, I've received a E0404 error on rust build. Here's the log:

./build_rust.sh 
    Updating git repository `https://github.com/LNP-BP/zeromq-src-rs`
    Updating git repository `https://github.com/afilini/rust-electrum-client.git`
    Updating crates.io index
warning: Patch `torut v0.1.3 (https://github.com/afilini/torut?branch=vendored-openssl-android#41c2dcf0)` was not used in the crate graph.
Check that the patched package version and available features are compatible
with the dependency requirements. If the patch has a different version from
what is locked in the Cargo.lock file, run `cargo update` to use the new
version. This may also occur with an optional dependency that is not enabled.
   Compiling rgb v0.1.0 (/mnt/dmc/zoe/work/rgb-node/ffi)
   Compiling rgb_node v0.1.0-beta.2 (/mnt/dmc/zoe/work/rgb-node)
^[x    Building [=====================================================> ] 324/326: rgb_node                                                                                                                                                                                                                                  error[E0404]: expected trait, found type alias `validation::TxResolver`
   --> src/stash/runtime.rs:374:6
    |
374 | impl validation::TxResolver for DummyTxResolver {
    |      ^^^^^^^^^^^^^^^^^^^^^^ type aliases cannot be used as traits
    |
    = help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias

error[E0404]: expected trait, found type alias `TxResolver`
  --> src/stash/electrum.rs:39:6
   |
39 | impl TxResolver for &ElectrumTxResolver {
   |      ^^^^^^^^^^ type aliases cannot be used as traits
   |
   = help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias

warning: the item `strict_encode` is imported redundantly
   --> src/cli/fungible.rs:255:13
    |
28  | use lnpbp::strict_encoding::strict_encode;
    |     ------------------------------------- the item `strict_encode` is already imported here
...
255 |         use lnpbp::strict_encoding::strict_encode;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: `#[warn(unused_imports)]` on by default

warning: the item `strict_encode` is imported redundantly
   --> src/cli/fungible.rs:288:13
    |
28  | use lnpbp::strict_encoding::strict_encode;
    |     ------------------------------------- the item `strict_encode` is already imported here
...
288 |         use lnpbp::strict_encoding::strict_encode;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 2 previous errors; 2 warnings emitted

For more information about this error, try `rustc --explain E0404`.
error: could not compile `rgb_node`.

To learn more, run the command again with --verbose.

Implement proper workflow PSBT data and keys

  • Take fee from PSBT input data, not from a proprietary keys
  • Define standard key (pending BIP) for tweaking input key
  • Define proprietary information about tweak target and how the tweak should be constructed

Clean install error: Rust E0554

DESCRIPTION:
Installed from a clean cargo/rust installation on MacOS Catalina. Throws rust E0554 requiring that I run with the nightly cargo installed.

COMMAND:

cargo install --path .

ERROR:
error[E0554]: #![feature] may not be used on the stable release channel
--> /Users/const/.cargo/git/checkouts/rust-lnpbp-1c6b6ac6d4fb658b/d430af6/derive/src/lib.rs:17:1
|
17 | #![feature(try_trait)]
| ^^^^^^^^^^^^^^^^^^^^^^

FULL LOGS:

cargo install --path .
Installing rgb_node v0.1.0-rc.1 (/Users/const/Workspace/RGB/rgb-node)
Updating git repository https://github.com/LNP-BP/rust-bitcoin
Updating git repository https://github.com/LNP-BP/bitcoin_hashes
Updating git repository https://github.com/LNP-BP/rust-miniscript
Updating git repository https://github.com/LNP-BP/zeromq-src-rs
Updating crates.io index
Updating git repository https://github.com/LNP-BP/rust-lnpbp
Compiling lnpbp_derive v0.1.0-rc.1 (https://github.com/LNP-BP/rust-lnpbp#d430af61)
error[E0554]: #![feature] may not be used on the stable release channel
--> /Users/const/.cargo/git/checkouts/rust-lnpbp-1c6b6ac6d4fb658b/d430af6/derive/src/lib.rs:17:1
|
17 | #![feature(try_trait)]
| ^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

For more information about this error, try rustc --explain E0554.
error: failed to compile rgb_node v0.1.0-rc.1 (/Users/const/Workspace/RGB/rgb-node), intermediate artifacts can be found at /Users/const/Workspace/RGB/rgb-node/target

Caused by:
could not compile lnpbp_derive.

To learn more, run the command again with --verbose.

Add RGB node Dockerfile

Currently the only Dockerfile present in this project is used to produce nodejs bindings.
Let's add a Dockerfile that allows to run the RGB node.

Unable to build android bindings

I've installed the dependencies and modified the cargo config file as described at: https://github.com/LNP-BP/rgb-node/tree/master/ffi/android/library.

However, I get the following errors when running .\gradlew build.
OS: Windows 10

PS E:\android-libs\rgb-node\ffi\android\library> .\gradlew build

> Task :library:compileDebugJavaWithJavac FAILED
E:\android-libs\rgb-node\ffi\android\library\library\src\main\java\org\lnpbp\rgbnode\Runtime.java:9: error: package org.lnpbp.rgbnode_autogen does not exist
import org.lnpbp.rgbnode_autogen.COpaqueStruct;
                                ^
E:\android-libs\rgb-node\ffi\android\library\library\src\main\java\org\lnpbp\rgbnode\Runtime.java:10: error: package org.lnpbp.rgbnode_autogen does not exist
import org.lnpbp.rgbnode_autogen.rgb_node;
                                ^
E:\android-libs\rgb-node\ffi\android\library\library\src\main\java\org\lnpbp\rgbnode\Runtime.java:16: error: cannot find symbol
    private final COpaqueStruct runtime;
                  ^
  symbol:   class COpaqueStruct
  location: class Runtime
E:\android-libs\rgb-node\ffi\android\library\library\src\main\java\org\lnpbp\rgbnode\Runtime.java:25: error: cannot find symbol
            this.runtime = rgb_node.start_rgb(jsonArgs);
                           ^
  symbol:   variable rgb_node
  location: class Runtime
E:\android-libs\rgb-node\ffi\android\library\library\src\main\java\org\lnpbp\rgbnode\Runtime.java:35: error: cannot find symbol
            rgb_node.issue(this.runtime, jsonArgs);
            ^
  symbol:   variable rgb_node
  location: class Runtime
E:\android-libs\rgb-node\ffi\android\library\library\src\main\java\org\lnpbp\rgbnode\Runtime.java:45: error: cannot find symbol
            rgb_node.transfer(this.runtime, jsonArgs);
            ^
  symbol:   variable rgb_node
  location: class Runtime
6 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':library:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 19s
12 actionable tasks: 1 executed, 11 up-to-date

Not sure whats going on here to be completely honest. Anyone have any ideas?

Edit: My cargo config file looks like the following (the paths for android targets might seem strange but it's in windows format):

[core]
	bare = false
	repositoryformatversion = 0
	filemode = false
	symlinks = false
	ignorecase = true
	logallrefupdates = true

[target.aarch64-linux-android]
ar = "C:\Users\rohan\AppData\Local\Android\Sdk\ndk\21.0.6113669\toolchains\llvm\prebuilt\windows-x86_64\bin\aarch64-linux-android-ar"
linker = "C:\Users\rohan\AppData\Local\Android\Sdk\ndk\21.0.6113669\toolchains\llvm\prebuilt\windows-x86_64\bin\aarch64-linux-android26-clang"

[target.x86_64-linux-android]
ar = "C:\Users\rohan\AppData\Local\Android\Sdk\ndk\21.0.6113669\toolchains\llvm\prebuilt\windows-x86_64\bin\x86_64-linux-android-ar"
linker = "C:\Users\rohan\AppData\Local\Android\Sdk\ndk\21.0.6113669\toolchains\llvm\prebuilt\windows-x86_64\bin\x86_64-linux-android26-clang"

[target.armv7-linux-androideabi]
ar = "C:\Users\rohan\AppData\Local\Android\Sdk\ndk\21.0.6113669\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ar"
linker = "C:\Users\rohan\AppData\Local\Android\Sdk\ndk\21.0.6113669\toolchains\llvm\prebuilt\windows-x86_64\bin\armv7a-linux-androideabi26-clang"

[target.i686-linux-android]
ar = "C:\Users\rohan\AppData\Local\Android\Sdk\ndk\21.0.6113669\toolchains\llvm\prebuilt\windows-x86_64\bin\i686-linux-android-ar"
linker = "C:\Users\rohan\AppData\Local\Android\Sdk\ndk\21.0.6113669\toolchains\llvm\prebuilt\windows-x86_64\bin\i686-linux-android26-clang"

bash: target/release/rgbd: No such file or directory

Following the instructions further in the README and after doing the fix to add "serde" in the client section of Cargo.toml. I follow the next step: Doing the command: target/release/rgbd --data-dir ~/.rgb --bin-dir target/release -vvvv - contract fungible

Which gives the message:
bash: target/release/rgbd: No such file or directory

rgb node nu such file or directory

nodejs did not work

To use nodejs I followed prescribed procedure in README.md of https://github.com/LNP-BP/rgb-node
that did not work, only after I set:
export LD_LIBRARY_PATH=LD_LIBRARY_PATH:$HOME/rgb-node/target/release
($HOME/rgb-node/target/release is where I have librgb.so)
then the example.js runs.

(worked on 2 machines, Ubuntu 16.04 and WSL Ubuntu 18.04)

Failed asset transfer when using i9n

I have successfully issued an asset with the issue i9n function (validated with rgb-cli).

However, when I try to transfer this asset, stashd returns an error after receiving the request to generate the consignment data.

Specifically, after the stash runtime receives the ConsignRequest, it returns this error:
ERROR rgb::contracts::fungible::runtime] Stash daemon has returned failure code: Failure { code: 3, info: "ServiceError { domain: Anchor(\"Incorrect public key data: {_0}\"), service: Stash }" }

AFAICT, the error originates here - all the addresses are bech32 and generated with rust-bitcoincore-rpc, so they should be valid.

I am using this PSBT: cHNidP8BAFICAAAAAQGzz8+yqacT1Ht5YXmBF4DzgLj3nlPgWsCk1UTKoC0YAAAAAAD/////AVBEBCoBAAAAFgAU+DbfVBjpyC+SVNiB1hZqXX2q6oYAAAAAAAEAhQIAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////BAFFAQH/////AgDyBSoBAAAAFgAUpkvo4kwaLqiaQCDJdNVXblUJ/cgAAAAAAAAAACZqJKohqe3i9hw/cdHe/T+pmd+jaVN1XGkGiXmZYrSL69g2l06M+QAAAAABAR8A8gUqAQAAABYAFKZL6OJMGi6omkAgyXTVV25VCf3IIgYDsInjExR4/MdnmDzQ5TtrF/mpn1iaOoEiTzHKeCjmkmAQl905VQAAAIAAAACAAAAAgAAiAgJ4/wTVYOZ4rrY0kDMSgS4INs/9t7st5TjSlGQJFneXyxCX3TlVAAAAgAAAAIACAACAAA==

I have made successful transfers in the past using rgb-cli and similar PSBTs, around when rgb-node was version beta.4 - I am not sure if the required PSBT structure has changed since then.

Improving integration (i9n) module

Hi,

I have seen the rgb-sdk, which looks useful for using rgb-node from another language. However, I would like to integrate in a Rust project. I have a working solution, but it seems like perhaps there is a more straighforward way to start and talk to rgbd.

Specifically, to start rgbd I mimic the approach used here, which works well since my program is not async at the moment.

To issue commands, I am mimicking the rgb-cli binary, but it is a bit awkward. Instead of parsing any input, I build commands manually. Building an Opts struct manually seems unworkable, since the config module is not puclic, so the Command enum there cannot be used.

Given the command and CLI config, RPC calls work - I am just wondering if I can make calls to rgbd without going through the CLI module, or if there is some other more idiomatic way to mimic the CLI demo from a Rust program.

Set-up docker container

ℹ️ INFORMATION

Trying to set-up the repository using the provided Dockerfile-nodejs file to launch the RGB node

👞 STEPS

  1. Rename the file Dockerfile-nodejs for Dockerfile
  2. Build the image docker build .

💻 LOGS

error: failed to run custom build command for `zmq-sys v0.11.0`

Caused by:
  process didn't exit successfully: `/rgb-node/target/debug/build/zmq-sys-246f493c083c6b25/build-script-main` (exit code: 101)
  --- stdout
  cargo:rerun-if-changed=build/main.rs
  cargo:rerun-if-env-changed=PROFILE
  running: "cmake" "/usr/local/cargo/git/checkouts/zeromq-src-rs-da612f523629c522/e95a4e6/vendor" "-DCMAKE_INSTALL_LIBDIR=lib" "-DCMAKE_C_STANDARD=99" "-DZMQ_BUILD_TESTS=OFF" "-DENABLE_DRAFTS=OFF" "-DENABLE_CURVE=ON" "-DCMAKE_BUILD_TYPE=Debug" "-DWITH_PERF_TOOL=OFF" "-DBUILD_SHARED=OFF" "-DBUILD_STATIC=ON" "-DWITH_LIBSODIUM=OFF" "-DCMAKE_INSTALL_PREFIX=/rgb-node/target/debug/build/zmq-sys-918b876fe8135554/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_ASM_COMPILER=/usr/bin/cc"

Receiving Error When Attempting to Complete the NodeJS Integration Steps

Is anyone else having this issue? After attempting to complete the NodeJS Integration steps running npm i throws the following error:

> [email protected] preinstall /Users/coreyphillips/Documents/testing/rgb-node/ffi/nodejs
> cargo build && swig -javascript -node -c++ swig.i

warning: Patch `torut v0.1.3 (https://github.com/afilini/torut?branch=vendored-openssl-android#41c2dcf0)` was not used in the crate graph.
Check that the patched package version and available features are compatible
with the dependency requirements. If the patch has a different version from
what is locked in the Cargo.lock file, run `cargo update` to use the new
version. This may also occur with an optional dependency that is not enabled.
warning: use of deprecated item 'std::vec::Vec::<T>::remove_item': Removing the first item equal to a needle is already easily possible with iterators and the current Vec methods. Furthermore, having a method for one particular case of removal (linear search, only the first item, no swap remove) but not for others is inconsistent. This method will be removed soon.
   --> src/contracts/fungible/data/asset.rs:171:21
    |
171 |         allocations.remove_item(&old_allocation).is_some()
    |                     ^^^^^^^^^^^
    |
    = note: `#[warn(deprecated)]` on by default

warning: 1 warning emitted

    Finished dev [unoptimized + debuginfo] target(s) in 0.30s

> [email protected] install /Users/coreyphillips/Documents/testing/rgb-node/ffi/nodejs
> node ./node_modules/node-gyp/bin/node-gyp.js rebuild

  CXX(target) Release/obj.target/rgb_node/swig_wrap.o
../swig_wrap.cxx:1524:3: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
  obj->SetAccessor(SWIGV8_CURRENT_CONTEXT(), SWIGV8_SYMBOL_NEW(symbol), getter, setter);
  ^~~~~~~~~~~~~~~~
../swig_wrap.cxx:2112:37: warning: 'New' is deprecated [-Wdeprecated-declarations]
  resolver = v8::Promise::Resolver::New(args.GetIsolate());
                                    ^
/Users/coreyphillips/Library/Caches/node-gyp/10.15.1/include/node/v8.h:4092:12: note: 'New' has been explicitly marked deprecated here
    static V8_DEPRECATED("Use maybe version",
           ^
/Users/coreyphillips/Library/Caches/node-gyp/10.15.1/include/node/v8config.h:327:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
../swig_wrap.cxx:2116:15: warning: 'Resolve' is deprecated [-Wdeprecated-declarations]
    resolver->Resolve(SWIG_NewPointerObj((new COpaqueStruct(static_cast< const COpaqueStruct& >((&result)->inner))), SWIGTYPE_p_COpaqueStruct, SWIG_POINTER_OWN |  0 ));
              ^
/Users/coreyphillips/Library/Caches/node-gyp/10.15.1/include/node/v8.h:4106:5: note: 'Resolve' has been explicitly marked deprecated here
    V8_DEPRECATED("Use maybe version", void Resolve(Local<Value> value));
    ^
/Users/coreyphillips/Library/Caches/node-gyp/10.15.1/include/node/v8config.h:327:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
../swig_wrap.cxx:2119:15: warning: 'Reject' is deprecated [-Wdeprecated-declarations]
    resolver->Reject(v8::String::NewFromUtf8(args.GetIsolate(), (const char*) (&result)->inner.ptr));
              ^
/Users/coreyphillips/Library/Caches/node-gyp/10.15.1/include/node/v8.h:4110:5: note: 'Reject' has been explicitly marked deprecated here
    V8_DEPRECATED("Use maybe version", void Reject(Local<Value> value));
    ^
/Users/coreyphillips/Library/Caches/node-gyp/10.15.1/include/node/v8config.h:327:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
../swig_wrap.cxx:2156:37: warning: 'New' is deprecated [-Wdeprecated-declarations]
  resolver = v8::Promise::Resolver::New(args.GetIsolate());
                                    ^
/Users/coreyphillips/Library/Caches/node-gyp/10.15.1/include/node/v8.h:4092:12: note: 'New' has been explicitly marked deprecated here
    static V8_DEPRECATED("Use maybe version",
           ^
/Users/coreyphillips/Library/Caches/node-gyp/10.15.1/include/node/v8config.h:327:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
../swig_wrap.cxx:2160:15: warning: 'Resolve' is deprecated [-Wdeprecated-declarations]
    resolver->Resolve(SWIG_NewPointerObj((new COpaqueStruct(static_cast< const COpaqueStruct& >((&result)->inner))), SWIGTYPE_p_COpaqueStruct, SWIG_POINTER_OWN |  0 ));
              ^
/Users/coreyphillips/Library/Caches/node-gyp/10.15.1/include/node/v8.h:4106:5: note: 'Resolve' has been explicitly marked deprecated here
    V8_DEPRECATED("Use maybe version", void Resolve(Local<Value> value));
    ^
/Users/coreyphillips/Library/Caches/node-gyp/10.15.1/include/node/v8config.h:327:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
../swig_wrap.cxx:2163:15: warning: 'Reject' is deprecated [-Wdeprecated-declarations]
    resolver->Reject(v8::String::NewFromUtf8(args.GetIsolate(), (const char*) (&result)->inner.ptr));
              ^
/Users/coreyphillips/Library/Caches/node-gyp/10.15.1/include/node/v8.h:4110:5: note: 'Reject' has been explicitly marked deprecated here
    V8_DEPRECATED("Use maybe version", void Reject(Local<Value> value));
    ^
/Users/coreyphillips/Library/Caches/node-gyp/10.15.1/include/node/v8config.h:327:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
../swig_wrap.cxx:2207:37: warning: 'New' is deprecated [-Wdeprecated-declarations]
  resolver = v8::Promise::Resolver::New(args.GetIsolate());
                                    ^
/Users/coreyphillips/Library/Caches/node-gyp/10.15.1/include/node/v8.h:4092:12: note: 'New' has been explicitly marked deprecated here
    static V8_DEPRECATED("Use maybe version",
           ^
/Users/coreyphillips/Library/Caches/node-gyp/10.15.1/include/node/v8config.h:327:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
../swig_wrap.cxx:2211:15: warning: 'Resolve' is deprecated [-Wdeprecated-declarations]
    resolver->Resolve(SWIG_NewPointerObj((new COpaqueStruct(static_cast< const COpaqueStruct& >((&result)->inner))), SWIGTYPE_p_COpaqueStruct, SWIG_POINTER_OWN |  0 ));
              ^
/Users/coreyphillips/Library/Caches/node-gyp/10.15.1/include/node/v8.h:4106:5: note: 'Resolve' has been explicitly marked deprecated here
    V8_DEPRECATED("Use maybe version", void Resolve(Local<Value> value));
    ^
/Users/coreyphillips/Library/Caches/node-gyp/10.15.1/include/node/v8config.h:327:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
../swig_wrap.cxx:2214:15: warning: 'Reject' is deprecated [-Wdeprecated-declarations]
    resolver->Reject(v8::String::NewFromUtf8(args.GetIsolate(), (const char*) (&result)->inner.ptr));
              ^
/Users/coreyphillips/Library/Caches/node-gyp/10.15.1/include/node/v8.h:4110:5: note: 'Reject' has been explicitly marked deprecated here
    V8_DEPRECATED("Use maybe version", void Reject(Local<Value> value));
    ^
/Users/coreyphillips/Library/Caches/node-gyp/10.15.1/include/node/v8config.h:327:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
10 warnings generated.
  SOLINK_MODULE(target) Release/rgb_node.node
clang: error: no such file or directory: '/Users/coreyphillips/Documents/testing/rgb-node/ffi/nodejs/../../target/debug/librgb.so'
make: *** [Release/rgb_node.node] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/coreyphillips/Documents/testing/rgb-node/ffi/nodejs/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:189:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Darwin 19.5.0
gyp ERR! command "/Users/coreyphillips/.nmv/versions/node/v10.15.1/bin/node" "/Users/coreyphillips/Documents/testing/rgb-node/ffi/nodejs/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/coreyphillips/Documents/testing/rgb-node/ffi/nodejs
gyp ERR! node -v v10.15.1
gyp ERR! node-gyp -v v5.1.1
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node ./node_modules/node-gyp/bin/node-gyp.js rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/coreyphillips/.npm/_logs/2020-07-29T12_59_46_311Z-debug.log

Maybe some ideas to add to Android readme

The android library (JNI) could be compiled under ubuntu 16.04

in
build_rust.sh
changed
#!/usr/bin/env sh
to
#!/usr/bin/env bash

follow README in ttps://github.com/LNP-BP/rgb-node/tree/a083e86b5244afc1f175b20fc0086b4fc9b9c15c/ffi/android/library

in
~/.cargo/config
<NDK_HOME>
somehow needed to be relative to the home directory, thus (in my case):
Android/Sdk/ndk/21.3.6528147/

[target.aarch64-linux-android]
ar = "Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-ar"
linker = "Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android26-clang"

[target.x86_64-linux-android]
ar = "Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android-ar"
linker = "Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android26-clang"

[target.armv7-linux-androideabi]
ar = "Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ar"
linker = "Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi26-clang"

[target.i686-linux-android]
ar = "Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android-ar"
linker = "Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android26-clang"

then
./build_rust.sh (succeeds, but gives some warnings)
./gradlew build (errors, but using Android Studio and putting most of the library src directory, excluding the manifest, in the demoapp src directory:

image
(I am sure there is a smarter way)

Anyway I ended up with an error in the Android app logcat:

2020-07-22 02:24:11.840 31750-31807/org.lnpbp.demoapp I/AdrenoGLES: Build Config                     : S P 8.0.8 AArch64
2020-07-22 02:24:11.842 31750-31807/org.lnpbp.demoapp I/AdrenoGLES: PFP: 0x016ee187, ME: 0x00000000
2020-07-22 02:24:11.862 31750-31807/org.lnpbp.demoapp W/Gralloc3: mapper 3.x is not supported
2020-07-22 02:24:11.876 31750-31750/org.lnpbp.demoapp W/Choreographer: Already have a pending vsync event.  There should only be one at a time.
2020-07-22 02:24:11.886 31750-31803/org.lnpbp.demoapp D/rgb::stash::runtime: Received ZMQ RPC request: AddSchema(Schema { field_types: {0: String(8), 1: String(256), 2: String(65535), 3: Unsigned(Bit64, 0, 18446744073709551615), 4: Unsigned(Bit64, 0, 18446744073709551615), 5: Unsigned(Bit64, 0, 18446744073709551615), 6: Unsigned(Bit8, 0, 18), 7: Bytes(65535), 8: Integer(Bit64, 1593870844, 9223372036854775807)}, assignment_types: {0: StateSchema { format: Declarative, abi: {Validate: Standard(IssueControl)} }, 1: StateSchema { format: DiscreteFiniteField(Unsigned64bit), abi: {Validate: Standard(ConfidentialAmount)} }, 2: StateSchema { format: Declarative, abi: {Validate: Standard(Prunning)} }}, genesis: GenesisSchema { metadata: {0: Once, 1: Once, 2: NoneOrOnce, 3: Once, 4: Once, 5: NoneOrOnce, 6: Once, 8: Once}, defines: {0: NoneOrOnce, 1: NoneOrUpTo(None), 2: NoneOrUpTo(None)}, abi: {} }, transitions: {0: TransitionSchema { metadata: {4: Once}, closes: {0: Once}, defines: {0: NoneOrOnce, 1: NoneOrUpTo(None), 2: NoneOrUpTo(None)}, abi: {} }, 1: TransitionSchema { metadata: {}, closes: {1: OnceOrUpTo(None)}, defines: {1: NoneOrUpTo(None)}, abi: {} }, 2: TransitionSchema { metadata: {7: NoneOrUpTo(None)}, closes: {1: OnceOrUpTo(None), 2: OnceOrUpTo(None)}, defines: {1: NoneOrUpTo(None), 2: NoneOrUpTo(None)}, abi: {} }} })
2020-07-22 02:24:11.887 31750-31803/org.lnpbp.demoapp D/rgb::stash::runtime: Got ADD_SCHEMA schema_data1pyqqqqqypqqqzqqyqqqsyqqylllsxqqqpqqqqqqqqqqqqq8llllllllllllsgqqqpqqqqqqqqqqqqq8lllllllllllls2qqqpqqqqqqqqqqqqq8llllllllllllsvqqqqyqpypcqqhll7zqqqyy0ezgqtuqqqqqqlllllllllllh7qcqqqqqqqgqqrlsyqgqqyqqsqqqqqqqqqqqqrllllllllllllcpqqq07qgzqqqqzqqqlupssqqqqqqsqqqqqqqqqqqqqyqqzqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqxqqpqqqqqqqqqqqqqpqqqyqqqqqqqqqqqqq9qqqqqqqqqqqqqqqqqcqqzqqqqqqqqqqqqqyqqqgqqqqqqqqqqqqqxqqqqqqqqqqqqqqqqqqqqyq0alllqqqqqqqqqqpqplhlluqqqqqqqqqqqqqqqqpsqqqqqyqqgqqpqqqqqqqqqqqqqqgqqqqqzqqqqqqqqqqqqqpsqqqqqqqqqqqqqqqqqqqpqrl0llcqqqqqqqqqqgq0alllqqqqqqqqqqqqqqqqqyqqqqqpqqqsplllluqqqqqqqqqqzqqpqrl0llcqqqqqqqqqqqqqqqqzqqqsqpcqlmll7qqqqqqqqqqzqqqsplllluqqqqqqqqqqyq8llllsqqqqqqqqqqsqqyq0alllqqqqqqqqqqpqplhlluqqqqqqqqqqqqqqqqqqqgty8vw
2020-07-22 02:24:11.889 31750-31803/org.lnpbp.demoapp D/rgb::stash::runtime: API request processing complete
2020-07-22 02:24:31.957 31750-31768/org.lnpbp.demoapp D/DecorView: onWindowFocusChangedFromViewRoot hasFocus: true, DecorView@ed05702[MainActivity]
2020-07-22 02:24:33.401 31750-31750/org.lnpbp.demoapp I/rgb: IssueArgs { network: mainnet (magic:d9b4bef9), ticker: "USDT", name: "USD Tether", description: None, issue_structure: SingleIssue, allocations: [Outcoins { coins: 100.0, vout: 0, txid: Some(0313ba7cfcaa66029a1a63918ebc426259f00953016c461663315d1bf6b83ab4) }], precision: 8, prune_seals: [], dust_limit: None }
2020-07-22 02:24:33.402 31750-31805/org.lnpbp.demoapp D/rgb::contracts::fungi..: Received ZMQ RPC request: Issue(Issue { ticker: "USDT", title: "USD Tether", description: None, supply: None, inflatable: None, precision: 8, dust_limit: None, allocate: [Outcoins { coins: 100.0, vout: 0, txid: Some(0313ba7cfcaa66029a1a63918ebc426259f00953016c461663315d1bf6b83ab4) }] })
2020-07-22 02:24:33.402 31750-31805/org.lnpbp.demoapp D/rgb::contracts::fungi..: Got ISSUE Issue { ticker: "USDT", title: "USD Tether", description: None, supply: None, inflatable: None, precision: 8, dust_limit: None, allocate: [Outcoins { coins: 100.0, vout: 0, txid: Some(0313ba7cfcaa66029a1a63918ebc426259f00953016c461663315d1bf6b83ab4) }] }
2020-07-22 02:24:33.548 31750-31803/org.lnpbp.demoapp D/rgb::stash::runtime: Received ZMQ RPC request: AddGenesis(Genesis { schema_id: 619926e8d10a44bb46b28797a7357a552084343e6af1888de084a284083242d3, network: testnet (magic:709110b), metadata: Metadata({0: {String("USDT")}, 1: {String("USD Tether")}, 3: {U64(100)}, 4: {U64(100)}, 5: {U64(0)}, 6: {U8(8)}, 8: {I64(1595377473)}}), assignments: {1: DiscreteFiniteField({Revealed { seal_definition: TxOutpoint(OutpointReveal { blinding: 2082683013, txid: 0313ba7cfcaa66029a1a63918ebc426259f00953016c461663315d1bf6b83ab4, vout: 0 }), assigned_state: Revealed { amount: 100, blinding: SecretKey(cde25ea5afcb2ec2b933fa1120febd70d8b0385183e45a447dd546a46b2dabab) } }}), 2: Declarative({})}, script: [] })
2020-07-22 02:24:33.549 31750-31803/org.lnpbp.demoapp D/rgb::stash::runtime: Got ADD_GENESIS genesis1yqqdxs3jpzz29p8q3ky0z637xjzzq4t6xkne0pajg6a5gzk3aqnfjcgtzyyswpcqqqqqzqppqsq9256y2sqsqqgqyy9qq42ngss9get5dpjhyqcqqyqqxeqqqqqqqqqqqqzqqqgqqdjqqqqqqqqqqqq9qqqsqqcqqqqqqqqqqqqqvqqpqqqqszqqqyqqksv8za0sqqqqqqpqqqgqqypszqqpqzznsgmuksat3asmt5ckx9jxdsq4xz0st93y90ywj9334xszv640cl96zvpsqqqrvsqqqqqqqqqqqgqqeh39afd0evhv9wfnlggjpl4awrvtqwz3s0j953ra64r2g6ed4w4syqqqqqqqqqqy4ve5t
2020-07-22 02:24:33.550 31750-31803/org.lnpbp.demoapp D/rgb::stash::runtime: API request processing complete
2020-07-22 02:24:33.556 31750-31805/org.lnpbp.demoapp D/rgb::contracts::fungi..: API request processing complete
2020-07-22 02:24:33.570 31750-31750/org.lnpbp.demoapp E/RGB_NODE: "Error(\"bad hex string length 66 (expected 64)\", line: 1, column: 188)"
2020-07-22 02:24:33.572 31750-31750/org.lnpbp.demoapp D/OnePlusJankManager:  Chor uploadMDM JANK_TYPE_ONCE mViewTitle = org.lnpbp.demoapp/org.lnpbp.demoapp.MainActivity--- jank level = 2

Oh look it is bedtime ;)

I am sure tomorrow will be a clear day....

Burn & reissue procedures

  • do a separate burn procedure
  • reissue after burn must be epoch-based AND provide meta-field for future zk-proof data

Build error due to compiler upgrade

I get the following error after installation steps on ubuntu 18.04. Mentioned:

mismatched types
--> /home/alice/.cargo/git/checkouts/rust-lnpbp-1c6b6ac6d4fb658b/dbd0d32/src/rgb/contract/amount.rs:92:48
|
92 | match (&self.commitment.0).partial_cmp(&other.commitment.0[..]) {
| ^^^^^^^^^^^^^^^^^^^^^^^ expected array [u8; 33], found slice [u8]
|
= note: expected reference &[u8; 33]
found reference &[u8]

error: aborting due to previous error

For more information about this error, try rustc --explain E0308.
error: could not compile lnpbp.

swig -version: 4.02
python --version: 2.7.17

rustc --explain E0308 gives:

Expected type did not match the received type.

Erroneous code example:

let x: i32 = "I am not a number!";
//     ~~~   ~~~~~~~~~~~~~~~~~~~~
//      |             |
//      |    initializing expression;
//      |    compiler infers type `&str`
//      |
//    type `i32` assigned to variable `x`

This error occurs when the compiler is unable to infer the concrete type of a
variable. It can occur in several cases, the most common being a mismatch
between two types: the type the author explicitly assigned, and the type the
compiler inferred.
mismatched types

Docker set-up documentation

ℹ️ INFORMATION

A getting started documentation would be ideal to have a quick set-up building and running the docker image to run this project in a well-optimized container.

👞 STEPS

  1. Run docker build . for the Dorkerfile (currently named Dockerfile-nodejs) as mention in #53

Expose `validate` and `accept` methods

These two methods https://github.com/LNP-BP/rgb-node/blob/4740b4c2aaf354fb5d3effb7403510e33cefc687/src/contracts/fungible/runtime.rs#L415-L432 should be exposed in i9n mod here https://github.com/LNP-BP/rgb-node/blob/4740b4c2aaf354fb5d3effb7403510e33cefc687/src/i9n/fungible.rs#L156

By "expose" I mean make a method in i9n that calls to fungible via ZMQ RPC API as it does for transfer

@zoedberg @rajarshimaitra pls let me know if any of you would like to pick this task

Implement "blank transition" VM procedure

When some UTXO has an assigned state under multiple contracts with multiple schemas it is required that when one of the stage is transitioned and UTXO is spent the rest of states under all other contracts will be assigned to new outputs. For this, VM should support "blank transition" procedure, which do not modifies state and just re-assignes it to some other output.

https://github.com/LNP-BP/rgb-node/blob/4e9e632c85ae808e81044b4147076879f9701ace/src/contracts/fungible/runtime.rs#L248

Dependency conflict when trying to use rgb-node in another project

rgb-node builds fine for me as its own crate, but when I try to include it in a separate project, I get this error upon cargo check or cargo build:

error: failed to select a version for secp256k1-sys.
... required by package secp256k1 v0.18.0
... which is depended on by bitcoin v0.24.0
... which is depended on by miniscript v2.0.0
... which is depended on by lnpbp v0.1.0-rc.2 (https://github.com/LNP-BP/rust-lnpbp?tag=v0.1.0-rc.2#96832d9b)
... which is depended on by rgb_node v0.1.0-rc.2 (https://github.com/LNP-BP/rgb-node?tag=v0.1.0-rc.2#a46423d6)
... which is depended on by $MY_PROJECT
versions that meet the requirements ^0.2.0 are: 0.2.0

the package secp256k1-sys links to the native library rustsecp256k1_v0_2_0, but it conflicts with a previous package which links to rustsecp256k1_v0_2_0 as well:
package secp256k1-sys v0.3.0
... which is depended on by secp256k1 v0.19.0
... which is depended on by bitcoin v0.25.0
... which is depended on by electrum-client v0.3.0-beta.1
... which is depended on by rgb_node v0.1.0-rc.2 (https://github.com/LNP-BP/rgb-node?tag=v0.1.0-rc.2#a46423d6)
... which is depended on by $MY_PROJECT

failed to select a version for secp256k1-sys which could resolve this conflict

This error is also present for the v0.1.0-rc.1 tag, but not v0.1.0-beta.4.

rgbd panics if it doesn't find daemon binaries

rgbd panics if it is not able to find fungibled and stashd binaries at the default/specified path:

thread 'main' panicked at 'RGBd runtime run loop has failed with error IO(Os { code: 2, kind: NotFound, message: "No such file or directory" })', /[...]/rgb-node/src/service.rs:39:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I believe this should be handled and the node should exit returning an appropriate error message.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.