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

Make it possible to connect wallet to staging #78

Merged
merged 1 commit into from
Mar 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions app/Cardano/CLI.hs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import qualified Data.Text as T
-- | Port number with a tag for describing what it is used for
newtype Port (tag :: Symbol) = Port Int

data Network = Mainnet | Testnet
data Network = Mainnet | Testnet | Staging
deriving (Show, Enum)


Expand Down Expand Up @@ -99,11 +99,13 @@ instance Decodable String (Port tag) where
instance Encodable Network String where
encode Mainnet = "mainnet"
encode Testnet = "testnet"
encode Staging = "staging"

instance Decodable String Network where
decode "mainnet" = Right Mainnet
decode "testnet" = Right Testnet
decode s = Left $ show s ++ " is neither \"mainnet\" nor \"testnet\"."
decode "staging" = Right Staging
decode s = Left $ show s ++ " is neither \"mainnet\", \"testnet\" nor \"staging\"."

instance Decodable [String] (Mnemonic 15) where
decode ws = first show $ mkMnemonic @15 (T.pack <$> ws)
9 changes: 5 additions & 4 deletions app/launcher/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Usage:
cardano-wallet-launcher --help

Options:
--network <NETWORK> mainnet or testnet [default: mainnet]
--network <NETWORK> mainnet, testnet or staging [default: mainnet]
--wallet-server-port <PORT> port used for serving the wallet API [default: 8090]
--http-bridge-port <PORT> port used for communicating with the http-bridge [default: 8080]
|]
Expand All @@ -66,19 +66,20 @@ main = do
sayErr "Starting..."
installSignalHandlers
let commands =
[ nodeHttpBridgeOn bridgePort
[ nodeHttpBridgeOn bridgePort network
, walletOn walletPort bridgePort network
]
sayErr $ fmt $ blockListF commands
(ProcessHasExited name code) <- launch commands
sayErr $ T.pack name <> " exited with code " <> T.pack (show code) 
exitWith code

nodeHttpBridgeOn :: Port "Node" -> Command
nodeHttpBridgeOn port = Command
nodeHttpBridgeOn :: Port "Node" -> Network -> Command
nodeHttpBridgeOn port net = Command
"cardano-http-bridge"
[ "start"
, "--port", encode port
, "--template", encode net
]
(return ())

Expand Down
2 changes: 1 addition & 1 deletion app/server/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Usage:
cardano-wallet-server --help

Options:
--network <NETWORK> mainnet or testnet [default: mainnet]
--network <NETWORK> mainnet, testnet or staging [default: mainnet]
--wallet-server-port <PORT> port used for serving the wallet API [default: 8090]
--http-bridge-port <PORT> port used for communicating with the http-bridge [default: 8080]
|]
Expand Down