Создание флэш-слоя
Запрос
Создайте новый бесплатный пробный флеш-слой.
POST /v1/flashlayer/create
Тело запроса
{
"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"
}
}
}
Для генерации секции walletSign
можно воспользоваться следующим фрагментом кода
```
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();
Пожалуйста, убедитесь, что ваш адрес прошел повторную проверку в тестнете Eigenlayer. Дополнительную информацию можно найти в разделе Предварительные действия - рестейк с использованием EigenLayer
fcfs
bool
Где режим обработки транзакций - в порядке живой очереди или приоритетный газовый аукцион
gasless
bool
Установлена ли цена сетевого газа в размере 0
blocktime
float
От 0,5 до 60
tokenSymbol
string
От 2 до 6 символов
blockGasLimit
uint
От 30 000 000 до 60 000 000
tokenDecimals
uint
Рекомендуется поддерживать значение не более 18 десятичных знаков
genesis
list
Список счета и балансов генезиса
name
string
Название флэш-слоя
От 2 до 12 символов, строчных и не начинающихся с цифр
freetrial
bool
Установите значение true для использования бесплатной пробной версии
restakingTrial
bool
Установите значение true для использования версии рестейкинга
Ответ
{
"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)
// Создание клиента
client := &http.Client{}
// Создание запроса
req, err := http.NewRequest("POST", "https://dashboard-api.alt.technology/v1/flashlayer/create", body)
// Заголовки
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"
}
}
}'
// Запрос на получение данных
resp, err := client.Do(req)
if err != nil {
fmt.Println("Failure : ", err)
}
// Считывание тела ответа
respBody, _ := io.ReadAll(resp.Body)
// Отображение результатов
fmt.Println("response Status : ", resp.Status)
fmt.Println("response Headers : ", resp.Header)
fmt.Println("response Body : ", string(respBody))
}// Некий код
# Установите библиотеку Python Requests:
# `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