37 lines
2.9 KiB
Go
37 lines
2.9 KiB
Go
package nitro
|
|
|
|
type Config struct {
|
|
// TODO: use keyring
|
|
Pk string `mapstructure:"pk" toml:"pk" comment:"pk specifies the private key used by the nitro node."`
|
|
|
|
// TODO: use keyring
|
|
EthPk string `mapstructure:"eth-pk" toml:"eth-pk" comment:"eth-pk specifies the private key to use when interacting with the Ethereum chain."`
|
|
EthUrl string `mapstructure:"eth-url" toml:"eth-url" comment:"eth-url specifies the URL of the Ethereum node to connect to."`
|
|
EthAuthToken string `mapstructure:"eth-auth-token" toml:"eth-auth-token" comment:"eth-auth-token specifies the bearer token used for auth in requests to the Ethereum chain's RPC endpoint."`
|
|
EthStartBlock uint64 `mapstructure:"eth-start-block" toml:"eth-start-block" comment:"eth-start-block specifies the Ethereum block number to start listening for Nitro Adjudicator events."`
|
|
EthNaAddress string `mapstructure:"eth-na-address" toml:"na-address" comment:"na-address specifies the address of the Nitro Adjudicator contract."`
|
|
EthVpaAddress string `mapstructure:"eth-vpa-address" toml:"vpa-address" comment:"vpa-address specifies the address of the Virtual Payment App contract."`
|
|
EthCaAddress string `mapstructure:"eth-ca-address" toml:"ca-address" comment:"ca-address specifies the address of the Consensus App contract."`
|
|
|
|
BootPeers string `mapstructure:"boot-peers" toml:"boot-peers" comment:"boot-peers is a comma-delimited list of peer multiaddrs the messaging service will connect to when initialized."`
|
|
PublicIp string `mapstructure:"public-ip" toml:"public-ip" comment:"public-ip specifies the public IP address used for the message service."`
|
|
ExtMultiAddr string `mapstructure:"ext-multiaddr" toml:"ext-multiaddr" comment:"ext-multiaddr specifies an additional external multiaddr to advertise."`
|
|
MsgPort int `mapstructure:"msg-port" toml:"msg-port" comment:"msg-port specifies the TCP port for the message service."`
|
|
WsMsgPort int `mapstructure:"ws-msg-port" toml:"ws-msg-port" comment:"ws-msg-port specifies the WebSocket port for the message service."`
|
|
RpcPort int `mapstructure:"rpc-port" toml:"rpc-port" comment:"rpc-port specifies the TCP port for the RPC server."`
|
|
TlsCertFilepath string `mapstructure:"tls-cert-filepath" toml:"tls-cert-filepath" comment:"tls-cert-filepath specifies the filepath to the TLS certificate. If not specified, TLS will not be used with the RPC transport."`
|
|
TlsKeyFilepath string `mapstructure:"tls-key-filepath" toml:"tls-key-filepath" comment:"tls-key-filepath specifies the filepath to the TLS private key. If not specified, TLS will not be used with the RPC transport."`
|
|
}
|
|
|
|
func DefaultConfig() *Config {
|
|
return &Config{
|
|
EthUrl: "http://localhost:8545",
|
|
PublicIp: "127.0.0.1",
|
|
MsgPort: 3005,
|
|
WsMsgPort: 6005,
|
|
RpcPort: 4005,
|
|
// TlsCertFilepath: "./tls/statechannels.org.pem",
|
|
// TlsKeyFilepath: "./tls/statechannels.org_key.pem",
|
|
}
|
|
}
|