### Install Manuscript GUI Source: https://docs.chainbase.com/core-concepts/manuscript/QuickStart/prerequisites Downloads and executes the installation script for the Manuscript GUI from a provided URL. This script handles the setup of the graphical user interface. ```bash curl -fsSL https://github.com/chainbase-labs/manuscript-core/raw/main/install-gui.sh | bash ``` -------------------------------- ### Example: Get Contract Name Source: https://docs.chainbase.com/api-reference/web3-api/basic/contract/contract-call Demonstrates how to retrieve the name of a smart contract using its address and ABI. This example assumes a Python environment for interacting with smart contracts. ```APIDOC [{"inputs":[{"internalType":"uint256","name":"maxBatchSize_","type":"uint256"},{"internalType":"uint256","name":"collectionSize_","type":"uint256"},{"internalType":"uint256","name":"amountForAuctionAndDev_","type":"uint256"},{"internalType":"uint256","name":"amountForDevs_","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxBatchSize","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawMoney","outputs":[],"stateMutability":"nonpayable","type":"function"}] ``` ```Python from web3 import Web3 # Assuming you have a Web3 instance connected to an Ethereum node # w3 = Web3(Web3.HTTPProvider('YOUR_NODE_URL')) # Example data from the input contract_address = '0xed5af388653567af2f388e6224dc7c4b3241c544' chain_id = 1 function_name = 'name' # The ABI for the 'name' function (extracted from the full ABI) name_function_abi = [ { "inputs": [], "name": "name", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" } ] # Create a contract instance # contract = w3.eth.contract(address=contract_address, abi=name_function_abi) # Call the 'name' function # contract_name = contract.functions.name().call() # print(f"Contract Name: {contract_name}") # Note: The actual execution requires a connected Web3 instance and potentially a wallet for signing transactions if it were a non-view function. # The provided example configuration is used here to illustrate the context. ``` -------------------------------- ### Run Manuscript CLI Source: https://docs.chainbase.com/core-concepts/manuscript/QuickStart/create_manuscript Starts the Manuscript CLI tool to begin creating or managing manuscripts. This is the initial step after installing the GUI tool. ```shell ➜ ~ ./manuscript ``` -------------------------------- ### Get NFT Owner using Axios in JavaScript Source: https://docs.chainbase.com/platform/usecases/nft-api/get-nft-owner-by-token Provides an example of fetching NFT owner information using the `axios` library in JavaScript. This method requires installing `axios` and demonstrates making a GET request to the Chainbase API with necessary parameters and headers. ```javascript const axios = require('axios'); const network_id = '1'; // See https://docs.chainbase.com/reference/supported-chains to get the id of different chains. const contract_addr = '0xed5af388653567af2f388e6224dc7c4b3241c544'; // Take Azuki's contract address as an example. const token_id = '1'; const options = { url: `https://api.chainbase.online/v1/nft/owner?chain_id=${network_id}&contract_address=${contract_addr}&token_id=${token_id}`, method: 'GET', headers: { 'x-api-key': 'YOUR_CHAINBASE_API_KEY', // Replace the field with your API key. 'accept': 'application/json' } }; axios(options) .then(response => console.log(response.data.data)) .catch(error => console.log(error)); ``` -------------------------------- ### JWT Header Component Example Source: https://docs.chainbase.com/api-reference/jtw An example of the JSON structure for a JWT header, specifying the signing algorithm ('RS256'), token type ('JWT'), and the key ID ('kid') obtained from Chainbase. ```json { "alg": "RS256", "typ": "JWT", "kid": "e7af4467-00f1-480e-97d7-6490d7f749b9" } ``` -------------------------------- ### Get Token Price using Axios in JavaScript Source: https://docs.chainbase.com/platform/usecases/token-api/get-token-price This example demonstrates fetching ERC20 token prices via the Chainbase API using the axios library in JavaScript. Ensure you have installed axios (`npm install axios --save`). It requires the network ID, token contract address, and your Chainbase API key, returning price details. ```javascript const axios = require('axios'); const network_id = '1'; // See https://docs.chainbase.com/reference/supported-chains to get the id of different chains. const token_addr = '0xdAC17F958D2ee523a2206206994597C13D831ec7'; // Take USDT as an example. const options = { url: `https://api.chainbase.online/v1/token/price?chain_id=${network_id}&contract_address=${token_addr}`, method: 'GET', headers: { 'x-api-key': 'YOUR_CHAINBASE_API_KEY', // Replace the field with your API key. 'accept': 'application/json' } }; axios(options) .then(response => console.log(response.data.data)) .catch(error => console.log(error)); ``` -------------------------------- ### Get NFT Metadata using JavaScript Axios Source: https://docs.chainbase.com/platform/usecases/nft-api/get-nft-metadata Provides an example of fetching NFT metadata using the `axios` library in JavaScript. This method requires installing `axios` first. It configures the request with the API endpoint, method, and headers, then logs the retrieved metadata. ```javascript const network_id = '1'; // See https://docs.chainbase.com/reference/supported-chains to get the id of different chains. const contract_addr = '0xed5af388653567af2f388e6224dc7c4b3241c544'; // Take the contract address of Azuki as an example. const token_id = '1'; // Token id should be in hex or num string. Here we take 1 as example. const axios = require('axios'); const options = { url: `https://api.chainbase.online/v1/nft/metadata?chain_id=${network_id}&contract_address=${contract_addr}&token_id=${token_id}`, method: 'GET', headers: { 'x-api-key': CHAINBASE_API_KEY, // Replace the field with your API key. 'accept': 'application/json' } }; axios(options) .then(response => console.log(response.data.data)) .catch(error => console.log(error)); ``` -------------------------------- ### Install chainbase-sdk Source: https://docs.chainbase.com/introduction/networks/developers Installs the chainbase-sdk using npm, a necessary step for local development and manuscript management. ```bash npm install chainbase-sdk ``` -------------------------------- ### Get NFTs using Axios in JavaScript Source: https://docs.chainbase.com/platform/usecases/balance-api/get-nfts-owned-by-address Provides an example of retrieving NFTs owned by a wallet address using the Chainbase API with the `axios` library in JavaScript. This method requires installing `axios` and configuring the request with the Chainbase API key, network ID, and wallet address. The NFT data is then logged to the console. ```javascript const axios = require('axios'); network_id = '1'; // See https://docs.chainbase.com/reference/supported-chains to get the id of different chains. wallet_addr = '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'; // Take Vitalik's wallet address as an example. const options = { url: `https://api.chainbase.online/v1/account/nfts?chain_id=${network_id}&address=${wallet_addr}&page=1&limit=5`, method: 'GET', headers: { 'x-api-key': CHAINBASE_API_KEY, // Replace the field with your API key. 'accept': 'application/json' } }; axios(options) .then(response => console.log(response.data.data)) .catch(error => console.log(error)); ``` -------------------------------- ### Install Manuscript Core Dependencies Source: https://docs.chainbase.com/core-concepts/manuscript/zone This snippet demonstrates how to set up the local development environment for the Chainbase Manuscript framework. It involves cloning the repository, navigating into the directory, and installing core dependencies using the `make` command, with options for GUI or CLI installation. ```bash git clone https://github.com/chainbase-labs/manuscript-core cd manuscript-core make install gui # or cli ``` -------------------------------- ### Check System Requirements (Docker) Source: https://docs.chainbase.com/core-concepts/manuscript/QuickStart/prerequisites Verifies the installation and operational status of Docker and Docker Compose. These commands are essential for confirming that the necessary containerization tools are available for the Manuscript environment. ```shell docker --version docker compose version ``` -------------------------------- ### Example NFT Metadata Output Source: https://docs.chainbase.com/platform/usecases/nft-api/get-nft-metadata An example of the JSON output returned by the Chainbase API when fetching NFT metadata for Azuki #1 on Ethereum. ```json { "contract_address": "0xed5af388653567af2f388e6224dc7c4b3241c544", "name": "Azuki", "symbol": "AZUKI", "owner": "0xC8967D1537F7B995607A1DEa2B0C06E18A9756a2", "token_id": "0x1", "erc_type": "ERC721", "image_uri": "https://ikzttp.mypinata.cloud/ipfs/QmYDvPAXtiJg7s8JdRBSLWdgSphQdac8j1YuQNNxcGE1hg/1.png", "mint_time": "2022-01-12T04:17:28Z", "mint_transaction_hash": "0xc208fdb2f133bda64522fececd6518a565aaa6e8801b0a776f2f93c922fe9420", "token_uri": "https://ikzttp.mypinata.cloud/ipfs/QmQFkLSQysj94s5GvTHPyzTxrawwtjgiiYS2TBLgrvw8CW/1", "metadata": { "name": "Azuki #1", "image": "https://ikzttp.mypinata.cloud/ipfs/QmYDvPAXtiJg7s8JdRBSLWdgSphQdac8j1YuQNNxcGE1hg/1.png", "attributes": [ { "trait_type": "Type", "value": "Human" }, { "trait_type": "Hair", "value": "Pink Hairband" }, { "trait_type": "Clothing", "value": "White Qipao with Fur" }, { "trait_type": "Eyes", "value": "Daydreaming" }, { "trait_type": "Mouth", "value": "Lipstick" }, { "trait_type": "Offhand", "value": "Gloves" }, { "trait_type": "Background", "value": "Off White D" } ] }, "traits": [ { "trait_type": "Type", "value": "Human" }, { "trait_type": "Hair", "value": "Pink Hairband" }, { "trait_type": "Clothing", "value": "White Qipao with Fur" }, { "trait_type": "Eyes", "value": "Daydreaming" }, { "trait_type": "Mouth", "value": "Lipstick" }, { "trait_type": "Offhand", "value": "Gloves" }, { "trait_type": "Background", "value": "Off White D" } ] } ``` -------------------------------- ### Clone Chainbase AVS Setup Repository Source: https://docs.chainbase.com/node/operator Clones the official Chainbase AVS setup repository from GitHub to your local machine. This repository contains the necessary scripts and configurations for running the operator node. ```shell git clone https://github.com/chainbase-labs/chainbase-avs-setup ``` -------------------------------- ### Ethereum Blobs Table Documentation and Sample Source: https://docs.chainbase.com/catalog/OtherEvm/Ethereum_Classic Provides documentation for the 'blobs' column in the Ethereum dataset, detailing its structure and purpose. Includes an embedded sample of the data for the 'blobs' table, allowing users to view typical entries. ```APIDOC EthereumBlobsTable: Description: - Provides schema and metadata for the 'blobs' column. - Source: https://doc-embed-app.chainbasehq.com/columns/ethereum.blobs SampleData: - Displays sample records from the 'blobs' table. - Source: https://doc-embed-app.chainbasehq.com/data/ethereum.blobs Usage: - Useful for understanding the structure and content of blob data on the Ethereum blockchain. ``` -------------------------------- ### Get ERC20 Transfers using Axios in JavaScript Source: https://docs.chainbase.com/platform/usecases/token-api/get-erc20-transfers-by-contract Shows how to fetch ERC20 token transfers via the Chainbase API using the `axios` library in JavaScript. Requires `axios` installation (`npm install axios`) and a Chainbase API key. Outputs transfer data to the console. ```javascript const axios = require('axios'); const network_id = '1'; // See https://docs.chainbase.com/reference/supported-chains to get the id of different chains. const contract_addr = '0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0'; // Take Matic Token's contract address as an example. const CHAINBASE_API_KEY = 'YOUR_API_KEY'; // Replace with your actual API key const options = { url: `https://api.chainbase.online/v1/token/transfers?chain_id=${network_id}&contract_address=${contract_addr}&page=1&limit=5`, method: 'GET', headers: { 'x-api-key': CHAINBASE_API_KEY, 'accept': 'application/json' } }; axios(options) .then(response => console.log(response.data.data)) .catch(error => console.log(error)); ``` -------------------------------- ### Configure Environment Variables Source: https://docs.chainbase.com/node/operator Sets up the `.env` file by copying the example configuration. This file is crucial for storing sensitive information and node-specific settings required for the operator. ```shell cp .env.example .env ``` -------------------------------- ### Get NFT Owners with Chainbase API using Axios (JavaScript) Source: https://docs.chainbase.com/platform/usecases/nft-api/get-nft-owners-by-collection Shows how to retrieve NFT owners for a collection via the Chainbase API using the `axios` library in JavaScript. Requires `axios` installation (`npm install axios`) and a Chainbase API key. Outputs owner data. ```JavaScript const network_id = '1'; // See https://docs.chainbase.com/reference/supported-chains to get the id of different chains. const contract_addr = '0xed5af388653567af2f388e6224dc7c4b3241c544'; // Take Azuki's contract address as an example. const axios = require('axios'); const options = { url: `https://api.chainbase.online/v1/nft/owners?chain_id=${network_id}&contract_address=${contract_addr}`, method: 'GET', headers: { 'x-api-key': CHAINBASE_API_KEY, // Replace the field with your API key. 'accept': 'application/json' } }; axios(options) .then(response => console.log(response.data.data)) .catch(error => console.log(error)); ``` -------------------------------- ### JWT Payload Component Example Source: https://docs.chainbase.com/api-reference/jtw An example of the JSON structure for a JWT payload, including the audience ('aud') for the token and its expiration time ('exp') in Unix timestamp format. ```json { "aud": "chainbase.com", "exp": 1690523501 } ``` -------------------------------- ### Ethereum Transactions Sample Data Source: https://docs.chainbase.com/catalog/OtherEvm/re.al Illustrates a sample dataset for Ethereum transactions, showing typical transaction records and their fields. ```HTML