-
Notifications
You must be signed in to change notification settings - Fork 324
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial version of an "everything app" that can be used to test and benchmark Aztec. - PXE in the browser with client proofs - Connect to local sandbox or any network (scoped data) - Lazy loading of most assets (think contract artifacts) and WASM (bb still loads at start due to top-level await, but in parallel as it is separated from the main index,js) - Bundled by vite, 1MB compressed - Drop any contract artifact, interpret its ABI, simulate and send - Acts as a barebones wallet, managing auth scopes and separating accounts - Stores artifacts, accounts and all that's required to pick up where you left off without having to redeploy everything (indexeddb) - Supports basic aliasing of addresses - Allows loading an artifact, provide the address and go (instead of having to deploy it) - Add senders/contact management - Authwits Missing: - Benchmarking window where simulation/proving stats are displayed This initial PR just puts it out there so other people can use it. Next up is hooking it up to CI and adding hard limits to bundle sizes, so we can control if something gets into the client packages that shouldn't be there. Both this app (that includes PXE, bb-prover, etc) and `aztec.js` will force CI to fail if a size threshold is surpassed (CC @spalladino @charlielye)
- Loading branch information
Showing
42 changed files
with
7,488 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
VITE_AZTEC_NODE_URL=http://localhost:8080 | ||
VITE_LOG_LEVEL=debug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? | ||
|
||
.yarn/* | ||
!.yarn/releases | ||
vite.config.ts.* | ||
*.module.css.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
nodeLinker: node-modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# GAztec | ||
|
||
Initial version of an "everything app" that can be used to test and benchmark Aztec. | ||
|
||
* PXE in the browser with client proofs | ||
* Connect to local sandbox or any network (scoped data) | ||
* Lazy loading of most assets (think contract artifacts) and WASM (bb still loads at start due to top-level await, but in parallel as it is separated from the main index,js) | ||
* Bundled by vite, 1MB compressed | ||
* Drop any contract artifact, interpret its ABI, simulate and send | ||
* Acts as a barebones wallet, managing auth scopes and separating accounts | ||
* Stores artifacts, accounts and all that's required to pick up where you left off without having to redeploy everything (indexeddb) | ||
* Supports basic aliasing of addresses | ||
* Allows loading an artifact, provide the address and go (instead of having to deploy it) | ||
* Add senders/contact management | ||
* Authwits | ||
|
||
Missing: | ||
|
||
* Benchmarking window where simulation/proving stats are displayed | ||
|
||
## To run | ||
|
||
Dev: | ||
|
||
``` | ||
yarn dev | ||
``` | ||
|
||
Production: | ||
|
||
``` | ||
yarn build | ||
yarn preview | ||
`````` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import js from '@eslint/js' | ||
import globals from 'globals' | ||
import reactHooks from 'eslint-plugin-react-hooks' | ||
import reactRefresh from 'eslint-plugin-react-refresh' | ||
import tseslint from 'typescript-eslint' | ||
|
||
export default tseslint.config( | ||
{ ignores: ['dist'] }, | ||
{ | ||
extends: [js.configs.recommended, ...tseslint.configs.recommended], | ||
files: ['**/*.{ts,tsx}'], | ||
languageOptions: { | ||
ecmaVersion: 2020, | ||
globals: globals.browser, | ||
}, | ||
plugins: { | ||
'react-hooks': reactHooks, | ||
'react-refresh': reactRefresh, | ||
}, | ||
rules: { | ||
...reactHooks.configs.recommended.rules, | ||
'react-refresh/only-export-components': [ | ||
'warn', | ||
{ allowConstantExport: true }, | ||
], | ||
}, | ||
}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>GAztec</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
"name": "vite", | ||
"private": true, | ||
"version": "0.0.0", | ||
"type": "module", | ||
"scripts": { | ||
"clean": "rm -rf ./dist .tsbuildinfo", | ||
"dev": "vite", | ||
"build": "tsc -b && vite build", | ||
"lint": "eslint .", | ||
"preview": "vite preview" | ||
}, | ||
"dependencies": { | ||
"@aztec/accounts": "link:../yarn-project/accounts", | ||
"@aztec/aztec.js": "link:../yarn-project/aztec.js", | ||
"@aztec/bb-prover": "link:../yarn-project/bb-prover", | ||
"@aztec/circuits.js": "link:../yarn-project/circuits.js", | ||
"@aztec/foundation": "link:../yarn-project/foundation", | ||
"@aztec/key-store": "link:../yarn-project/key-store", | ||
"@aztec/kv-store": "link:../yarn-project/kv-store", | ||
"@aztec/pxe": "link:../yarn-project/pxe", | ||
"@aztec/simulator": "link:../yarn-project/simulator", | ||
"@emotion/react": "^11.14.0", | ||
"@emotion/styled": "^11.14.0", | ||
"@fontsource/roboto": "^5.1.1", | ||
"@mui/icons-material": "^6.3.1", | ||
"@mui/material": "^6.3.1", | ||
"@mui/styles": "^6.3.1", | ||
"react": "^18.3.1", | ||
"react-dom": "^18.3.1", | ||
"react-dropzone": "^14.3.5" | ||
}, | ||
"devDependencies": { | ||
"@eslint/js": "^9.18.0", | ||
"@types/node": "^22.10.5", | ||
"@types/react": "^19.0.6", | ||
"@types/react-dom": "^19.0.3", | ||
"@vitejs/plugin-react-swc": "^3.7.2", | ||
"eslint": "^9.13.0", | ||
"eslint-plugin-react-hooks": "^5.1.0", | ||
"eslint-plugin-react-refresh": "^0.4.18", | ||
"globals": "^15.14.0", | ||
"typescript": "~5.7.3", | ||
"typescript-eslint": "^8.11.0", | ||
"vite": "^6.0.7", | ||
"vite-plugin-node-polyfills": "^0.22.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Home } from "./components/home/home"; | ||
import { Global } from "@emotion/react"; | ||
import { ThemeProvider } from "@mui/material/styles"; | ||
import { globalStyle, theme } from "./common.styles"; | ||
|
||
function App() { | ||
return ( | ||
<ThemeProvider theme={theme}> | ||
<Global styles={globalStyle}></Global> | ||
<Home /> | ||
</ThemeProvider> | ||
); | ||
} | ||
|
||
export default App; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import "@fontsource/roboto/300.css"; | ||
import "@fontsource/roboto/400.css"; | ||
import "@fontsource/roboto/500.css"; | ||
import "@fontsource/roboto/700.css"; | ||
|
||
import { css } from "@emotion/react"; | ||
|
||
import { ThemeOptions, createTheme } from "@mui/material/styles"; | ||
|
||
const themeOptions: ThemeOptions & { cssVariables: boolean } = { | ||
palette: { | ||
mode: "light", | ||
primary: { | ||
main: "#646cff", | ||
}, | ||
secondary: { | ||
main: "#f50057", | ||
}, | ||
}, | ||
cssVariables: true, | ||
}; | ||
|
||
export const theme = createTheme(themeOptions); | ||
|
||
export const globalStyle = css({ | ||
body: { | ||
margin: 0, | ||
display: "flex", | ||
minWidth: "100vw", | ||
minHeight: "100vh", | ||
background: "linear-gradient(#f6fbfc, #d8d4e7)" | ||
}, | ||
|
||
"#root": { | ||
width: "100%", | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { useState } from "react"; | ||
import { IconButton, Snackbar } from "@mui/material"; | ||
import ContentPasteIcon from "@mui/icons-material/ContentPaste"; | ||
|
||
export function CopyToClipboardButton({ | ||
data, | ||
disabled, | ||
}: { | ||
data: string; | ||
disabled: boolean; | ||
}) { | ||
const [open, setOpen] = useState(false); | ||
|
||
const handleClick = () => { | ||
setOpen(true); | ||
navigator.clipboard.writeText(data); | ||
}; | ||
|
||
return ( | ||
<> | ||
<IconButton disabled={disabled} onClick={handleClick} color="primary"> | ||
<ContentPasteIcon /> | ||
</IconButton> | ||
<Snackbar | ||
message="Copied to clipboard" | ||
anchorOrigin={{ vertical: "top", horizontal: "center" }} | ||
autoHideDuration={2000} | ||
onClose={() => setOpen(false)} | ||
open={open} | ||
/> | ||
</> | ||
); | ||
} |
Oops, something went wrong.