Tweak laconicd config to allow setting endpoint port and to make the fixturenet restartable. #660

Merged
telackey merged 4 commits from telackey/endpoint into main 2023-11-22 17:31:30 +00:00
Member

Needed to let the endpoint sit behind an SSL proxy.

Needed to let the endpoint sit behind an SSL proxy.
dboreham reviewed 2023-11-22 13:49:37 +00:00
dboreham left a comment
Owner

Are the create-fixturenet.sh changes related to pulling in a newer version of init.sh from laconicd?

Are the create-fixturenet.sh changes related to pulling in a newer version of init.sh from laconicd?
Author
Member

No, but the actual changes are hard to see because of the indent.

It is just an if around the creation stuff. I also removed the call to make (which isn't installed, so does nothing) and the delete, which likewise doesn't work as intended, because it tries to remove a bind-mounted dir.

diff --git a/stack_orchestrator/data/config/fixturenet-laconicd/create-fixturenet.sh b/stack_orchestrator/data/config/fixturenet-laconicd/create-fixturenet.sh
index 9c30bff..3b850f3 100644
--- a/stack_orchestrator/data/config/fixturenet-laconicd/create-fixturenet.sh
+++ b/stack_orchestrator/data/config/fixturenet-laconicd/create-fixturenet.sh
@@ -17,10 +17,9 @@ TRACE="--trace"
 # validate dependencies are installed
 command -v jq > /dev/null 2>&1 || { echo >&2 "jq not installed. More info: https://stedolan.github.io/jq/download/"; exit 1; }

+if [ ! -d "/root/.laconicd/data/blockstore.db" ]; then
   # remove existing daemon and client
-rm -rf ~/.laconic*
-
-make install
+  rm -rf ~/.laconicd/*

   laconicd config keyring-backend $KEYRING
   laconicd config chain-id $CHAINID
@@ -113,6 +112,9 @@ laconicd validate-genesis
   if [[ $1 == "pending" ]]; then
     echo "pending mode is on, please wait for the first block committed."
   fi
+else
+  echo "Using existing blockchain database."
+fi

 # Start the node (remove the --pruning=nothing flag if historical queries are not needed)
 laconicd start --pruning=nothing --evm.tracer=json $TRACE --log_level $LOGLEVEL --minimum-gas-prices=0.0001aphoton --json-rpc.api eth,txpool,personal,net,debug,web3,miner --api.enable --gql-server --gql-playground
No, but the actual changes are hard to see because of the indent. It is just an `if` around the creation stuff. I also removed the call to make (which isn't installed, so does nothing) and the delete, which likewise doesn't work as intended, because it tries to remove a bind-mounted dir. ``` diff --git a/stack_orchestrator/data/config/fixturenet-laconicd/create-fixturenet.sh b/stack_orchestrator/data/config/fixturenet-laconicd/create-fixturenet.sh index 9c30bff..3b850f3 100644 --- a/stack_orchestrator/data/config/fixturenet-laconicd/create-fixturenet.sh +++ b/stack_orchestrator/data/config/fixturenet-laconicd/create-fixturenet.sh @@ -17,10 +17,9 @@ TRACE="--trace" # validate dependencies are installed command -v jq > /dev/null 2>&1 || { echo >&2 "jq not installed. More info: https://stedolan.github.io/jq/download/"; exit 1; } +if [ ! -d "/root/.laconicd/data/blockstore.db" ]; then # remove existing daemon and client -rm -rf ~/.laconic* - -make install + rm -rf ~/.laconicd/* laconicd config keyring-backend $KEYRING laconicd config chain-id $CHAINID @@ -113,6 +112,9 @@ laconicd validate-genesis if [[ $1 == "pending" ]]; then echo "pending mode is on, please wait for the first block committed." fi +else + echo "Using existing blockchain database." +fi # Start the node (remove the --pruning=nothing flag if historical queries are not needed) laconicd start --pruning=nothing --evm.tracer=json $TRACE --log_level $LOGLEVEL --minimum-gas-prices=0.0001aphoton --json-rpc.api eth,txpool,personal,net,debug,web3,miner --api.enable --gql-server --gql-playground ```
Owner

No, but the actual changes are hard to see because of the indent.

Can you see if you can put the changes into the file in the laconicd repo, or come up with a refactoring that would make any changes here minimal and easy to see by diffing? The general idea is that this file shouldn't be maintained both here and in the laconicd repo. It's a bit of a hack that it's here in the first place.

> No, but the actual changes are hard to see because of the indent. Can you see if you can put the changes into the file in the laconicd repo, or come up with a refactoring that would make any changes here minimal and easy to see by diffing? The general idea is that this file shouldn't be maintained both here and in the laconicd repo. It's a bit of a hack that it's here in the first place.
Author
Member
Done: https://git.vdb.to/cerc-io/laconicd/pulls/117
dboreham approved these changes 2023-11-22 17:28:49 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cerc-io/stack-orchestrator#660
No description provided.