Skip to content

Commit

Permalink
Merge pull request #3 from blockfrost/publicEts
Browse files Browse the repository at this point in the history
Public ETS table, clarify setup/0 in readme
  • Loading branch information
sorki authored Jan 18, 2024
2 parents 755b0c1 + 65c6236 commit 652b538
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Version [0.1.1](https://github.com/blockfrost/blockfrost-erlang/compare/0.1.0...0.1.1) (2024-01-18)

* Fix public ETS table setup [#3](https://github.com/blockfrost/blockfrost-erlang/pull/3)

# Version [0.1.0](https://github.com/blockfrost/blockfrost-erlang/compare/c245452...0.1.0) (2024-01-16)

* Initial release
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ rebar3 shell
```

If you export `BLOCKFROST_TOKEN_PATH` environment variable
you can use `blockfrost:setup().` to automatically load
it and configure network and token:
`blockfrost-erlang` will automatically load
and configure network and token:

```sh
export BLOCKFROST_TOKEN_PATH=~/.blockfrost.mainnet.token
Expand All @@ -67,7 +67,6 @@ export BLOCKFROST_TOKEN_PATH=~/.blockfrost.mainnet.token
Then in `eshell`:

```erlang
blockfrost:setup().
blockfrost:get_blocks_latest().

{ok, Block} = blockfrost:get_blocks_latest().
Expand All @@ -76,7 +75,7 @@ TxCount = maps:get(<<"tx_count">>, Block).
io:format("Block ~p tx count: ~p~n", [binary:bin_to_list(Hash), TxCount]).
```

Otherwise you can use `setup/1` function
Alternatively you can use `setup/1` function
which accepts a project string, for example

```erlang
Expand Down
2 changes: 1 addition & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
with pkgs.beamPackages;
buildRebar3 {
name = "blockfrost_erlang";
version = "0.1.0";
version = "0.1.1";
src = ./.;
profile = "prod";
beamDeps = builtins.attrValues
Expand Down
2 changes: 1 addition & 1 deletion example/rebar.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{erl_opts, [debug_info]}.
{deps, [
{blockfrost_erlang, "0.1.0"}
{blockfrost_erlang, "0.1.1"}
]}.

{shell, [
Expand Down
2 changes: 1 addition & 1 deletion example/rebar.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{"1.2.0",
[{<<"blockfrost_erlang">>,{pkg,<<"blockfrost_erlang">>,<<"0.1.0">>},0},
[{<<"blockfrost_erlang">>,{pkg,<<"blockfrost_erlang">>,<<"0.1.1">>},0},
{<<"certifi">>,{pkg,<<"certifi">>,<<"2.12.0">>},2},
{<<"hackney">>,{pkg,<<"hackney">>,<<"1.19.1">>},1},
{<<"idna">>,{pkg,<<"idna">>,<<"6.1.1">>},2},
Expand Down
2 changes: 1 addition & 1 deletion src/blockfrost_core.erl
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ lookupConfig() ->
init() ->
case ets:whereis(?MODULE) of
undefined ->
_ = ets:new(?MODULE, [named_table, set]),
_ = ets:new(?MODULE, [named_table, set, public]),
ok;
_Else ->
ok
Expand Down
2 changes: 1 addition & 1 deletion src/blockfrost_erlang.app.src
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{application, blockfrost_erlang,
[{description, "Blockfrost API client"},
{vsn, "0.1.0"},
{vsn, "0.1.1"},
{registered, []},
{mod, {blockfrost_erlang_app, []}},
{applications,
Expand Down

0 comments on commit 652b538

Please sign in to comment.