Skip to content

Commit

Permalink
feat(hb_store): switch local_store to hb_store_rocksdb
Browse files Browse the repository at this point in the history
  • Loading branch information
oltarasenko committed Dec 11, 2024
1 parent 435419d commit 48a0096
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
16 changes: 15 additions & 1 deletion src/ar_bundles.erl
Original file line number Diff line number Diff line change
Expand Up @@ -944,10 +944,24 @@ ar_bundles_test_() ->
{timeout, 30, fun test_bundle_map/0},
{timeout, 30, fun test_basic_member_id/0},
{timeout, 30, fun test_deep_member/0},
{timeout, 30, fun test_serialize_deserialize_deep_signed_bundle/0},
{timeout, 30, fun test_extremely_large_bundle/0}
].

ar_bundles_with_hb_store_test_() ->
{foreach,
fun() ->
Opts = hb_opts:get(local_store),
hb_store:start(Opts)
end,
fun(_) ->
Opts = hb_opts:get(local_store),
hb_store:stop(Opts)
end,
[
{timeout, 30, fun test_serialize_deserialize_deep_signed_bundle/0}
]
}.

test_no_tags() ->
{Priv, Pub} = ar_wallet:new(),
{KeyType, Owner} = Pub,
Expand Down
2 changes: 1 addition & 1 deletion src/hb_opts.erl
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ config() ->
client_error_strategy => throw,
% Dev options
local_store =>
[{hb_store_fs, #{ prefix => "TEST-data" }}],
[{hb_store_rocksdb, #{ prefix => "TEST-data" }}],
mode => debug,
debug_stack_depth => 40,
debug_print_map_line_threshold => 30,
Expand Down
3 changes: 1 addition & 2 deletions src/hb_store_rocksdb.erl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ start_link(Opts) ->

% -spec start(#{dir := term()}) -> ignore | {ok, pid()}.
start(Opts) ->
start_link(Opts).
start_link([{hb_store_rocksdb, Opts}]).

-spec stop(any()) -> ok.
stop(_Opts) ->
Expand Down Expand Up @@ -211,7 +211,6 @@ add_path(_Opts, Path1, Path2) ->
%%% Gen server callbacks
%%%=============================================================================
init(Dir) ->
logger:error("Starting the process"),
{ok, DBHandle, [DefaultH, MetaH]} = open_rockdb(Dir),
State = #{
db_handle => DBHandle,
Expand Down

0 comments on commit 48a0096

Please sign in to comment.