From 363df695e2ce2a8668750499fdfc47c4c8c30c4e Mon Sep 17 00:00:00 2001 From: "dustin.ray" Date: Mon, 25 Nov 2024 18:12:06 -0800 Subject: [PATCH] feat: env variables and updates to readmes --- README.md | 4 ++++ examples/deno/README.md | 17 +++++++++-------- examples/node/README.md | 13 ++++++------- examples/node/query.js | 2 +- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index a200c86..cae1316 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,10 @@ async fn main() -> Result<(), Box> { 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). diff --git a/examples/deno/README.md b/examples/deno/README.md index 13bc7fc..9a270fc 100644 --- a/examples/deno/README.md +++ b/examples/deno/README.md @@ -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: @@ -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). \ No newline at end of file diff --git a/examples/node/README.md b/examples/node/README.md index 7bfaa47..b4b079d 100644 --- a/examples/node/README.md +++ b/examples/node/README.md @@ -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: @@ -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). \ No newline at end of file diff --git a/examples/node/query.js b/examples/node/query.js index f30484d..67926b2 100644 --- a/examples/node/query.js +++ b/examples/node/query.js @@ -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 {