Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename data -> genesis_data to avoid confusion with data_dir #699

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 0 additions & 3 deletions apps/arweave/include/ar.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,6 @@
%% Transaction headers directory, relative to the disk cache directory.
-define(DISK_CACHE_TX_DIR, "txs").

%% Directory with files indicating completed storage migrations, relative to the data dir.
-define(STORAGE_MIGRATIONS_DIR, "data/storage_migrations").

%% Backup block hash list storage directory, relative to the data dir.
-define(HASH_LIST_DIR, "hash_lists").

Expand Down
6 changes: 3 additions & 3 deletions apps/arweave/src/ar_http_iface_middleware.erl
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ handle(<<"GET">>, [<<"tx">>, Hash, << "data.", _/binary >>], Req, _Pid) ->
{ok, ID} ->
case ar_storage:read_tx(ID) of
unavailable ->
{404, #{ <<"content-type">> => <<"text/html; charset=utf-8">> }, sendfile("data/not_found.html"), Req};
{404, #{ <<"content-type">> => <<"text/html; charset=utf-8">> }, sendfile("genesis_data/not_found.html"), Req};
#tx{} = TX ->
serve_tx_html_data(Req, TX)
end
Expand Down Expand Up @@ -1666,7 +1666,7 @@ serve_tx_data(Req, #tx{ format = 2, id = ID, data_size = DataSize } = TX) ->
{error, not_found} when DataSize == 0 ->
{200, #{}, <<>>, Req};
{error, not_found} ->
{404, #{ <<"content-type">> => <<"text/html; charset=utf-8">> }, sendfile("data/not_found.html"), Req};
{404, #{ <<"content-type">> => <<"text/html; charset=utf-8">> }, sendfile("genesis_data/not_found.html"), Req};
{error, timeout} ->
{503, #{}, jiffy:encode(#{ error => timeout }), Req}
end
Expand Down Expand Up @@ -1700,7 +1700,7 @@ serve_format_2_html_data(Req, ContentType, TX) ->
{error, not_found} when TX#tx.data_size == 0 ->
{200, #{ <<"content-type">> => ContentType }, <<>>, Req};
{error, not_found} ->
{404, #{ <<"content-type">> => <<"text/html; charset=utf-8">> }, sendfile("data/not_found.html"), Req};
{404, #{ <<"content-type">> => <<"text/html; charset=utf-8">> }, sendfile("genesis_data/not_found.html"), Req};
{error, timeout} ->
{503, #{}, jiffy:encode(#{ error => timeout }), Req}
end
Expand Down
2 changes: 1 addition & 1 deletion apps/arweave/src/ar_node_worker.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1689,7 +1689,7 @@ read_hash_list_2_0_for_1_0_blocks() ->
Fork_2_0 = ar_fork:height_2_0(),
case Fork_2_0 > 0 of
true ->
File = filename:join(["data", "hash_list_1_0"]),
File = filename:join(["genesis_data", "hash_list_1_0"]),
{ok, Binary} = file:read_file(File),
HL = lists:map(fun ar_util:decode/1, jiffy:decode(Binary)),
Fork_2_0 = length(HL),
Expand Down
1 change: 0 additions & 1 deletion apps/arweave/src/ar_storage.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,6 @@ ensure_directories(DataDir) ->
filelib:ensure_dir(filename:join(DataDir, ?BLOCK_DIR) ++ "/"),
filelib:ensure_dir(filename:join(DataDir, ?WALLET_LIST_DIR) ++ "/"),
filelib:ensure_dir(filename:join(DataDir, ?HASH_LIST_DIR) ++ "/"),
filelib:ensure_dir(filename:join(DataDir, ?STORAGE_MIGRATIONS_DIR) ++ "/"),
filelib:ensure_dir(filename:join([DataDir, ?TX_DIR, "migrated_v1"]) ++ "/").

get_same_disk_storage_modules_total_size() ->
Expand Down
2 changes: 1 addition & 1 deletion apps/arweave/src/ar_util.erl
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ pfilter(Fun, List) ->

%% @doc Generate a list of GENESIS wallets, from the CSV file.
genesis_wallets() ->
{ok, Bin} = file:read_file("data/genesis_wallets.csv"),
{ok, Bin} = file:read_file("genesis_data/genesis_wallets.csv"),
lists:map(
fun(Line) ->
[Addr, RawQty] = string:tokens(Line, ","),
Expand Down
8 changes: 4 additions & 4 deletions apps/arweave/src/ar_weave.erl
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,13 @@ add_padding(Data, LeftoverBytes) ->
<<Data/binary, Padding:LeftoverBytes/unit:8>>.

add_mainnet_v1_genesis_txs() ->
case filelib:is_dir("data/genesis_txs") of
case filelib:is_dir("genesis_data/genesis_txs") of
true ->
{ok, Files} = file:list_dir("data/genesis_txs"),
{ok, Files} = file:list_dir("genesis_data/genesis_txs"),
{ok, Config} = application:get_env(arweave, config),
lists:foldl(
fun(F, Acc) ->
SourcePath = "data/genesis_txs/" ++ F,
SourcePath = "genesis_data/genesis_txs/" ++ F,
TargetPath = Config#config.data_dir ++ "/" ++ ?TX_DIR ++ "/" ++ F,
file:copy(SourcePath, TargetPath),
[ar_util:decode(hd(string:split(F, ".")))|Acc]
Expand All @@ -174,7 +174,7 @@ add_mainnet_v1_genesis_txs() ->
Files
);
false ->
?LOG_WARNING("data/genesis_txs directory not found. Node might not index the genesis "
?LOG_WARNING("genesis_data/genesis_txs directory not found. Node might not index the genesis "
"block transactions."),
[]
end.
Expand Down
Loading
Loading