Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding in support for mainnet #897

Merged
merged 25 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 29 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ version: 2.1


orbs:
node: circleci/node@5.1.0
node: circleci/node@5.2.0


executors:
rust-node:
docker:
- image: cimg/rust:1.73-node
- image: cimg/rust:1.80-node


commands:
Expand Down Expand Up @@ -73,6 +73,25 @@ jobs:
yarn test


e2e-testnet:
executor: rust-node
steps:
- setup-sdk
- run:
working_directory: sdk/e2e/testnet
command: |
yarn start

e2e-mainnet:
executor: rust-node
steps:
- setup-sdk
- run:
working_directory: sdk/e2e/mainnet
command: |
yarn start


template-node:
executor: rust-node
steps:
Expand Down Expand Up @@ -119,7 +138,8 @@ jobs:
- run:
working_directory: wasm
command: |
cargo clippy
cargo clippy --features testnet
cargo clippy --features mainnet

check-fmt:
executor: rust-node
Expand All @@ -144,6 +164,12 @@ workflows:
- sdk-test:
requires:
- sdk
- e2e-testnet:
requires:
- sdk
- e2e-mainnet:
requires:
- sdk
- template-node:
requires:
- sdk
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ labels: bug
<!--
What's the bug in the Aleo SDK that you found?
How serious is this bug and what is affected?
To report a security issue in the Aleo SDK, please email security@aleo.org.

Pauan marked this conversation as resolved.
Show resolved Hide resolved
To report a security issue in the Aleo SDK, please email security@provable.com.
-->

(Write your description here)
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
**/node_modules
**/target
**/dist
**/tmp
storage*/
**/.next

Expand All @@ -18,4 +19,4 @@ rust/src/program/.DS_Store
# Local Netlify folder
.netlify

package-lock.json
package-lock.json
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<a href="https://developer.aleo.org"> <img alt="Website" src="https://img.shields.io/badge/Developer_Docs-online-blue"></a>
<a href="https://developer.provable.com"> <img alt="Website" src="https://img.shields.io/badge/Developer_Docs-online-blue"></a>
Pauan marked this conversation as resolved.
Show resolved Hide resolved
<a href="https://circleci.com/gh/ProvableHQ/sdk"><img src="https://circleci.com/gh/ProvableHQ/sdk.svg?style=svg"></a>
<a href="https://discord.com/invite/aleo"><img src="https://img.shields.io/discord/700454073459015690?logo=discord"/></a>
<a href="https://github.com/ProvableHQ/sdk#%EF%B8%8F-contributors"><img src="https://img.shields.io/badge/contributors-23-ee8449"/></a>
Expand All @@ -16,7 +16,7 @@ several TypeScript & JavaScript libraries which provide the following functional
4. [Management of program state and data](https://provable.tools/record)
5. [Communication with the Aleo network](https://provable.tools/rest)

All of this functionality is demonstrated on [Provable.tools](https://provable.tools).
All of this functionality is demonstrated on [Provable.tools](https://provable.tools).


The Aleo SDK is divided into three TypeScript/JavaScript packages:
Expand All @@ -29,7 +29,7 @@ The official Aleo SDK providing JavaScript/TypeScript tools for creating zero-kn

### ⚡ Build your own app

Start here with the [Aleo SDK Readme](https://github.com/ProvableHQ/sdk#readme) to get started building your
Start here with the [Aleo SDK Readme](https://github.com/ProvableHQ/sdk#readme) to get started building your
first zero-knowledge web app.

#### Source: [`Aleo SDK`](https://www.npmjs.com/package/@provablehq/sdk)
Expand All @@ -47,7 +47,7 @@ start with working examples should start here.
<a href="https://www.npmjs.com/package/@provablehq/nodejs"> <img alt="Create Leo App" src="https://img.shields.io/npm/l/%40provablehq%2Fnodejs?label=NPM%20-%20Aleo%20Nodejs&labelColor=green&color=blue"></a>
<a href="https://crates.io/crates/aleo-wasm"> <img alt="Aleo-Wasm" src="https://img.shields.io/crates/v/aleo-wasm.svg?color=neon"></a>

Aleo Wasm is a Rust crate which compiles the Aleo source code responsible for creating and executing zero-knowledge programs into
Aleo Wasm is a Rust crate which compiles the Aleo source code responsible for creating and executing zero-knowledge programs into
WebAssembly.

When compiled with `wasm-pack`, JavaScript bindings are generated for the WebAssembly allowing Aleo zero-knowledge programs to be used in the browser and Node.js. This package is available on NPM (linked above). The Aleo Wasm
Expand All @@ -61,9 +61,9 @@ Source: [Aleo Wasm](https://www.npmjs.com/package/@provablehq/wasm)

## 📚 Documentation

#### [API Documentation](https://developer.aleo.org/sdk/typescript/overview)
#### [API Documentation](https://developer.provable.com/sdk/typescript/overview)
Pauan marked this conversation as resolved.
Show resolved Hide resolved
API Documentation, tutorials for the Aleo SDK, and documentation on how to build Leo and Aleo Instructions programs can
be found on the [Aleo Developer Docs](https://developer.aleo.org/sdk/typescript/overview) page.
be found on the [Aleo Developer Docs](https://developer.provable.com/sdk/typescript/overview) page.
Pauan marked this conversation as resolved.
Show resolved Hide resolved

#### [SDK Readme](https://github.com/ProvableHQ/sdk/tree/testnet3/sdk#readme)
The SDK readme provides concepts core to executing zero-knowledge programs in the web and several detailed examples of
Expand Down
6 changes: 3 additions & 3 deletions create-leo-app/template-react-leo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ Your app should be running on http://localhost:5173/

## Deploy program from web app

> [!WARNING]
> [!WARNING]
> This is for demonstration purposes or local testing only, in production applications you
> should avoid building a public facing web app with private key information

Information on generating a private key, seeding a wallet with funds, and finding a spendable record can be found here
if you are unfamiliar: https://developer.aleo.org/testnet/getting_started/deploy_execute_demo
if you are unfamiliar: https://developer.provable.com/testnet/getting_started/deploy_execute_demo
Pauan marked this conversation as resolved.
Show resolved Hide resolved

Aleo programs deployed require unique names, make sure to edit the program's name to something unique in `helloworld/src/main.leo`, `helloworld/program.json`, rename `helloworld/inputs/helloworld.in` and rebuild.

Expand All @@ -62,7 +62,7 @@ Aleo programs deployed require unique names, make sure to edit the program's nam
2. (Optional) Provide a fee record manually (located in commented code within `worker.js`)

If you do not provide a manual fee record, the SDK will attempt to scan for a record starting at the latest block. A simple way to speed this up would be to make a public transaction to this account right before deploying.

3. Run the web app and hit the deploy button

## Production deployment
Expand Down
2 changes: 1 addition & 1 deletion create-leo-app/template-react-leo/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function App() {
return (
<>
<div>
<a href="https://aleo.org" target="_blank">
<a href="https://provable.com" target="_blank">
<img src={aleoLogo} className="logo" alt="Aleo logo" />
</a>
<a href="https://react.dev" target="_blank">
Expand Down
4 changes: 2 additions & 2 deletions create-leo-app/template-react-leo/src/workers/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ async function deployProgram(program) {
keyProvider.useCache(true);

// Create a record provider that will be used to find records and transaction data for Aleo programs
const networkClient = new AleoNetworkClient("https://api.explorer.aleo.org/v1");
const networkClient = new AleoNetworkClient("https://api.explorer.provable.com/v1");

// Use existing account with funds
const account = new Account({
Expand All @@ -48,7 +48,7 @@ async function deployProgram(program) {

// Initialize a program manager to talk to the Aleo network with the configured key and record providers
const programManager = new ProgramManager(
"https://api.explorer.aleo.org/v1",
"https://api.explorer.provable.com/v1",
keyProvider,
recordProvider,
);
Expand Down
2 changes: 1 addition & 1 deletion create-leo-app/template-react-managed-worker/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function App() {
return (
<>
<div>
<a href="https://aleo.org" target="_blank">
<a href="https://provable.com" target="_blank">
<img src={aleoLogo} className="logo" alt="Aleo logo" />
</a>
<a href="https://react.dev" target="_blank">
Expand Down
6 changes: 3 additions & 3 deletions create-leo-app/template-react-ts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ Your app should be running on http://localhost:5173/

## Deploy program from web app

> [!WARNING]
> [!WARNING]
> This is for demonstration purposes or local testing only, in production applications you
> should avoid building a public facing web app with private key information

Information on generating a private key, seeding a wallet with funds, and finding a spendable record can be found here
if you are unfamiliar: https://developer.aleo.org/testnet/getting_started/deploy_execute_demo
if you are unfamiliar: https://developer.provable.com/testnet/getting_started/deploy_execute_demo
Pauan marked this conversation as resolved.
Show resolved Hide resolved

Aleo programs deployed require unique names, make sure to edit the program's name to something unique in `helloworld/src/main.leo`, `helloworld/program.json`, rename `helloworld/inputs/helloworld.in` and rebuild.

Expand All @@ -62,7 +62,7 @@ Aleo programs deployed require unique names, make sure to edit the program's nam
2. (Optional) Provide a fee record manually (located in commented code within `worker.js`)

If you do not provide a manual fee record, the SDK will attempt to scan for a record starting at the latest block. A simple way to speed this up would be to make a public transaction to this account right before deploying.

3. Run the web app and hit the deploy button

## Production deployment
Expand Down
2 changes: 1 addition & 1 deletion create-leo-app/template-react-ts/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function App() {
return (
<>
<div>
<a href="https://aleo.org" target="_blank">
<a href="https://provable.com" target="_blank">
<img src={aleoLogo} className="logo" alt="Aleo logo" />
</a>
<a href="https://react.dev" target="_blank">
Expand Down
4 changes: 2 additions & 2 deletions create-leo-app/template-react-ts/src/workers/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ async function deployProgram(program) {
keyProvider.useCache(true);

// Create a record provider that will be used to find records and transaction data for Aleo programs
const networkClient = new AleoNetworkClient("https://api.explorer.aleo.org/v1");
const networkClient = new AleoNetworkClient("https://api.explorer.provable.com/v1");

// Use existing account with funds
const account = new Account({
Expand All @@ -49,7 +49,7 @@ async function deployProgram(program) {

// Initialize a program manager to talk to the Aleo network with the configured key and record providers
const programManager = new ProgramManager(
"https://api.explorer.aleo.org/v1",
"https://api.explorer.provable.com/v1",
keyProvider,
recordProvider,
);
Expand Down
2 changes: 1 addition & 1 deletion create-leo-app/template-vanilla/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ document.querySelector("#app").innerHTML = `
<a href="https://vitejs.dev" target="_blank">
<img src="${viteLogo}" class="logo" alt="Vite logo" />
</a>
<a href="https://aleo.org/" target="_blank">
<a href="https://provable.com/" target="_blank">
<img src="${aleoLogo}" class="logo" alt="Aleo logo" />
</a>
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript" target="_blank">
Expand Down
6 changes: 3 additions & 3 deletions create-leo-app/template-vanilla/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ async function deployProgram(program) {
keyProvider.useCache(true);

// Create a record provider that will be used to find records and transaction data for Aleo programs
const networkClient = new AleoNetworkClient("https://api.explorer.aleo.org/v1");
const networkClient = new AleoNetworkClient("https://api.explorer.provable.com/v1");

// Use existing account with funds
const account = new Account({
Expand All @@ -56,7 +56,7 @@ async function deployProgram(program) {

// Initialize a program manager to talk to the Aleo network with the configured key and record providers
const programManager = new ProgramManager(
"https://api.explorer.aleo.org/v1",
"https://api.explorer.provable.com/v1",
keyProvider,
recordProvider,
);
Expand Down Expand Up @@ -91,5 +91,5 @@ onmessage = async function (e) {
postMessage({ error: error.message });
}
}

};
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"wasm",
"website",
"create-leo-app",
"create-leo-app/*"
"create-leo-app/*",
"e2e",
"e2e/*"
],
"type": "module",
"scripts": {
Expand Down
Loading
Loading