diff --git a/lib/wallet/api/http/Cardano/CLI.hs b/lib/wallet/api/http/Cardano/CLI.hs index 9a44436b06a..aed62383e78 100644 --- a/lib/wallet/api/http/Cardano/CLI.hs +++ b/lib/wallet/api/http/Cardano/CLI.hs @@ -655,6 +655,7 @@ cmdWalletCreateFromMnemonic mkClient = (ApiT wName) (ApiT wPwd) Nothing + Nothing -- | Arguments for 'wallet create from-public-key' command data WalletCreateFromPublicKeyArgs = WalletCreateFromPublicKeyArgs diff --git a/lib/wallet/api/http/Cardano/Wallet/Api/Types.hs b/lib/wallet/api/http/Cardano/Wallet/Api/Types.hs index a72e730df1d..2ee7e390e7e 100644 --- a/lib/wallet/api/http/Cardano/Wallet/Api/Types.hs +++ b/lib/wallet/api/http/Cardano/Wallet/Api/Types.hs @@ -377,6 +377,9 @@ import Cardano.Wallet.Api.Types.MintBurn , ApiTokenAmountFingerprint (..) , ApiTokens (..) ) +import Cardano.Wallet.Api.Types.RestorationMode + ( RestorationMode + ) import Cardano.Wallet.Api.Types.SchemaMetadata ( TxMetadataWithSchema ) @@ -1062,6 +1065,7 @@ data WalletPostData = WalletPostData , name :: !(ApiT WalletName) , passphrase :: !(ApiT (Passphrase "user")) , oneChangeAddressMode :: !(Maybe Bool) + , restorationMode :: Maybe RestorationMode } deriving (FromJSON, ToJSON) via DefaultRecord WalletPostData deriving (Eq, Generic, Show) diff --git a/lib/wallet/api/http/Cardano/Wallet/Api/Types/RestorationMode.hs b/lib/wallet/api/http/Cardano/Wallet/Api/Types/RestorationMode.hs new file mode 100644 index 00000000000..980eb00d653 --- /dev/null +++ b/lib/wallet/api/http/Cardano/Wallet/Api/Types/RestorationMode.hs @@ -0,0 +1,90 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE InstanceSigs #-} +{-# LANGUAGE LambdaCase #-} + +module Cardano.Wallet.Api.Types.RestorationMode + ( RestorationMode (..) + ) where + +import Prelude + +import Data.Aeson + ( FromJSON (parseJSON) + , KeyValue ((.=)) + , ToJSON (toJSON) + , Value (..) + , object + , (.:) + ) +import Data.Aeson.Types + ( Parser + ) +import Data.Quantity + ( Quantity (Quantity) + ) +import Data.Time + ( UTCTime + ) +import Data.Time.Format.ISO8601 + ( iso8601ParseM + , iso8601Show + ) +import Data.Word + ( Word32 + ) +import GHC.Generics + ( Generic + ) + +import qualified Data.Text as T + +data RestorationMode + = RestoreFromGenesis + | RestoreFromSlot (Quantity "slot" Word32) + | RestoreFromTip + | RestoreFromDate UTCTime + | RestoreFromBlock (Quantity "block" Word32) + deriving (Eq, Show, Generic) + +instance ToJSON RestorationMode where + toJSON :: RestorationMode -> Value + toJSON = \case + RestoreFromGenesis -> object [ "unit" .= String "genesis" ] + RestoreFromSlot (Quantity s) -> + object + [ "unit" .= String "slot" + , "quantity" .= s + ] + RestoreFromTip -> object [ "unit" .= String "tip" ] + RestoreFromDate t -> object + [ "unit" .= String "time" + , "value" .= String (T.pack $ iso8601Show t) + ] + RestoreFromBlock (Quantity b) -> + object + [ "unit" .= String "block" + , "quantity" .= b + ] + +instance FromJSON RestorationMode where + parseJSON :: Value -> Parser RestorationMode + parseJSON = \case + Object o -> do + unit <- o .: "unit" + case unit of + String "genesis" -> pure RestoreFromGenesis + String "slot" -> do + s <- o .: "quantity" + pure $ RestoreFromSlot (Quantity s) + String "tip" -> pure RestoreFromTip + String "time" -> do + t <- o .: "value" + case iso8601ParseM (T.unpack t) of + Nothing -> fail "Invalid date format" + Just t' -> pure $ RestoreFromDate t' + String "block" -> do + b <- o .: "quantity" + pure $ RestoreFromBlock (Quantity b) + _ -> fail "Invalid restoration unit" + _ -> fail "Invalid restoration mode" diff --git a/lib/wallet/cardano-wallet.cabal b/lib/wallet/cardano-wallet.cabal index f6a64a02b0f..615522fb2f1 100644 --- a/lib/wallet/cardano-wallet.cabal +++ b/lib/wallet/cardano-wallet.cabal @@ -369,6 +369,7 @@ library cardano-wallet-api-http Cardano.Wallet.Api.Types.Key Cardano.Wallet.Api.Types.MintBurn Cardano.Wallet.Api.Types.Primitive + Cardano.Wallet.Api.Types.RestorationMode Cardano.Wallet.Api.Types.SchemaMetadata Cardano.Wallet.Api.Types.Transaction Cardano.Wallet.Api.Types.WalletAsset diff --git a/lib/wallet/test/data/Cardano/Wallet/Api/RestorationMode.json b/lib/wallet/test/data/Cardano/Wallet/Api/RestorationMode.json new file mode 100644 index 00000000000..b84f02963aa --- /dev/null +++ b/lib/wallet/test/data/Cardano/Wallet/Api/RestorationMode.json @@ -0,0 +1,14 @@ +{ + "samples": [ + "genesis", + "1864-04-30T04:03:19.072819843555Z", + "1864-04-30T18:11:24.043146520263Z", + "genesis", + "1864-04-12T09:52:34.353086972485Z", + { + "quantity": 6594, + "unit": "block" + } + ], + "seed": 0 +} \ No newline at end of file diff --git a/lib/wallet/test/unit/Cardano/Wallet/Api/TypesSpec.hs b/lib/wallet/test/unit/Cardano/Wallet/Api/TypesSpec.hs index 7670084461f..17120c7e90f 100644 --- a/lib/wallet/test/unit/Cardano/Wallet/Api/TypesSpec.hs +++ b/lib/wallet/test/unit/Cardano/Wallet/Api/TypesSpec.hs @@ -286,6 +286,9 @@ import Cardano.Wallet.Api.Types.Error , ApiErrorSharedWalletNoSuchCosigner (..) , ApiErrorTxOutputLovelaceInsufficient (..) ) +import Cardano.Wallet.Api.Types.RestorationMode + ( RestorationMode (..) + ) import Cardano.Wallet.Api.Types.SchemaMetadata ( TxMetadataSchema (..) , TxMetadataWithSchema (..) @@ -527,6 +530,7 @@ import Data.OpenApi , NamedSchema (..) , Schema , ToSchema (..) + , validateToJSON ) import Data.OpenApi.Declare ( Declare @@ -619,6 +623,7 @@ import Test.QuickCheck , Arbitrary1 (..) , Gen , InfiniteList (..) + , Property , applyArbitrary2 , applyArbitrary3 , arbitraryBoundedEnum @@ -700,6 +705,9 @@ import qualified Data.Text as T import qualified Data.Text.Encoding as T import qualified Data.Yaml as Yaml import qualified Prelude +import Test.Hspec.QuickCheck + ( prop + ) import qualified Test.Utils.Roundtrip as Utils type T0 = 'Testnet 0 @@ -846,6 +854,7 @@ spec = do jsonTest @(ApiRewardAccount T0) jsonTest @(ApiExternalCertificate T0) jsonTest @ApiVoteAction + jsonTest @RestorationMode describe "ApiEra roundtrip" $ it "toApiEra . fromApiEra == id" $ property $ \era -> do @@ -909,6 +918,17 @@ spec = do ReqBody '[JSON] WalletPostData :> PostNoContent ) + describe "Verify that schema and json instances agrees on writing values for" $ + do + let check + :: forall v + . (ToJSON v, ToSchema v, Show v, Arbitrary v) => Property + check = forAll arbitrary $ \(v :: v) -> do + let es = validateToJSON v + counterexample (show (v, es)) $ length es `shouldBe` 0 + prop "WalletPostData" $ check @WalletPostData + prop "ApiVoteAction" $ check @ApiVoteAction + describe "verify that every path specified by the servant server matches an \ \existing path in the specification" $ @@ -2699,6 +2719,11 @@ instance Arbitrary (Hash "BlockHeader") where instance Arbitrary ApiBlockHeader where arbitrary = genericArbitrary shrink = genericShrink + +instance Arbitrary RestorationMode where + arbitrary = genericArbitrary + shrink = genericShrink + {------------------------------------------------------------------------------- Specification / Servant-Swagger Machinery diff --git a/test/manual/ConnectionLostWithTheNode.md b/test/manual/ConnectionLostWithTheNode.md deleted file mode 100644 index 9dfbc9eb2b8..00000000000 --- a/test/manual/ConnectionLostWithTheNode.md +++ /dev/null @@ -1,85 +0,0 @@ - -# Test cardano-wallet recovers after losing connection with cardano-node - -## OS - -Windows, MacOS, Linux - -## Test - -1. Start cardano-node and cardano-wallet on `testnet` using latest [config](https://hydra.iohk.io/job/Cardano/iohk-nix/cardano-deployment/latest/download/1/index.html) in two separate terminals. Make sure both are fully synced. - -```bash -$ cardano-node run \ - --config ./*-config.json \ - --topology ./*-topology.json \ - --database-path ./db \ - --socket-path ./node.socket - -$ cardano-wallet serve --port 8090 \ - --node-socket ../relay1/node.socket \ - --testnet testnet-byron-genesis.json \ - --database ./wallet-db -``` - -2. Make sure there are some wallets created and that they are synced. E.g. -```bash -$ curl -X GET http://localhost:8090/v2/wallets | jq length -3 - -$ curl -X GET http://localhost:8090/v2/wallets | jq '.[].state' -{ - "status": "ready" -} -{ - "status": "ready" -} -{ - "status": "ready" -} -``` - -3. Stop the cardano-node, but **keep cardano-wallet running**. -4. Check in wallet logs that it is trying to reconnect to the node. -```bash -Couldn't connect to node (x5). Retrying in a bit... -``` - -5. Make sure you still can see all your wallets. - -```bash -$ curl -X GET http://localhost:8090/v2/wallets | jq length -3 - -$ curl -X GET http://localhost:8090/v2/wallets | jq '.[].state' -{ - "status": "ready" -} -{ - "status": "ready" -} -{ - "status": "ready" -} -``` - - -5. Start cardano-node again. -6. Make sure cardano-wallet re-connected to the node. No more `Couldn't connect to node (x5). Retrying in a bit...` entries appear in the wallet log. -7. Make sure you still can see all your wallets. - -```bash -$ curl -X GET http://localhost:8090/v2/wallets | jq length -3 - -$ curl -X GET http://localhost:8090/v2/wallets | jq '.[].state' -{ - "status": "ready" -} -{ - "status": "ready" -} -{ - "status": "ready" -} -``` diff --git a/test/manual/DBMigration.md b/test/manual/DBMigration.md deleted file mode 100644 index 47d844d9a42..00000000000 --- a/test/manual/DBMigration.md +++ /dev/null @@ -1,111 +0,0 @@ -# DB Migration from previously released version - -## OS - -Windows, MacOS, Linux - -**strongly recommended to test on all platforms** - -## Start previous version of the wallet - -1. Get **previous** release -> https://github.com/cardano-foundation/cardano-wallet/releases -2. Start cardano-node and cardano-wallet on `testnet` using latest [config](https://hydra.iohk.io/job/Cardano/iohk-nix/cardano-deployment/latest/download/1/index.html). Make sure both are fully synced. - -```bash -$ cardano-node run \ - --config ./*-config.json \ - --topology ./*-topology.json \ - --database-path ./db \ - --socket-path ./node.socket - -$ cardano-wallet serve --port 8090 \ - --node-socket ../relay1/node.socket \ - --testnet testnet-byron-genesis.json \ - --database ./wallet-db -``` - -3. Produce some data in the cardano-wallet DB e.g. - - add shelley wallet - ```bash -$ curl -vX POST http://localhost:8090/v2/wallets \ - -H "Content-Type: application/json; charset=utf-8" \ - -d '{ - "name": "Shelley", - "mnemonic_sentence": ["identify", "screen", "lock", "bargain", "inch", "drop", "canyon", "flock", "dry", "zone", "wash", "argue", "system", "glory", "light"], - "passphrase": "Secure Passphrase", - "address_pool_gap": 20 - }' - ``` - - - add byron wallets - ```bash -$ curl -vX POST http://localhost:8090/v2/byron-wallets \ - -H "Content-Type: application/json; charset=utf-8" \ - -d '{ - "style" : "random", - "name": "Random", - "mnemonic_sentence": ["rotate", "machine", "travel", "safe", "expire", "leopard", "wink", "vault", "borrow", "digital", "wisdom", "harsh"], - "passphrase": "Secure Passphrase" - }' - -$ curl -vX POST http://localhost:8090/v2/byron-wallets \ - -H "Content-Type: application/json; charset=utf-8" \ - -d '{ - "style" : "icarus", - "name": "Icarus", - "mnemonic_sentence": ["rotate", "machine", "travel", "safe", "expire", "leopard", "wink", "vault", "borrow", "digital", "wisdom", "harsh"], - "passphrase": "Secure Passphrase" - }' - ``` - - send tx - ```bash -$ curl -vX POST http://localhost:8090/v2/wallets/617963656a409b8a6828dc3a09001de22af90400/transactions \ - -H "Accept: application/json; charset=utf-8" \ - -H "Content-Type: application/json; charset=utf-8" \ - -d '{ - "payments": [ - { - "address": "addr1qryq74hega5juqdl9n86697mwx0mfxu5hf02vuphnqfejtj3rkjw6sd4xtj3ka2c0wsvul94apvycmhy3lr2dmne6w8seyfa3d", - "amount": { "quantity": 1000000, "unit": "lovelace" } - } - ], - "metadata":{ "4": { "map": [ { "k": { "string": "key" }, "v": { "string": "value" } }, { "k": { "string": "14" }, "v": { "int": 42 } } ] } }, - "passphrase": "Secure Passphrase" - }' - ``` - - delegate to a stake-pool - ```bash -$ curl -vX PUT http://localhost:8090/v2/stake-pools/6f79ce9538fb79c9bb4ccd7a290eb58a878188b92fb97a93c44922baf68abb7d/wallets/617963656a409b8a6828dc3a09001de22af90400 \ - -H "Content-Type: application/json; charset=utf-8" \ - -d '{ - "passphrase": "Secure Passphrase" - }' - ``` - - network information, parameters, clock - ```bash -$ curl -vX GET http://localhost:8090/v2/network/information -$ curl -vX GET http://localhost:8090/v2/network/parameters -$ curl -vX GET http://localhost:8090/v2/network/clock - ``` - -## Start current version of the wallet - -1. Get **current** release -> https://github.com/cardano-foundation/cardano-wallet/releases -2. start wallet (on the same `--database`) - -```bash -$ cardano-wallet serve --port 8090 \ - --node-socket ../relay1/node.socket \ - --testnet testnet-byron-genesis.json \ - --database ./wallet-db -``` - -3. Wallet starts and functions properly. - -4. Check basic functionality: - - add shelley wallet - - add byron wallet - - make sure sync progress and block height are tracked on both syncing and synced wallets - - send tx - - delegate to a stake-pool - - network information, parameters, clock diff --git a/test/manual/README.md b/test/manual/README.md deleted file mode 100644 index 75e5e82eb32..00000000000 --- a/test/manual/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# Manual Tests - -The `./make-env.sh` script in this directory will make the environment necessary to run the tests listed here. - -Call it with the appropriate `WALLET_VERSION` and `NODE_VERSION` environment variables set: - -``` -WALLET_VERSION=2022-04-27 NODE_VERSION=1.34.1 ./make-env.sh -``` - -Binaries: - - - cardano-node: `./cardano-node/bin/cardano-node` - - cardano-wallet: `./cardano-wallet/bin/cardano-wallet` - -Directories: - - - Use `db-testnet` as the database directory for `cardano-node`. - - Use `wallet-db-testnet` as the database directory for `cardano-wallet`. - -E.g.: - -``` -cardano-node/bin/cardano-node run \ - --config ./testnet-config.json \ - --topology ./testnet-topology.json \ - --database-path ./db-testnet \ - --socket-path ./node.socket - -cardano-wallet/bin/cardano-wallet serve --port 8090 \ - --node-socket ./node.socket \ - --testnet ./testnet-byron-genesis.json \ - --database ./wallet-db-testnet -``` - -Type `exit` to leave the test environment. diff --git a/test/manual/SyncTolerance.md b/test/manual/SyncTolerance.md deleted file mode 100644 index ea76e03147d..00000000000 --- a/test/manual/SyncTolerance.md +++ /dev/null @@ -1,80 +0,0 @@ -# Tests for `--sync-tolerance` on cardano-wallet - -## OS - -Windows, MacOS, Linux - -## Small --sync-tolerance - -1. Start cardano-node and cardano-wallet on `testnet` using latest [config](https://hydra.iohk.io/job/Cardano/iohk-nix/cardano-deployment/latest/download/1/index.html). Make sure both are fully synced. - -```bash -$ cardano-node run \ - --config ./*-config.json \ - --topology ./*-topology.json \ - --database-path ./db \ - --socket-path ./node.socket - -$ cardano-wallet serve --port 8090 \ - --node-socket ../relay1/node.socket \ - --testnet testnet-byron-genesis.json \ - --database ./wallet-db -``` - -2. Poll network information until the `sync_progress` is marked as `"ready"` - -```bash -$ cardano-wallet network information | jq .sync_progress.status - -Ok. -"ready" -``` - -3. Stop the cardano-wallet for at least 30 seconds, but **keep cardano-node running**. - - -4. Restart the server with a `--sync-tolerance` **short** in front of 30 seconds - -```bash -$ cardano-wallet serve --port 8090 \ - --node-socket ../relay1/node.socket \ - --testnet testnet-byron-genesis.json \ - --database ./wallet-db \ - --sync-tolerance 1s -``` - - -5. Quickly query the network information and check that the `sync_progress` is `"syncing"`. - -```bash -$ cardano-wallet network information | jq .sync_progress.status - -Ok. -"syncing" -``` - -## Large --sync-tolerance - - -6. Stop the cardano-wallet for at least 30 seconds, but **keep cardano-node running**. - - -7. Restart the server with a `--sync-tolerance` **large** in front of 30 seconds - -```bash -$ cardano-wallet serve --port 8090 \ - --node-socket ./node.socket \ - --testnet testnet-byron-genesis.json \ - --database ./wallet-db \ - --sync-tolerance 90s -``` - - -8. Quickly query the network information and check that the `sync_progress` is `"ready"`. - -```bash -$ cardano-wallet network information | jq .sync_progress.status - -Ok. -"ready" -``` diff --git a/test/manual/SyncingInByronEra.md b/test/manual/SyncingInByronEra.md deleted file mode 100644 index 4699a550c74..00000000000 --- a/test/manual/SyncingInByronEra.md +++ /dev/null @@ -1,69 +0,0 @@ -# Tests for syncing in the Byron era - -## OS - -Windows, MacOS, Linux - -## Restart syncing in Byron era. - -1. Start cardano-node and cardano-wallet on `testnet` using latest [config](https://hydra.iohk.io/job/Cardano/iohk-nix/cardano-deployment/latest/download/1/index.html). **Start syncing from scratch.** - -```bash -$ cardano-node run \ - --config ./*-config.json \ - --topology ./*-topology.json \ - --database-path ./db \ - --socket-path ./node.socket - -$ cardano-wallet serve --port 8090 \ - --node-socket ../relay1/node.socket \ - --testnet testnet-byron-genesis.json \ - --database ./wallet-db -``` - -2. Note the `sync_progress` while wallet and node are syncing through Byron era. - -```bash -$ cardano-wallet network information | jq .sync_progress - -Ok. -{ - "status": "syncing", - "progress": { - "quantity": 49.95, - "unit": "percent" - } -} -``` - -3. Stop the cardano-wallet, but **keep cardano-node running**. - - -4. Start cardano-wallet again and make sure that `sync_progress` restarts from the place it was stopped at and moves forward. - -```bash -$ cardano-wallet network information | jq .sync_progress - -Ok. -{ - "status": "syncing", - "progress": { - "quantity": 49.95, - "unit": "percent" - } -} -``` - -## Listing stake pools - - -6. List stake pools while the wallet is syncing through Byron era and make sure appropriate error message is presented. - -```bash -$ curl -X GET 'http://localhost:8090/v2/stake-pools?stake=1000000000' - -{ - "code": "past_horizon", - "message": "Tried to convert something that is past the horizon (due to uncertainty about the next hard fork). Wait for the node to finish syncing to the hard fork. Depending on the blockchain, this process can take an unknown amount of time." -} -``` diff --git a/test/manual/TokenMetadataFetchFailed.md b/test/manual/TokenMetadataFetchFailed.md deleted file mode 100644 index 77976115347..00000000000 --- a/test/manual/TokenMetadataFetchFailed.md +++ /dev/null @@ -1,89 +0,0 @@ - -# Error reported in API when failing to fetch metadata - -## OS - -Any - -## Steps - -1. Start cardano-node and cardano-wallet on `testnet` using latest [config](https://hydra.iohk.io/job/Cardano/iohk-nix/cardano-deployment/latest/download/1/index.html). Make sure both are fully synced. - -```bash -$ cardano-node run \ - --config ./*-config.json \ - --topology ./*-topology.json \ - --database-path ./db \ - --socket-path ./node.socket - -$ cardano-wallet serve --port 8090 \ - --node-socket ../relay1/node.socket \ - --testnet testnet-byron-genesis.json \ - --database ./wallet-db \ - --token-metadata-server http://localhost/ -``` -Make sure wallet server `--token-metadata-server` points to an url which is not token metadata server. - -2. Restore one of the wallets which has some assets. - -The following command will decrypt the E2E test fixtures (see LastPass for the password). - -```console -$ export TESTS_E2E_FIXTURES=******* -$ nix develop --command "cd test/e2e && rake fixture_wallets_decode" -$ jq 'map_values(.shelley|join(" "))' test/e2e/fixtures/fixture_wallets.json -``` - -This will restore the Shelley E2E test wallet for Linux: - -```console -$ jq '{ name: "E2E Linux Shelley", passphrase: "Secure passphrase", mnemonic_sentence: .linux.shelley }' test/e2e/fixtures/fixture_wallets.json | curl -H 'Content-type: application/json' http://localhost:8091/v2/wallets --data @- | jq . -{ - "id": "b1fb863243a9ae451bc4e2e662f60ff217b126e2", - "assets": { - "total": [ ... ], - "available": [ ... ] - }, - ... -} -``` - -3. On the wallet that has some assets check that `"metadata_error":"fetch"` is returned when getting assets. - - when listing all assets -``` -$ curl -X GET http://localhost:8090/v2/wallets/73d38c71e4b8b5d71769622ab4f5bfdedbb7c39d/assets - -[ -... -{ - "asset_name": "496e737472756d656e74616c4f4b3133", - "fingerprint": "asset123svc349ccm6njzpu6w3uzu6cnw87t9l95dmcy", - "metadata_error": "fetch", - "policy_id": "c7b3f8f9d6a02027e7b5ce2a4da0ff3f68d6d49d4ca58c96c5900b37" -}, -... -] -``` -- when getting asset with only policy id -``` -$ curl -X GET http://localhost:8090/v2/wallets/73d38c71e4b8b5d71769622ab4f5bfdedbb7c39d/assets/789ef8ae89617f34c07f7f6a12e4d65146f958c0bc15a97b4ff169f1 - -{ - "asset_name": "", - "fingerprint": "asset1656gm7zkherdvxkn52mhaxkkw343qtkqgv0h8c", - "metadata_error": "fetch", - "policy_id": "789ef8ae89617f34c07f7f6a12e4d65146f958c0bc15a97b4ff169f1" -} -``` - - when getting asset with policy id and asset name -``` -$ $ curl -X GET http://localhost:8090/v2/wallets/73d38c71e4b8b5d71769622ab4f5bfdedbb7c39d/assets/005bd7d46219700eccb77cbf7122055a0b26cd064db51e1277cc1b0b/653265636f696e3635 - -{ - "asset_name": "653265636f696e3635", - "fingerprint": "asset1txvs0057gd63g02q4ttrd86vgxlv3scjua7r03", - "metadata_error": "fetch", - "policy_id": "005bd7d46219700eccb77cbf7122055a0b26cd064db51e1277cc1b0b" -} - -``` diff --git a/test/manual/make-env.sh b/test/manual/make-env.sh deleted file mode 100755 index 0e865dd7eb2..00000000000 --- a/test/manual/make-env.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env bash -# -# The following script creates the environment needed to run the manual tests. - -if [[ -z "${WALLET_VERSION}" ]]; then - echo "WALLET_VERSION is not set!" - exit 1 -fi - -if [[ -z "${NODE_VERSION}" ]]; then - echo "NODE_VERSION is not set!" - exit 1 -fi - -set -euxo pipefail - -pushd $(mktemp -d) - -# Download source repositories -curl -L -o cardano-wallet.tar.gz "https://github.com/cardano-foundation/cardano-wallet/archive/refs/tags/v${WALLET_VERSION}.tar.gz" -tar -xzf cardano-wallet.tar.gz - -curl -L -o cardano-node.tar.gz "https://github.com/IntersectMBO/cardano-node/archive/refs/tags/${NODE_VERSION}.tar.gz" -tar -xzf cardano-node.tar.gz - -WALLET_DIR=cardano-wallet-${WALLET_VERSION} -NODE_DIR=cardano-node-${NODE_VERSION} - -# Build binaries -nix-build $NODE_DIR -A cardano-node -o cardano-node -nix-build $WALLET_DIR -A cardano-wallet -o cardano-wallet - -# Get latest configs -curl -L -o testnet-config.json https://hydra.iohk.io/job/Cardano/iohk-nix/cardano-deployment/latest/download/1/testnet-config.json -curl -L -o testnet-topology.json https://hydra.iohk.io/job/Cardano/iohk-nix/cardano-deployment/latest/download/1/testnet-topology.json -curl -L -o testnet-byron-genesis.json https://hydra.iohk.io/job/Cardano/iohk-nix/cardano-deployment/latest/download/1/testnet-byron-genesis.json -curl -L -o testnet-shelley-genesis.json https://hydra.iohk.io/job/Cardano/iohk-nix/cardano-deployment/latest/download/1/testnet-shelley-genesis.json -curl -L -o testnet-alonzo-genesis.json https://hydra.iohk.io/job/Cardano/iohk-nix/cardano-deployment/latest/download/1/testnet-alonzo-genesis.json - -# Restore node database -curl -L -o db-testnet.tar.gz https://updates-cardano-testnet.s3.amazonaws.com/cardano-node-state/db-testnet.tar.gz -tar -xzf db-testnet.tar.gz - -mkdir wallet-db-testnet - -exec bash