Skip to content
Merged
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
7 changes: 4 additions & 3 deletions pages/api-references/genlayer-cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ COMMANDS:
EXAMPLES:
genlayer network set # Interactive selection menu
genlayer network set localnet # Set network to localnet
genlayer network set testnet-asimov # Set network to testnet-asimov
genlayer network set testnet-asimov # Set network to testnet-asimov
genlayer network set testnet-bradbury # Set network to testnet-bradbury
genlayer network info # Show current network details
genlayer network list # List available networks
```
Expand Down Expand Up @@ -364,7 +365,7 @@ OPTIONS (delegation-info):
--delegator <address> Delegator address (defaults to signer)

COMMON OPTIONS:
--network <network> Network to use (localnet, testnet-asimov)
--network <network> Network to use (localnet, testnet-asimov, testnet-bradbury)
--rpc <rpcUrl> RPC URL for the network
--staking-address <addr> Override staking contract address

Expand Down Expand Up @@ -496,7 +497,7 @@ EXAMPLES:

### Staking Operations (Testnet)

Manage staking for validators and delegators on testnet-asimov.
Manage staking for validators and delegators on testnet.

```bash
USAGE:
Expand Down
19 changes: 10 additions & 9 deletions pages/api-references/genlayer-js.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Creates a new GenLayer client instance with various configuration options.

```typescript
import { createClient } from 'genlayer-js';
import { localnet, studionet, testnetAsimov } from 'genlayer-js/chains';
import { localnet, studionet, testnetAsimov, testnetBradbury } from 'genlayer-js/chains';

// Basic client with localnet chain
const client = createClient({
Expand Down Expand Up @@ -38,7 +38,7 @@ const client = createClient({
```

**Parameters:**
- `chain`: The chain configuration (localnet, studionet, testnetAsimov)
- `chain`: The chain configuration (localnet, studionet, testnetAsimov, testnetBradbury)
- `account`: (Optional) Can be either:
- An account object (from `createAccount()`) for direct signing with private key
- A string address (e.g., '0x1234...') for external signing (MetaMask)
Expand Down Expand Up @@ -572,31 +572,32 @@ console.log('Cancelled:', result);
GenLayerJS provides several chain configurations for different environments:

- **localnet**: Local development network
- **studionet**: Staging environment network
- **testnetAsimov**: Test network for production testing
- **studionet**: Staging environment network
- **testnetAsimov**: Test network for infrastructure and stress testing
- **testnetBradbury**: Test network for AI/LLM use cases

```typescript
import { localnet, studionet, testnetAsimov } from 'genlayer-js/chains';
import { localnet, studionet, testnetAsimov, testnetBradbury } from 'genlayer-js/chains';

// Use the appropriate chain for your environment
const client = createClient({
chain: localnet, // or studionet, testnetAsimov
chain: testnetBradbury, // or localnet, studionet, testnetAsimov
});
```

## Staking (Testnet)

The SDK provides staking functionality for validators and delegators on testnet-asimov.
The SDK provides staking functionality for validators and delegators on testnet.

### Setup

```typescript
import { testnetAsimov } from 'genlayer-js/chains';
import { testnetBradbury } from 'genlayer-js/chains';
import { createClient, createAccount } from "genlayer-js";

const account = createAccount();
const client = createClient({
chain: testnetAsimov,
chain: testnetBradbury,
account,
});
```
Expand Down
15 changes: 12 additions & 3 deletions pages/api-references/genlayer-test.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ networks:
- "${ACCOUNT_PRIVATE_KEY_3}"
from: "${ACCOUNT_PRIVATE_KEY_2}" # Optional: specify default account

testnet_bradbury: # Test network configuration (pre-configured)
# Pre-configured network - requires accounts to be specified
accounts:
- "${ACCOUNT_PRIVATE_KEY_1}"
- "${ACCOUNT_PRIVATE_KEY_2}"
- "${ACCOUNT_PRIVATE_KEY_3}"
from: "${ACCOUNT_PRIVATE_KEY_2}" # Optional: specify default account

custom_network: # Custom network configuration
id: 1234
url: "http://custom.network:8545"
Expand All @@ -59,7 +67,8 @@ environment: .env # Path to your environment file containing private keys and o
- Pre-configured networks:
- `localnet`: Local development network with auto-generated test accounts
- `studionet`: GenLayer Studio network with auto-generated test accounts
- `testnet_asimov`: Public test network (requires account configuration)
- `testnet_asimov`: Public test network for infrastructure testing (requires account configuration)
- `testnet_bradbury`: Public test network for AI/LLM use cases (requires account configuration)
- Network configurations can include:
- `url`: The RPC endpoint for the network (optional for pre-configured networks)
- `id`: Chain ID (optional for pre-configured networks)
Expand Down Expand Up @@ -629,7 +638,7 @@ gltest --network localnet
gltest --network studionet

# Run tests on testnet
gltest --network testnet_asimov
gltest --network testnet_bradbury
```

Set a custom RPC endpoint:
Expand Down Expand Up @@ -659,5 +668,5 @@ When enabled, deployments and write operations run only on the leader node. On u

**Note:** All configuration options can be combined. For example:
```bash
gltest -v --network testnet_asimov --default-wait-interval 1000
gltest -v --network testnet_bradbury --default-wait-interval 1000
```
5 changes: 3 additions & 2 deletions pages/developers/intelligent-contracts/deploying.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ Deploy to different networks based on your development stage:
|---------|---------|-------------|
| **Localnet** | Local development | Development, debugging, initial testing |
| **Studionet** | Hosted development | Team collaboration, quick prototyping |
| **TestnetAsimov** | Pre-production testing | Final validation (requires faucet tokens) |
| **TestnetAsimov** | Infrastructure testing | Stability, scalability, and stress testing |
| **TestnetBradbury** | AI/LLM testing | Real AI workloads and intelligent contract testing |

[Explore Network Configuration →](./deploying/network-configuration)

Expand All @@ -78,7 +79,7 @@ Follow this recommended progression:

1. **Develop locally** on `localnet` with full control
2. **Test collaboratively** on `studionet` with your team
3. **Validate thoroughly** on `testnetAsimov` in a production-like environment
3. **Validate thoroughly** on `testnetBradbury` in a production-like environment with real AI workloads

<Callout emoji="💡">
Start with CLI deployment for simple contracts, then graduate to deploy scripts as your projects become more complex.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ genlayer deploy --rpc https://custom-network.com/api
**Alternative: Set default network first**
```bash
# Set network then deploy
genlayer network testnet-asimov
genlayer network testnet-bradbury
genlayer deploy --contract contracts/my_contract.py
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import {
DecodedDeployData,
GenLayerChain
} from "genlayer-js/types";
import { testnetAsimov } from "genlayer-js/chains";
import { testnetBradbury } from "genlayer-js/chains";

export default async function main(client: GenLayerClient<any>) {
// Read the contract file
Expand Down Expand Up @@ -66,9 +66,9 @@ export default async function main(client: GenLayerClient<any>) {
throw new Error(`Deployment failed. Receipt: ${JSON.stringify(receipt)}`);
}

// Receipt structure differs between TestnetAsimov and localnet/studionet
// Receipt structure differs between testnet and localnet/studionet
const deployedContractAddress =
(client.chain as GenLayerChain).id !== testnetAsimov.id
(client.chain as GenLayerChain).id !== testnetBradbury.id
? receipt.data.contract_address
: (receipt.txDataDecoded as DecodedDeployData)?.contractAddress;
Comment on lines +69 to 73
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

In the current GenLayerJS docs or source, when deploying on testnetAsimovandtestnetBradbury, which receipt field contains the deployed contract address? Is txDataDecoded.contractAddress used for both testnets, or only for Bradbury?

💡 Result:

  • testnetBradbury: the deployed contract address is in receipt.data.contract_address (same as localnet/studionet). (docs.genlayer.com)
  • testnetAsimov: the deployed contract address is in (receipt.txDataDecoded as DecodedDeployData).contractAddress. (docs.genlayer.com)

So txDataDecoded.contractAddress is not used for Bradbury in the current GenLayerJS docs—it’s used for Asimov only. (docs.genlayer.com)

Citations:


Fix inverted receipt field logic affecting both testnet deployments.

The code branches only on testnetBradbury but has the condition logic inverted: it reads receipt.data.contract_address for Asimov and txDataDecoded.contractAddress for Bradbury. According to GenLayerJS docs, the fields are swapped—Asimov uses txDataDecoded.contractAddress while Bradbury uses receipt.data.contract_address. This causes Asimov deployments to read the wrong field, resulting in missing or incorrect contract addresses.

Use a feature-detect approach instead of chain-specific branching:

♻️ Suggested fix
-  // Receipt structure differs between testnet and localnet/studionet
-  const deployedContractAddress = 
-    (client.chain as GenLayerChain).id !== testnetBradbury.id
-      ? receipt.data.contract_address
-      : (receipt.txDataDecoded as DecodedDeployData)?.contractAddress;
+  // Prefer the decoded deploy payload when present; fall back to the legacy field.
+  const deployedContractAddress =
+    (receipt.txDataDecoded as DecodedDeployData | undefined)?.contractAddress ??
+    receipt.data?.contract_address;
+
+  if (!deployedContractAddress) {
+    throw new Error("Deployment succeeded but no contract address was returned in the receipt");
+  }

Also applies to: 153-157, 237-241

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pages/developers/intelligent-contracts/deploying/deploy-scripts.mdx` around
lines 69 - 73, The receipt field selection is inverted: per GenLayerJS, Bradbury
uses receipt.data.contract_address and Asimov uses
receipt.txDataDecoded.contractAddress; replace the chain-specific check in the
deployedContractAddress assignment (and the other occurrences around the file)
with a feature-detect that prefers receipt.data.contract_address when present
and falls back to (receipt.txDataDecoded as DecodedDeployData)?.contractAddress
otherwise — update the logic that references client.chain / GenLayerChain /
testnetBradbury and the fields receipt.data.contract_address and
receipt.txDataDecoded.contractAddress accordingly.


Expand All @@ -93,7 +93,7 @@ import {
DecodedDeployData,
GenLayerChain
} from "genlayer-js/types";
import { testnetAsimov } from "genlayer-js/chains";
import { testnetBradbury } from "genlayer-js/chains";

export default async function main(client: GenLayerClient<any>) {
console.log("🚀 Starting deployment process...");
Expand Down Expand Up @@ -150,9 +150,9 @@ async function deployContract(
throw new Error(`Deployment failed for ${contractPath}. Receipt: ${JSON.stringify(receipt)}`);
}

// Receipt structure differs between TestnetAsimov and localnet/studionet
// Receipt structure differs between testnet and localnet/studionet
const deployedContractAddress =
(client.chain as GenLayerChain).id !== testnetAsimov.id
(client.chain as GenLayerChain).id !== testnetBradbury.id
? receipt.data.contract_address
: (receipt.txDataDecoded as DecodedDeployData)?.contractAddress;

Expand Down Expand Up @@ -234,9 +234,9 @@ export default async function main(client: GenLayerClient<any>) {
throw new Error(`Deployment failed: ${JSON.stringify(receipt)}`);
}

// Receipt structure differs between TestnetAsimov and localnet/studionet
// Receipt structure differs between testnet and localnet/studionet
const deployedContractAddress =
(client.chain as GenLayerChain).id !== testnetAsimov.id
(client.chain as GenLayerChain).id !== testnetBradbury.id
? receipt.data.contract_address
: (receipt.txDataDecoded as DecodedDeployData)?.contractAddress;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Callout } from 'nextra-theme-docs'

# Network Configuration

GenLayer supports three different networks, each serving specific purposes in the development lifecycle:
GenLayer supports multiple networks, each serving specific purposes in the development lifecycle:

## Localnet

Expand Down Expand Up @@ -55,46 +55,71 @@ genlayer deploy --contract contracts/my_contract.py

## TestnetAsimov

**Purpose**: Production-like testing environment
- **When to use**: For final testing
**Purpose**: Infrastructure testing and stress testing
- **When to use**: For infrastructure stability testing, scalability testing, and stress tests
- **Setup**: Connect using network configuration
- **Benefits**:
- Production-like environment
- Stable for testing dApp integrations
- Stable infrastructure testing environment
- Scalability and stress testing
- Shared testnet for community testing

### Using TestnetAsimov

```bash
# Set network to testnet
genlayer network testnet-asimov

# Deploy to testnet
genlayer deploy --contract contracts/my_contract.py
```

## TestnetBradbury

**Purpose**: Production-like testing environment with real AI/LLM use cases
- **When to use**: For deploying and testing intelligent contracts with real LLM models
- **Setup**: Connect using network configuration
- **Benefits**:
- Real AI workloads using powerful LLM models
- Production-like environment for intelligent contract testing
- Real use cases and contracts deployed
- Shared testnet for community testing

<Callout emoji="ℹ️">
Testnet Bradbury configuration details will be available when the network goes live. The faucet and RPC endpoints are shared with Testnet Asimov.
</Callout>
Comment on lines +76 to +89
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Separate Bradbury preview copy from live deployment guidance.

This section says Bradbury config details will only be available once the network goes live, but the same page immediately tells users to switch to testnet-bradbury, grab faucet funds, and use Bradbury as the recommended final deployment target. That reads as both “coming soon” and “ready now.” Either label these commands/workflow steps as preview-only, or keep the live guidance on Asimov until Bradbury addresses are published.

Also applies to: 93-103, 120-123

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pages/developers/intelligent-contracts/deploying/network-configuration.mdx`
around lines 76 - 89, The "TestnetBradbury" section is contradictory—it says
config details are forthcoming yet simultaneously instructs users to switch to
`testnet-bradbury`, get faucet funds, and treat Bradbury as a recommended
deployment target; update the copy so it’s consistent by either (A) marking all
Bradbury-specific commands/workflows and the Callout as "preview/coming soon"
and removing any live deployment instructions, or (B) removing Bradbury live
guidance entirely and pointing users to continue using Testnet Asimov until
Bradbury addresses are published; ensure you update the "TestnetBradbury"
header, the Callout block, and the other Bradbury mentions in the same page to
reflect the chosen approach.


### Getting Testnet Tokens

Before deploying to TestnetAsimov, you'll need testnet tokens. Use the [faucet](https://testnet-faucet.genlayer.foundation/) to get free GEN tokens.
Before deploying to TestnetBradbury, you'll need testnet tokens. Use the [faucet](https://testnet-faucet.genlayer.foundation/) to get free GEN tokens.

### Using TestnetAsimov
### Using TestnetBradbury

```bash
# Set network to testnet
genlayer network testnet-asimov
genlayer network testnet-bradbury

# Deploy to testnet
genlayer deploy --contract contracts/my_contract.py
```

## Network Comparison

| Feature | Localnet | Studionet | TestnetAsimov |
|---------|----------|-----------|---------------|
| **Setup Complexity** | Medium | None | Low |
| **Control Level** | Full | Limited | Limited |
| **Persistence** | Local only | Temporary | Persistent |
| **Collaboration** | No | Yes | Yes |
| **Performance** | Fast | Medium | Production-like |
| **Best for** | Development | Prototyping | Pre-production testing |
| Feature | Localnet | Studionet | TestnetAsimov | TestnetBradbury |
|---------|----------|-----------|---------------|-----------------|
| **Setup Complexity** | Medium | None | Low | Low |
| **Control Level** | Full | Limited | Limited | Limited |
| **Persistence** | Local only | Temporary | Persistent | Persistent |
| **Collaboration** | No | Yes | Yes | Yes |
| **Performance** | Fast | Medium | Production-like | Production-like |
| **Best for** | Development | Prototyping | Infrastructure testing | AI/LLM testing |

## Development Workflow

We recommend following this progression:

1. **Start with Localnet**: Develop and test your contracts locally with full control
2. **Test on Studionet**: Validate contracts in a shared environment
3. **Deploy to TestnetAsimov**: Final testing in a production-like environment
3. **Deploy to TestnetBradbury**: Final testing in a production-like environment with real AI workloads

## Managing Network Settings

Expand Down Expand Up @@ -123,8 +148,9 @@ This command will show you available networks and let you choose:
```
? Select a network:
❯ localnet
studionet
studionet
testnet-asimov
testnet-bradbury
custom
```

Expand All @@ -134,6 +160,7 @@ This command will show you available networks and let you choose:
genlayer network localnet
genlayer network studionet
genlayer network testnet-asimov
genlayer network testnet-bradbury
```

### Network Switching Workflow
Expand All @@ -148,7 +175,7 @@ genlayer network studionet
genlayer deploy --contract contracts/my_contract.py

# Pre-production workflow
genlayer network testnet-asimov
genlayer network testnet-bradbury
genlayer deploy --contract contracts/my_contract.py
```

Expand Down
4 changes: 3 additions & 1 deletion pages/validators/setup-guide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,11 @@ rollup:
genlayerchainwebsocketurl: "TODO: Set your GenLayer Chain ZKSync WebSocket RPC URL here" # GenLayer Chain WebSocket URL
# consensus contracts configuration
consensus:
# Testnet - Phase 5
# Testnet Asimov consensus contract
consensusaddress: "0xe66B434bc83805f380509642429eC8e43AE9874a" # AddressManager Smart Contract Address
genesis: 17326 # (Optional) Genesis block number for this consensus deployment. If not provided, it will be auto-detected by searching for the first log from the ConsensusMain contract.
# Testnet Bradbury consensus contract (use this instead of the above for Bradbury)
# consensusaddress: "0x0112Bf6e83497965A5fdD6Dad1E447a6E004271D" # AddressManager Smart Contract Address
# data directory
datadir: "./data/node"
# logging configuration
Expand Down
Loading