-
Notifications
You must be signed in to change notification settings - Fork 213
Conversation
4285bc3
to
7a5a50d
Compare
PR description says to "set the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works so smoothly! I do see a lot of "Rolling back to ChainPoint" messages. You don't have to wait for these, but they can drown out the "Tx confirmed" message.
The problem is that the chain index prints all log messages to stdout, it doesn't filter by log level. I added an issue in Jira to fix that |
@james-iohk Updated the PR description |
Works for me too; awesome @j-mueller ! |
2c83925
to
fc438b2
Compare
Thanks @j-mueller. I think it'd be worth adding these details to the plutus-pab/README.md. Although, it's already quite large so maybe just mention the local-cluster there and add details in a new plutus-pab/local-cluster/README.md. |
When running the |
pab-local-cluster
tool that starts up a local cluster (private testnet) with wallet, chain index, PABcardano-wallet
plutus-chain-index-core
: The chain index libraries (used to be theplutus-chain-index
project)plutus-chain-index
: A new library that implements the executable / app. This was done so that we can import the code in other places, which wasn't possible when it was an executable.Running the integration tests
Private testnet (local cluster)
cabal build plutus-pab-local-cluster cardano-node cardano-wallet
https://github.com/input-output-hk/cardano-wallet/
and set theSHELLEY_TEST_DATA
environment variable to the absolute path of theplutus-pab/local-cluster/cluster-data/cardano-node-shelley
in your local clone of the plutus-apps repository.cabal exec plutus-pab-local-cluster
Starting PAB backend server on port 9080
appearscurl -H "Content-Type: application/json" -v -X POST -d '{"caID":{"tag":"IntegrationTest"},"caWallet":{"getWalletId":"2d4cc31a4b3116ab86bfe529d30d9c362acd0b44"}}' localhost:9080/api/contract/activate
to start the test. A couple of log messages appear, the last one should say something likefbca6236-f532-43d9-89db-6ddc7002336e: "Tx confirmed. Integration test complete."
Public testnet
Assuming you have checked out the plutus apps repository in
${plutus-apps}
cabal build plutus-pab-examples plutus-chain-index cardano-node cardano-wallet
${plutus-apps}/plutus-pab/test-node/start-testnet-node.sh
script, wait for cardano node to synchronisecabal exec -- cardano-wallet serve --testnet ${plutus-apps}/plutus-pab/test-node/testnet/testnet-byron-genesis.json --node-socket ${plutus-apps}/plutus-pab/test-node/testnet/node.sock
in a new terminal to start the walleti. if you don't have a testnet wallet, generate a recovery phrase with
cabal exec -- cardano-wallet recovery-phrase generate
ii. run
curl -H "content-type: application/json" -XPOST -d @restore-wallet.json localhost:8090/v2/wallets
whererestore-wallet.json
is a request body JSON file with the recovery phrase (example). Note the spending password!iii. If this is a new wallet, you need to use the testnet faucet to send some tAda to it. An address of the wallet can be obtained using the wallet's HTTP API. Verify that the wallet has received the tAda by calling
getWallet
cabal exec -- plutus-chain-index --config ${chain-index-config} start-index
in a new terminal. The configuration should look something like this - don't forget to replace the${plutus-apps}
variable.${pab-config}
.cabal exec -- plutus-pab-examples --config ${pab-config} webserver --passphrase PABPABPABPAB
(passphrase is the spending password from step 4.ii) in a new terminalcardano-node
,cardano-wallet
,plutus-pab-examples
,plutus-chain-index
) to fully synchronise with the testnet. The chain index is probably going to take the longest time to synchronise, ~3h on my machine. To check the sync status of the chain index, runcurl localhost:9083/tip | jq .
When it's fully synched the slot should be the same slot that theplutus-pab-examples
process last printed to the console. Note that the PAB process will be silent for a while, after the initial log messages, before it starts printing log messages about its sync status.curl -H "Content-Type: application/json" -v -X POST -d '{"caID":{"tag":"IntegrationTest"},"caWallet":{"getWalletId":"4c04ce356e087d12980a1e5134c15234661acc39"}}' localhost:9080/api/contract/activate
(note the wallet ID - this has to be the ID of the wallet that you created in step 4)Things that can go wrong
Notes
TODO / Plans:
cardano-wallet
--> add it to this PRPre-submit checklist: