-
Notifications
You must be signed in to change notification settings - Fork 20
#357 log message on starting proxy #564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
b8472e8
a63bd6a
67066fd
14f27b6
d8cf7b2
b5673ec
d6fea32
c62b4f1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,8 @@ | ||
| #!/bin/bash | ||
| echo $(date "+%F %X.%3N") I $(basename "$0"):${LINENO} $$ Proxy:Undefined {} | ||
| COMPONENT=Proxy | ||
| echo "$(date "+%F %X.%3N") I $(basename $0):${LINENO} $$ ${COMPONENT}:StartScript {} Start ${COMPONENT} service" | ||
|
|
||
| source proxy/run-set-env.sh | ||
| source proxy/run-set-env.sh ${COMPONENT} | ||
|
|
||
| echo run-proxy | ||
| echo "$(date "+%F %X.%3N") I $(basename $0):${LINENO} $$ ${COMPONENT}:StartScript {} run-proxy" | ||
| python3 -m proxy --hostname 0.0.0.0 --port 9090 --enable-web-server --plugins proxy.plugin.SolanaProxyPlugin $EXTRA_ARGS |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| #!/bin/bash | ||
| echo $(date "+%F %X.%3N") I $(basename "$0"):${LINENO} $$ Proxy:Undefined {} | ||
| COMPONENT=Proxy | ||
| echo "$(date "+%F %X.%3N") I $(basename "$0"):${LINENO} $$ ${COMPONENT}:StartScript {} Start ${COMPONENT} service" | ||
|
|
||
| if [ -z "$SOLANA_URL" ]; then | ||
| echo "SOLANA_URL is not set" | ||
|
||
|
|
@@ -8,17 +9,18 @@ fi | |
|
|
||
| solana config set -u $SOLANA_URL | ||
|
|
||
| echo "Dumping evm_loader and extracting ELF parameters" | ||
| echo "$(date "+%F %X.%3N") I $(basename "$0"):${LINENO} $$ ${COMPONENT}:StartScript {} Dumping evm_loader and extracting ELF parameters" | ||
| export EVM_LOADER=$(solana address -k /spl/bin/evm_loader-keypair.json) | ||
| export $(/spl/bin/neon-cli --commitment confirmed --url $SOLANA_URL --evm_loader="$EVM_LOADER" neon-elf-params) | ||
|
|
||
| export NUM_ACCOUNTS=15 | ||
| echo "$(date "+%F %X.%3N") I $(basename "$0"):${LINENO} $$ ${COMPONENT}:StartScript {} Create test accounts: ${NUM_ACCOUNTS}" | ||
|
||
| /spl/bin/create-test-accounts.sh $NUM_ACCOUNTS | ||
|
|
||
| [[ -z "$NEW_USER_AIRDROP_AMOUNT" ]] && export NEW_USER_AIRDROP_AMOUNT=100 | ||
| echo "NEW_USER_AIRDROP_AMOUNT=$NEW_USER_AIRDROP_AMOUNT" | ||
| echo "$(date "+%F %X.%3N") I $(basename "$0"):${LINENO} $$ ${COMPONENT}:StartScript {} NEW_USER_AIRDROP_AMOUNT=${NEW_USER_AIRDROP_AMOUNT}" | ||
|
|
||
| echo "NEON_TOKEN_MINT=$NEON_TOKEN_MINT" | ||
| echo "$(date "+%F %X.%3N") I $(basename "$0"):${LINENO} $$ ${COMPONENT}:StartScript {} NEON_TOKEN_MINT=${NEON_TOKEN_MINT}" | ||
|
|
||
| for i in $(seq 1 $NUM_ACCOUNTS); do | ||
| ID_FILE="$HOME/.config/solana/id" | ||
|
|
@@ -29,9 +31,9 @@ for i in $(seq 1 $NUM_ACCOUNTS); do | |
| fi | ||
|
|
||
| if [ "$(spl-token balance --owner "$ID_FILE" "$NEON_TOKEN_MINT" || echo '0')" == "0" ]; then | ||
| echo 'Create balance and mint token' | ||
| echo "$(date "+%F %X.%3N") I $(basename "$0"):${LINENO} $$ ${COMPONENT}:StartScript {} Create balance and mint token" | ||
| TOKEN_ACCOUNT=$( (spl-token create-account --owner "$ID_FILE" "$NEON_TOKEN_MINT" || true) | grep -Po 'Creating account \K[^\n]*') | ||
| echo "TOKEN_ACCOUNT=$TOKEN_ACCOUNT" | ||
| echo "$(date "+%F %X.%3N") I $(basename "$0"):${LINENO} $$ ${COMPONENT}:StartScript {} TOKEN_ACCOUNT=$TOKEN_ACCOUNT" | ||
| spl-token mint "$NEON_TOKEN_MINT" $(("$NEW_USER_AIRDROP_AMOUNT"*100000)) --owner /spl/bin/evm_loader-keypair.json -- "$TOKEN_ACCOUNT" | ||
| fi | ||
| done | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,23 @@ | ||
| #!/bin/sh | ||
| echo $(date "+%F %X.%3N") I $(basename "$0"):${LINENO} $$ Faucet:Undefined {} | ||
|
|
||
| COMPONENT=Faucet | ||
| echo "$(date "+%F %X.%3N") I $(basename "$0"):${LINENO} $$ ${COMPONENT}:StartScript {} Start ${COMPONENT} service" | ||
| if [ -z "$SOLANA_URL" ]; then | ||
| echo "SOLANA_URL is not set" | ||
|
||
| exit 1 | ||
| fi | ||
|
|
||
| echo "Extracting NEON-EVM's ELF parameters" | ||
| echo "$(date "+%F %X.%3N") I $(basename "$0"):${LINENO} $$ ${COMPONENT}:StartScript {} Extracting NEON-EVM's ELF parameters" | ||
| export EVM_LOADER=$(solana address -k /spl/bin/evm_loader-keypair.json) | ||
| export $(/spl/bin/neon-cli --commitment confirmed --url $SOLANA_URL --evm_loader="$EVM_LOADER" neon-elf-params) | ||
|
|
||
| BALANCE=$(solana balance | tr '.' '\t'| tr '[:space:]' '\t' | cut -f1) | ||
| if [ "$BALANCE" -eq 0 ]; then | ||
| echo "SOL balance is 0" | ||
| echo "$(date "+%F %X.%3N") W $(basename "$0"):${LINENO} $$ ${COMPONENT}:StartScript {} SOL balance is 0" | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [ "$(spl-token balance "$NEON_TOKEN_MINT" || echo 0)" -eq 0 ]; then | ||
| echo "NEON balance is 0" | ||
| echo "$(date "+%F %X.%3N") W $(basename "$0"):${LINENO} $$ ${COMPONENT}:StartScript {} NEON balance is 0" | ||
| exit 1 | ||
| fi | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need to change logging format here too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly, I looked at this line, Ivan
It doesn't have any heavy operation after previous logging note. That's why I left it as it is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done