Skip to content

Commit

Permalink
feat: dibbler new genesis block with faucet utxos (tari-project#3688)
Browse files Browse the repository at this point in the history
Description
---
Generates a new genesis block for `dibbler` network, with faucet utxos

Motivation and Context
---
Previous genesis block was missing faucet utxos

How Has This Been Tested?
---
- Relevant unit tests
- Built nodes, wallets, miner, started mining new chain, sent transactions between wallets
- Registered a new asset, minted tokens, but was unable to send token between wallets (could not find by unique id, I think that has changed recently)
  • Loading branch information
Byron Hambly authored Jan 10, 2022
1 parent 9dc7c13 commit 10011d1
Show file tree
Hide file tree
Showing 6 changed files with 4,097 additions and 31 deletions.
6 changes: 4 additions & 2 deletions applications/test_faucet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ version = "0.22.1"
authors = ["The Tari Development Community"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]
simd = ["tari_crypto/simd"]
avx2 = ["simd"]

[dependencies]
tari_crypto = { git = "https://github.com/tari-project/tari-crypto.git", branch = "main" }
tari_utilities = "^0.3"
tari_common_types ={path="../../base_layer/common_types"}
tari_common_types = { path = "../../base_layer/common_types" }

rand = "0.8"
serde = { version = "1.0.97", features = ["derive"] }
Expand Down
17 changes: 17 additions & 0 deletions applications/test_faucet/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# testnet faucet utxo generator

- To build the generator in release mode with avx2 enabled, run this command from the root folder of the tari repo:

```bash
RUSTFLAGS='-C target-feature=+avx2' cargo build --bin test_faucet --release --features avx2
```

- Copy the generated `test_faucet` binary from `target/release` to another folder
- Navigate to that folder and execute the binary: `./test_faucet`
- You should now have these additional files: `utxos.json` and `keys.json`

- go to `print_new_genesis_block` test and check network is correct, then run the test to print the new raw block:

```
cargo test --package tari_core --test mempool -- helpers::block_builders::print_new_genesis_block --exact --nocapture --ignored
```
1 change: 1 addition & 0 deletions applications/test_faucet/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ async fn write_keys(mut rx: mpsc::Receiver<(TransactionOutput, PrivateKey, Micro
excess,
excess_sig: sig,
};
let kernel = serde_json::to_string(&kernel).unwrap();
let _ = utxo_file.write_all(format!("{}\n", kernel).as_bytes());

println!("Done.");
Expand Down
Loading

0 comments on commit 10011d1

Please sign in to comment.