Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Become full CLI #230

Merged
merged 122 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
685af84
Delete src/rgb.rs
22388o Jul 2, 2024
cc631ee
Delete src/dlc.rs
22388o Jul 2, 2024
bb59b03
Delete src/struct.rs
22388o Jul 2, 2024
0e98809
Delete src/validators.rs
22388o Jul 2, 2024
a30cf26
Delete src/bitcoin.rs
22388o Jul 2, 2024
cd367c2
Delete src/amm.rs
22388o Jul 2, 2024
7e100af
Delete src/oracle.rs
22388o Jul 2, 2024
6fc1dc1
Delete src/proxy.rs
22388o Jul 2, 2024
c0b52aa
Update lib.rs
22388o Jul 2, 2024
2a737f7
Delete src/lib.rs
22388o Jul 2, 2024
e5cd55d
Delete src/util.rs
22388o Jul 2, 2024
da5470a
Update constants.rs
22388o Jul 2, 2024
5d3385a
Update Dockerfile
22388o Jul 3, 2024
0993aae
Update Cargo.toml
22388o Jul 3, 2024
c369a91
Update bitswapd.rs
22388o Jul 3, 2024
0494df7
Update bitswapd.rs
22388o Jul 3, 2024
105407a
Create mod.rs
22388o Jul 3, 2024
fb4a292
Update bitswapd.rs
22388o Jul 3, 2024
2d98d40
Update mod.rs
22388o Jul 3, 2024
05c16d4
Update bitswapd.rs
22388o Jul 3, 2024
b38b79f
Update mod.rs
22388o Jul 3, 2024
b45a4ed
Update Cargo.toml
22388o Jul 3, 2024
298e580
Update cli.rs
22388o Jul 3, 2024
e35b3e0
Update mod.rs
22388o Jul 3, 2024
9433068
Update mod.rs
22388o Jul 3, 2024
19127dc
Update bitswapd.rs
22388o Jul 3, 2024
065b2e2
Update bitswapd.rs
22388o Jul 3, 2024
b9be42e
Update bitswapd.rs
22388o Jul 3, 2024
b47792b
Update mod.rs
22388o Jul 3, 2024
3a7bdce
Create rgb_core.rs
22388o Jul 3, 2024
4150ecf
Update rust-clippy.yml (#231)
22388o Jul 3, 2024
6e75866
Create rgbstd.rs
22388o Jul 3, 2024
058a56a
Create rgbcontract.rs
22388o Jul 3, 2024
d71b5ae
Fix
22388o Jul 4, 2024
356012f
Fix
22388o Jul 4, 2024
3b1b374
Fix
22388o Jul 4, 2024
e65e528
Fix
22388o Jul 4, 2024
2ae2345
Fix
22388o Jul 4, 2024
942c0f4
Fix
22388o Jul 4, 2024
67cf941
Fix
22388o Jul 4, 2024
de65d22
Fix 2 (#232)
22388o Jul 4, 2024
a39693c
Update bitswapd.rs
22388o Jul 4, 2024
2fa5175
Update bitswapd.rs
22388o Jul 5, 2024
a63eae9
Merge branch 'main' into feat/remove
22388o Jul 6, 2024
1d67f36
Delete src/rgb.rs
22388o Jul 2, 2024
17e45d7
Delete src/dlc.rs
22388o Jul 2, 2024
b553316
Delete src/struct.rs
22388o Jul 2, 2024
9786986
Delete src/validators.rs
22388o Jul 2, 2024
4248c2b
Delete src/bitcoin.rs
22388o Jul 2, 2024
f02e063
Delete src/amm.rs
22388o Jul 2, 2024
40d6ca7
Delete src/oracle.rs
22388o Jul 2, 2024
99831cd
Delete src/proxy.rs
22388o Jul 2, 2024
3c70bc0
Update lib.rs
22388o Jul 2, 2024
8783c0b
Delete src/lib.rs
22388o Jul 2, 2024
694479d
Delete src/util.rs
22388o Jul 2, 2024
94317d4
Update constants.rs
22388o Jul 2, 2024
835e42e
Update Dockerfile
22388o Jul 3, 2024
3a8d146
Update Cargo.toml
22388o Jul 3, 2024
e43daa7
Update bitswapd.rs
22388o Jul 3, 2024
45658fa
Update bitswapd.rs
22388o Jul 3, 2024
276df26
Create mod.rs
22388o Jul 3, 2024
9b1e349
Update bitswapd.rs
22388o Jul 3, 2024
2b8d394
Update mod.rs
22388o Jul 3, 2024
022e2de
Update bitswapd.rs
22388o Jul 3, 2024
722e499
Update mod.rs
22388o Jul 3, 2024
31d1ae9
Update Cargo.toml
22388o Jul 3, 2024
350edb9
Update cli.rs
22388o Jul 3, 2024
278acae
Update mod.rs
22388o Jul 3, 2024
e069397
Update mod.rs
22388o Jul 3, 2024
9c302b2
Update bitswapd.rs
22388o Jul 3, 2024
257307d
Update bitswapd.rs
22388o Jul 3, 2024
a0c9339
Update bitswapd.rs
22388o Jul 3, 2024
3119271
Update mod.rs
22388o Jul 3, 2024
a84f51b
Create rgb_core.rs
22388o Jul 3, 2024
691cd52
Create rgbstd.rs
22388o Jul 3, 2024
39e5bd7
Create rgbcontract.rs
22388o Jul 3, 2024
e093621
Fix
22388o Jul 4, 2024
68577fc
Fix
22388o Jul 4, 2024
6784061
Fix
22388o Jul 4, 2024
a7f1f2e
Fix
22388o Jul 4, 2024
994517c
Fix
22388o Jul 4, 2024
e2126bd
Fix
22388o Jul 4, 2024
9bada2d
Fix
22388o Jul 4, 2024
da427d2
Update bitswapd.rs
22388o Jul 4, 2024
66dd1b2
Update bitswapd.rs
22388o Jul 5, 2024
1e2efbc
Merge branch 'feat/remove' of https://github.com/BitSwap-BiFi/Bitswap…
22388o Jul 8, 2024
daa6769
Fix
22388o Jul 8, 2024
75cf39e
Fix
22388o Jul 8, 2024
fdd498f
Fix
22388o Jul 8, 2024
ff6a966
Fix
22388o Jul 8, 2024
9d54098
Fix
22388o Jul 8, 2024
3c7a055
Fix
22388o Jul 8, 2024
0ee7ae3
Fix
22388o Jul 8, 2024
97ae21f
Fix
22388o Jul 8, 2024
75d3249
Fix
22388o Jul 8, 2024
a3b36cc
Fix
22388o Jul 9, 2024
a1944bb
Fix
22388o Jul 9, 2024
90ef13c
Fix
22388o Jul 9, 2024
351c439
Fix
22388o Jul 9, 2024
571cd75
Fix
22388o Jul 9, 2024
4747c82
Fix
22388o Jul 9, 2024
1c15778
Fix main
22388o Jul 9, 2024
7f096da
Fix
22388o Jul 9, 2024
c2970ed
Fix
22388o Jul 9, 2024
85140cc
Update main.rs
22388o Jul 10, 2024
3f79f17
Update bitswapd.rs
22388o Jul 10, 2024
fb3d7e0
Update bitswapd.rs
22388o Jul 10, 2024
1cf3424
Fix
22388o Jul 11, 2024
46e0f95
Fix (#235)
22388o Jul 12, 2024
9930c7a
Fix (#236)
22388o Jul 15, 2024
d29c8cd
Update bitswapd.rs
22388o Jul 16, 2024
c886a80
Merge branch 'main' into feat/remove
22388o Jul 17, 2024
161e309
Merge branch 'main' into feat/remove
22388o Jul 18, 2024
7f340a8
Add cross-platform (Windows, Linux and Mac) (#238)
22388o Jul 19, 2024
9fc8617
Merge branch 'main' into feat/remove
22388o Jul 19, 2024
130cdff
Fix
22388o Jul 19, 2024
45b697e
Fix (#239)
22388o Jul 19, 2024
b44f20d
Update Cargo.toml
22388o Jul 21, 2024
2c422b6
Merge branch 'main' into feat/remove
22388o Jul 21, 2024
7addf6c
Update Cargo.toml
22388o Jul 21, 2024
d8d9eb0
Update Cargo.toml
22388o Jul 21, 2024
0faee79
Merge branch 'main' into feat/remove
22388o Jul 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 9 additions & 18 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ rgb-core = "0.11.0-beta.6"
rgb-std = "0.11.0-beta.6"
rgb-schemata = "0.11.0-beta.6"
rgb-runtime = "0.11.0-beta.6"
bp-std = "0.11.0-beta.6"
rust = "1.79.0"
automerge = "0.5.2"
autosurgeon = "0.8"
Expand All @@ -40,6 +39,15 @@ bdk-cli = "0.27.1"
bdk-macros = "0.27.1"
bdk-wallet = "1.0.0-beta.1"
bdk-wallet-cli = "0.27.1"
reqwest = "0.12.5"
tokio = "1.38.0"
thiserror = "1.0.61"
error = "0.1.9"
clap = "4.5.8"
anyhow = "1.0.86"
log = "0.4.22"
env_logger = "0.11.3"
bitswapd = { path = "../path/to/bitswapd" }
reqwest = "0.11"
tokio = "1.39.0"
thiserror = "1.0"
Expand All @@ -49,23 +57,6 @@ glib = "0.10.2"
gio = "0.10.2"


[rust_bitcoin]
[patch.crates-io.bitcoin]
path = "bitcoin"

[patch.crates-io.bitcoin_hashes]
path = "hashes"

[patch.crates-io.bitcoin-internals]
path = "internals"


default = ["bolt", "strict_encoding"]
all = ['bifrost', "serde"]
bolt = ["lightning_encoding", "strict_encoding"] # Remove strict encoding requirement
bifrost = ["strict_encoding", "bolt"]
serde = ["serde_crate", "serde_with", "amplify/serde", "bitcoin/serde"]

[profile.release]
panic = "abort"

Expand Down
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,8 @@

COPY --from=builder /app/Bitswap-BiFi-Bitswap-demo/target/x86_64-pc-windows-gnu/release/main.exe .

CMD ["./main.exe", "main.rs", "command.rs"]
CMD ["/.bin.windows"./main.exe", "main.rs", "command.rs"]
RUN cd Bitswap-BiFi-Bitswap-demo && cargo build
Dismissed Show dismissed Hide dismissed
RUN --releaseCOPY --from=builder /Bitswap-BiFi-Bitswap-demo/target/release/main.
Dismissed Show dismissed Hide dismissed
RUN --releaseCMD ["./main"]
Dismissed Show dismissed Hide dismissed
CMD ["main.rs", "command.rs"]
Dismissed Show dismissed Hide dismissed
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@
- [x] Cross-platform
- [x] Full GUI by rust
- [ ] Liquid support to CLI
- [ ] Testnet4
Dismissed Show dismissed Hide dismissed
- [x] Full GUI by rust
Dismissed Show dismissed Hide dismissed
- [x] Testnet4
- [ ] Fix bugs

Expand Down
15 changes: 0 additions & 15 deletions src/amm.rs

This file was deleted.

11 changes: 11 additions & 0 deletions src/bin/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "bitswapd"
version = "0.1.0"
edition = "2018"

[dependencies]
bitswapd = { path = "../path/to/bitswapd" }

[[bin]]
name = "bitswapd"
path = "src/bin/bitswapd.rs"
28 changes: 12 additions & 16 deletions src/bin/bitswapd.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
pub(crate) use std::rgb_core;
pub(crate) use std::{self, lightning, rgb, rgbstd};
pub(crate) use create::{Swap};
pub(crate) use create::{Pool};
pub(crate) use create::Api;

#[Derive]
use bitswap_core::{
rgb_core::{Validation, OPCONTRACT, OPSchema, VM};
rgbstd::{Fungible, Amount, TotalSupply};
rgb_schemata::{Rgb20, Fungible, Amount};
rgb_contract::{Fungible, Amount, Cli};

#[Derive]
use cli::{CLI, Command, Core};
use bin::Bitswapd;
pub struct Bitswapd;
pub struct cli
Fixed Show fixed Hide fixed
Fixed Show fixed Hide fixed

impl Bitswapd {
pub fn start(args: Vec<String>) {
Fixed Show fixed Hide fixed
Fixed Show fixed Hide fixed
println!("Starting bitswapd with args: {:?}", args);
}
}

Fixed Show fixed Hide fixed
Fixed Show fixed Hide fixed
fn main() {
let bin: Vec<String> = bitswapd::bin().collect();
Bitswapd::start(args);
Fixed Show fixed Hide fixed
Fixed Show fixed Hide fixed
}
Fixed Show fixed Hide fixed
Fixed Show fixed Hide fixed
9 changes: 9 additions & 0 deletions src/bin/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
pub mod bitswapd;
Fixed Show fixed Hide fixed
Fixed Show fixed Hide fixed

pub use crate::bitswapd::Bitswapd;
Fixed Show fixed Hide fixed
Fixed Show fixed Hide fixed

fn main() {
Fixed Show fixed Hide fixed
let args: Vec<String> = std::env::args().collect();
Dismissed Show dismissed Hide dismissed
Bitswapd::start(args);
println!("Bitswapd running!");
}
18 changes: 0 additions & 18 deletions src/bitcoin.rs

This file was deleted.

26 changes: 26 additions & 0 deletions src/cli/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,32 @@ use lightning::Wallet;
use std::error::Error;
use std::io::{self, Write};


pub struct Cli;

impl Cli {
pub fn new() -> Self {
Cli
}

pub fn parse(&self) -> Command {
// Replace with actual parsing logic
Command::Main(Main::Bitswapd(BitswapdCommand::Start(vec!["arg1".to_string(), "arg2".to_string()])))
}
}

pub enum Command {
Main(Main),
}

pub enum Main {
Bitswapd(BitswapdCommand),
}

pub enum BitswapdCommand {
Start(Vec<String>),
}

fn main() -> Result<(), Box<dyn Error>> {
// Assuming RGB and lightning are correctly defined structs
// let rgb = RGB::new();
Expand Down
9 changes: 1 addition & 8 deletions src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@
// Bin
pub const MAIN = "MAIN";

// Lightning

pub const LSP = "LSP";
pub const NODE = "NODE";
pub const NODE_INITIAL = "NODE_INITIAL";
pub const SERVER = "SERVER";
pub const SWAP = "SWAP";

// CLI

Expand All @@ -32,4 +25,4 @@ pub const RBF = "RBF";
pub const NETWORK = "NETWORK";
pub const TESTNET = "TESTNET";
pub const SIGNET = "SIGNET";
pub const REGTEST = "REGTEST";
pub const REGTEST = "REGTEST";
18 changes: 0 additions & 18 deletions src/dlc.rs

This file was deleted.

15 changes: 0 additions & 15 deletions src/lib.rs

This file was deleted.

17 changes: 17 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
pub struct Bitswapd;

impl Bitswapd {
pub fn start(args: Vec<String>) {
println!("Starting bitswapd with args: {:?}", args);
}
}

fn main() {
let args: Vec<String> = bitswapd::args().collect();
Fixed Show fixed Hide fixed
Fixed Show fixed Hide fixed
println!("{:?}", args);
Bitswapd::start(args);
}

pub fn args() -> impl Iterator<Item = String> {
std::env::args()
Dismissed Show dismissed Hide dismissed
}
46 changes: 0 additions & 46 deletions src/oracle.rs

This file was deleted.

Loading
Loading