Skip to content
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

Cannot run as Service #688

Open
mtgnoah opened this issue Dec 2, 2023 · 2 comments
Open

Cannot run as Service #688

mtgnoah opened this issue Dec 2, 2023 · 2 comments
Assignees

Comments

@mtgnoah
Copy link

mtgnoah commented Dec 2, 2023

I wrote a service file to use ANR to run a local devnet that doesn't get killed when I close my terminal but I cannot add a subnet to it when it's running in the service

Here is the error I get
Error: rpc error: code = Unknown desc = avalanche exec is not defined

Here is the service

[Unit]

Description=Avalanche Network Runner
After=network-online.target
Wants=network-online.target

[Service]

WorkingDirectory=/home/ubuntu
User=ubuntu
ExecStart=/home/ubuntu/code/avalanche-network-runner/bin/avalanche-network-runner server --log-level debug --port=":8080" --grpc-gateway-port=":8081"
Restart=always
RestartSec=5s

[Install]
WantedBy=multi-user.target

Here is the command I am trying to run which gives the error above

avalanche-network-runner control start --log-level debug --endpoint="localhost:8080" --blockchain-specs '[{"vm_name": "tokenvm", "genesis": "/home/ubuntu/code/tests/tokenvm-genesis.json", "chain_config": "/home/ubuntu/code/tests/tokenvm-chain-config.json", "subnet_config": "/home/ubuntu/code/tests/tokenvm-subnet-config.json"}]'
@felipemadero
Copy link
Collaborator

It seems ANR is not finding a suitable executable. You can either use Environment= setting of the service configuration to set AVALANCHEGO_EXEC_PATH to the appropriate avago binary (I believe you may prefer this option).
Or you can add a flag --avalanchego-path to your avalanche-network-runner control start command.

@felipemadero felipemadero self-assigned this Dec 4, 2023
@mtgnoah
Copy link
Author

mtgnoah commented Dec 4, 2023

Ok thanks that worked. I am also running it with a reverse proxy so I am going to try to make a modification that allows for requests from anywhere similar to the docker modification. https://github.com/ava-labs/avalanche-network-runner/pull/687/files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants