0

I am currently developing on an intranet with other solana developers, and so to run my own test validator I’d need to specify a custom port on local host. However, I am not sure how to specify that on Anchor.toml.

2
  • I also attempted doing solana program deploy after specifying my url to localhost:<custom_port>, however I get the error ConnectionError(Protocol(HttparseError(Version)))
    – ImSandwich
    Commented Aug 8, 2022 at 15:50
  • please elaborate this network infrastructure, how you're running the validator, etc. none of this is clear. a true "test validator" shouldn't even need a network connection so there are vital details missing here
    – trent.sol
    Commented Aug 18, 2022 at 3:25

1 Answer 1

3

In your Anchor.toml:

[test.validator]
rpc_port = 1337

https://book.anchor-lang.com/anchor_references/anchor-toml_reference.html#testvalidator

5
  • thanks! however I still run into the ConnectionError(Protocol(HttparseError(Version))) error. I set my url to 0.0.0.0:1337
    – ImSandwich
    Commented Aug 9, 2022 at 13:39
  • Prefix your URL with http and try again.
    – HelmetFace
    Commented Aug 9, 2022 at 14:24
  • That didn’t work
    – ImSandwich
    Commented Aug 10, 2022 at 19:46
  • I found out that if I just changed the rpc-port of my validator and have a single validator running on my local network then it works just fine. However, I need to change both the rpc-port and the faucet-port if I want two separate validators running locally. How do I specify faucet port on Anchor toml? I tried faucet_port but it didnt work
    – ImSandwich
    Commented Aug 19, 2022 at 17:06
  • The documentation says to use faucet_port, I'm not sure why it wouldn't work for you. In general, they're just the options that you can pass to solana-test-validator.
    – HelmetFace
    Commented Aug 24, 2022 at 15:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.