decentralised sync engine
1# For Lattice development 2 3This is a guide to get you bootstrapped for development on Lattice. You don't _have_ to install [nix](https://nixos.org/download/), particularly if you're on Windows and not using WSL, but it would make your life easier. (also please use [WSL](https://learn.microsoft.com/en-us/windows/wsl/install) for your own sanity). 4 5If you're on Nix, setting up your dev environment is as easy as performing the following. 6 7```bash 8nix develop 9pnpm install 10pnpm bootstrap 11``` 12 13## Bootstrapping 14 15The 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. 16 17The records on your PDS that are added by the bootstrapper are as follows: 18 191. A [`lattice`](https://github.com/gemstone-systems/lexicons/blob/main/lexicons/systems/gmstn/development/lattice.json) record pointing to `localhost:3000`. 202. A [`shard`](https://github.com/gemstone-systems/lexicons/blob/main/lexicons/systems/gmstn/development/shard.json) record pointing to the Shard provided earlier in the bootstrapper. 213. A [`channel`](https://github.com/gemstone-systems/lexicons/blob/main/lexicons/systems/gmstn/development/channel.json) record where the `routeThrough` field is set to the Lattice record created in step 1, and the `storeAt` field is set to the Shard record created in step 2. 22 23You may verify the script that creates the records in `scripts/bootstrap-local-dev.ts`. 24 25If 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. 26 27If you want to automate this, you can run `pnpm bootstrap/from-shard`, which runs `scripts/bootstrap-from-local-shard.ts`. 28 29## Development 30 31In 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](https://github.com/gemstone-systems/gemstone-app). You will find the development channels listed under your repository.