Skip to content
Closed
Show file tree
Hide file tree
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
20 changes: 19 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18.19.0'

- name: Set up Docker
uses: docker/setup-buildx-action@v2

Expand Down Expand Up @@ -47,4 +52,17 @@ jobs:
run: script -e -c "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --no-cache --runInBand --config jest.integration.config.json && aztec test"

- name: Run scripts
run: script -e -c "yarn deploy && yarn deploy-account && yarn fees"
run: script -e -c "yarn deploy && yarn deploy-account && yarn fees"

- name: Stop Aztec sandbox
run: |
docker rm -f aztec-sandbox
sleep 2

- name: Start Sandbox without PXE
run: |
NO_PXE=true aztec start --sandbox &
sleep 10

- name: Run scripts that create PXE
run: "yarn pxe"
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"compile": "${AZTEC_NARGO:-aztec-nargo} compile",
"deploy": "node --loader ts-node/esm scripts/deploy-contract.ts",
"deploy-account": "node --loader ts-node/esm scripts/deploy-account.ts",
"pxe": "node --loader ts-node/esm scripts/pxe.ts",
"get-block": "node --loader ts-node/esm scripts/getBlock.ts",
"test": "yarn test:js && yarn test:nr",
"test:js": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --no-cache --runInBand --config jest.integration.config.json",
Expand All @@ -25,6 +26,7 @@
"@aztec/accounts": "0.82.2",
"@aztec/aztec.js": "0.82.2",
"@aztec/noir-contracts.js": "0.82.2",
"@aztec/pxe": "0.82.2",
"@aztec/stdlib": "0.82.2",
"@types/node": "^22.5.1"
},
Expand Down
32 changes: 32 additions & 0 deletions scripts/pxe.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { PXE, waitForPXE, createAztecNodeClient } from "@aztec/aztec.js";
import { createPXEService, type PXEServiceConfig, getPXEServiceConfig } from "@aztec/pxe/server"

const setupPXE = async () => {
const { NODE_URL = 'http://localhost:8080' } = process.env;
const aztecNode = await createAztecNodeClient(NODE_URL);

const config = getPXEServiceConfig();
config.dataDirectory = 'pxe';

// config.proverEnabled = true;
// const l1Contracts = await aztecNode.getL1ContractAddresses();
// const configWithContracts = {
// ...config,
// l1Contracts,
// } as PXEServiceConfig;

const pxe = await createPXEService(aztecNode, config)
// await waitForPXE(pxe);
return pxe;
};

async function main() {

const pxe = await setupPXE();

let block = await pxe.getBlock(1);
console.log(block)
console.log(await block?.hash())
}

main();
Loading