diff --git a/README.md b/README.md index dbd6501..c29017e 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,15 @@ +## Requiriements + +A recent version of [Crystal](https://crystal-lang.org/install) and [Rust](https://www.rust-lang.org/tools/install). + ## Building -Instruction for building crystal project and rust library +Instruction for building crystal project and the `verke_crypto` rust library it depends on. ```sh -$ (cd verkle_crypto; cargo build) -$ LIBRARY_PATH=$(PWD)/verkle_crypto/target/debug:$LIBRARY_PATH CRYSTAL_OPTS="--link-flags=-Wl,-ld_classic" GC_DONT_GC=1 crystal build src/main.cr -o pampero +$ (cd verkle_crypto; cargo build --release) +$ shards install +$ LIBRARY_PATH=$(PWD)/verkle_crypto/target/debug:$LIBRARY_PATH crystal build src/main.cr -o pampero ``` ## Show block details @@ -12,13 +17,13 @@ $ LIBRARY_PATH=$(PWD)/verkle_crypto/target/debug:$LIBRARY_PATH CRYSTAL_OPTS="--l Block at latest slot ```sh -$ LIBRARY_PATH=$(PWD)/verkle_crypto/target/debug:$LIBRARY_PATH CRYSTAL_OPTS="--link-flags=-Wl,-ld_classic" GC_DONT_GC=1 crystal run src/dump_block.cr +$ LIBRARY_PATH=$(PWD)/verkle_crypto/target/debug:$LIBRARY_PATH crystal run src/dump_block.cr ``` Block at slot 831627 ```sh -$ LIBRARY_PATH=$(PWD)/verkle_crypto/target/debug:$LIBRARY_PATH CRYSTAL_OPTS="--link-flags=-Wl,-ld_classic" GC_DONT_GC=1 crystal run src/dump_block.cr -- 831627 +$ LIBRARY_PATH=$(PWD)/verkle_crypto/target/debug:$LIBRARY_PATH crystal run src/dump_block.cr -- 831627 ``` ## Unit tests @@ -26,6 +31,6 @@ $ LIBRARY_PATH=$(PWD)/verkle_crypto/target/debug:$LIBRARY_PATH CRYSTAL_OPTS="--l To run all the tests ```sh -$ LIBRARY_PATH=$(PWD)/verkle_crypto/target/debug:$LIBRARY_PATH CRYSTAL_OPTS="--link-flags=-Wl,-ld_classic" GC_DONT_GC=1 crystal spec +$ LIBRARY_PATH=$(PWD)/verkle_crypto/target/debug:$LIBRARY_PATH crystal spec ``` diff --git a/src/config.cr b/src/config.cr index 47bd089..db16cfc 100644 --- a/src/config.cr +++ b/src/config.cr @@ -1,10 +1,9 @@ module Pampero - class Config getter beacon_node : String def initialize - @beacon_node = ENV["BEACON_NODE"] || "" + @beacon_node = ENV["BEACON_NODE"]? || "" end end end diff --git a/src/models/account.cr b/src/models/account.cr index 9ebbb60..3a87fe2 100644 --- a/src/models/account.cr +++ b/src/models/account.cr @@ -1,5 +1,6 @@ require "../common/types" require "../common/constants" +require "json" module Pampero struct Account