Class: BSV::MCP::Config
- Inherits:
-
Object
- Object
- BSV::MCP::Config
- Defined in:
- lib/bsv/mcp/config.rb
Overview
Configuration parsed from environment variables for the MCP server.
Environment variables:
BSV_NETWORK — 'mainnet' or 'testnet' (default: 'mainnet')
BSV_ARC_URL — optional ARC endpoint override
BSV_ARC_API_KEY — optional ARC bearer token
Constant Summary collapse
Instance Attribute Summary collapse
-
#arc_api_key ⇒ Object
readonly
Returns the value of attribute arc_api_key.
-
#arc_url ⇒ Object
readonly
Returns the value of attribute arc_url.
-
#network ⇒ Object
readonly
Returns the value of attribute network.
Instance Method Summary collapse
-
#initialize(network: nil, arc_url: nil, arc_api_key: nil) ⇒ Config
constructor
A new instance of Config.
- #mainnet? ⇒ Boolean
- #testnet? ⇒ Boolean
Constructor Details
#initialize(network: nil, arc_url: nil, arc_api_key: nil) ⇒ Config
Returns a new instance of Config.
18 19 20 21 22 23 |
# File 'lib/bsv/mcp/config.rb', line 18 def initialize(network: nil, arc_url: nil, arc_api_key: nil) raw_network = network || ENV.fetch('BSV_NETWORK', MAINNET) @network = normalise_network(raw_network) @arc_url = arc_url || ENV.fetch('BSV_ARC_URL', nil) @arc_api_key = arc_api_key || ENV.fetch('BSV_ARC_API_KEY', nil) end |
Instance Attribute Details
#arc_api_key ⇒ Object (readonly)
Returns the value of attribute arc_api_key.
16 17 18 |
# File 'lib/bsv/mcp/config.rb', line 16 def arc_api_key @arc_api_key end |
#arc_url ⇒ Object (readonly)
Returns the value of attribute arc_url.
16 17 18 |
# File 'lib/bsv/mcp/config.rb', line 16 def arc_url @arc_url end |
#network ⇒ Object (readonly)
Returns the value of attribute network.
16 17 18 |
# File 'lib/bsv/mcp/config.rb', line 16 def network @network end |