Skip to content

Commit

Permalink
Client updates (#45)
Browse files Browse the repository at this point in the history
* Update for feeData in builtQuery and sendQuery (#8)

* Update for feeData in builtQuery and sendQuery

* Update package builder files

* Fix imports

* Update packages

* Update builtQuery destructure order

* [RC1] ComputeQuery changes for AxiomV2CircuitMetadata (#7)

* Add AxiomV2CircuitMetadata encoder

* Update computeQuery encoding for circuit metadata

* Update gh actions

* Fix type issue

* Set provider from environment

* Update metadata based on comments

* Add floor

* Update scaffold equation and tests

* [RC1] Update harness tests for Sepolia (#10)

* Update harness tests for sepolia

* Update workflow

* rebase to rc1; Fix merge conflicts

* Fix merge conflicts

* Fix merge conflicts

* Fix merge conflicts

* Spacing

* Update tests

* Fix merge conflict

* fix merge conflicts

* Update packages for rc

* Add rc1 branch to workflow

* Try setting baseUrl

* Update defaults to use tools constants

* Align core package

* Align core package imports

* Update packages and imports

* Update package versions

* Update package versions

* Fix tests for circuit metadata  (#11)

* Update dependencies

* Update dependencies

* Update packages

* Fix tests

* New cli base

* Publish scripts for automatically publishing  (#12)

* Add scripts

* Update package script

* Version

* Use new scaffoldManager

* Update circuit

* Update scaffoldmanager

* Update comments

* Update default save/load paths

* Update cli defaults

* Add error for invalid tag

* Update package deps

* chore: update halo2-lib-js and halo2-wasm deps (#13)

* Lockfile update

* Fix merge conflicts and publish rc.5

* Fix circuit/client packages for AxiomREPL

* Update params

* Revert customRequire change

* Fix/harness array input (#15)

* Update harness parsing

* Update integration -> unit

* Pretty-print inputs

* Update for CI checks

* Update core/tools packages

* Update package deps

* Update harness tests to send queries

* Update package locks

* New user-facing Axiom client interface

* Revert "New user-facing Axiom client interface"

This reverts commit 4fb7a43.

* New external-facing `Axiom` interface from `sdk-client` (#18)

* Revert "Revert "New user-facing Axiom client interface""

This reverts commit 5bf44cd.

* Update versions for all packages

* Publish alpha tag for testing

* Fix import

* Update tests and PR comment fixes

* Update CLI params

* Remove CLI mock default value

* Update core SDK

* Update prove CLI params and scaffold mock equation

* Update alpha publish packages

* Update input->inputs, output->outputs

* Publish package alpha.5

* Optimistically dd rc2 branch to workflow

* Harness flags consistency

* Update harness consistency

* Update tests

* Update fix sendQuery inputs

* Update cli interface

* Update proven input for harness

* Publish rc2.0

* chore(deps): bump follow-redirects from 1.15.3 to 1.15.4 in /circuit/js (#21)

Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.3 to 1.15.4.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](follow-redirects/follow-redirects@v1.15.3...v1.15.4)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Args output

* input cleanup

* option for params as object

* Update provider description for all

* Remove unused comment

* Publish 0.2.2-rc2.0

* Move axiom-react repo to react folder in this repo (#25)

* feat: update default foundry imports (#26)

* inputs defaults and export UserInputs type

* DevEx/CI improvements (#30)

* Update version scripts

* Update local script

* Update circuitprovider

* Update cli input logging

* Update CI for local tests

* Update local script

* Update local script

* Update ci flag pos for CI

* Update ci flag for CI

* Update packages for CI trial

* Update CI test

* Remove ts-node reference

* Update postbuild script

* Update readme naming

* Fix nits

* Update readme case

* Re-add halo2-wasm package

* feat: update templates to latest axiom-v2-client (#33)

* feat: update templates to latest axiom-v2-client

* fix: update solc version

* feat: full from axiom-quickstart

* chore: update version number

* Update sdk-core and validate on build (#34)

* Publish 0.2.2-rc2.2

* feat: mock compile (#28)

* feat: mock compile

* fix: commit rest of files

* fix: mock description

* fix: mock compile option

* chore: deploy

* chore: deploy fix

* fix: comments

---------

Co-authored-by: Yu Jiang Tham <[email protected]>

* Publish 0.2.3-rc2.0

* chore: make runFromString just pass (#36)

* fix: instance/subquery padding (#31)

* fix: fee data fetching (#37)

* fix: fee data fetching

* fix: fetch before passing to qb

* fix: comment

* Update packages for new wasm/lib-js (#35)

* Update for newest halo2-wasm/lib-js packages

* Update packages for new wasm/lib-js

* Update packages

* Update wasm/libjs package

* Update wasm/libjs package

* Update core

* Update halo2-wasm & halo2-lib-js v0.3.3

* chore: update dependency versions

---------

Co-authored-by: Jonathan Wang <[email protected]>

* Publish 0.2.3-rc2.2

* fix: query schema calculation (#38)

* fix: query schema calculation

* fix: use axiom-tools query schema

* Publish 0.2.3-rc2.3

* chore: bump versions in package.json

* Callback in constructor (#39)

* Require callback into Axiom class

* WIP

* Update callback params and axiom options

* Pass in AxiomV2ClientOptions

* Remove unused logging

* Remove node_modules for ci

* Update clear

* Command spacing

* Update utils string input

* Update local script

* Remove maximumMaxFeePerGas

* Set callback gas limit default in client (#42)

* App scaffolds (#40)

* Next.js scaffold

* Update project scaffold

* Merge install

* Remove mock (#43)

* Remove mock

* Bump sdk-core versions

* Update lockfiles

* v2.0.0

* Contract client updates and misc fixes

* Update readme for react

* Fix merge conflicts

* Update readme headers

* Update comments and Next.js caps

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Roshan <[email protected]>
Co-authored-by: Jonathan Wang <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Yi Sun <[email protected]>
  • Loading branch information
5 people authored Jan 20, 2024
1 parent 3e5ee2b commit ab1b8fd
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 25 deletions.
19 changes: 17 additions & 2 deletions client/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# @axiom-crypto/client
# Axiom Client SDK

Main developer interface for developers who are writing node.js scripts to interact with Axiom.
## What is Axiom

(Axiom)[https://www.axiom.xyz/] is the ZK Coprocessor for Ethereum. Axiom enables trustless custom compute over the entire history of Ethereum, unlocking new possibilities for smart contracts.

## Getting Started

Starting a new Axiom project is easy:
```bash
npx create-axiom-client
```

Set a directory to start your project in and then select `Script` in the options list to scaffold a new Axiom quickstart app.

## Docs

For more information on Axiom, please see the (Docs)[https://docs.axiom.xyz] page.
16 changes: 8 additions & 8 deletions client/src/projectScaffold/nextjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const scaffoldNext = async (
{
name: "path",
type: "text",
message: "Path to initialize Axiom next.js project (default: './app')?"
message: "Path to initialize Axiom Next.js project (default: './app')?"
},
{
name: "packageMgr",
Expand Down Expand Up @@ -88,17 +88,17 @@ export const scaffoldNext = async (
// Move to base path
process.chdir(sm.basePath);

// Clone the next.js scaffold
console.log("Fetching Axiom next.js scaffold...");
// Clone the Next.js scaffold
console.log("Fetching Axiom Next.js scaffold...");
const tempDir = `.axiom-temp-${Date.now()}`;
console.log("tempDir", tempDir);
await sm.exec(`git clone --depth 1 https://github.com/axiom-crypto/axiom-scaffold-nextjs.git ${tempDir}`, "Clone Axiom next.js scaffold");
await sm.rm(`${tempDir}/.git`, ` - Remove cloned next.js scaffold's ${chalk.bold(".git")} folder`);
sm.cp(`${tempDir}/.`, ".", ` - Copy next.js scaffold files to ${chalk.bold(sm.basePath)}`);
await sm.exec(`git clone --depth 1 https://github.com/axiom-crypto/axiom-scaffold-nextjs.git ${tempDir}`, "Clone Axiom Next.js scaffold");
await sm.rm(`${tempDir}/.git`, ` - Remove cloned Next.js scaffold's ${chalk.bold(".git")} folder`);
sm.cp(`${tempDir}/.`, ".", ` - Copy Next.js scaffold files to ${chalk.bold(sm.basePath)}`);

// Install package dependencies
console.log("Installing next.js scaffold dependencies...");
await sm.execWithStream(sm.packageMgr, [sm.installCmd], `Install next.js scaffold dependencies`);
console.log("Installing Next.js scaffold dependencies...");
await sm.execWithStream(sm.packageMgr, [sm.installCmd], `Install Next.js scaffold dependencies`);

// Clean up cloned repo
await sm.exec(`rm -rf ${tempDir}`, "Clean up build files");
Expand Down
15 changes: 4 additions & 11 deletions client/src/projectScaffold/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const scaffoldProject = async (sm: ProjectScaffoldManager, appScaffold: s

const tempDir = `.axiom-temp-${Date.now()}`;
console.log("Fetching Axiom quickstart template...");
await sm.exec(`git clone -b staging https://github.com/axiom-crypto/axiom-quickstart.git ${tempDir}`, "Clone Axiom quickstart template");
await sm.exec(`git clone --depth 1 https://github.com/axiom-crypto/axiom-quickstart.git ${tempDir}`, "Clone Axiom quickstart template");

// Check if `node_modules` is in .gitignore and if not then add
if (!sm.exists(".gitignore", `${chalk.bold(".gitignore")} exists?`)) {
Expand Down Expand Up @@ -59,9 +59,9 @@ export const scaffoldProject = async (sm: ProjectScaffoldManager, appScaffold: s
}
}

// Add axiom-v2-client to Foundry
console.log("Installing @axiom-v2-client Solidity library to Foundry...");
await sm.exec("forge install axiom-crypto/axiom-v2-client --no-commit", `Add ${chalk.bold("axiom-v2-client")} library to Foundry`);
// Add axiom-v2-periphery to Foundry
console.log("Installing @axiom-crypto/v2-periphery Solidity library to Foundry...");
await sm.exec("forge install axiom-crypto/axiom-v2-periphery --no-commit", `Add ${chalk.bold("@axiom-crypto/v2-periphery")} library to Foundry`);

// Create forge src files
const fileAvgBal = path.join("src", "AverageBalance.sol");
Expand All @@ -77,13 +77,6 @@ export const scaffoldProject = async (sm: ProjectScaffoldManager, appScaffold: s
sm.cp(`${tempDir}/${fileAvgBalTest}`, fileAvgBalTest, ` - Copy template ${chalk.bold(fileAvgBalTest)}`);
}

// Create circuit test files
const inputFile = path.join("test", "input.json");
if (!sm.exists(inputFile, `${chalk.bold(inputFile)} exists?`)) {
console.log("Generating input file...");
sm.cp(`${tempDir}/${inputFile}`, inputFile, ` - Copy template ${chalk.bold(inputFile)}`);
}

if (appScaffold === "script") {
const appPath = "app";

Expand Down
4 changes: 2 additions & 2 deletions client/src/projectScaffold/script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const scaffoldScript = async (
{
name: "path",
type: "text",
message: "Path to initialize Axiom next.js project (default: './app')?"
message: "Path to initialize Axiom Next.js project (default: './app')?"
},
{
name: "packageMgr",
Expand Down Expand Up @@ -88,7 +88,7 @@ export const scaffoldScript = async (
// Move to base path
process.chdir(sm.basePath);

// Clone the next.js scaffold
// Clone the Next.js scaffold
console.log("Fetching Axiom quickstart template...");
const tempDir = `.axiom-temp-${Date.now()}`;
await sm.exec(`git clone -b staging https://github.com/axiom-crypto/axiom-quickstart.git ${tempDir}`, "Clone Axiom quickstart template");
Expand Down
19 changes: 17 additions & 2 deletions react/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Axiom SDK React Components
# Axiom React Components

Axiom Circuit React components for use with the Axiom SDK in React/Next.js web applications.
## What is Axiom

(Axiom)[https://www.axiom.xyz/] is the ZK Coprocessor for Ethereum. Axiom enables trustless custom compute over the entire history of Ethereum, unlocking new possibilities for smart contracts.

## Getting Started

Starting a new Axiom project is easy:
```bash
npx create-axiom-client
```

Set a directory to start your project in and then select `Next.js` in the options list to scaffold a new Axiom Next.js dApp.

## Docs

For more information on Axiom, please see the (Docs)[https://docs.axiom.xyz] page.

0 comments on commit ab1b8fd

Please sign in to comment.