Examples for common use cases meant for the REPL.
;; Supported platforms:
;;
[:jvm]This module hosts a series of recipes, concrete examples regarding how Convex works and how to build high-performance decentralized applications. They are meant to run at the REPL. Early recipes explain core concepts while later ones focus on networking and interacting with the current testnet.
Find more information about the Convex network on the official website.
Those examples rely on 2 libraries from this monorepository:
:module/cvm, core utilities:module/net, network utilities
Recommended order is:
- convex.recipe.cell, to understand cells, types forming the core data model
- convex.recipe.db, to understand how cells are persisted in an immutable database
- convex.recipe.cvm, to understand the execution engine
- convex.recipe.key-pair, for generating and managing key pairs
- convex.recipe.rest, useful methods for the
convex.worldREST API (e.g. creating an account) - convex.recipe.client, using the fast binary client to query the network and issue transactions
- convex.recipe.peer.local, to run a local standalone peer
- convex.recipe.peer.testnet, to run a peer connected to the current testnet
Steps:
- Clone/fork this repo
- Ensure Babashka is installed
- Start REPL from the root of this whole repository
- Open any of the namespaces above and eval stuff
From the root of this repository, in your terminal:
bb dev '[:module/recipe ...]'
Adding to this vector any other alias that might be useful for you (e.g. an NREPL alias from your ~/.clojure/deps.edn).
Often, especially when running a peer, it is best to set the log level to :debug in order to see more accurately what is going on:
env TIMBRE_LEVEL=:debug bb dev '[:module/recipe ...]'