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();
Please ensure that your address has restaked at the Eigenlayer testnet. For more information, you can refer to Prerequisite - Restake with EigenLayer.
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