Skip to content

Commit

Permalink
feat: env variables and updates to readmes
Browse files Browse the repository at this point in the history
  • Loading branch information
Dustin-Ray committed Nov 26, 2024
1 parent 49115e4 commit 363df69
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {

Note: Replace "your_sxt_api_key" with your actual SxT API key, and ensure the `verifier_setup.bin` file is correctly specified. You can use the [file here](https://github.com/spaceandtimelabs/sxt-proof-of-sql-sdk/blob/main/verifier_setup.bin) or fetch the files [here](https://github.com/spaceandtimelabs/sxt-proof-of-sql/releases/tag/dory-prover-params-nu-16).

## JavaScript Support

See [deno](https://github.com/spaceandtimelabs/sxt-proof-of-sql-sdk/tree/feat/javascript-examples/examples/deno) and [node](https://github.com/spaceandtimelabs/sxt-proof-of-sql-sdk/tree/feat/javascript-examples/examples/node) in this repo for examples of JavaScript support.

## Getting an API Key

To obtain an API key for accessing SxT services, please refer to the [Space and Time docs](https://docs.spaceandtime.io/docs/accreditation-use-api-keys).
Expand Down
17 changes: 9 additions & 8 deletions examples/deno/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
# Space and Time (SxT) Proof of SQL SDK
# Space and Time (SxT) Proof of SQL SDK - Deno Example

## Introduction
This is a simple example showing how to use the Deno runtime to query SXTChain and verify the results. See [link to main README] for a overview of the SDK.

The Space and Time Proof of SQL SDK is designed to simplify the process of running SQL queries against the Space and Time TestNet and verifying the results using cryptographic proofs. It leverages the [Proof of SQL](https://github.com/spaceandtimelabs/sxt-proof-of-sql) framework to ensure the integrity and correctness of query results.
## Install Deno

Follow instructions here: https://docs.deno.com/runtime/getting_started/installation/. Or just run
```
curl -fsSL https://deno.land/install.sh | sh
```

## Getting an API Key

An API key is required to interact with SxT services. To obtain an API key, please refer to the [Space and Time docs](https://docs.spaceandtime.io/docs/accreditation-use-api-keys).

## Running Examples
### Node
## Running Deno Example

The PoSQL SDK supports features JavaScript support. You can setup a deno environment in the following manner:

Expand All @@ -21,7 +26,3 @@ Then export your API key, and run with the following:
export SXT_API="your api key here"
deno run --allow-net --allow-env examples/deno/query.js
```

## License

This project is licensed under the terms of the [Cryptographic Open Software License 1.0](https://github.com/spaceandtimelabs/sxt-proof-of-sql-sdk/blob/main/LICENSE).
13 changes: 6 additions & 7 deletions examples/node/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# Space and Time (SxT) Proof of SQL SDK

## Introduction
This is a simple example showing how to use the Deno runtime to query SXTChain and verify the results. See [link to main README] for a overview of the SDK.

The Space and Time Proof of SQL SDK is designed to simplify the process of running SQL queries against the Space and Time TestNet and verifying the results using cryptographic proofs. It leverages the [Proof of SQL](https://github.com/spaceandtimelabs/sxt-proof-of-sql) framework to ensure the integrity and correctness of query results.
## Install Node

Follow instructions here: https://nodejs.org/en/download/package-manager

## Getting an API Key

An API key is required to interact with SxT services. To obtain an API key, please refer to the [Space and Time docs](https://docs.spaceandtime.io/docs/accreditation-use-api-keys).

## Running Examples
### Deno
## Running Node Example

The PoSQL SDK supports features JavaScript support. You can setup a node environment in the following manner:

Expand All @@ -18,9 +20,6 @@ https://github.com/spaceandtimelabs/sxt-proof-of-sql-sdk/blob/bfc04024f54daab011
Then run with the following:

```bash
export SXT_API="your sxt api key here"
node examples/node/query.js
```

## License

This project is licensed under the terms of the [Cryptographic Open Software License 1.0](https://github.com/spaceandtimelabs/sxt-proof-of-sql-sdk/blob/main/LICENSE).
2 changes: 1 addition & 1 deletion examples/node/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const proof = new SxTSDK.SxTClient(
"https://api.spaceandtime.dev/v1/prove",
"https://proxy.api.spaceandtime.dev/auth/apikey",
"https://rpc.testnet.sxt.network/",
"your api key here",
process.env.SXT_API,
);

try {
Expand Down

0 comments on commit 363df69

Please sign in to comment.