- Git
- Node & NPM
- Install JDK 17
- Install Docker
- Install Chromia CLI
- Install Rell VS Code Plugin
In this workshop we will build a basic auction house.
After having a local Postgres started you can run a local node by executing the command below.
chr node start
For convenience I've packaged defined a postgres
in docker-compose.yml
and provided a script to easily start it.
We are going to test out the updated typescript postchain-client
and I've tested a test script for this under client/ah.ts
.
You can execute it by running:
npm run auctions
Next lets try to query the node to list all the auctions.
chr query auction_house.list_all
In order to send transactions we will need a keypair
.
chr keygen
Create a .secret
file in the project and store your credentials, i.e.
privkey=...
pubkey=...
mnemonic=...
The contract of the dapp specifies that we need to register a user, so let's do that first.
chr tx --secret .secret --await auction_house.register_user <pubkey> <name>
Try if you can place a bid of 10
on any of the auctions.
Modify the code so that auctions includes a default buyout price 15 and if a bid matches or is above that, then the auction is instantly settled and a balance of 15 is transferred.
After that, update the code that runs on the node.
chr node update