From 964466284e316c7e6ec0f67fb15ea3268b1482c9 Mon Sep 17 00:00:00 2001 From: kenta-mori3322 Date: Tue, 30 Apr 2024 15:43:54 +0000 Subject: [PATCH] chore: update local node run script --- scripts/local_faucet.sh | 5 ++++- scripts/node_config.toml | 4 ++++ scripts/run_local_node.sh | 7 +++++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 scripts/node_config.toml diff --git a/scripts/local_faucet.sh b/scripts/local_faucet.sh index 5a99f44a4d..511ccd537e 100755 --- a/scripts/local_faucet.sh +++ b/scripts/local_faucet.sh @@ -18,6 +18,8 @@ export HOME_DIR=$(eval echo "${HOME_DIR:-"~/.ethermintd"}") export BINARY=${BINARY:-"./build/ethermintd"} export DENOM=${DENOM:-ainco} +export FHEVM_GO_KEYS_DIR="$HOME_DIR/keys/network-fhe-keys" + # if which binary does not exist, exit if [ -z `which $BINARY` ]; then echo "Ensure $BINARY is installed and in your PATH" @@ -48,7 +50,8 @@ AMOUNT="1000000000000000000$DENOM" # 10**18, so 1INCO # The `$BINARY debug addr` outputs 4 lines, the 3rd one is: # Bech32 Acc: inco1n7g8ek2znyua9dqua554pjvkh8vysxejlsfmcp # We extract the inco1... part -BECH32_ADDR=$($BINARY debug addr $RECIPIENT | sed -n '3 p' | sed 's/Bech32 Acc: //') +echo "BECH32_ADDR $($BINARY debug addr $RECIPIENT)" +BECH32_ADDR=$($BINARY debug addr $RECIPIENT | sed -n '5 p' | sed 's/Bech32 Acc: //') echo "Sending $AMOUNT to $BECH32_ADDR" $BINARY tx bank send $KEY $BECH32_ADDR $AMOUNT --gas-prices 1000000000$DENOM --yes \ No newline at end of file diff --git a/scripts/node_config.toml b/scripts/node_config.toml new file mode 100644 index 0000000000..7437ede1c0 --- /dev/null +++ b/scripts/node_config.toml @@ -0,0 +1,4 @@ +[fhevm] + +# Add mock functionality using trivial encrypt. DO NOT USE in production. +mock_ops_flag = true \ No newline at end of file diff --git a/scripts/run_local_node.sh b/scripts/run_local_node.sh index c27d5eaa3c..6edc7b49e5 100755 --- a/scripts/run_local_node.sh +++ b/scripts/run_local_node.sh @@ -28,6 +28,7 @@ export GRPC_WEB=${GRPC_WEB:-"9091"} export ROSETTA=${ROSETTA:-"8080"} export BLOCK_TIME=${BLOCK_TIME:-"5s"} + # if which binary does not exist, exit if [ -z `which $BINARY` ]; then echo "Ensure $BINARY is installed and in your PATH" @@ -54,6 +55,12 @@ from_scratch () { fi rm -rf $HOME_DIR && echo "Removed $HOME_DIR" + mkdir -p $HOME_DIR/config + cp ./scripts/node_config.toml $HOME_DIR/config + + mkdir -p $HOME_DIR/keys/network-fhe-keys + fhevm-tfhe-cli generate-keys -d $HOME_DIR/keys/network-fhe-keys + # reset values if not set already after whipe set_config