-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose the vdf_sha2_nif to help with debugging a Rust implementation
- Loading branch information
1 parent
d2c5fd1
commit 4fd88d2
Showing
4 changed files
with
73 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
-module(ar_manual_vdf). | ||
|
||
-export([manual_vdf/0]). | ||
|
||
-include_lib("arweave/include/ar_vdf.hrl"). | ||
|
||
manual_vdf() -> | ||
PrevOutput = ar_util:decode(<<"W-5B1F7rYIayc_1d3nq3bsLanXNympgA3tkIXOT0EF8">>), | ||
StepNumber = 21499625, | ||
Salt = ar_vdf:step_number_to_salt_number(StepNumber-1), | ||
Salt2 = << Salt:256 >>, | ||
CheckpointCount = 0, | ||
SkipCheckpointCount = 0, | ||
Iterations = 1, | ||
{ok, Output, _CheckpointsBuffer} = | ||
ar_mine_randomx:vdf_sha2_nif( | ||
Salt2, PrevOutput, CheckpointCount, SkipCheckpointCount, Iterations), | ||
io:format("~n~n"), | ||
io:format("Salt: ~p~n", [ar_util:encode(Salt2)]), | ||
io:format("Output: ~p~n", [ar_util:encode(Output)]). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
SCRIPT_DIR="$(dirname "$0")" | ||
cd "$SCRIPT_DIR/.." | ||
|
||
echo Building dependencies... | ||
./rebar3 compile | ||
|
||
ERL="erl" | ||
# ERL="$ERL_TOP/bin/cerl -debug" | ||
|
||
$ERL +MBas aobf +MBlmbcs 512 +A100 +SDio100 +Bi -pa `./rebar3 path` \ | ||
-config config/sys.config -args_file config/vm.args.dev \ | ||
-run ar manual_vdf ${@:1} | ||
|