CI: fix scripts/gen_genesis.ml
This commit is contained in:
parent
e1f66ffa85
commit
6792c61023
@ -14,17 +14,20 @@
|
|||||||
#mod_use "../src/lib_stdlib/utils.ml";;
|
#mod_use "../src/lib_stdlib/utils.ml";;
|
||||||
#mod_use "../src/lib_crypto/base58.ml";;
|
#mod_use "../src/lib_crypto/base58.ml";;
|
||||||
|
|
||||||
let date =
|
|
||||||
Lwt_main.run (Lwt_process.pread_line (Lwt_process.shell "date +%FT%TZ --utc"))
|
|
||||||
|
|
||||||
let prefix = "BLockGenesisGenesisGenesisGenesisGenesis"
|
let prefix = "BLockGenesisGenesisGenesisGenesisGenesis"
|
||||||
let suffix = String.sub Digest.(to_hex (string date)) 0 5
|
let rec genesis () =
|
||||||
let p =
|
let date =
|
||||||
|
Lwt_main.run
|
||||||
|
(Lwt_process.pread_line (Lwt_process.shell "date +%FT%TZ --utc")) in
|
||||||
|
let suffix = String.sub Digest.(to_hex (string date)) 0 5 in
|
||||||
match Base58.raw_decode (prefix ^ suffix ^ "crcCRC") with
|
match Base58.raw_decode (prefix ^ suffix ^ "crcCRC") with
|
||||||
| None -> assert false
|
| None -> genesis ()
|
||||||
| Some s -> s
|
| Some p ->
|
||||||
let p = String.sub p 0 (String.length p - 4)
|
let p = String.sub p 0 (String.length p - 4) in
|
||||||
let genesis = Base58.safe_encode p
|
Base58.safe_encode p, date
|
||||||
|
|
||||||
|
let genesis, date = genesis ()
|
||||||
|
|
||||||
let () =
|
let () =
|
||||||
Lwt_main.run (Lwt_io.lines_to_file "alphanet_version"
|
Lwt_main.run (Lwt_io.lines_to_file "alphanet_version"
|
||||||
|
Loading…
Reference in New Issue
Block a user