Skip to content

Commit 24e8536

Browse files
authored
Merge pull request #18 from input-output-hk/piotr/acceptance-tests
Add acceptance scenarios
2 parents 040cfa4 + 767dd08 commit 24e8536

File tree

11 files changed

+210
-864
lines changed

11 files changed

+210
-864
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
<img width="200" src=".github/images/cardano-logo.png"/>
77
</p>
88

9+
<p align="center">
10+
<a href="https://buildkite.com/input-output-hk/offchain-metadata-tools"><img src="https://badge.buildkite.com/7df25c563faffd8c7b09db8d802a73bd2ebc14ace98a432761.svg" alt="Build status"></a>
11+
</p>
12+
913
## Overview
1014

1115
In the Cardano multi-asset era, this project helps you create and

docs/index.org

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,6 +1193,65 @@ libraries, but without Haskell packages, use =nix-shell default.nix -A
11931193
cabal-shell=. You can then use cabal to build all Haskell package
11941194
dependencies.
11951195

1196+
*** Make a release
1197+
1198+
Follow this checklist when making a release.
1199+
1200+
**** Preparing the release
1201+
:PROPERTIES:
1202+
:CUSTOM_ID: preparing-the-release
1203+
:END:
1204+
1205+
- [ ] Deploy offchain-metadata-tools to testnet such that
1206+
metadata-server is available at
1207+
https://metadata.cardano-testnet.iohkdev.io/ and new metadata can be
1208+
added in https://github.com/input-output-hk/metadata-registry-testnet
1209+
1210+
**** Create the release notes
1211+
:PROPERTIES:
1212+
:CUSTOM_ID: create-the-release-notes
1213+
:END:
1214+
1215+
- [ ] Add a draft release to
1216+
https://github.com/input-output-hk/offchain-metadata-tools/releases,
1217+
so that the release notes can be reviewed.
1218+
1219+
**** Acceptance tests
1220+
:PROPERTIES:
1221+
:CUSTOM_ID: acceptance-tests
1222+
:END:
1223+
/It is assumed that offchain-metadata-tools have been deployed to
1224+
testnet infrastructure prior to the release so e2e acceptance tests can
1225+
be executed./
1226+
1227+
- [ ] Verify the release notes point to relevant API documentation and
1228+
manual.
1229+
1230+
- [ ] Download release artifacts from the release page and make them
1231+
available on =$PATH=.
1232+
1233+
- [ ] Go over e2e acceptance tests ->
1234+
https://github.com/input-output-hk/offchain-metadata-tools/tree/master/test/Acceptance.md
1235+
1236+
- [ ] Run locally automated scenarios from
1237+
https://github.com/input-output-hk/offchain-metadata-tools/tree/master/token-metadata-creator/test
1238+
1239+
- [ ] Run pre-release load tests from
1240+
https://github.com/input-output-hk/offchain-metadata-tools/tree/master/test/load
1241+
1242+
#+begin_example
1243+
$ npm install
1244+
$ npm test
1245+
#+end_example
1246+
1247+
**** Publication
1248+
:PROPERTIES:
1249+
:CUSTOM_ID: publication
1250+
:END:
1251+
1252+
- [ ] Once everyone has signed off (i.e. Tech lead, QA, Ops & Release
1253+
manager), publish the release.
1254+
11961255
** Reference
11971256
*** Components of the offchain-metadata-tools project
11981257
**** metadata-lib

test/Acceptance.md

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
2+
3+
# Acceptance tests
4+
The document describes few high-level end-to-end scenarios that can be used as acceptance tests.
5+
6+
## Scenarios
7+
1. Add new metadata
8+
2. Update metadata
9+
10+
### Add new metadata
11+
12+
0. Mint a new token on testnet, like https://github.com/input-output-hk/cardano-node/blob/master/scripts/byron-to-mary/mint.sh
13+
14+
1. Add metadata entry to testnet metadata registry:
15+
16+
```
17+
$ git clone https://github.com/input-output-hk/metadata-registry-testnet.git
18+
$ cd metadata-registry-testnet/registry
19+
```
20+
21+
```
22+
$ token-metadata-creator entry --init bb59e0d0065c3368e0b7add747f
23+
795026a93489b550bf0ddfbd6dc636f6666636861696e546f6f6c7354657374696e67
24+
25+
$ token-metadata-creator entry bb59e0d0065c3368e0b7add747f795026a93489b550bf0ddfbd6dc636f6666636861696e546f6f6c7354657374696e67 \
26+
--name "OffchainToolsCoin" \
27+
--description "Test OffchainTools" \
28+
--policy /home/piotr/t/node/tokens/minter/offchain-tools-test/policy.script
29+
30+
$ token-metadata-creator entry bb59e0d0065c3368e0b7add747f795026a93489b550bf0ddfbd6dc636f6666636861696e546f6f6c7354657374696e67 \
31+
--ticker "OTC" \
32+
--url "https://github.com/input-output-hk/offchain-metadata-tools/" \
33+
--logo "/home/piotr/wb/offchain-metadata-tools/token-metadata-creator/test/testData/icon.png"
34+
35+
$ token-metadata-creator entry bb59e0d0065c3368e0b7add747f795026a93489b550bf0ddfbd6dc636f6666636861696e546f6f6c7354657374696e67 -a /home/piotr/t/node/tokens/minter/offchain-tools-test/policy.skey
36+
37+
$ token-metadata-creator entry bb59e0d0065c3368e0b7add747f795026a93489b550bf0ddfbd6dc636f6666636861696e546f6f6c7354657374696e67 --finalize
38+
39+
$ token-metadata-creator validate bb59e0d0065c3368e0b7add747f795026a93489b550bf0ddfbd6dc636f6666636861696e546f6f6c7354657374696e67.json
40+
41+
[Info] [Main.log#281] Wallet metadata validation successful!
42+
```
43+
44+
2. Commit file and create PR on https://github.com/input-output-hk/metadata-registry-testnet.git
45+
46+
3. Validate PR.
47+
```
48+
$ metadata-validator-github --no-auth input-output-hk metadata-registry-testnet 94 --expect-branch master
49+
50+
[Info] [Cardano.Metadata.Validation.GitHub.gitHubValidationRules#146] Validating 1 files.
51+
[Info] [Cardano.Metadata.Validation.GitHub.validatePRFile#198] Adding a record...
52+
53+
```
54+
4. Merge PR.
55+
56+
5. Check that metadata is displayed in cardano-wallet which holds tokens for which we defined metadata in metadata-registry:
57+
58+
- cardano-wallet must be started with `--token-metadata-server https://metadata.cardano-testnet.iohkdev.io/` parameter
59+
```
60+
cardano-wallet serve
61+
--node-socket ../node/node.socket \
62+
--testnet testnet-byron-genesis.json \
63+
--token-metadata-server https://metadata.cardano-testnet.iohkdev.io/ \
64+
--database ./wallet-db
65+
```
66+
67+
```
68+
curl -X GET http://localhost:8090/v2/wallets/1b0aa24994b4181e79116c131510f2abf6cdaa4f/assets | jq
69+
...
70+
{
71+
"asset_name": "6f6666636861696e546f6f6c7354657374696e67",
72+
"fingerprint": "asset19ctrcwqhl2ttx97qr4n590v382k8l59getman3",
73+
"policy_id": "bb59e0d0065c3368e0b7add747f795026a93489b550bf0ddfbd6dc63",
74+
"metadata": {
75+
"url": "https://github.com/input-output-hk/offchain-metadata-tools/",
76+
"name": "OffchainToolsCoin",
77+
"ticker": "OTC",
78+
"logo": "...",
79+
"description": "Test OffchainTools"
80+
}
81+
},
82+
```
83+
84+
## Update metadata
85+
86+
1. Update name in the already existing metadata:
87+
```
88+
$ token-metadata-creator entry bb59e0d0065c3368e0b7add747f795026a93489b550bf0ddfbd6dc636f6666636861696e546f6f6c7354657374696e67 \
89+
--name "OffchainToolsCoin update"
90+
91+
$ token-metadata-creator entry bb59e0d0065c3368e0b7add747f795026a93489b550bf0ddfbd6dc636f6666636861696e546f6f6c7354657374696e67 -a /home/piotr/t/node/tokens/minter/offchain-tools-test/policy.skey \
92+
--attest-name
93+
94+
$ token-metadata-creator entry bb59e0d0065c3368e0b7add747f795026a93489b550bf0ddfbd6dc636f6666636861696e546f6f6c7354657374696e67 --finalize
95+
```
96+
97+
2. Verify that name `value` and `signature` are updated, also `sequenceNumber` is increased by one.
98+
99+
```
100+
"name": {
101+
"sequenceNumber": 1,
102+
"value": "OffchainToolsCoin update",
103+
"signatures": [
104+
{
105+
"signature": "18967d36105d3cc749a831282e52456008483fe673c86f11e423c0e56e319c3649aae9eec0a3fac8dcdf99f1e3fbd126cb8d62db49ff9c4fb88eda9bb1c4f800",
106+
"publicKey": "197b6c5c36b69919f3ac9952f9014de3fd096f6c7c0b34d55561942bd37d76a2"
107+
}
108+
]
109+
}
110+
```
111+
112+
3. Validate the update:
113+
114+
```
115+
$ token-metadata-creator validate bb59e0d0065c3368e0b7add747f795026a93489b550bf0ddfbd6dc636f6666636861696e546f6f6c7354657374696e67.json
116+
117+
[Info] [Main.log#281] Wallet metadata validation successful!
118+
```
119+
120+
4. Commit file and create PR on https://github.com/input-output-hk/metadata-registry-testnet.git
121+
122+
5. Validate PR.
123+
```
124+
$ metadata-validator-github --no-auth input-output-hk metadata-registry-testnet 95 --expect-branch master
125+
126+
[Info] [Cardano.Metadata.Validation.GitHub.gitHubValidationRules#146] Validating 1 files.
127+
[Info] [Cardano.Metadata.Validation.GitHub.validatePRFile#197] Modifying a record...
128+
```
129+
6. Merge PR.
130+
7. Make sure that updated metadata is displayed in cardano-wallet which holds tokens for which we defined metadata in metadata-registry.
131+
```
132+
curl -X GET http://localhost:8090/v2/wallets/1b0aa24994b4181e79116c131510f2abf6cdaa4f/assets | jq
133+
...
134+
{
135+
"asset_name": "6f6666636861696e546f6f6c7354657374696e67",
136+
"fingerprint": "asset19ctrcwqhl2ttx97qr4n590v382k8l59getman3",
137+
"policy_id": "bb59e0d0065c3368e0b7add747f795026a93489b550bf0ddfbd6dc63",
138+
"metadata": {
139+
"url": "https://github.com/input-output-hk/offchain-metadata-tools/",
140+
"name": "OffchainToolsCoin update",
141+
"ticker": "OTC",
142+
"logo": "...",
143+
"description": "Test OffchainTools"
144+
}
145+
},
146+
147+
```

token-metadata-creator/docs/Makefile

Lines changed: 0 additions & 47 deletions
This file was deleted.

token-metadata-creator/docs/bors.md

Lines changed: 0 additions & 53 deletions
This file was deleted.

0 commit comments

Comments
 (0)