Skip to content

Commit 409379d

Browse files
committed
Merge branch 'main' into syn/use-flake
2 parents a283da5 + 9014128 commit 409379d

File tree

3 files changed

+34
-36
lines changed

3 files changed

+34
-36
lines changed

README.md

Lines changed: 16 additions & 30 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-)
@@ -22,7 +21,9 @@
2221
## Prerequisites
2322

2423
- nix
25-
- arion - Use patched one from `nix develop`!
24+
- [IOHK binary cache](https://github.com/input-output-hk/plutus#how-to-set-up-the-iohk-binary-caches)
25+
- arion - Provided by devshell
26+
- [docker](https://docs.docker.com/get-docker/)
2627
- [nami wallet](https://namiwallet.io/) installed as browser extension
2728
- Funds in wallet obtained from [faucet](https://testnets.cardano.org/en/testnets/cardano/tools/faucet/)
2829

@@ -39,6 +40,7 @@ $ git clone --recurse-submodules [email protected]:mlabs-haskell/seabug.git
3940
```shell
4041
$ nix develop --extra-experimental-features nix-command --extra-experimental-features flakes
4142
```
43+
From now, execute every command in devshell dropped by `nix develop`
4244

4345
### Setup `nft.storage` key
4446

@@ -65,24 +67,6 @@ Once the chain is synced, you should be able to view the dApp UI from `localhost
6567

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

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-
8670
### Optional: Mint your own NFTs
8771

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

124108
$ # In other console
125109
$ # Mint underlying CNFTs, replace "CONVERTED_CID" with the result of `ipfs` command
126-
$ curl --location --request POST 'localhost:3003/api/contract/activate'
110+
$ curl --location --request POST 'localhost:3003/api/contract/activate' \
127111
--header 'Content-Type: application/json' \
128112
--data-raw '
129113
{
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-
]
114+
"caID": {
115+
"tag":"MintCnft",
116+
"contents":[
117+
{
118+
"mc'"'"'name":"Cat number 123",
119+
"mc'"'"'description":"Cat eating piece of cheese",
120+
"mc'"'"'image":"ipfs://CONVERTED_CID",
121+
"mc'"'"'tokenName":"cat-123" # This should be hex encoded (without 0x)
122+
}
123+
]
124+
}
139125
}'
140126

141127
$ # Go back to previous terminal and stop BPI

arion-compose.nix

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
{ pkgs, ... }:
2-
3-
{
2+
let
3+
nft-marketplace-server =
4+
(pkgs.callPackage (import nft-marketplace-server/release.nix)
5+
{ }).nft-marketplace-server;
6+
ogmios-datum-cache = (import ogmios-datum-cache/default.nix).packages.x86_64-linux.ogmios-datum-cache;
7+
cardano-transaction-lib-server = (import
8+
cardano-transaction-lib/default.nix).packages.x86_64-linux."cardano-browser-tx-server:exe:cardano-browser-tx-server";
9+
in {
410
# NOTE: still can't remember it...
511
# ports = [ "host:container" ]
612
config.services = {
@@ -109,6 +115,7 @@
109115
[ "${toString ./.}/data/postgres-data:/var/lib/postgresql/data" ];
110116
};
111117
nft-marketplace-server.service = {
118+
image = "alpine";
112119
command = [
113120
"${pkgs.nft-marketplace-server}/bin/nft-marketplace-server"
114121
"--db-connection"

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)