AltLayer Documentation
  • 👋Welcome
    • Overview
  • Restaked Rollups
    • VITAL for Decentralised Verification
      • Tier-1 Finality
      • Tier-2 Finality
      • Tier-3 Finality
    • MACH for Faster Finality
      • Interoperability via MACH
    • SQUAD for Decentralised Sequencing
    • Staking of dApp Token
  • Wizard
    • Introduction
    • Technical overview
    • Create AVS
    • Manage AVS
    • Operator management
    • Hosted operator API (BLS based)
    • Custom AVS specification
      • Constructor specification requirements
      • Import Externally-Deployed AVS
    • Report bug or submit a feature request
  • Autonome
    • Deploy AI Agent
    • Autonome API guide
    • Uploading your own agent framework
    • Twitter/X login troubleshooting guide
  • ♾️AltLayer-Facilitated Actively Validated Services
    • Overview
    • AltLayer MACH AVS
      • Operator Guide
      • User Delegation Guide
    • Cyber MACH AVS for Cyber L2
      • Operator Guide
      • User Delegation Guide
    • DODOchain MACH AVS for DODO Chain
      • Operator Guide
      • User Delegation Guide
    • Fast Finality Layer for Soneium
      • Operator Guide
      • User Delegation Guide
    • Xterio MACH AVS for Xterio Chain
      • Operator Guide
      • User Delegation Guide
  • V0.3.3 Upgrade Guide
  • 🥩ALT Restaking
    • Staking Info & Parameters
    • Restake ALT
    • Delegating reALT
    • Check and Claim Staking Rewards
    • Unstake ALT
    • Migration from Xterio (Legacy) ALT Pool to Xterio Restaked ALT Pool
    • Testnet reALT faucet
  • Rollup-as-a-Service
    • What is Rollup-as-a-Service (RaaS)?
    • AltLayer's RaaS Offering
    • RaaS Onboarding Guide
      • Optimism Rollup FAQ
      • Arbitrum Rollup FAQ
    • AltLayer Ecosystem
    • Clients in the Spotlight
    • Pricing Model
  • External Integrations
    • Account Abstraction using Biconomy
    • Enabling permissionless interoperability on AltLayer Rollup with Hyperlane
      • Deplying Hyperlane Warp Routes for ERC20 Token Bridging
      • Running Off-chain Agents
      • Setting up the bridging UI
    • Cross-chain Interoperability using Celer
      • Fungible Token Bridging
      • Non-fungible Token Bridging
      • Generic Message Passing
      • cBridge SDK
  • AltLayer's In-House Rollup Stack in Depth
    • How does AltLayer's in-house rollup stack work?
    • Decentralized Sequencer Set
    • Security via Fraud Proof
  • Rollup Types
    • Flash Layer Rollups
      • Example Use cases
        • NFT Mint Events
        • Games
        • Event Ticketing
    • Persistent Rollups
  • Core Features of AltLayer's In-House Rollup Stack
    • Modular
    • Elastic
    • Multi-VM Support
    • Fraud Proofs
    • Decentralized Sequencers
    • Tiered-Finality
  • FlashLayer Showcase
    • AltLayer's POAP NFTs Collection Mint
      • Performance Test in the Wild
    • Dark Forest Community Round
    • Oh Ottie! NFT Collection Mint
    • Dark Forest Community Round for Jump Crypto's Pit Event
    • Ottie 2048
    • Other demos
      • Fraud Proof Demo
      • Flash Layer Demo
      • Rollup Launchpad Demo
      • FlashGPT Demo
  • Implementation Status
    • Roadmap
    • Development Status
  • Community & Support
    • Community
    • Support
Powered by GitBook
On this page
  1. Rollup Launchpad
  2. API and SDKs

Creating Flash Layer

Request

Create a new free trial flashlayer.

POST /v1/flashlayer/create

Request body

{
  "flashlayer": {
    "settings": {
      "fcfs": true, // first in first serve mod
      "gasless": true, // gasless
      "blockTime": "0.5", // block time in sec
      "tokenSymbol": "ETH", // token symbol
      "blockGasLimit": "70000000", // block gas limit in wei
      "tokenDecimals": "18", // token decimals
      "genesisAccounts": [ // list of genesis accounts
        {
          "account": "0x55085B2Fd83323d98d30d6B3342cc39de6D527f8",
          "balance": "21000000000000000000000000"
        },
        {
          "account": "0x9434e7d062bF1257BF726a96A83fAE177703ccFD",
          "balance": "21000000000000000000000000"
        }
      ]
    },
    "name": "freetrial" // flashlayer name
  },
  "freeTrial": true
}

{
  "restakingTrial": true,
  "walletSign": {
    "address": "<Your restaking address>",
    "sign": "<Payload signature>",
    "ts": "<timestamp>"
  },
  "flashlayer": {
    "name": "<flashlayer name>",
    "settings": {
      "tokenDecimals": "18",
      "genesisAccounts": [
        {
          "account": "0x55085B2Fd83323d98d30d6B3342cc39de6D527f8",
          "balance": "21000000000000000000000000"
        },
        {
          "account": "0x9434e7d062bF1257BF726a96A83fAE177703ccFD",
          "balance": "21000000000000000000000000"
        }
      ],
      "blockGasLimit": "70000000",
      "gasless": true,
      "fcfs": true,
      "tokenSymbol": "ETH",
      "blockTime": "1"
    }
  }
}

To generate walletSign section, you can use the following code snippet

```
const { ethers } = require("ethers");

const provider = new ethers.providers.JsonRpcProvider();

const privateKey = `<your private key>`;
const wallet = new ethers.Wallet(privateKey, provider);

async function sign() {
  var ts = Math.round(+new Date() / 1000);
  const domain = {
    name: "Altlayer Launchpad",
  };
  const types = {
    WalletSign: [
      { name: "ts", type: "uint256" },
      { name: "address", type: "address" },
    ],
  };
  const value = {
    ts: ts,
    address: wallet.address,
  };
  const signature = await wallet._signTypedData(domain, types, value);
  console.log("ts:", ts.toString());
  console.log("address:", wallet.address);
  console.log("sign:", signature);
}

sign();
Property
Type
Description

fcfs

bool

Where transaction processing mode is first come first serve or priority gas auction

gasless

bool

whether network gas price is priced at 0 gas or not

blocktime

float

Between 0.5 to 60

tokenSymbol

string

Between 2 to 6 characters

blockGasLimit

uint

Between 30,000,000 to 60,000,000

tokenDecimals

uint

High recommended to keep it at 18 decimals

genesis

list

list of genesis account and balances

name

string

Name of the flash layer Between 2 and 12 characters, lowercase and cannot begin with numbers.

freetrial

bool

set to true to use free trial tier

restakingTrial

bool

set to true to use restaking tier

Response

{
  "flashlayer": {
    "name": "freetrial",
    "status": "STATUS_INITIALIZING",
    "settings": {
      "blockTime": 0.5,
      "gasless": true,
      "fcfs": true,
      "genesisAccounts": [
        {
          "account": "0x55085B2Fd83323d98d30d6B3342cc39de6D527f8",
          "balance": "21000000000000000000000000"
        },
        {
          "account": "0x9434e7d062bF1257BF726a96A83fAE177703ccFD",
          "balance": "21000000000000000000000000"
        }
      ],
      "tokenDecimals": "18",
      "tokenSymbol": "ETH",
      "blockGasLimit": "70000000"
    },
    "resources": {
      "rpc": "https://flashlayer.alt.technology/freetrial",
      "explorer": "https://explorer.alt.technology?rpcUrl=https://flashlayer.alt.technology/freetrial",
      "faucet": "https://faucet.alt.technology?chainId=10000001",
      "chainId": "10000001",
      "rpcWs": "wss://flashlayer.alt.technology/freetrial"
    },
    "createdAt": "2023-08-03T10:13:27.491183Z",
    "id": "1",
    "tier": "FLASHLAYER_TIER_FREE_TRIAL",
  }
}

## /v1/flashlayer/create
curl -X "POST" "https://dashboard-api.alt.technology/v1/flashlayer/create" \
     -H 'Content-Type: application/json' \
     -H 'Accept: application/json' \
     -H 'Authorization: Bearer {access_token}' \
     -d $'{
  "freeTrial": true,
  "flashlayer": {
    "name": "freetrial",
    "settings": {
      "tokenDecimals": "18",
      "genesisAccounts": [
        {
          "account": "0x55085B2Fd83323d98d30d6B3342cc39de6D527f8",
          "balance": "21000000000000000000000000"
        },
        {
          "account": "0x9434e7d062bF1257BF726a96A83fAE177703ccFD",
          "balance": "21000000000000000000000000"
        }
      ],
      "blockGasLimit": "70000000",
      "gasless": true,
      "fcfs": true,
      "tokenSymbol": "ETH",
      "blockTime": "0.5"
    }
  }
}'
package main

import (
	"fmt"
	"io"
	"net/http"
	"bytes"
)

func sendV1FlashlayerCreate() {
	// /v1/flashlayer/create (POST https://dashboard-api.alt.technology/v1/flashlayer/create)

	json := []byte(`{"freeTrial": true,"flashlayer": {"name": "freetrial","settings": {"tokenDecimals": "18","genesisAccounts": [{"account": "0x55085B2Fd83323d98d30d6B3342cc39de6D527f8","balance": "21000000000000000000000000"},{"account": "0x9434e7d062bF1257BF726a96A83fAE177703ccFD","balance": "21000000000000000000000000"}],"blockGasLimit": "70000000","gasless": true,"fcfs": true,"tokenSymbol": "ETH","blockTime": "0.5"}}}`)
	body := bytes.NewBuffer(json)

	// Create client
	client := &http.Client{}

	// Create request
	req, err := http.NewRequest("POST", "https://dashboard-api.alt.technology/v1/flashlayer/create", body)

	// Headers
	req.Header.Add("Content-Type", "application/json")
	req.Header.Add("Accept", "application/json")
	req.Header.Add("Authorization", "Bearer {access_token}")
## /v1/flashlayer/create
curl -X "POST" "https://stg-dashboard-api.alt.technology/v1/flashlayer/create" \
     -H 'Content-Type: application/json' \
     -H 'Accept: application/json' \
     -H 'Authorization: Bearer {access_token}' \
     -d $'{
  "freeTrial": true,
  "flashlayer": {
    "name": "freetrial",
    "settings": {
      "tokenDecimals": "18",
      "genesisAccounts": [
        {
          "account": "0x55085B2Fd83323d98d30d6B3342cc39de6D527f8",
          "balance": "21000000000000000000000000"
        },
        {
          "account": "0x9434e7d062bF1257BF726a96A83fAE177703ccFD",
          "balance": "21000000000000000000000000"
        }
      ],
      "blockGasLimit": "70000000",
      "gasless": true,
      "fcfs": true,
      "tokenSymbol": "ETH",
      "blockTime": "0.5"
    }
  }
}'
	// Fetch Request
	resp, err := client.Do(req)
	
	if err != nil {
		fmt.Println("Failure : ", err)
	}

	// Read Response Body
	respBody, _ := io.ReadAll(resp.Body)

	// Display Results
	fmt.Println("response Status : ", resp.Status)
	fmt.Println("response Headers : ", resp.Header)
	fmt.Println("response Body : ", string(respBody))
}// Some code
# Install the Python Requests library:
# `pip install requests
#!/usr/bin/python3
import requests
import json


def send_request():
    # /v1/flashlayer/create
    # POST https://dashboard-api.alt.technology/v1/flashlayer/create

    try:
        response = requests.post(
            url="https://dashboard-api.alt.technology/v1/flashlayer/create",
            headers={
                "Content-Type": "application/json",
                "Accept": "application/json",
                "Authorization": "Bearer {access_token}"
            },
            data=json.dumps({
                "freeTrial": True,
                "flashlayer": {
                    "name": "freetrial",
                    "settings": {
                        "tokenDecimals": "18",
                        "genesisAccounts": [
                            {
                                "account": "0x55085B2Fd83323d98d30d6B3342cc39de6D527f8",
                                "balance": "21000000000000000000000000"
                            },
                            {
                                "account": "0x9434e7d062bF1257BF726a96A83fAE177703ccFD",
                                "balance": "21000000000000000000000000"
                            }
                        ],
                        "blockGasLimit": "70000000",
                        "gasless": True,
                        "fcfs": True,
                        "tokenSymbol": "ETH",
                        "blockTime": "0.5"
                    }
                }
            })
        )
        print('Response HTTP Status Code: {status_code}'.format(
            status_code=response.status_code))
        print('Response HTTP Response Body: {content}'.format(
            content=response.content))
    except requests.exceptions.RequestException:
        print('HTTP Request failed')py

Last updated 1 year ago

Please ensure that your address has restaked at the Eigenlayer testnet. For more information, you can refer to .

Prerequisite - Restake with EigenLayer