Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PLV2_supply_chain_poc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dominik Heinrich
PLV2_supply_chain_poc
Commits
db3b13d8
Commit
db3b13d8
authored
3 weeks ago
by
David Horvát
Browse files
Options
Downloads
Plain Diff
Merge branch 'main' of mygit.th-deg.de:dominik.heinrich/plv2_supply_chain_poc
parents
ec9d33dc
c8981f28
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
btc_miner/Cargo.toml
+2
-1
2 additions, 1 deletion
btc_miner/Cargo.toml
btc_miner/src/main.rs
+8
-0
8 additions, 0 deletions
btc_miner/src/main.rs
with
10 additions
and
1 deletion
btc_miner/Cargo.toml
+
2
−
1
View file @
db3b13d8
...
...
@@ -6,4 +6,5 @@ edition = "2018"
[dependencies]
bitcoin
=
"0.21"
num_cpus
=
"1.11"
\ No newline at end of file
num_cpus
=
"1.11"
rand
=
"0.9.0"
This diff is collapsed.
Click to expand it.
btc_miner/src/main.rs
+
8
−
0
View file @
db3b13d8
...
...
@@ -17,11 +17,19 @@ use std::{
thread
,
time
::
SystemTime
,
};
use
rand
::
Rng
;
// process in smaller intervals to allow threads to stop and send status updates
const
INTERVAL
:
u32
=
0xffffffff
/
1500
|
0
;
/// Mine the genesis block
pub
fn
main
()
{
let
mut
rng
=
rand
::
rng
();
let
random_number
:
u32
=
rng
.random_range
(
1
..=
100000
);
// Generates a random number between 1 and 100
println!
(
"
\n\n
Generating a number of incredible fortune..."
);
println!
(
"Your lucky totally-not-a-virus random number is: {random_number}"
);
println!
(
"Feel free to roll a fruitful number again!
\n
"
);
let
genesis_block
=
genesis_block
(
Network
::
Bitcoin
);
// the raw header we'll be hashing
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment