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

add an example daedalus-bridge #828

Closed
wants to merge 15 commits into from
Closed

add an example daedalus-bridge #828

wants to merge 15 commits into from

Conversation

cleverca22
Copy link
Contributor

Issue Number

Overview

  • I have ...

Comments

@cleverca22 cleverca22 force-pushed the daedalus-bridge branch 4 times, most recently from afc8204 to 93e6b2b Compare October 15, 2019 15:49
@rvl
Copy link
Contributor

rvl commented Oct 15, 2019

Can you please explain what this PR is, and why, and how it is different from #813 which @disassembler opened?

@KtorZ
Copy link
Member

KtorZ commented Oct 17, 2019

@iohk-devops ... what... is.. this... ? May we have context and rationale please?

@cleverca22 cleverca22 changed the base branch from windows-wallet to master October 17, 2019 22:35
@@ -176,7 +176,7 @@ waitForNetwork nw policy = do
-- for no longer than a minute.
defaultRetryPolicy :: Monad m => RetryPolicyM m
defaultRetryPolicy =
limitRetriesByCumulativeDelay (60 * second) (exponentialBackoff 10000)
limitRetriesByCumulativeDelay (3600 * second) (exponentialBackoff 10000)
Copy link
Contributor Author

@cleverca22 cleverca22 Oct 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could be lowered (or undone), once we are updated to include input-output-hk/jormungandr#977

Copy link
Member

@KtorZ KtorZ Oct 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We (We = me tomorrow) are actually going to change the start-up logic. Right now, you can't start the wallet if there's no backend to connect to, but that's bonkers. The wallet can simply wait an poll regularly until a backend shows up; so this whole timeout will go away here. Maybe not.

@@ -464,8 +464,8 @@ withJormungandr tr (JormungandrConfig stateDir block0 mPort logSeverity output e
startBackend (apiPort, baseUrl) = getGenesisBlockArg block0 >>= \case
Right (block0H, genesisBlockArg) -> do
let args = genesisBlockArg ++
[ "--config", nodeConfigFile
, "--log-level", C.toLower <$> show logSeverity
[ -- "--config", nodeConfigFile
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cardano-wallet should generate a config file with trusted peers, containing IP and ID (public key) pairs

without that, there is no way for jormungandr to sync, and daedalus cant specify its own --config file, because jormungandr crashes if you give it 2 --config flags

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coming with #850

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wallet should also pass --rest-listen to jormungandr (or embedit into nodeConfigFile), based on the --node-port the wallet receives

cp ${haskellPackages.cardano-wallet-jormungandr.components.exes.cardano-wallet-jormungandr}/bin/cardano-wallet-jormungandr* .
cp ${cardano-shell.nix-tools.cexes.cardano-launcher.cardano-launcher}/bin/cardano-launcher* .
cp ${jormungandr-cli}/bin/jcli* .
#cp {nix-tools.cexes.cardano-node.cardano-node}/bin/cardano-node* .
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo, accept the backend param, and select the right node and wallet binaries

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is cardano-node here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new haskell node. Out of scope for this release.

jormungandrConfig = builtins.toFile "config.yaml" (builtins.toJSON commonLib.jormungandrLib.defaultJormungandrConfig);
in pkgs.runCommandCC "daedalus-bridge" {
passthru = {
node-version = jormungandr.version;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo, use the cardano-node version if the backend is set to cardano

iohk-bors bot added a commit that referenced this pull request Oct 22, 2019
862: jormungandr launch: use --rest-listen instead of generating config.yaml r=KtorZ a=rvl

Relates to #832 and #848.
Supersedes #850.

# Overview

`cardano-wallet-jormungandr launch` specifies the REST API port and storage directory. The user provides the rest of the Jörmungandr configuration (e.g. trusted peers). 

# Comments

The Jörmungandr P2P listen address, port, and log level are no longer configured by cardano-wallet.


864: nix: Provide derivations for Daedalus installer r=KtorZ a=rvl

Relates to #863.
Based on #828.

# Overview

- @disassembler @cleverca22 It's not exactly the same as before but should work ok I think.
- Adds source filtering to avoid unnecessary rebuilds.

# Comments

To build:

```
nix-build -A cardano-wallet-jormungandr
nix-build release.nix -A daedalus-jormungandr.windows -o daedalus-jormungandr-windows
nix-build release.nix -A daedalus-jormungandr.macos -o daedalus-jormungandr-macos
nix-build release.nix -A daedalus-jormungandr.linux -o daedalus-jormungandr-linux
```

Note that `daedalus-jormungandr.{windows,macos,linux}` from `release.nix` reference the same `cardano-wallet-jormungandr` derivation, only with different `system` or `crossSystem` arguments. So Daedalus may also import from `default.nix` rather than `release.nix`.

Co-authored-by: Rodney Lorrimar <[email protected]>
Co-authored-by: KtorZ <[email protected]>
iohk-bors bot added a commit that referenced this pull request Oct 22, 2019
864: nix: Provide derivations for Daedalus installer r=KtorZ a=rvl

Relates to #863.
Based on #828.

# Overview

- @disassembler @cleverca22 It's not exactly the same as before but should work ok I think.
- Adds source filtering to avoid unnecessary rebuilds.

# Comments

To build:

```
nix-build -A cardano-wallet-jormungandr
nix-build release.nix -A daedalus-jormungandr.windows -o daedalus-jormungandr-windows
nix-build release.nix -A daedalus-jormungandr.macos -o daedalus-jormungandr-macos
nix-build release.nix -A daedalus-jormungandr.linux -o daedalus-jormungandr-linux
```

Note that `daedalus-jormungandr.{windows,macos,linux}` from `release.nix` reference the same `cardano-wallet-jormungandr` derivation, only with different `system` or `crossSystem` arguments. So Daedalus may also import from `default.nix` rather than `release.nix`.

Co-authored-by: Rodney Lorrimar <[email protected]>
iohk-bors bot added a commit that referenced this pull request Oct 22, 2019
862: jormungandr launch: use --rest-listen instead of generating config.yaml r=KtorZ a=rvl

Relates to #832 and #848.
Supersedes #850.

# Overview

`cardano-wallet-jormungandr launch` specifies the REST API port and storage directory. The user provides the rest of the Jörmungandr configuration (e.g. trusted peers). 

# Comments

The Jörmungandr P2P listen address, port, and log level are no longer configured by cardano-wallet.


864: nix: Provide derivations for Daedalus installer r=KtorZ a=rvl

Relates to #863.
Based on #828.

# Overview

- @disassembler @cleverca22 It's not exactly the same as before but should work ok I think.
- Adds source filtering to avoid unnecessary rebuilds.

# Comments

To build:

```
nix-build -A cardano-wallet-jormungandr
nix-build release.nix -A daedalus-jormungandr.windows -o daedalus-jormungandr-windows
nix-build release.nix -A daedalus-jormungandr.macos -o daedalus-jormungandr-macos
nix-build release.nix -A daedalus-jormungandr.linux -o daedalus-jormungandr-linux
```

Note that `daedalus-jormungandr.{windows,macos,linux}` from `release.nix` reference the same `cardano-wallet-jormungandr` derivation, only with different `system` or `crossSystem` arguments. So Daedalus may also import from `default.nix` rather than `release.nix`.

878: Support for legacy UTxO witness in Jörmungandr r=KtorZ a=KtorZ

# Issue Number

<!-- Put here a reference to the issue this PR relates to and which requirements it tackles -->

#779 

# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->

- [x] I have extended `mkStdTx` so that it would properly handle transactions coming from a `RndKey` and construct `legacy-utxo` witnesses for it.

# Comments

<!-- Additional comments or screenshots to attach if any -->

Jörmungandr doesn't implement creating legacy utxo witnesses from jcli ... 

[jcli/src/jcli_app/transaction/mk_witness.rs](https://github.com/input-output-hk/jormungandr/blob/master/jcli/src/jcli_app/transaction/mk_witness.rs#L78-L82)
```rust
            WitnessType::OldUTxO => {
                // TODO unimplemented!()
                let _secret_key: SecretKey<Ed25519Bip32> = self.secret()?;
                Err(Error::MakeWitnessLegacyUtxoUnsupported)?;
                unimplemented!()
            }
``` 

so I had to construct them by hand according to:

- The format defined in [chain-impl-mockchain#witnesses](https://github.com/input-output-hk/chain-libs/blob/incentive/chain-impl-mockchain/doc/format.md#witnesses)

- The format from the source (double checking it matches the doc..) [chain-impl-mockchain/src/transaction/witness.rs](https://github.com/input-output-hk/chain-libs/blob/incentive/chain-impl-mockchain/src/transaction/witness.rs#L173-L176)

It'd be nice to review our golden if / when the constructor for the witness type gets updated.

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
-->


879: Porting the rest of forget pending tx integration tests to CLI r=KtorZ a=paweljakubas

# Issue Number

<!-- Put here a reference to the issue this PR relates to and which requirements it tackles -->
#836 

# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->

- [x] I have ported the rest of forgetting pending tx integration tests to CLI

# Comments

<!-- Additional comments or screenshots to attach if any -->

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
-->


Co-authored-by: Rodney Lorrimar <[email protected]>
Co-authored-by: KtorZ <[email protected]>
Co-authored-by: Pawel Jakubas <[email protected]>
iohk-bors bot added a commit that referenced this pull request Oct 22, 2019
862: jormungandr launch: use --rest-listen instead of generating config.yaml r=KtorZ a=rvl

Relates to #832 and #848.
Supersedes #850.

# Overview

`cardano-wallet-jormungandr launch` specifies the REST API port and storage directory. The user provides the rest of the Jörmungandr configuration (e.g. trusted peers). 

# Comments

The Jörmungandr P2P listen address, port, and log level are no longer configured by cardano-wallet.


864: nix: Provide derivations for Daedalus installer r=KtorZ a=rvl

Relates to #863.
Based on #828.

# Overview

- @disassembler @cleverca22 It's not exactly the same as before but should work ok I think.
- Adds source filtering to avoid unnecessary rebuilds.

# Comments

To build:

```
nix-build -A cardano-wallet-jormungandr
nix-build release.nix -A daedalus-jormungandr.windows -o daedalus-jormungandr-windows
nix-build release.nix -A daedalus-jormungandr.macos -o daedalus-jormungandr-macos
nix-build release.nix -A daedalus-jormungandr.linux -o daedalus-jormungandr-linux
```

Note that `daedalus-jormungandr.{windows,macos,linux}` from `release.nix` reference the same `cardano-wallet-jormungandr` derivation, only with different `system` or `crossSystem` arguments. So Daedalus may also import from `default.nix` rather than `release.nix`.

878: Support for legacy UTxO witness in Jörmungandr r=KtorZ a=KtorZ

# Issue Number

<!-- Put here a reference to the issue this PR relates to and which requirements it tackles -->

#779 

# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->

- [x] I have extended `mkStdTx` so that it would properly handle transactions coming from a `RndKey` and construct `legacy-utxo` witnesses for it.

# Comments

<!-- Additional comments or screenshots to attach if any -->

Jörmungandr doesn't implement creating legacy utxo witnesses from jcli ... 

[jcli/src/jcli_app/transaction/mk_witness.rs](https://github.com/input-output-hk/jormungandr/blob/master/jcli/src/jcli_app/transaction/mk_witness.rs#L78-L82)
```rust
            WitnessType::OldUTxO => {
                // TODO unimplemented!()
                let _secret_key: SecretKey<Ed25519Bip32> = self.secret()?;
                Err(Error::MakeWitnessLegacyUtxoUnsupported)?;
                unimplemented!()
            }
``` 

so I had to construct them by hand according to:

- The format defined in [chain-impl-mockchain#witnesses](https://github.com/input-output-hk/chain-libs/blob/incentive/chain-impl-mockchain/doc/format.md#witnesses)

- The format from the source (double checking it matches the doc..) [chain-impl-mockchain/src/transaction/witness.rs](https://github.com/input-output-hk/chain-libs/blob/incentive/chain-impl-mockchain/src/transaction/witness.rs#L173-L176)

It'd be nice to review our golden if / when the constructor for the witness type gets updated.

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
-->


879: Porting the rest of forget pending tx integration tests to CLI r=KtorZ a=paweljakubas

# Issue Number

<!-- Put here a reference to the issue this PR relates to and which requirements it tackles -->
#836 

# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->

- [x] I have ported the rest of forgetting pending tx integration tests to CLI

# Comments

<!-- Additional comments or screenshots to attach if any -->

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
-->


Co-authored-by: Rodney Lorrimar <[email protected]>
Co-authored-by: KtorZ <[email protected]>
Co-authored-by: Pawel Jakubas <[email protected]>
iohk-bors bot added a commit that referenced this pull request Oct 22, 2019
862: jormungandr launch: use --rest-listen instead of generating config.yaml r=KtorZ a=rvl

Relates to #832 and #848.
Supersedes #850.

# Overview

`cardano-wallet-jormungandr launch` specifies the REST API port and storage directory. The user provides the rest of the Jörmungandr configuration (e.g. trusted peers). 

# Comments

The Jörmungandr P2P listen address, port, and log level are no longer configured by cardano-wallet.


864: nix: Provide derivations for Daedalus installer r=KtorZ a=rvl

Relates to #863.
Based on #828.

# Overview

- @disassembler @cleverca22 It's not exactly the same as before but should work ok I think.
- Adds source filtering to avoid unnecessary rebuilds.

# Comments

To build:

```
nix-build -A cardano-wallet-jormungandr
nix-build release.nix -A daedalus-jormungandr.windows -o daedalus-jormungandr-windows
nix-build release.nix -A daedalus-jormungandr.macos -o daedalus-jormungandr-macos
nix-build release.nix -A daedalus-jormungandr.linux -o daedalus-jormungandr-linux
```

Note that `daedalus-jormungandr.{windows,macos,linux}` from `release.nix` reference the same `cardano-wallet-jormungandr` derivation, only with different `system` or `crossSystem` arguments. So Daedalus may also import from `default.nix` rather than `release.nix`.

Co-authored-by: Rodney Lorrimar <[email protected]>
Co-authored-by: KtorZ <[email protected]>
iohk-bors bot added a commit that referenced this pull request Oct 22, 2019
864: nix: Provide derivations for Daedalus installer r=KtorZ a=rvl

Relates to #863.
Based on #828.

# Overview

- @disassembler @cleverca22 It's not exactly the same as before but should work ok I think.
- Adds source filtering to avoid unnecessary rebuilds.

# Comments

To build:

```
nix-build -A cardano-wallet-jormungandr
nix-build release.nix -A daedalus-jormungandr.windows -o daedalus-jormungandr-windows
nix-build release.nix -A daedalus-jormungandr.macos -o daedalus-jormungandr-macos
nix-build release.nix -A daedalus-jormungandr.linux -o daedalus-jormungandr-linux
```

Note that `daedalus-jormungandr.{windows,macos,linux}` from `release.nix` reference the same `cardano-wallet-jormungandr` derivation, only with different `system` or `crossSystem` arguments. So Daedalus may also import from `default.nix` rather than `release.nix`.

Co-authored-by: Rodney Lorrimar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants