Skip to content

Commit

Permalink
chore(main): minor changes & doc enhancements (#90)
Browse files Browse the repository at this point in the history
### Changes
- Added `test` target to the Makefile.
- Additional information about `Opentofu` installation for different
distros.
- Updated `.terraform.lock.hcl` dependencies due to Linux installation.
- Updated `README.md` about potential failure in the `make init`
command.
- Added basic Indexer query command example.
  • Loading branch information
fforbeck authored Jan 17, 2025
1 parent 95c196a commit 6ea7fb5
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ indexer:
clean-indexer:
rm -f ./indexer

.PHONY: test

test:
go test -race -v ./...

ucangen:
go build -o ./ucangen cmd/ucangen/main.go

Expand Down
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- [Overview](#overview)
- [Installation](#installation)
- [Deployment](#deployment)
- [CLI](#cli)
- [Contribute](#contribute)
- [License](#license)

Expand Down Expand Up @@ -34,6 +35,14 @@ First, install OpenTofu e.g.
brew install opentofu
```

or for Linux distributions that support Snap:

```sh
snap install --classic opentofu
```

for other Operating Systems see: https://opentofu.org/docs/intro/install

### AWS settings

The terraform configuration will fetch AWS settings (such as credentials and the region to deploy resources to) from your local AWS configuration. Although an installation of the AWS CLI is not strictly required, it can be a convenient way to manage these settings.
Expand Down Expand Up @@ -82,6 +91,8 @@ This will simply compile the lambdas locally and put then in the `build` directo

You should only need to run this once -- initializes your terraform deployment and workspace. Make sure you've set `TF_WORKSPACE` first!

If the `make init` fails you will need to execute `tofu init` directly from the `deploy/app` folder to install the required dependencies, and it will update the `.terraform.lock.hcl` file if needed.

#### `make validate`

This will validate your terraform configuration -- good to run to check errors in any changes you make to terraform configs.
Expand All @@ -94,6 +105,23 @@ This will plan a deployment, but not execute it -- useful to see ahead what chan

The big kahuna! This will deploy all of your changes, including redeploying lambdas if any of code changes.

## CLI

The command line interface can be used to query an indexer node. You'll need to compile the binary first:

```sh
make indexer
```

#### `./indexer query <CID>`
Attempts to find the given CID in the Indexer node. The result can be multiple Location Claims, as there may be several storage nodes that store copies of the content, as well as potential indexes and the indexes themselves. If you want to query a specific node, you can use the following command:

```sh
./indexer query -u https://<INDEXING_SERVICE_URL> <CID>
```

If you don't specify a node it will query the Storacha Production node at https://indexer.storacha.network .

## Releasing a new version

Every time changes are merged to `main` the staging environment is automatically updated. Therefore, staging always runs the latest version of the code. The production environment, however, is only updated when a new version is released.
Expand Down
2 changes: 2 additions & 0 deletions deploy/app/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6ea7fb5

Please sign in to comment.