Skip to content

Commit 2e082dd

Browse files
committed
Update ODC
1 parent b96c822 commit 2e082dd

File tree

4 files changed

+23
-36
lines changed

4 files changed

+23
-36
lines changed

README.md

Lines changed: 12 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
* [Setup `nft.storage` key](#setup--nftstorage--key)
88
* [Optional: Copy testnet node database](#optional--copy-testnet-node-database)
99
* [Start services](#start-services)
10-
* [Start ogmios-datum-cache block fetcher](#start-ogmios-datum-cache-block-fetcher)
1110
* [Optional: Mint your own NFTs](#optional--mint-your-own-nfts)
1211
- [Components](#components)
1312
* [`nft-marketplace`](#-nft-marketplace-)
@@ -65,24 +64,6 @@ Once the chain is synced, you should be able to view the dApp UI from `localhost
6564

6665
Ensure that Nami is set to Testnet, that you have some Test Ada, and that you've set collateral in Nami.
6766

68-
69-
### Start ogmios-datum-cache block fetcher
70-
71-
Necessary untill [#20](https://github.com/mlabs-haskell/ogmios-datum-cache/issues/20) is implemented.
72-
73-
```shell
74-
$ curl --location --request POST 'localhost:9999/control/fetch_blocks' -i\
75-
--header 'Content-Type: application/json' \
76-
--data-raw '
77-
{
78-
"slot": 44366242,
79-
"id": "d2a4249fe3d0607535daa26caf12a38da2233586bc51e79ed0b3a36170471bf5"
80-
}
81-
'
82-
```
83-
84-
Detaild block fetcher api is described [here](https://github.com/mlabs-haskell/ogmios-datum-cache/tree/9e8bcbe00f88715afdb202cd9654ec2adc72c09e#control-api).
85-
8667
### Optional: Mint your own NFTs
8768

8869
This process will be simplified in the future.
@@ -123,19 +104,21 @@ $ nix develop -L -c cabal run efficient-nft-pab
123104

124105
$ # In other console
125106
$ # Mint underlying CNFTs, replace "CONVERTED_CID" with the result of `ipfs` command
126-
$ curl --location --request POST 'localhost:3003/api/contract/activate'
107+
$ curl --location --request POST 'localhost:3003/api/contract/activate' \
127108
--header 'Content-Type: application/json' \
128109
--data-raw '
129110
{
130-
"tag":"MintCnft",
131-
"contents":[
132-
{
133-
"mc'"'"'name":"Cat number 123",
134-
"mc'"'"'description":"Cat eating piece of cheese",
135-
"mc'"'"'image":"ipfs://CONVERTED_CID",
136-
"mc'"'"'tokenName":"cat-123"
137-
}
138-
]
111+
"caID": {
112+
"tag":"MintCnft",
113+
"contents":[
114+
{
115+
"mc'"'"'name":"Cat number 123",
116+
"mc'"'"'description":"Cat eating piece of cheese",
117+
"mc'"'"'image":"ipfs://CONVERTED_CID",
118+
"mc'"'"'tokenName":"cat-123" # This should be hex encoded (without 0x)
119+
}
120+
]
121+
}
139122
}'
140123

141124
$ # Go back to previous terminal and stop BPI

arion-compose.nix

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ let
33
nft-marketplace-server =
44
(pkgs.callPackage (import nft-marketplace-server/release.nix)
55
{ }).nft-marketplace-server;
6-
ogmios-datum-cache = (pkgs.callPackage (import ogmios-datum-cache/release.nix)
7-
{ }).ogmios-datum-cache;
6+
ogmios-datum-cache = (import ogmios-datum-cache/default.nix).packages.x86_64-linux.ogmios-datum-cache;
87
cardano-transaction-lib-server = (import
98
cardano-transaction-lib/default.nix).packages.x86_64-linux."cardano-browser-tx-server:exe:cardano-browser-tx-server";
109
in {

config/datum-cache-config.toml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
dbConnectionString = "host=postgresql-db port=5432 user=seabug dbname=seabug password=seabug"
22

3-
saveAllDatums = true
4-
53
server.port = 9999
64

75
ogmios.address = "ogmios"
86
ogmios.port = 1337
97

10-
firstFetchBlock.slot = 44366242
11-
firstFetchBlock.id = "d2a4249fe3d0607535daa26caf12a38da2233586bc51e79ed0b3a36170471bf5"
8+
blockFetcher.autoStart = true
9+
blockFetcher.startFromLast = true
10+
blockFetcher.firstBlock.slot = 44366242
11+
blockFetcher.firstBlock.id = "d2a4249fe3d0607535daa26caf12a38da2233586bc51e79ed0b3a36170471bf5"
12+
blockFetcher.filter = '''
13+
{
14+
"address": "addr_test1wr05mmuhd3nvyjan9u4a7c76gj756am40qg7vuz90vnkjzczfulda"
15+
}
16+
'''

0 commit comments

Comments
 (0)