For Lattice development#
This is a guide to get you bootstrapped for development on Lattice. You don't have to install nix, particularly if you're on Windows and not using WSL, but it would make your life easier. (also please use WSL for your own sanity).
If you're on Nix, setting up your dev environment is as easy as performing the following.
nix develop
pnpm install
pnpm bootstrap
Bootstrapping#
The bootstrapper will ask for your ATProto handle and password. This is only used to add a minimial number of records to your PDS required for development on Lattice. The bootstrapper will also ask you where you want to store your messages. If you give an empty string, it will point to the currently running production Shard. You can provide localhost:<port> or any other URL to use the Shard there.
The records on your PDS that are added by the bootstrapper are as follows:
- A
latticerecord pointing tolocalhost:3000. - A
shardrecord pointing to the Shard provided earlier in the bootstrapper. - A
channelrecord where therouteThroughfield is set to the Lattice record created in step 1, and thestoreAtfield is set to the Shard record created in step 2.
You may verify the script that creates the records in scripts/bootstrap-local-dev.ts.
If you've already bootstrapped for Shard, then you can either delete the shard and channel records on your PDS created by the Lattice bootstrapper, or skip the bootstrapper and manually create a lattice record yourself that points to localhost:3000. Either way, you will need to then edit the channel record on your PDS to change the routeThrough field to the localhost:3000 Lattice.
If you want to automate this, you can run pnpm bootstrap/from-shard, which runs scripts/bootstrap-from-local-shard.ts.
Development#
In order to actually access the Lattice and the development channels you've made, you'll need to either log in to the production Gemstone frontend at https://app.gmstn.systems/ or run a local copy of the frontend from here. You will find the development channels listed under your repository.