From 4575d58437954dbcbb6979f7447679acada8ed91 Mon Sep 17 00:00:00 2001 From: Beta Ziliani Date: Thu, 22 Aug 2024 09:57:20 -0300 Subject: [PATCH 1/6] Use --release in cargo build to have a faster library --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dbd6501..bc86242 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Instruction for building crystal project and rust library ```sh -$ (cd verkle_crypto; cargo build) +$ (cd verkle_crypto; cargo build --release) $ 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 ``` From eca3032bbbd68e09e5e630868a90cc8a9440d9d4 Mon Sep 17 00:00:00 2001 From: Beta Ziliani Date: Thu, 22 Aug 2024 10:01:27 -0300 Subject: [PATCH 2/6] Adding requirements (Crystal and Rust) --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bc86242..bd3c8c4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@ +## 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 --release) From 5a85ee99a1dcb9f81c893537b2f1a0e5401f0e11 Mon Sep 17 00:00:00 2001 From: Beta Ziliani Date: Thu, 22 Aug 2024 10:02:36 -0300 Subject: [PATCH 3/6] Removing unnecessary (as of Crystal 1.13) options. GC_DONT_GC is a small optimization in the build times, but that should be up to the developer to choose --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index bd3c8c4..eb25cec 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Instruction for building crystal project and the `verke_crypto` rust library it ```sh $ (cd verkle_crypto; cargo build --release) -$ 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 +$ LIBRARY_PATH=$(PWD)/verkle_crypto/target/debug:$LIBRARY_PATH crystal build src/main.cr -o pampero ``` ## Show block details @@ -16,13 +16,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 @@ -30,6 +30,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 ``` From aac75f7206a35b00075e6a3e2b0944f9c416e4f5 Mon Sep 17 00:00:00 2001 From: Beta Ziliani Date: Thu, 22 Aug 2024 10:03:30 -0300 Subject: [PATCH 4/6] Adding missing command --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index eb25cec..c29017e 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,8 @@ A recent version of [Crystal](https://crystal-lang.org/install) and [Rust](https Instruction for building crystal project and the `verke_crypto` rust library it depends on. ```sh -$ (cd verkle_crypto; cargo build --release) +$ (cd verkle_crypto; cargo build --release) +$ shards install $ LIBRARY_PATH=$(PWD)/verkle_crypto/target/debug:$LIBRARY_PATH crystal build src/main.cr -o pampero ``` From 9972a75f5df29c2a9ad951bdfd03117d781543da Mon Sep 17 00:00:00 2001 From: Beta Ziliani Date: Thu, 22 Aug 2024 10:39:32 -0300 Subject: [PATCH 5/6] missing require to run specs --- src/models/account.cr | 1 + 1 file changed, 1 insertion(+) 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 From 3582c28934c621a39fc488a419f5066cc17471d7 Mon Sep 17 00:00:00 2001 From: Beta Ziliani Date: Fri, 23 Aug 2024 14:02:10 -0300 Subject: [PATCH 6/6] Fixed wrong accessor to env --- src/config.cr | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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