Monorepo for the GeoSpatialRegistry
This repo contains the GeoSpatialRegistry smart contract, a TypeScript SDK for more easily working with it, and the indexer server for checking ownership of placements.
See each packages's README for details on usage and development.
The smart contracts hardhat package can be found in packages/contracts, and the contracts themselves in packages/contracts/contracts
See packages/contracts/docs for a full walk-through of the smart contract logic.
The TypeScript SDK can be found in packages/sdk.
The indexer service can be found in packages/indexer
First, install CockroachDb.
# linux/wsl
curl https://binaries.cockroachdb.com/cockroach-v22.1.11.linux-amd64.tgz | tar -xz && sudo cp -i cockroach-v22.1.11.linux-amd64/cockroach /usr/local/bin/
# macos
brew install cockroachdb/tap/cockroachOr follow the docs for more details.
Then install dependencies:
# Set up corepack for yarn2
npm i -g corepack
# Install dependencies
yarn installBuild all packages:
yarn buildRun all unit tests
yarn testRun E2E tests of the contracts, SDK, and indexer APIs
# Start a local blockchain
yarn ws contracts start
# Build the SDK
yarn ws sdk start
# Start up the test DB, and serve a text indexer on localhost:3001
yarn ws indexer e2e
# Run e2e tests
yarn ws e2e e2e:testIf you haven't run the server before, first deploy migrations
yarn ws indexer db:start # start the local db, if it is not already running.
yarn ws indexer db:deploy # deploy migrations to local dbThen, end the db:start process. If you don't, yarn start will try to restart the DB and will fail.
Make sure to run the DB setup before continuing.
For development, you can either start a local blockchain and all services in one command:
yarn startOr start each one individually
# local blockchain
yarn ws contracts start
# SDK builder
yarn ws sdk start
# Indexer
yarn ws indexer startGithub actions will run tests in CI when a commit goes up to a branch
Commits to develop will deploy to the testnet site
Commits to main will deploy to the mainnet site.