Skip to content
Carsten Munk edited this page Mar 2, 2024 · 14 revisions

Devkit

Notes:

  • No example of setting/getting state

Requirements: Docker installed

Works on AMD64 and ARM64 (Mac M1)

docker run -p 127.0.0.1:8081:8081 -p 127.0.0.1:8080:8080 -p 127.0.0.1:3033:3033 --privileged zippiehq/cartesi-lambada-devkit:1.1

And follow instructions, either open up the in-browser development environment on http://localhost:8081 or use the docker command outputted

Python example

See code at https://github.com/zippiehq/test-lambada-python

git clone https://github.com/zippiehq/test-lambada-python

cd test-lambada-python

cartesi-build

this gives a Chain CID in the resulting JSON line, in "state_cid" field, if it errored on initialization it'll show an error

Javascript example

See code at https://github.com/zippiehq/test-lambada-js

git clone https://github.com/zippiehq/test-lambada-js

cd test-lambada-js

cartesi-build

this gives a Chain CID in the resulting JSON line, in "state_cid" field, if it errored on initialization it'll show an error

Subscribing, submitting and reading to your new chain

curl http://127.0.0.1:3033/subscribe/<chain CID>

the node now follows your chain

send transaction with:

curl -X POST -d 'transaction data' -H "Content-type: application/octet-stream" http://127.0.0.1:3033/submit/<chain CID>

read latest state with:

curl http://127.0.0.1:3033/latest/<chain CID>

Access IPFS gateway on http://127.0.0.1:8080/ipfs/<chain or state CID>

Building devkit container locally and improving it

See README.md