From 082556951e87f35ca933b0692e7746133f91a47d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gergely=20B=C3=A9k=C3=A9si?= Date: Tue, 26 May 2026 10:05:08 +0200 Subject: [PATCH 1/8] ci: use bee factory with 2.8.0 bee version --- .github/workflows/tests.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 24ca56ae..238c1dd1 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -29,7 +29,7 @@ jobs: run: npm ci - name: Install global dependencies - run: npm install --global bee-dev @fairdatasociety/fdp-play @ethersphere/swarm-cli npxie + run: npm install --global bee-dev @ethersphere/bee-factory @ethersphere/swarm-cli npxie - name: Run bee-dev run: bee-dev --port 16337 & @@ -37,8 +37,8 @@ jobs: - name: Run bee-dev with --no-swap run: bee-dev --port 16338 --no-swap & - - name: Start fdp-play environment - run: fdp-play start --detach --fresh --bee-version d0aa8b9-commit + - name: Start bee-factory + run: bee-factory start --tag v2.8.0 - name: Deposit to chequebook run: | From ab1b944c787d7291c289c9c4d3d605384097c51e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gergely=20B=C3=A9k=C3=A9si?= Date: Tue, 26 May 2026 10:28:17 +0200 Subject: [PATCH 2/8] fix: add fresh tag to factory start --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 238c1dd1..b68184b9 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -38,7 +38,7 @@ jobs: run: bee-dev --port 16338 --no-swap & - name: Start bee-factory - run: bee-factory start --tag v2.8.0 + run: bee-factory start --fresh --tag v2.8.0 - name: Deposit to chequebook run: | From d749348f8c7c4609d117628aeb5cf7308e365837 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gergely=20B=C3=A9k=C3=A9si?= Date: Tue, 26 May 2026 10:38:38 +0200 Subject: [PATCH 3/8] ci: remove chequebook funding --- .github/workflows/tests.yaml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index b68184b9..b1ed078d 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -40,14 +40,6 @@ jobs: - name: Start bee-factory run: bee-factory start --fresh --tag v2.8.0 - - name: Deposit to chequebook - run: | - swarm-cli cheque deposit 10 - swarm-cli cheque deposit 10 --bee-api-url http://localhost:11633 - swarm-cli cheque deposit 10 --bee-api-url http://localhost:21633 - swarm-cli cheque deposit 10 --bee-api-url http://localhost:31633 - swarm-cli cheque deposit 10 --bee-api-url http://localhost:41633 - - name: Print swarm-cli status continue-on-error: true run: swarm-cli status From 16b642cf87fb34ac1d2b08647df4a3874e40d686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gergely=20B=C3=A9k=C3=A9si?= Date: Tue, 26 May 2026 12:44:23 +0200 Subject: [PATCH 4/8] fix: update specs --- src/utils/rpc.ts | 27 +++++++++++++++++++++++++++ test/command/create-batch.spec.ts | 17 ++++++++++++----- test/command/redeem.spec.ts | 12 ++++++------ test/command/stamp.spec.ts | 6 +++--- 4 files changed, 48 insertions(+), 14 deletions(-) diff --git a/src/utils/rpc.ts b/src/utils/rpc.ts index b30b604a..dbccc779 100644 --- a/src/utils/rpc.ts +++ b/src/utils/rpc.ts @@ -82,6 +82,33 @@ export async function sendNativeTransaction( return { transaction, receipt } } +export async function mintBzzTransaction( + privateKey: string, + to: string, + value: string, + jsonRpcProvider: string, +): Promise { + if (!to.startsWith('0x')) { + to = `0x${to}` + } + const { signer, provider } = await makeReadySigner(privateKey, jsonRpcProvider) + const { gasPrice } = await provider.getFeeData() + + if (gasPrice === null) { + throw new Error('Unable to determine gas price from provider') + } + + const bzz = new Contract(Contracts.bzz, ['function mint(address to, uint256 amount) external'], signer) + const transaction = await bzz.mint(to, value, { gasPrice }) + const receipt = await transaction.wait(1) + + if (receipt === null) { + throw new Error('Transaction was not included in a block') + } + + return { transaction, receipt } +} + export async function sendBzzTransaction( privateKey: string, to: string, diff --git a/test/command/create-batch.spec.ts b/test/command/create-batch.spec.ts index f9d40394..da60c44b 100644 --- a/test/command/create-batch.spec.ts +++ b/test/command/create-batch.spec.ts @@ -1,3 +1,4 @@ +import { mintBzzTransaction } from '../../src/utils/rpc' import { toMatchLinesInOrder } from '../custom-matcher' import { describeCommand, invokeTestCli } from '../utility' @@ -5,22 +6,28 @@ expect.extend({ toMatchLinesInOrder, }) +const DEPLOYER_KEY = '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80' +const DEPLOYER_ADDRESS = '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266' +const JSON_RPC_URL = 'http://localhost:8545' +const BZZ_10 = 100_000_000_000_000_000n.toString() + describeCommand('Test `utility create-batch` command', ({ consoleMessages }) => { it('should create batch', async () => { - process.env.SWARM_CLI_NETWORK_ID = '4020' - process.env.SWARM_CLI_BZZ_ADDRESS = '0xe78A0F7E598Cc8b0Bb87894B0F60dD2a88d6a8Ab' - process.env.SWARM_CLI_POSTAGE_STAMP_ADDRESS = '0x254dffcd3277C0b1660F6d42EFbB754edaBAbC2B' + process.env.SWARM_CLI_NETWORK_ID = '1337' + process.env.SWARM_CLI_BZZ_ADDRESS = '0x5FbDB2315678afecb367f032d93F642f64180aa3' + process.env.SWARM_CLI_POSTAGE_STAMP_ADDRESS = '0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512' + await mintBzzTransaction(DEPLOYER_KEY, DEPLOYER_ADDRESS, BZZ_10, JSON_RPC_URL) await invokeTestCli([ 'utility', 'create-batch', '--private-key', - '0x566058308ad5fa3888173c741a1fb902c9f1f19559b11fc2738dfc53637ce4e9', + DEPLOYER_KEY, '--depth', '17', '--amount', '10B', '--json-rpc-url', - 'http://localhost:9545', + JSON_RPC_URL, '--yes', ]) expect(consoleMessages).toMatchLinesInOrder([ diff --git a/test/command/redeem.spec.ts b/test/command/redeem.spec.ts index 09576b2b..b36bc411 100644 --- a/test/command/redeem.spec.ts +++ b/test/command/redeem.spec.ts @@ -1,5 +1,5 @@ import { Wallet } from 'ethers' -import { sendBzzTransaction, sendNativeTransaction } from '../../src/utils/rpc' +import { mintBzzTransaction, sendNativeTransaction } from '../../src/utils/rpc' import { toMatchLinesInOrder } from '../custom-matcher' import { describeCommand, invokeTestCli } from '../utility' @@ -7,21 +7,21 @@ expect.extend({ toMatchLinesInOrder, }) -const FUNDER_KEY = '0x566058308ad5fa3888173c741a1fb902c9f1f19559b11fc2738dfc53637ce4e9' -const JSON_RPC_URL = 'http://localhost:9545' +const FUNDER_KEY = '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80' +const JSON_RPC_URL = 'http://localhost:8545' const ETH_01 = 100_000_000_000_000_000n.toString() const BZZ_5 = 50_000_000_000_000_000n.toString() describeCommand('Test `utility redeem` command', ({ consoleMessages }) => { it('should redeem funds to target address', async () => { - process.env.SWARM_CLI_NETWORK_ID = '4020' - process.env.SWARM_CLI_BZZ_ADDRESS = '0xe78A0F7E598Cc8b0Bb87894B0F60dD2a88d6a8Ab' + process.env.SWARM_CLI_NETWORK_ID = '1337' + process.env.SWARM_CLI_BZZ_ADDRESS = '0x5FbDB2315678afecb367f032d93F642f64180aa3' const sourceWallet = Wallet.createRandom() const targetWallet = Wallet.createRandom() await sendNativeTransaction(FUNDER_KEY, sourceWallet.address, ETH_01, JSON_RPC_URL) - await sendBzzTransaction(FUNDER_KEY, sourceWallet.address, BZZ_5, JSON_RPC_URL) + await mintBzzTransaction(FUNDER_KEY, sourceWallet.address, BZZ_5, JSON_RPC_URL) await invokeTestCli([ 'utility', diff --git a/test/command/stamp.spec.ts b/test/command/stamp.spec.ts index afc7c193..f7bcfeea 100644 --- a/test/command/stamp.spec.ts +++ b/test/command/stamp.spec.ts @@ -1,10 +1,10 @@ +import { BatchId, Bee } from '@ethersphere/bee-js' import { Types } from 'cafe-utility' +import { randomBytes } from 'crypto' import inquirer from 'inquirer' import { Buy } from '../../src/command/stamp/buy' import { toMatchLinesInOrder } from '../custom-matcher' import { describeCommand, invokeTestCli } from '../utility' -import { BatchId, Bee } from '@ethersphere/bee-js' -import { randomBytes } from 'crypto' expect.extend({ toMatchLinesInOrder, @@ -105,7 +105,7 @@ describeCommand( }) it('should print custom message when there are no stamps', async () => { - await invokeTestCli(['stamp', 'list', '--bee-api-url', 'http://localhost:11633']) + await invokeTestCli(['stamp', 'list', '--bee-api-url', 'http://localhost:21633']) expect(getNthLastMessage(4)).toContain('You do not have any stamps.') }) From 880a7942baf64ea991c2b7143bcef5ada1200d53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gergely=20B=C3=A9k=C3=A9si?= Date: Tue, 26 May 2026 13:05:49 +0200 Subject: [PATCH 5/8] fix: remove mint function --- src/utils/rpc.ts | 27 --------------------------- test/command/create-batch.spec.ts | 8 ++------ test/command/redeem.spec.ts | 4 ++-- 3 files changed, 4 insertions(+), 35 deletions(-) diff --git a/src/utils/rpc.ts b/src/utils/rpc.ts index dbccc779..b30b604a 100644 --- a/src/utils/rpc.ts +++ b/src/utils/rpc.ts @@ -82,33 +82,6 @@ export async function sendNativeTransaction( return { transaction, receipt } } -export async function mintBzzTransaction( - privateKey: string, - to: string, - value: string, - jsonRpcProvider: string, -): Promise { - if (!to.startsWith('0x')) { - to = `0x${to}` - } - const { signer, provider } = await makeReadySigner(privateKey, jsonRpcProvider) - const { gasPrice } = await provider.getFeeData() - - if (gasPrice === null) { - throw new Error('Unable to determine gas price from provider') - } - - const bzz = new Contract(Contracts.bzz, ['function mint(address to, uint256 amount) external'], signer) - const transaction = await bzz.mint(to, value, { gasPrice }) - const receipt = await transaction.wait(1) - - if (receipt === null) { - throw new Error('Transaction was not included in a block') - } - - return { transaction, receipt } -} - export async function sendBzzTransaction( privateKey: string, to: string, diff --git a/test/command/create-batch.spec.ts b/test/command/create-batch.spec.ts index da60c44b..59d4dcd6 100644 --- a/test/command/create-batch.spec.ts +++ b/test/command/create-batch.spec.ts @@ -1,4 +1,3 @@ -import { mintBzzTransaction } from '../../src/utils/rpc' import { toMatchLinesInOrder } from '../custom-matcher' import { describeCommand, invokeTestCli } from '../utility' @@ -6,22 +5,19 @@ expect.extend({ toMatchLinesInOrder, }) -const DEPLOYER_KEY = '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80' -const DEPLOYER_ADDRESS = '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266' +const FUNDER_KEY = '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80' const JSON_RPC_URL = 'http://localhost:8545' -const BZZ_10 = 100_000_000_000_000_000n.toString() describeCommand('Test `utility create-batch` command', ({ consoleMessages }) => { it('should create batch', async () => { process.env.SWARM_CLI_NETWORK_ID = '1337' process.env.SWARM_CLI_BZZ_ADDRESS = '0x5FbDB2315678afecb367f032d93F642f64180aa3' process.env.SWARM_CLI_POSTAGE_STAMP_ADDRESS = '0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512' - await mintBzzTransaction(DEPLOYER_KEY, DEPLOYER_ADDRESS, BZZ_10, JSON_RPC_URL) await invokeTestCli([ 'utility', 'create-batch', '--private-key', - DEPLOYER_KEY, + FUNDER_KEY, '--depth', '17', '--amount', diff --git a/test/command/redeem.spec.ts b/test/command/redeem.spec.ts index b36bc411..6a6b33ab 100644 --- a/test/command/redeem.spec.ts +++ b/test/command/redeem.spec.ts @@ -1,5 +1,5 @@ import { Wallet } from 'ethers' -import { mintBzzTransaction, sendNativeTransaction } from '../../src/utils/rpc' +import { sendBzzTransaction, sendNativeTransaction } from '../../src/utils/rpc' import { toMatchLinesInOrder } from '../custom-matcher' import { describeCommand, invokeTestCli } from '../utility' @@ -21,7 +21,7 @@ describeCommand('Test `utility redeem` command', ({ consoleMessages }) => { const targetWallet = Wallet.createRandom() await sendNativeTransaction(FUNDER_KEY, sourceWallet.address, ETH_01, JSON_RPC_URL) - await mintBzzTransaction(FUNDER_KEY, sourceWallet.address, BZZ_5, JSON_RPC_URL) + await sendBzzTransaction(FUNDER_KEY, sourceWallet.address, BZZ_5, JSON_RPC_URL) await invokeTestCli([ 'utility', From 404ad76a0ca3b003d0dfba0a6e6408a81fdd1a1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gergely=20B=C3=A9k=C3=A9si?= Date: Tue, 26 May 2026 16:07:46 +0200 Subject: [PATCH 6/8] fix: remove fresh tag --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index b1ed078d..e7e9895b 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -38,7 +38,7 @@ jobs: run: bee-dev --port 16338 --no-swap & - name: Start bee-factory - run: bee-factory start --fresh --tag v2.8.0 + run: bee-factory start --tag v2.8.0 - name: Print swarm-cli status continue-on-error: true From 3daec1d4fdaeaaff9ae95858fe8484513a51eb8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gergely=20B=C3=A9k=C3=A9si?= Date: Wed, 27 May 2026 10:02:12 +0200 Subject: [PATCH 7/8] fix: use different private key --- test/command/create-batch.spec.ts | 2 +- test/command/redeem.spec.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/command/create-batch.spec.ts b/test/command/create-batch.spec.ts index 59d4dcd6..f8eefe72 100644 --- a/test/command/create-batch.spec.ts +++ b/test/command/create-batch.spec.ts @@ -5,7 +5,7 @@ expect.extend({ toMatchLinesInOrder, }) -const FUNDER_KEY = '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80' +const FUNDER_KEY = '0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba' const JSON_RPC_URL = 'http://localhost:8545' describeCommand('Test `utility create-batch` command', ({ consoleMessages }) => { diff --git a/test/command/redeem.spec.ts b/test/command/redeem.spec.ts index 6a6b33ab..fbc8272c 100644 --- a/test/command/redeem.spec.ts +++ b/test/command/redeem.spec.ts @@ -7,7 +7,7 @@ expect.extend({ toMatchLinesInOrder, }) -const FUNDER_KEY = '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80' +const FUNDER_KEY = '0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba' const JSON_RPC_URL = 'http://localhost:8545' const ETH_01 = 100_000_000_000_000_000n.toString() const BZZ_5 = 50_000_000_000_000_000n.toString() From f5aecd2cb1ce9c31cdef8c9881f8c9f698fde5bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gergely=20B=C3=A9k=C3=A9si?= Date: Wed, 27 May 2026 11:09:55 +0200 Subject: [PATCH 8/8] ci: update rc --- .github/workflows/tests-rc.yaml | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/.github/workflows/tests-rc.yaml b/.github/workflows/tests-rc.yaml index 47cb462d..5393d352 100644 --- a/.github/workflows/tests-rc.yaml +++ b/.github/workflows/tests-rc.yaml @@ -29,23 +29,7 @@ jobs: run: npm ci - name: Install global dependencies - run: npm install --global bee-dev @fairdatasociety/fdp-play @ethersphere/swarm-cli npxie - - - name: Clone fdp-play - run: git clone https://github.com/fairDataSociety/fdp-play - - - name: Install fdp-play dependencies - run: | - cd fdp-play && npm install - cd orchestrator && npm install - - - name: Build fdp-play images - run: | - cd fdp-play/orchestrator - npm run build:env -- --build-base-bee --bee-repository=ethersphere/bee.git - - - name: Clean up fdp-play - run: rm -rf fdp-play/test + run: npm install --global bee-dev @ethersphere/bee-factory @ethersphere/swarm-cli npxie - name: Run bee-dev run: bee-dev --port 16337 & @@ -53,16 +37,8 @@ jobs: - name: Run bee-dev with --no-swap run: bee-dev --port 16338 --no-swap & - - name: Start fdp-play environment - run: fdp-play start --detach --blockchain-image ethereum/client-go:release-1.13 --bee-version HEAD-commit - - - name: Deposit to chequebook - run: | - swarm-cli cheque deposit 10 - swarm-cli cheque deposit 10 --bee-api-url http://localhost:11633 - swarm-cli cheque deposit 10 --bee-api-url http://localhost:21633 - swarm-cli cheque deposit 10 --bee-api-url http://localhost:31633 - swarm-cli cheque deposit 10 --bee-api-url http://localhost:41633 + - name: Start bee-factory + run: bee-factory start --tag master - name: Print swarm-cli status continue-on-error: true