Skip to content

NEAR_HELPER_ACCOUNT env var contains garbage strings in the suggestion.  #32

@a1akris

Description

@a1akris

That's what the script suggested me to export as a NEAR_HELPER_ACCOUNT env var:

export NEAR_HELPER_ACCOUNT="\"ed25519:2ykcMLiM7vCmsSECcgfmUzihBtNdBv7v2CxNi94sNt4R8ar4xsrMMYvtsSNGQDfSRhNWXEnZvgx2wzS9ViBiS9jW\"})
ed25519:2ykcMLiM7vCmsSECcgfmUzihBtNdBv7v2CxNi94sNt4R8ar4xsrMMYvtsSNGQDfSRhNWXEnZvgx2wzS9ViBiS9jW"})
test.near"

The issue is exec-output.log contains multiple strings with the account_id:

❯ cat exec-output.log  | grep account_id
> print "Indexer launched with struct(private_rpc_url = struct(ip_address = \"indexer-node\", p
ath = \"\", port_number = 3030, protocol = \"http\"), public_rpc_url = struct(ip_address = \"12
7.0.0.1\", path = \"\", port_number = 8332, protocol = \"http\"), validator_key = {\"account_i
\": \"test.near\", \"public_key\": \"ed25519:3Kuyi2DUXdoHgoaNEvCxa1m6G8xqc6Xs7WGajaqLhNmW\", \"
secret_key\": \"ed25519:2ykcMLiM7vCmsSECcgfmUzihBtNdBv7v2CxNi94sNt4R8ar4xsrMMYvtsSNGQDfSRhNWXEn
Zvgx2wzS9ViBiS9jW\"})"
Indexer launched with struct(private_rpc_url = struct(ip_address = "indexer-node", path = "", p
ort_number = 3030, protocol = "http"), public_rpc_url = struct(ip_address = "127.0.0.1", path =
 "", port_number = 8332, protocol = "http"), validator_key = {"account_id": "test.near", "publi
c_key": "ed25519:3Kuyi2DUXdoHgoaNEvCxa1m6G8xqc6Xs7WGajaqLhNmW", "secret_key": "ed25519:2ykcMLiM
7vCmsSECcgfmUzihBtNdBv7v2CxNi94sNt4R8ar4xsrMMYvtsSNGQDfSRhNWXEnZvgx2wzS9ViBiS9jW"})
		"account_id": "test.near",

I fixed that by inserting tail -1 after grep in this line:

cat "${package_output_filepath}" | grep "${property_name}" | awk '{print $NF}' | sed 's/^"//' | sed 's/",*$//'

However, there may be a better solution that fixes the actual regexp.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions