Skip to content

Commit faac292

Browse files
committed
Move SEED_HEX to config parsing
chore: * remove Settings entity * move logic of obtaining Settings * add aggregate config to obtain value from it to functions * remove irrelevant line from Guide * remove last redundant in cli
1 parent 1d1ec0e commit faac292

29 files changed

+953
-206
lines changed

.simplicity-dex.example/.simplicity-dex.config.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ relays = [
44
"wss://relay.damus.io",
55
"wss://nostr.wine/",
66
]
7+
seed_hex = "your_hex_value"

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ simplicity-lang = { version = "0.6.0" }
3737
simplicityhl = { version = "0.2.0" }
3838
simplicityhl-core = { git = "https://github.com/BlockstreamResearch/simplicity-contracts.git", rev = "baa8ab7", package = "simplicityhl-core", features = ["encoding"] }
3939
sled = { version = "0.34.7" }
40+
tempfile = { version = "3.23.0" }
4041
thiserror = { version = "2.0.17" }
4142
tokio = { version = "1.48.0", features = ["macros", "test-util", "rt", "rt-multi-thread", "tracing" ] }
43+
toml = { version = "0.9.8" }
4244
tracing = { version = "0.1.41" }
4345
tracing-appender = { version = "0.2.3" }
4446
tracing-subscriber = { version = "0.3.19", features = ["env-filter"] }

Guide.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
# Simplicity DEX — Developer Guide
2-
3-
This short guide helps contributors understand, build, test and extend the project. It focuses on practical commands and
4-
the patterns used across crates (not exhaustive; follow Rust and crate docs for deeper dives).
1+
# Simplicity DEX - Guide
52

63
## Project layout
74

@@ -24,6 +21,7 @@ the patterns used across crates (not exhaustive; follow Rust and crate docs for
2421
- `mv ./target/release/simplicity-dex ./demo/simplicity-dex`
2522
- `cp ./.simplicity-dex.example/.simplicity-dex.config.toml ./demo/.simplicity-dex.config.toml`
2623
- `echo SEED_HEX=ffff0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab > ./demo/.env`
24+
- `cd /demo`
2725
3. Insert your valid nostr keypair into `.simplicity-dex.config.toml`
2826

2927
## Commands example execution
@@ -42,6 +40,8 @@ Maker and Taker responsible for taking such steps:
4240
* Early termination
4341
6) After `settlement-height` both maker and taker can use settlement exit to receive their tokens (collateral or settlement) depending on the settlement token price, which is signed with oracle.
4442

43+
### Example
44+
4545
1. Create your own contract with your values. For example can be taken
4646

4747
* `taker-funding-start-time` 1764328373 (timestamp can be taken from https://www.epochconverter.com/)
@@ -79,9 +79,9 @@ Actual command in cli:
7979
```bash
8080
./simplicity-dex maker fund
8181
--filler-utxo <FILLER_TOKEN_UTXO>
82-
--grant-coll-utxo <GRANTOR_COLLATERAL_TOKEN_UTXO>
83-
--grant-settl-utxo <GRANTOR_SETTLEMENT_TOKEN_UTXO>
84-
--settl-asset-utxo <SETTLEMENT_ASSET_UTXO>
82+
--grantor-collateral-utxo <GRANTOR_COLLATERAL_TOKEN_UTXO>
83+
--grantor-settlement-utxo <GRANTOR_SETTLEMENT_TOKEN_UTXO>
84+
--settlement-asset-utxo <SETTLEMENT_ASSET_UTXO>
8585
--fee-utxo <FEE_UTXO>
8686
--taproot-pubkey-gen <DCD_TAPROOT_PUBKEY_GEN>
8787
```

crates/dex-cli/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,6 @@ thiserror = { workspace = true }
3737
tokio = { workspace = true }
3838
tracing = { workspace = true }
3939

40+
[dev-dependencies]
41+
tempfile = { workspace = true}
42+
toml = { workspace = true }

crates/dex-cli/src/cli/maker.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ pub enum MakerCommands {
3939
#[arg(long = "filler-utxo")]
4040
filler_token_utxo: OutPoint,
4141
/// UTXO containing Maker grantor collateral tokens to be locked or burned
42-
#[arg(long = "grant-coll-utxo")]
42+
#[arg(long = "grantor-collateral-utxo")]
4343
grantor_collateral_token_utxo: OutPoint,
4444
/// UTXO containing Maker grantor settlement tokens to be locked or burned
45-
#[arg(long = "grant-settl-utxo")]
45+
#[arg(long = "grantor-settlement-utxo")]
4646
grantor_settlement_token_utxo: OutPoint,
4747
/// UTXO providing the settlement asset (e.g. LBTC) for the DCD contract
48-
#[arg(long = "settl-asset-utxo")]
48+
#[arg(long = "settlement-asset-utxo")]
4949
settlement_asset_utxo: OutPoint,
5050
/// UTXO used to pay miner fees for the Maker funding transaction
5151
#[arg(long = "fee-utxo")]

0 commit comments

Comments
 (0)