xmtp / didethresolver

XMTP Registry Resolver
MIT License
3 stars 1 forks source link

Use Environment Variables instead of CLI Arguments #11

Closed insipx closed 9 months ago

insipx commented 9 months ago

Is your feature request related to a problem?

We will generally be running the gateway as a dockerfile deployment or otherwise, so it will be easier to set environment variables rather than CLI Arguments. Environment variables are better if we ever need to set an APIKEY for our ethereum provider, since these variables may be encrypted secrets. Additionally we can change the arguments without rebuilding the docker image.

didethresolver currently defines two command line arguments in it's lib.rs:

#[derive(FromArgs)]
/// DID Ethereum Resolver XMTP Gateway
struct DidEthGatewayApp {
    /// the address to start the server
    #[argh(option, short = 'a', default = "String::from(\"127.0.0.1:9944\")")]
    address: String,

    /// ethereum RPC Provider
    #[argh(
        option,
        short = 'p',
        default = "String::from(\"wss://eth.llamarpc.com\")"
    )]
    provider: String,
}

Describe the solution to the problem

No response

Describe the uses cases for the feature

No response

Additional details

No response

jac18281828 commented 9 months ago

What do you think of using dotenv for this?

insipx commented 9 months ago

dotenv is good