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

refactor: renaming @aztec/aztec-rpc package as @aztec/pxe #2538

Merged
merged 4 commits into from
Sep 26, 2023
Merged
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -817,7 +817,7 @@ jobs:
name: "Test"
command: cond_run_script end-to-end ./scripts/run_tests_local e2e_card_game.test.ts

aztec-rpc-sandbox:
pxe-sandbox:
machine:
image: ubuntu-2204:2023.07.2
resource_class: large
@@ -1214,7 +1214,7 @@ workflows:
- e2e-canary-test: *e2e_test
- e2e-browser-sandbox: *e2e_test
- e2e-card-game: *e2e_test
- aztec-rpc-sandbox: *e2e_test
- pxe-sandbox: *e2e_test
- cli-docs-sandbox: *e2e_test
- guides-writing-an-account-contract: *e2e_test
- guides-dapp-testing: *e2e_test
@@ -1251,7 +1251,7 @@ workflows:
- e2e-browser-sandbox
- e2e-canary-test
- e2e-card-game
- aztec-rpc-sandbox
- pxe-sandbox
- cli-docs-sandbox
- guides-writing-an-account-contract
- guides-dapp-testing
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ All the packages that make up [Aztec](https://docs.aztec.network).

- [Aztec.nr](./yarn-project/aztec-nr/): A [Noir](https://noir-lang.org) framework for smart contracts on Aztec.
- [Aztec Sandbox](./yarn-project/aztec-sandbox/): A package for setting up a local dev net, including a local Ethereum network, deployed rollup contracts and Aztec execution environment.
- [Aztec.js](./yarn-project/aztec.js/): A tool for interacting with the Aztec network. It communicates via the [Aztec RPC Server](./yarn-project/aztec-rpc/).
- [Aztec.js](./yarn-project/aztec.js/): A tool for interacting with the Aztec network. It communicates via the [Aztec RPC Server](./yarn-project/pxe/).
- [Aztec Boxes](./yarn-project/boxes/): A minimal framework for building full stack applications for Aztec (using React).
- [Example contracts](./yarn-project/noir-contracts/): Example contracts for the Aztec network, written in Noir.
- [End to end tests](./yarn-project/end-to-end/): Integration tests writted in Typescript--a good reference for how to use the packages for specific tasks.
2 changes: 1 addition & 1 deletion docs/docs/dev_docs/getting_started/quickstart.md
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ This is a 1 page introduction to getting started with running the sandbox, and i
Aztec's Layer 2 network is a fully programmable combined private/public ZK rollup. To achieve this, the network contains the following primary components:

- Aztec Node - Aggregates all of the 'backend' services necessary for the building and publishing of rollups. This packages is currently in development and much of the functionality is mocked.
- [Aztec RPC Server](https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/aztec-rpc) - Normally residing with the end client, this decrypts and stores a client's private state, executes simulations and submits transactions to the Aztec Node.
- [Aztec RPC Server](https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/pxe) - Normally residing with the end client, this decrypts and stores a client's private state, executes simulations and submits transactions to the Aztec Node.
- [Aztec.js](https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/aztec.js) - Aztec's client library for interacting with the Aztec RPC Server (think Ethers.js). See the getting started guide [here](./sandbox.md).

All of this is included in the Sandbox, with the exception of Aztec.js which you can use to interact with it.
10 changes: 5 additions & 5 deletions docs/docs/dev_docs/getting_started/sandbox.md
Original file line number Diff line number Diff line change
@@ -167,7 +167,7 @@ A successful run should show:
rollupAddress: EthAddress {
buffer: <Buffer cf 7e d3 ac ca 5a 46 7e 9e 70 4c 70 3e 8d 87 f6 34 fb 0f c9>
},
client: 'aztec-rpc@0.1.0',
client: 'pxe@0.1.0',
compatibleNargoVersion: '0.11.1-aztec.0'
}
```
@@ -201,7 +201,7 @@ Now that we have our accounts loaded, let's move on to deploy our pre-compiled t
rollupAddress: EthAddress {
buffer: <Buffer cf 7e d3 ac ca 5a 46 7e 9e 70 4c 70 3e 8d 87 f6 34 fb 0f c9>
},
client: 'aztec-rpc@0.1.0',
client: 'pxe@0.1.0',
compatibleNargoVersion: '0.11.1-aztec.0'
}
token Creating accounts using schnorr signers... +3ms
@@ -243,7 +243,7 @@ Running now should yield output:
rollupAddress: EthAddress {
buffer: <Buffer cf 7e d3 ac ca 5a 46 7e 9e 70 4c 70 3e 8d 87 f6 34 fb 0f c9>
},
client: 'aztec-rpc@0.1.0',
client: 'pxe@0.1.0',
compatibleNargoVersion: '0.11.1-aztec.0'
}
token Creating accounts using schnorr signers... +3ms
@@ -285,7 +285,7 @@ Our output should now look like this:
rollupAddress: EthAddress {
buffer: <Buffer cf 7e d3 ac ca 5a 46 7e 9e 70 4c 70 3e 8d 87 f6 34 fb 0f c9>
},
client: 'aztec-rpc@0.1.0',
client: 'pxe@0.1.0',
compatibleNargoVersion: '0.11.1-aztec.0'
}
token Creating accounts using schnorr signers... +3ms
@@ -324,7 +324,7 @@ Our complete output should now be:
rollupAddress: EthAddress {
buffer: <Buffer cf 7e d3 ac ca 5a 46 7e 9e 70 4c 70 3e 8d 87 f6 34 fb 0f c9>
},
client: 'aztec-rpc@0.1.0',
client: 'pxe@0.1.0',
compatibleNargoVersion: '0.11.1-aztec.0'
}
token Creating accounts using schnorr signers... +3ms
2 changes: 1 addition & 1 deletion docs/docs/dev_docs/tutorials/writing_dapp/rpc_server.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Connecting to the RPC Server

As an app developer, the [Aztec RPC Server](https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/aztec-rpc) interface provides you with access to the user's accounts and their private state, as well as a connection to the network for accessing public global state.
As an app developer, the [Aztec RPC Server](https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/pxe) interface provides you with access to the user's accounts and their private state, as well as a connection to the network for accessing public global state.

During the Sandbox phase, this role is fulfilled by the [Aztec Sandbox](../../getting_started/sandbox.md), which runs a local RPC Server and an Aztec Node, both connected to a local Ethereum development node like Anvil. The Sandbox also includes a set of pre-initialized accounts that you can use from your app.

4 changes: 2 additions & 2 deletions docs/docs/dev_docs/tutorials/writing_token_contract.md
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ Node Info:
Version: 1
Chain Id: 31337
Rollup Address: 0xcf7ed3acca5a467e9e704c703e8d87f634fb0fc9
Client: aztec-rpc@0.7.5
Client: pxe@0.7.5
Compatible Nargo Version: 0.11.1-aztec.0
```

@@ -466,7 +466,7 @@ A getter function for checking the token `total_supply`.

#### `balance_of_private`

A getter function for checking the private balance of the provided Aztec account. Note that the [Aztec RPC Server](https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/aztec-rpc) must have access to the `owner`s decryption keys in order to decrypt their notes.
A getter function for checking the private balance of the provided Aztec account. Note that the [Aztec RPC Server](https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/pxe) must have access to the `owner`s decryption keys in order to decrypt their notes.

#include_code balance_of_private /yarn-project/noir-contracts/src/contracts/token_contract/src/main.nr rust

2 changes: 1 addition & 1 deletion docs/docs/dev_docs/wallets/creating_schnorr_accounts.md
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ Let's assume you have a file `src/index.ts` from the example used in the Sandbox
rollupAddress: EthAddress {
buffer: <Buffer cf 7e d3 ac ca 5a 46 7e 9e 70 4c 70 3e 8d 87 f6 34 fb 0f c9>
},
client: 'aztec-rpc@0.1.0',
client: 'pxe@0.1.0',
compatibleNargoVersion: '0.11.1-aztec.0'
}
token Creating accounts using schnorr signers... +3ms
4 changes: 2 additions & 2 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -125,11 +125,11 @@ const config = {
[
"@spalladino/docusaurus-plugin-typedoc",
{
id: "apis/aztec-rpc",
id: "apis/pxe",
entryPoints: ["../yarn-project/types/src/interfaces/aztec_rpc.ts"],
tsconfig: "../yarn-project/types/tsconfig.json",
entryPointStrategy: "expand",
out: "apis/aztec-rpc",
out: "apis/pxe",
disableSources: true,
frontmatter: { sidebar_label: "Aztec RPC Server" },
},
2 changes: 1 addition & 1 deletion docs/scripts/build.sh
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ if [ -n "$NETLIFY" ]; then
(cd yarn-project && yarn)

# Build the required projects for typedoc
build_package "aztec-rpc"
build_package "pxe"
build_package "aztec.js" "yarn build:ts"

# Back to docs site
2 changes: 1 addition & 1 deletion docs/sidebars.js
Original file line number Diff line number Diff line change
@@ -353,7 +353,7 @@ const sidebars = {
{
label: "Aztec RPC Server",
type: "doc",
id: "apis/aztec-rpc/interfaces/AztecRPC",
id: "apis/pxe/interfaces/AztecRPC",
},
{
label: "Aztec.js",
2 changes: 1 addition & 1 deletion yarn-project/aztec-node/README.md
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

The Aztec Node implements a sequencer node in the network, and is currently meant to be used for local development and testing. The Node is the entrypoint for creating and starting a new Sequencer client with default components (a local P2P client, an in-memory merkle tree database, etc).

The Node also exposes methods that are consumed by the client (see `aztec-rpc`), such as querying network info or submitting a transaction. As Aztec evolves beyond local development, these methods will be accessible via a JSON-RPC API or similar. Refer to the `end-to-end` tests for examples on how to initialize an Aztec Node and use it along with an RPC client.
The Node also exposes methods that are consumed by the client (see `pxe`), such as querying network info or submitting a transaction. As Aztec evolves beyond local development, these methods will be accessible via a JSON-RPC API or similar. Refer to the `end-to-end` tests for examples on how to initialize an Aztec Node and use it along with an RPC client.

## Development

2 changes: 1 addition & 1 deletion yarn-project/aztec-node/src/bin/index.ts
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ import http from 'http';
import Koa from 'koa';
import Router from 'koa-router';

import { AztecNodeConfig, AztecNodeService, getConfigEnvVars, createAztecNodeRpcServer } from '../index.js';
import { AztecNodeConfig, AztecNodeService, createAztecNodeRpcServer, getConfigEnvVars } from '../index.js';

const { SERVER_PORT = 8081, API_PREFIX = '' } = process.env;

4 changes: 2 additions & 2 deletions yarn-project/aztec-sandbox/Dockerfile
Original file line number Diff line number Diff line change
@@ -6,8 +6,8 @@ ARG COMMIT_TAG=""
RUN rm -rf /usr/src/barretenberg/cpp/srs_db/ignition/monomial
COPY . .

# Update aztec-rpc version if COMMIT_TAG has been used
WORKDIR /usr/src/yarn-project/aztec-rpc
# Update pxe version if COMMIT_TAG has been used
WORKDIR /usr/src/yarn-project/pxe
RUN if [[ -n "${COMMIT_TAG}" ]]; then \
jq --arg v ${COMMIT_TAG} '.version = $v' package.json > _temp && mv _temp package.json; \
fi
2 changes: 1 addition & 1 deletion yarn-project/aztec-sandbox/package.json
Original file line number Diff line number Diff line change
@@ -29,14 +29,14 @@
],
"dependencies": {
"@aztec/aztec-node": "workspace:^",
"@aztec/aztec-rpc": "workspace:^",
"@aztec/aztec.js": "workspace:^",
"@aztec/circuits.js": "workspace:^",
"@aztec/ethereum": "workspace:^",
"@aztec/foundation": "workspace:^",
"@aztec/l1-artifacts": "workspace:^",
"@aztec/noir-compiler": "workspace:^",
"@aztec/noir-contracts": "workspace:^",
"@aztec/pxe": "workspace:^",
"@aztec/types": "workspace:^",
"abitype": "^0.8.11",
"koa": "^2.14.2",
2 changes: 1 addition & 1 deletion yarn-project/aztec-sandbox/src/bin/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env -S node --no-warnings
import { startHttpRpcServer } from '@aztec/aztec-rpc';
import { deployInitialSandboxAccounts } from '@aztec/aztec.js';
import { createDebugLogger } from '@aztec/foundation/log';
import { fileURLToPath } from '@aztec/foundation/url';
import NoirVersion from '@aztec/noir-compiler/noir-version';
import { startHttpRpcServer } from '@aztec/pxe';

import { readFileSync } from 'fs';
import { dirname, resolve } from 'path';
2 changes: 1 addition & 1 deletion yarn-project/aztec-sandbox/src/sandbox.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env -S node --no-warnings
import { AztecNodeConfig, AztecNodeService, getConfigEnvVars } from '@aztec/aztec-node';
import { createAztecRPCServer, getConfigEnvVars as getRpcConfigEnvVars } from '@aztec/aztec-rpc';
import {
DeployL1Contracts,
L1ContractArtifactsForDeployment,
@@ -21,6 +20,7 @@ import {
RollupAbi,
RollupBytecode,
} from '@aztec/l1-artifacts';
import { createAztecRPCServer, getConfigEnvVars as getRpcConfigEnvVars } from '@aztec/pxe';

import { createPublicClient, http as httpViemTransport } from 'viem';
import { mnemonicToAccount } from 'viem/accounts';
2 changes: 1 addition & 1 deletion yarn-project/aztec-sandbox/src/server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getHttpRpcServer } from '@aztec/aztec-rpc';
import { getHttpRpcServer } from '@aztec/pxe';
import { AztecRPC } from '@aztec/types';

import http from 'http';
6 changes: 3 additions & 3 deletions yarn-project/aztec-sandbox/tsconfig.json
Original file line number Diff line number Diff line change
@@ -9,9 +9,6 @@
{
"path": "../aztec-node"
},
{
"path": "../aztec-rpc"
},
{
"path": "../aztec.js"
},
@@ -33,6 +30,9 @@
{
"path": "../noir-contracts"
},
{
"path": "../pxe"
},
{
"path": "../types"
}
2 changes: 1 addition & 1 deletion yarn-project/aztec.js/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Aztec.js

Aztec.js is a library that provides APIs for managing accounts and interacting with contracts on the Aztec network. It communicates with the [Aztec RPC Server](https://docs.aztec.network/apis/aztec-rpc/interfaces/AztecRPC) through an `AztecRPCClient` implementation, allowing developers to easily register new accounts, deploy contracts, view functions, and send transactions.
Aztec.js is a library that provides APIs for managing accounts and interacting with contracts on the Aztec network. It communicates with the [Aztec RPC Server](https://docs.aztec.network/apis/pxe/interfaces/AztecRPC) through an `AztecRPCClient` implementation, allowing developers to easily register new accounts, deploy contracts, view functions, and send transactions.

## Usage

2 changes: 1 addition & 1 deletion yarn-project/deploy_npm.sh
Original file line number Diff line number Diff line change
@@ -64,7 +64,7 @@ deploy_package ethereum
deploy_package noir-compiler
deploy_package noir-contracts
deploy_package cli
deploy_package aztec-rpc
deploy_package pxe
deploy_package acir-simulator
deploy_package archiver
deploy_package merkle-tree
4 changes: 2 additions & 2 deletions yarn-project/end-to-end/package.json
Original file line number Diff line number Diff line change
@@ -24,7 +24,6 @@
"dependencies": {
"@aztec/archiver": "workspace:^",
"@aztec/aztec-node": "workspace:^",
"@aztec/aztec-rpc": "workspace:^",
"@aztec/aztec-sandbox": "workspace:^",
"@aztec/aztec.js": "workspace:^",
"@aztec/circuits.js": "workspace:^",
@@ -34,6 +33,7 @@
"@aztec/l1-artifacts": "workspace:^",
"@aztec/noir-contracts": "workspace:^",
"@aztec/p2p": "workspace:^",
"@aztec/pxe": "workspace:^",
"@aztec/sequencer-client": "workspace:^",
"@aztec/types": "workspace:^",
"@aztec/world-state": "workspace:^",
@@ -75,4 +75,4 @@
"!*.test.*"
],
"types": "./dest/index.d.ts"
}
}
2 changes: 1 addition & 1 deletion yarn-project/end-to-end/src/aztec_rpc_sandbox.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { aztecRpcTestSuite } from '@aztec/aztec-rpc';
import { createAztecRpcClient, waitForSandbox } from '@aztec/aztec.js';
import { aztecRpcTestSuite } from '@aztec/pxe';

const { SANDBOX_URL = 'http://localhost:8080' } = process.env;

2 changes: 1 addition & 1 deletion yarn-project/end-to-end/src/e2e_2_rpc_servers.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { AztecNodeService } from '@aztec/aztec-node';
import { AztecRPCServer, EthAddress, Fr } from '@aztec/aztec-rpc';
import { AztecAddress, Wallet, computeMessageSecretHash } from '@aztec/aztec.js';
import { DebugLogger } from '@aztec/foundation/log';
import { retryUntil } from '@aztec/foundation/retry';
import { toBigInt } from '@aztec/foundation/serialize';
import { ChildContract, TokenContract } from '@aztec/noir-contracts/types';
import { AztecRPCServer, EthAddress, Fr } from '@aztec/pxe';
import { AztecRPC, CompleteAddress, TxStatus } from '@aztec/types';

import { jest } from '@jest/globals';
2 changes: 1 addition & 1 deletion yarn-project/end-to-end/src/e2e_cheat_codes.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { EthAddress } from '@aztec/aztec-rpc';
import { CheatCodes, Wallet } from '@aztec/aztec.js';
import { RollupAbi } from '@aztec/l1-artifacts';
import { TestContract } from '@aztec/noir-contracts/types';
import { EthAddress } from '@aztec/pxe';
import { AztecRPC, TxStatus } from '@aztec/types';

import { Account, Chain, HttpTransport, PublicClient, WalletClient, getAddress, getContract, parseEther } from 'viem';
2 changes: 1 addition & 1 deletion yarn-project/end-to-end/src/e2e_cli.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { AztecNodeService } from '@aztec/aztec-node';
import { AztecRPCServer } from '@aztec/aztec-rpc';
import { startHttpRpcServer } from '@aztec/aztec-sandbox';
import { AztecRPC, createDebugLogger } from '@aztec/aztec.js';
import { AztecRPCServer } from '@aztec/pxe';

import { cliTestSuite } from './canary/cli.js';
import { setup as e2eSetup } from './fixtures/utils.js';
7 changes: 1 addition & 6 deletions yarn-project/end-to-end/src/e2e_p2p_network.test.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
import { AztecNodeConfig, AztecNodeService } from '@aztec/aztec-node';
import {
AztecRPCServer,
ConstantKeyPair,
createAztecRPCServer,
getConfigEnvVars as getRpcConfig,
} from '@aztec/aztec-rpc';
import { ContractDeployer, SentTx, isContractDeployed } from '@aztec/aztec.js';
import { AztecAddress, CompleteAddress, Fr, PublicKey, getContractDeploymentInfo } from '@aztec/circuits.js';
import { Grumpkin } from '@aztec/circuits.js/barretenberg';
import { DebugLogger } from '@aztec/foundation/log';
import { TestContractAbi } from '@aztec/noir-contracts/artifacts';
import { BootstrapNode, P2PConfig, createLibP2PPeerId } from '@aztec/p2p';
import { AztecRPCServer, ConstantKeyPair, createAztecRPCServer, getConfigEnvVars as getRpcConfig } from '@aztec/pxe';
import { TxStatus } from '@aztec/types';

import { setup } from './fixtures/utils.js';
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { AztecNodeService } from '@aztec/aztec-node';
import { AztecRPCServer } from '@aztec/aztec-rpc';
import { CheatCodes, Wallet, computeMessageSecretHash } from '@aztec/aztec.js';
import { AztecAddress, CompleteAddress, EthAddress, Fr, PublicKey } from '@aztec/circuits.js';
import { DeployL1Contracts } from '@aztec/ethereum';
@@ -8,6 +7,7 @@ import { sha256ToField } from '@aztec/foundation/crypto';
import { DebugLogger } from '@aztec/foundation/log';
import { OutboxAbi } from '@aztec/l1-artifacts';
import { TokenBridgeContract, TokenContract } from '@aztec/noir-contracts/types';
import { AztecRPCServer } from '@aztec/pxe';
import { AztecRPC, TxStatus } from '@aztec/types';

import { Chain, HttpTransport, PublicClient, getContract } from 'viem';
2 changes: 1 addition & 1 deletion yarn-project/end-to-end/src/fixtures/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { AztecNodeConfig, AztecNodeService, getConfigEnvVars } from '@aztec/aztec-node';
import { AztecRPCServer, createAztecRPCServer, getConfigEnvVars as getRpcConfigEnvVars } from '@aztec/aztec-rpc';
import {
AccountWallet,
AztecAddress,
@@ -42,6 +41,7 @@ import {
TokenPortalBytecode,
} from '@aztec/l1-artifacts';
import { NonNativeTokenContract, TokenBridgeContract, TokenContract } from '@aztec/noir-contracts/types';
import { AztecRPCServer, createAztecRPCServer, getConfigEnvVars as getRpcConfigEnvVars } from '@aztec/pxe';
import { AztecRPC, L2BlockL2Logs, LogType, TxStatus } from '@aztec/types';

import {
6 changes: 3 additions & 3 deletions yarn-project/end-to-end/tsconfig.json
Original file line number Diff line number Diff line change
@@ -12,9 +12,6 @@
{
"path": "../aztec-node"
},
{
"path": "../aztec-rpc"
},
{
"path": "../aztec-sandbox"
},
@@ -42,6 +39,9 @@
{
"path": "../p2p"
},
{
"path": "../pxe"
},
{
"path": "../sequencer-client"
},
Loading