### Example Node Log Output for Snapshot Initialization Source: https://docs.eosnetwork.com/docs/latest/node-operation/api-node Example output from the nodeos log file indicating the start and completion of initialization from a snapshot. This confirms successful snapshot restoration. ```text info 2023-08-15T23:15:55.395 nodeos controller.cpp:603 startup ] Starting initialization from snapshot and no block log, this may take a significant amount of time info 2023-08-15T23:15:55.707 nodeos controller.cpp:610 startup ] Snapshot loaded, lib: 92757487 info 2023-08-15T23:15:55.707 nodeos controller.cpp:613 startup ] Finished initialization from snapshot ... ``` -------------------------------- ### Install New Node Binary (DPKG) Source: https://docs.eosnetwork.com/docs/latest/node-operation/migration-guides/general-upgrade-guide Install the new node binary using DPKG, providing the filename of the .deb package. ```bash sudo dpkg -i .deb ``` -------------------------------- ### Get Account Response Sample Source: https://docs.eosnetwork.com/apis/spring/latest/chain.api Example of a successful response when requesting account details. ```json { "account_name": "string", "head_block_num": 0, "head_block_time": "string", "last_code_update": "string", "created": "string", "refund_request": { "owner": "string", "request_time": "string", "net_amount": "string", "cpu_amount": "string" }, "ram_quota": "string", "net_limit": { "max": "string", "available": "string", "used": "string" }, "cpu_limit": { "max": "string", "available": "string", "used": "string" }, "total_resources": { "owner": "string", "ram_bytes": "string", "net_weight": "string", "cpu_weight": "string" }, "core_liquid_balance": "string", "self_delegated_bandwidth": { "from": "string", "to": "string", "net_weight": "string", "cpu_weight": "string" }, "net_weight": "string", "cpu_weight": "string", "ram_usage": "string", "privileged": true, "permissions": [ { "parent": "string", "perm_name": "string", "required_auth": { "waits": [ { "wait_sec": 0, "weight": 0 } ], "keys": [ { "key": "string", "weight": 0 } ], "threshold": 0, "accounts": [ { "weight": 0, "permission": { "actor": "string", "permission": "string" } } ] } } ], "voter_info": { "owner": "string", "proxy": "string", "producers": [ "string" ], "staked": "string", "last_vote_weight": "string", "proxied_vote_weight": "string", "is_proxy": 0, "flags1": 0, "reserved2": 0, "reserved3": "string" } } ``` -------------------------------- ### Install New Node Binary (APT) Source: https://docs.eosnetwork.com/docs/latest/node-operation/migration-guides/general-upgrade-guide Install the new leap node binaries using APT, specifying the downloaded .deb file. ```bash sudo apt-get install -y ./leap[-_][0-9]*.deb ``` -------------------------------- ### Local get_info Endpoint Response Example Source: https://docs.eosnetwork.com/docs/latest/node-operation/api-node Example response from the local `get_info` endpoint, showing blockchain information. ```json { "server_version": "7e1ad13e", "chain_id": "73e4385a2708e6d7048834fbc1079f2fabb17b3c125b146af438971e90716c4d", ... "head_block_producer": "alohaeostest", "virtual_block_cpu_limit": 200000000, ... "earliest_available_block_num": 92757488, "last_irreversible_block_time": "2023-08-17T16:02:05.500" } ``` -------------------------------- ### Trace API Plugin Configuration Example Source: https://docs.eosnetwork.com/docs/latest/node-operation/getting-started/plugins/trace-api-plugin Example configuration for nodeos with trace_api_plugin, specifying trace directory and ABIs for Antelope reference contracts. ```bash nodeos --data-dir data_dir --config-dir config_dir --trace-dir traces_dir --plugin eosio::trace_api_plugin --trace-rpc-abi=eosio=abis/eosio.abi --trace-rpc-abi=eosio.token=abis/eosio.token.abi --trace-rpc-abi=eosio.msig=abis/eosio.msig.abi --trace-rpc-abi=eosio.wrap=abis/eosio.wrap.abi ``` -------------------------------- ### Install RabbitMQ Source: https://docs.eosnetwork.com/docs/latest/node-operation/history/build-hyperion-software-components Installs the latest version of RabbitMQ by adding its official repositories and then installing the server package. Ensure you have curl, gnupg, and apt-transport-https installed. ```bash > sudo apt update > sudo apt-get install curl gnupg apt-transport-https -y #Team RabbitMQ's main signing key# > curl -1sLf "https://keys.openpgp.org/vks/v1/by-fingerprint/0A9AF2115F4687BD29803A206B73A36E6026DFCA" | sudo gpg --dearmor | sudo tee /usr/share/keyrings/com.rabbitmq.team.gpg > /dev/null #Cloudsmith: modern Erlang repository# > curl -1sLf https://github.com/rabbitmq/signing-keys/releases/download/3.0/cloudsmith.rabbitmq-erlang.E495BB49CC4BBE5B.key | sudo gpg --dearmor | sudo tee /usr/share/keyrings/rabbitmq.E495BB49CC4BBE5B.gpg > /dev/null #Cloudsmith: RabbitMQ repository# > curl -1sLf https://github.com/rabbitmq/signing-keys/releases/download/3.0/cloudsmith.rabbitmq-server.9F4587F226208342.key | sudo gpg --dearmor | sudo tee /usr/share/keyrings/rabbitmq.9F4587F226208342.gpg > /dev/null -------------------------------------------------------------------- #Add apt repositories maintained by Team RabbitMQ# > sudo tee /etc/apt/sources.list.d/rabbitmq.list < sudo apt-get update -y #Install Erlang packages# > sudo apt-get install -y erlang-base \ erlang-asn1 erlang-crypto erlang-eldap erlang-ftp erlang-inets \ erlang-mnesia erlang-os-mon erlang-parsetools erlang-public-key \ erlang-runtime-tools erlang-snmp erlang-ssl \ erlang-syntax-tools erlang-tftp erlang-tools erlang-xmerl #Install rabbitmq-server and its dependencies# > sudo apt-get install rabbitmq-server -y --fix-missing **Check Version** > sudo rabbitmqctl version ``` -------------------------------- ### Get Block Info Response Sample Source: https://docs.eosnetwork.com/apis/spring/latest/chain.api Example of a successful response when requesting block info. ```json { "block_num": 0, "ref_block_num": 0, "id": "string", "timestamp": "string", "producer": "string", "confirmed": 0, "previous": "string", "transaction_mroot": "string", "action_mroot": "string", "schedule_version": 0, "producer_signature": "string", "ref_block_prefix": 0 } ``` -------------------------------- ### Install Redis Source: https://docs.eosnetwork.com/docs/latest/node-operation/history/build-hyperion-software-components Installs the latest stable version of Redis by adding its official repository and then installing the server package. Requires curl and gpg. ```bash > sudo apt install lsb-release curl gpg #Redis Signing Key# > curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg #Latest Redis repository# > echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list> sudo apt update #Install Redis# > sudo apt install redis **Check Version** > redis-server --version ``` -------------------------------- ### Install Testing Dependencies Source: https://docs.eosnetwork.com/docs/latest/smart-contracts/testing Install VeRT, Mocha, and Chai using npm. Ensure your package.json includes '"type": "module"' and a test script. ```bash npm install -D @vaulta/vert mocha chai ``` ```json "scripts": { "test": "mocha tests/**/*.spec.js" } ``` ```json { "name": "your-project", "version": "1.0.0", "type": "module", "scripts": { "test": "mocha tests/**/*.spec.js" }, "devDependencies": { "@vaulta/vert": "^0.3.24", "chai": "^4.3.10", "mocha": "^10.2.0" } } ``` -------------------------------- ### Install Kibana Source: https://docs.eosnetwork.com/docs/latest/node-operation/history/build-hyperion-software-components Installs the latest Kibana version, which should be paired with your installed Elasticsearch version. This process assumes prerequisites and the signing key are already added. ```bash sudo apt update sudo apt-get install apt-transport-https sudo apt install gpg #Elasticsearch signing key - Not needed if already added# wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo gpg --dearmor -o /usr/share/keyrings/elasticsearch-keyring.gpg #Latest Elasticsearch 8.x repository - Not needed if already added# echo "deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] https://artifacts.elastic.co/packages/8.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-8.x.list #Install Kibana# sudo apt update && sudo apt install kibana ``` -------------------------------- ### FuckYea Configuration for Network Deployment Source: https://docs.eosnetwork.com/docs/latest/quick-start/local-development Example configuration for deploying contracts, specifying the network chain and accounts with their private keys. ```javascript networks: { jungle: { chain: 'Jungle4', accounts: [ { name: 'youraccount', permission: 'owner', private_key: process.env.PRIVATE_KEY } ] } } ``` -------------------------------- ### Install Truffle Dependencies Source: https://docs.eosnetwork.com/evm/configure-tooling/truffle Install the `@truffle/hdwallet-provider` and `dotenv` packages using npm or yarn. ```bash npm install @truffle/hdwallet-provider dotenv ``` ```bash yarn add @truffle/hdwallet-provider dotenv ``` -------------------------------- ### Start the Indexer using pm2 Source: https://docs.eosnetwork.com/docs/latest/node-operation/history/running-hyperion Navigate to the Hyperion history API directory and start the eos-indexer using pm2. Ensure environment variables are updated. ```bash > cd ~/hyperion-history-api > pm2 start --only eos-indexer --update-env ``` -------------------------------- ### Semantic Versioning Example Source: https://docs.eosnetwork.com/evm/smart-contracts/contract-anatomy Illustrates the basic structure of Semantic Versioning: MAJOR.MINOR.PATCH. ```text .. 0.1.1 ``` -------------------------------- ### Start the EVM Miner Source: https://docs.eosnetwork.com/evm/miners-and-nodes/transaction-miner Execute this command to start the Vaulta EVM transaction miner after setting up the environment variables. ```bash yarn mine ``` -------------------------------- ### Enable Net API Plugin via Command Line Source: https://docs.eosnetwork.com/docs/latest/node-operation/getting-started/plugins/net-api-plugin Use this flag when starting nodeos to enable the net_api_plugin. ```bash nodeos ... --plugin eosio::net_api_plugin ``` -------------------------------- ### Install Elasticsearch 8.x Source: https://docs.eosnetwork.com/docs/latest/node-operation/history/build-hyperion-software-components Installs the latest Elasticsearch 8.x version using apt. Ensure you have the necessary prerequisites and the Elasticsearch signing key. ```bash sudo apt update sudo apt install apt-transport-https sudo apt install gpg #Elasticsearch signing key# wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo gpg --dearmor -o /usr/share/keyrings/elasticsearch-keyring.gpg #Latest Elasticsearch 8.x repository# echo "deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] https://artifacts.elastic.co/packages/8.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-8.x.list #Install Elasticsearch# sudo apt update && sudo apt install elasticsearch **Take note of the super-user password** ``` -------------------------------- ### Example Output of Key Generation Source: https://docs.eosnetwork.com/docs/latest/advanced-topics/managing-finalizer-keys This is an example of the output generated when creating a BLS finalizer key, showing the private key, public key, and proof of possession. ```text Private key: PVT_BLS_9-9ziZZzZcZZoiz-ZZzUtz9ZZ9u9Zo9aS9BZ-o9iznZfzUZU Public key: PUB_BLS_Se0dH9PzeGQaYHJ1F44qVNcGR2XXTiF5HcAO5rXjYxDutIckoWjRPoY2gBTFfvAA7g8H0Ce7__7yQ0BUFMQUBBWX6Y4ERasyhh8QHxCVXK9JZOw0ICNWPxXIJD_UDmILQ0kouA Proof of Possession: SIG_BLS_yenZIv6kbim2W1zntl73wxcSNWHFJS1DuMH7qAUFyCKOGBYWZXZYJb7MCr7503ULWiJTAwLUyjmSbXPw38BW9n6UE8r6MpjYKgxlSI2Ezuwzp-18sy_6StHbisSNLl0GtxmJ987ouO8gMvUDUO68cHhMbjRh9j2L790k4gCQS8gPON9OJgiIY9JgYraTB04FyAdpmc_3JCauU4nSwo3xYjS9NUVqgbuJR2lbQDjTPp5VR3z5OrOrNhaw2tewIkEJyxeZmg ``` -------------------------------- ### Example Node Log Output for Block Sync Source: https://docs.eosnetwork.com/docs/latest/node-operation/api-node Example output from the nodeos log file showing received blocks, including block number, producer, and latency. This helps verify active synchronization. ```text ... info 2023-08-15T23:16:04.797 nodeos producer_plugin.cpp:651 on_incoming_block ] Received block b9dd3609f8194902... #92772000 @ 2023-08-15T23:01:02.000 signed by jumpingfrogs [trxs: 0, lib: 92771671, confirmed: 0, net: 0, cpu: 1, elapsed: 55, time: 98, latency: 902797 ms] info 2023-08-15T23:16:05.367 nodeos producer_plugin.cpp:651 on_incoming_block ] Received block 0966e24d95ef120f... #92773000 @ 2023-08-15T23:09:22.000 signed by ivote4eosusa [trxs: 1, lib: 92772667, confirmed: 0, net: 120, cpu: 1253, elapsed: 175, time: 272, latency: 403367 ms] ... ``` -------------------------------- ### Start Hyperion API with PM2 Source: https://docs.eosnetwork.com/docs/latest/node-operation/history/running-hyperion Command to start the Hyperion API using PM2. This command ensures the API is running and its environment variables are updated. ```bash > pm2 start --only eos-api --update-env ``` -------------------------------- ### Enable Producer API Plugin via Command Line Source: https://docs.eosnetwork.com/docs/latest/node-operation/getting-started/plugins/producer-api-plugin Use this command-line argument to enable the producer_api_plugin when starting nodeos. ```bash # nodeos startup params nodeos ... --plugin eosio::producer_api_plugin ``` -------------------------------- ### Load Test Control Plugin via Command Line Source: https://docs.eosnetwork.com/docs/latest/node-operation/getting-started/plugins/test-control-plugin Load the test_control_plugin when starting nodeos from the command line. ```bash # command-line nodeos ... --plugin eosio::test_control_plugin ``` -------------------------------- ### Load Chain and HTTP Plugins via Command Line Source: https://docs.eosnetwork.com/docs/latest/node-operation/getting-started/plugins/chain-api-plugin This example demonstrates loading the required chain_plugin and http_plugin, along with their options, from the command line. ```bash # command-line nodeos ... --plugin eosio::chain_plugin [operations] [options] \ --plugin eosio::http_plugin [options] ``` -------------------------------- ### Load Producer Plugin in config.ini Source: https://docs.eosnetwork.com/docs/latest/node-operation/getting-started/plugins/producer-plugin Example of how to load the chain plugin, which includes the producer plugin, in the config.ini file. ```ini # config.ini plugin = eosio::chain_plugin [operations] [options] ``` -------------------------------- ### Create a New FuckYea Project Source: https://docs.eosnetwork.com/docs/latest/quick-start/local-development Use this command to initialize a new project. You can optionally specify a directory. ```bash fuckyea create [optional_directory] ``` -------------------------------- ### Project structure for multi-contract support Source: https://docs.eosnetwork.com/docs/latest/quick-start/local-development Example project structure demonstrating how to configure multiple contracts using the `.entry.cpp` suffix for distinct builds. ```text 📂 build 📄 game.abi 📄 game.wasm 📄 token.abi 📄 token.wasm 📂 contracts 📄 game.entry.cpp 📄 token.entry.cpp ``` -------------------------------- ### Get Block Response Sample Source: https://docs.eosnetwork.com/apis/spring/latest/trace_api.api Example of a successful 200 OK response from the get_block endpoint, showing the BlockTrace structure. ```json { "id": "string", "number": 0, "previous_id": "string", "status": "string", "timestamp": "string", "producer": "string", "transactions": [ { "id": "string", "actions": [ { "global_sequence": 0, "receiver": "string", "account": "string", "action": "string", "authorization": [ { "account": "string", "permission": "string" } ], "data": { } } ] } ] } ``` -------------------------------- ### Get Transaction Trace Response Sample Source: https://docs.eosnetwork.com/apis/spring/latest/trace_api.api Example of a successful 200 OK response from the get_transaction_trace endpoint, showing the TransactionTrace structure. ```json { "id": "string", "actions": [ { "global_sequence": 0, "receiver": "string", "account": "string", "action": "string", "authorization": [ { "account": "string", "permission": "string" } ], "data": { } } ] } ``` -------------------------------- ### Setup Vaulta Smart Contract Test File Source: https://docs.eosnetwork.com/docs/latest/smart-contracts/testing Import necessary modules, instantiate the blockchain emulator, load your contract, create accounts, and set up a beforeEach hook to reset tables before each test. ```javascript // tests/mycontract.spec.js import { Blockchain, nameToBigInt, expectToThrow } from "@vaulta/vert"; import { assert } from "chai"; // instantiate the blockchain emulator const blockchain = new Blockchain() // Load a contract const contract = blockchain.createContract( // The account to set the contract on 'accountname', // The path to the contract's wasm file 'build/yourcontract' ) // Create some accounts to work with const [alice, bob] = blockchain.createAccounts('alice', 'bob') // You can clear the tables in the // contract before each test beforeEach(async () => { blockchain.resetTables() }) describe('Testing Suite', () => { it('should do X', async () => { // Your test goes here... }); }); ``` -------------------------------- ### Single File Smart Contract Source: https://docs.eosnetwork.com/docs/latest/smart-contracts/contract-anatomy A basic example of a smart contract defined within a single C++ file. This is the simplest way to start and is commonly used. ```cpp #include CONTRACT singlefile : public eosio.contract { public: using contract::contract; ACTION test() { // ... } }; ``` -------------------------------- ### Load Net and HTTP Plugins via Command Line Source: https://docs.eosnetwork.com/docs/latest/node-operation/getting-started/plugins/net-api-plugin Start nodeos with flags to load the net_plugin and http_plugin, required for the net_api_plugin. ```bash nodeos ... --plugin eosio::net_plugin [options] \ --plugin eosio::http_plugin [options] ``` -------------------------------- ### Roborovski History API - Get Actions (V1 compatible) Source: https://docs.eosnetwork.com/docs/latest/node-operation/migration-guides/v1-history-alternatives Retrieves actions compatible with the V1 History API standard. This endpoint is designed for seamless integration with existing V1 History Plugin setups. ```APIDOC ## POST /v1/history/get_actions ### Description Retrieves actions compatible with the V1 History API standard. This endpoint is designed for seamless integration with existing V1 History Plugin setups. ### Method POST ### Endpoint `https://vaulta.greymass.com/v1/history/get_actions` ### Parameters #### Request Body (No specific request body fields are detailed in the source, but it is expected to contain parameters for filtering actions.) ### Response #### Success Response (200) (No specific response fields are detailed in the source, but it is expected to return action data.) ### Request Example (No request example provided in the source.) ### Response Example (No response example provided in the source.) ``` -------------------------------- ### Powering Up CPU & NET Resources Source: https://docs.eosnetwork.com/docs/latest/core-concepts/resources Use the `cleos push action` command to power up an account with CPU and NET resources. This action requires specifying the payer, receiver, duration in days, fractional net and CPU resources, and the maximum payment amount. ```bash cleos push action core.vaulta powerup '[user, user, 1, 10000000000000, 10000000000000, "1000.0000 A"]' -p user ``` -------------------------------- ### Load Producer Plugin via Command-Line Source: https://docs.eosnetwork.com/docs/latest/node-operation/getting-started/plugins/producer-plugin Example of how to load the chain plugin, which includes the producer plugin, using the nodeos command-line interface. ```bash # command-line nodeos ... --plugin eosio::chain_plugin [operations] [options] ``` -------------------------------- ### Install PM2 Source: https://docs.eosnetwork.com/docs/latest/node-operation/history/build-hyperion-software-components Installs the latest version of PM2 globally using npm. Ensure Node.js and npm are installed prior to running this command. ```bash > sudo apt update #Install PM2# > sudo npm install pm2@latest -g **Check Version** > pm2 -v ``` -------------------------------- ### Peer Setup using Command-Line Arguments Source: https://docs.eosnetwork.com/docs/latest/node-operation/getting-started/peering Configure peering connections by providing arguments directly to the `nodeos` command when launching your instance. This method allows for dynamic configuration of peer connections. ```bash nodeos ... \ p2p-listen-endpoint = : \ p2p-server-address = : \ p2p-peer-address = : \ p2p-peer-address = : \ ... ``` -------------------------------- ### Install Node.js v18 Source: https://docs.eosnetwork.com/docs/latest/node-operation/history/build-hyperion-software-components Installs Node.js version 18, the current LTS, by adding the Nodesource repository and then installing the nodejs package. Requires ca-certificates, curl, and gnupg. ```bash #Download and import the Nodesource GPG key# > sudo apt update > sudo apt install -y ca-certificates curl gnupg > sudo mkdir -p /etc/apt/keyrings > curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg #Create .deb repository# > NODE_MAJOR=18 > echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list #Install Node.js# > sudo apt update > sudo apt-get install -y nodejs **Check Version** > node -v ``` -------------------------------- ### Enable Producer Plugin via nodeos Startup Parameters Source: https://docs.eosnetwork.com/docs/latest/node-operation/getting-started/plugins/producer-plugin Alternatively, enable the producer_plugin using command-line arguments during nodeos startup. ```bash # nodeos startup params nodeos ... -- plugin eosio::producer_plugin [options] ``` -------------------------------- ### Example Inscription Data URI Source: https://docs.eosnetwork.com/evm/advanced-guides/inscriptions An example of how an inscription JSON can be formatted as a data URI. ```plaintext data:,{"p":"eorc-20","op":"deploy","tick":"orcs","max":"420420","lim":"69"} ``` -------------------------------- ### Buy RAM with Vaulta tokens using Wharfkit Source: https://docs.eosnetwork.com/docs/latest/advanced-topics/upgrading-to-vaulta Example using Wharfkit to buy RAM with 'A' tokens, demonstrating the use of the new token symbol with system contract actions. ```javascript await session.transact({ action: { account: "core.vaulta", name: "buyram", authorization: [session.permissionLevel], data: { payer: session.actor, receiver: session.actor, quant: "1.0000 A" }, }, }) ``` -------------------------------- ### Instantiate Singleton Table Source: https://docs.eosnetwork.com/docs/latest/smart-contracts/state-data Demonstrates how to instantiate a singleton table, providing the contract owner and scope as constructor arguments. ```cpp name thisContract = get_self(); config_table configs(thisContract, thisContract.value); ``` -------------------------------- ### Token Transfer Action (Example) Source: https://docs.eosnetwork.com/docs/latest/guides/linked-actions-pattern This is a basic example of a token transfer action. It includes checks to ensure the recipient is valid. ```cpp ACTION transfer(name from, name to, asset quantity, string memo){ // ... require_recipient( from ); require_recipient( to ); // ... } ``` -------------------------------- ### Example ABI Struct Definition Source: https://docs.eosnetwork.com/docs/latest/advanced-topics/understanding-ABI-files An example of a struct definition within an ABI, showing the 'newuser' struct with its 'account' field. ```json { "name": "newuser", "base": "", "fields": [ { "name": "account", "type": "name" } ] } ``` -------------------------------- ### Deploy Contract using Deployment File Source: https://docs.eosnetwork.com/docs/latest/quick-start/local-development Example of a deployment script that deploys a contract using the provided deployer object. Includes error handling and optional contract code addition. ```javascript module.exports = async (deployer) => { const contract = await deployer.deploy('someaccount', 'build/mycontract', { // Allows the contract to be able to send tokens from itself addCode: true }).catch(err => { console.error(err) process.exit(1); }) // do other stuff here... } ``` -------------------------------- ### Event Receiver and Record Action (Initial) Source: https://docs.eosnetwork.com/docs/latest/guides/linked-actions-pattern This shows an initial setup for an event receiver that listens for a specific token transfer and a subsequent record action. It does not yet implement the linked-actions pattern logic. ```cpp #include [[eosio::on_notify("core.vaulta::transfer")]] void on_transfer(name from, name to, asset quantity, string memo){ // ... } ACTION record(name from, uint64_t internal_id, uint8_t status){ // ... } ``` -------------------------------- ### Clone Miner Repository and Install Dependencies Source: https://docs.eosnetwork.com/evm/miners-and-nodes/transaction-miner Clone the eos-evm-miner repository from GitHub and install the necessary project dependencies using yarn. ```bash git clone https://github.com/vaultafoundation/eos-evm-miner.git cd eos-evm-miner yarn ``` -------------------------------- ### Install Zstd Archiver Source: https://docs.eosnetwork.com/docs/latest/node-operation/api-node Installs the zstd archiver, which is required to decompress snapshot files. This command is typically run on Debian-based systems. ```bash sudo apt install zstd ``` -------------------------------- ### Load Chain and HTTP Plugins via Command-Line Source: https://docs.eosnetwork.com/docs/latest/node-operation/getting-started/plugins/prometheus-plugin Load the chain and HTTP plugins using command-line arguments for nodeos. ```bash nodeos ... --plugin eosio::chain_plugin [operations] [options] \ --plugin eosio::http_plugin [options] ``` -------------------------------- ### Manage Elasticsearch Service with Systemctl Source: https://docs.eosnetwork.com/docs/latest/node-operation/history/configure-hyperion-software-components Commands to reload systemd units, start the Elasticsearch service, and enable it to start automatically on boot. ```bash #Reload Units > sudo systemctl daemon-reload #Start Elasticsearch > sudo systemctl start elasticsearch.service #Start Elasticsearch automatically on boot > sudo systemctl enable elasticsearch.service ``` -------------------------------- ### Peer Setup using config.ini Source: https://docs.eosnetwork.com/docs/latest/node-operation/getting-started/peering Configure your node's `config.ini` file to establish peering connections before launching the `nodeos` instance. Specify listening endpoints, server addresses, and addresses of peers to connect to. ```ini # your listening host:port p2p-listen-endpoint = : # e.g. 0.0.0.0:9876 # your public host:port p2p-server-address = : # e.g. p2p.vaulta99.io:9876 # peers host:port (for each peer to connect to) p2p-peer-address = : # e.g. peer.leap.sg:9876 p2p-peer-address = : # e.g. p2p.vaultaphere.io:3571 # etc. ``` -------------------------------- ### Get Singleton Data (Get or Create) Source: https://docs.eosnetwork.com/docs/latest/smart-contracts/state-data Retrieves data from a singleton table, creating and persisting a default value if the data does not exist. ```cpp ConfigModel config = configs.get_or_create(ConfigModel{ .is_active = true }); ``` -------------------------------- ### Create a New Vaulta Project Source: https://docs.eosnetwork.com/docs/latest/quick-start/introduction Use this command to initialize a new Vaulta project locally. Follow the prompts to select your preferred frontend and project structure. ```bash npm create vaulta@latest myproject ``` -------------------------------- ### Load DB Size API Plugin via Command Line Source: https://docs.eosnetwork.com/docs/latest/node-operation/getting-started/plugins/db-size-api-plugin Alternatively, load the db_size_api_plugin using command-line arguments with nodeos. ```bash # command-line nodeos ... --plugin eosio::db_size_api_plugin ``` -------------------------------- ### Example ABI Table Definition Source: https://docs.eosnetwork.com/docs/latest/advanced-topics/understanding-ABI-files An example of a filled-out table definition in an ABI, specifying 'accounts' table with its type, index, and key details. ```json { "name": "accounts", "type": "account", // Corresponds to previously defined struct "index_type": "i64", "key_names" : ["primary_key"], "key_types" : ["uint64"] } ``` -------------------------------- ### Get Singleton Data (Get or Fail) Source: https://docs.eosnetwork.com/docs/latest/smart-contracts/state-data Retrieves data from a singleton table, throwing an error if the data does not exist. Includes a check for existence. ```cpp if (!configs.exists()) { // handle error } ConfigModel config = configs.get(); bool isActive = config.is_active; ``` -------------------------------- ### Load Chain and HTTP Plugins in config.ini Source: https://docs.eosnetwork.com/docs/latest/node-operation/getting-started/plugins/chain-api-plugin This example shows how to load the necessary dependencies, chain_plugin and http_plugin, in the config.ini file before loading the chain_api_plugin. ```ini # config.ini plugin = eosio::chain_plugin [options] plugin = eosio::http_plugin [options] ``` -------------------------------- ### Print Build Information to Console Source: https://docs.eosnetwork.com/docs/latest/node-operation/getting-started/plugins/chain-plugin Use `--print-build-info` to display build environment information as JSON in the console and exit. ```bash --print-build-info ``` -------------------------------- ### Example Transaction Trace Result Source: https://docs.eosnetwork.com/docs/latest/node-operation/tutorials/watching-transfers This is an example of the JSON output you can expect when fetching a transaction trace. It includes details about the transaction, its actions, status, and header. ```json { "id": "d11dc29013e40c5f132b1ae507622eaba6ab01e1e3ac1ecc875b7a80fdc72233", "block_num": 21, "block_time": "2023-06-02T15:15:33.500", "producer_block_id": null, "actions": [ { "global_sequence": 51, "receiver": "eosio.dex", "account": "eosio.dex", "action": "withdraw", "authorization": [ { "account": "bob", "permission": "active" } ], "data": "0000000000000e3da08601000000000004454f530000000000a6823403ea305506313233343536", "return_value": "" }, { "global_sequence": 52, "receiver": "eosio.token", "account": "eosio.token", "action": "transfer", "authorization": [ { "account": "eosio.dex", "permission": "active" } ], "data": "0000e82a01ea305500a6823403ea3055a08601000000000004454f530000000006313233343536", "return_value": "", "params": { "from": "eosio.dex", "to": "eosio.token", "quantity": "10.0000 EOS", "memo": "123456" } }, { "global_sequence": 53, "receiver": "eosio.dex", "account": "eosio.token", "action": "transfer", "authorization": [ { "account": "eosio.dex", "permission": "active" } ], "data": "0000e82a01ea305500a6823403ea3055a08601000000000004454f530000000006313233343536", "return_value": "", "params": { "from": "eosio.dex", "to": "eosio.token", "quantity": "10.0000 EOS", "memo": "123456" } } ], "status": "executed", "cpu_usage_us": 187, "net_usage_words": 17, "signatures": [ "SIG_K1_JwowShN9caNF4PeX3oMN3PCwKqbfLKz3f1noURuftDSvEd9RiMdY4HGk2kbVJjN47QKcFJSFMh1Yf6uZAfYRxay8iWprzF" ], "transaction_header": { "expiration": "2023-06-02T15:16:03", "ref_block_num": 19, "ref_block_prefix": 3497594715, "max_net_usage_words": 0, "max_cpu_usage_ms": 0, "delay_sec": 0 } } ``` -------------------------------- ### Load Chain API Plugin via Command Line Source: https://docs.eosnetwork.com/docs/latest/node-operation/getting-started/plugins/chain-api-plugin Alternatively, you can load the chain API plugin directly from the command line when starting nodeos. ```bash # command-line nodeos ... --plugin eosio::chain_api_plugin ``` -------------------------------- ### Struct Packing for Efficiency Source: https://docs.eosnetwork.com/evm/smart-contracts/state-data Compares a 'good' example of a tightly packed struct with a 'bad' example of a loosely packed struct, highlighting efficiency differences. ```solidity // Good struct MyStruct { uint32 a; uint32 b; uint64 c; uint128 d; uint256 e; } // Bad struct MyStruct { uint32 a; uint64 b; uint256 c; uint32 d; uint128 e; } ``` -------------------------------- ### Enable Trace API Plugin via Command Line Source: https://docs.eosnetwork.com/docs/latest/node-operation/getting-started/plugins/trace-api-plugin The trace_api_plugin can also be enabled using command-line arguments when starting nodeos. ```bash # command-line nodeos ... --plugin eosio::trace_api_plugin [options] ``` -------------------------------- ### Example get_table_rows Result Source: https://docs.eosnetwork.com/docs/latest/web-applications/reading-state This is an example of the JSON output from the get_table_rows function, showing retrieved rows with 'owner' and 'hash' fields, along with pagination information. ```json { "rows": [ { "owner": "eosio", "hash": "00e166885b16bcce50fea9ea48b6bd79434cb845e8bc93cf356ff787e445088c" }, { "owner": "eosio.assert", "hash": "aad0ac9f3f3d8f71841d82c52080f99479e869cbde5794208c9cd08e94b7eb0f" }, { "owner": "eosio.evm", "hash": "9f238b42f5a4be3b7f97861f90d00bbfdae03e707e5209a4c22d70dfbe3bcef7" } ], "more": true, "next_key": "6138663584080503808" } ``` -------------------------------- ### Create a new deployment scaffold Source: https://docs.eosnetwork.com/docs/latest/quick-start/local-development Use this command to scaffold a new deployment for a specified network. An optional directory can be provided. ```bash npx fuckyea scaffold deployment [optional_directory] ``` -------------------------------- ### Example of a Failing Batched JSON-RPC Request Source: https://docs.eosnetwork.com/evm/miscellaneous/json-rpc-compatibility This example demonstrates a batched request body that will result in a 400 error because batched requests are not currently supported. ```json [{"method":"eth_chainId","params":[],"id":1,"jsonrpc":"2.0"},{"method":"eth_blockNumber","params":[],"id":2,"jsonrpc":"2.0"}] ``` -------------------------------- ### Example Smart Contract Source: https://docs.eosnetwork.com/docs/latest/advanced-topics/understanding-ABI-files This C++ code defines a simple EOSIO smart contract with a user table and a newuser action. It serves as the source for generating an ABI file. ```cpp CONTRACT mycontract : public contract { public: using contract::contract; TABLE user { name account; uint8_t is_admin; uint64_t primary_key() const { return account.value; } }; using user_table = eosio::multi_index<"users"_n, user>; ACTION newuser( name account ){} }; ``` -------------------------------- ### Enable producer_api_plugin Source: https://docs.eosnetwork.com/docs/latest/node-operation/migration-guides/upgrade-guide-spring-1-0 Enable the producer_api_plugin by passing `--plugin eosio::producer_api_plugin` on the command line or `plugin = eosio::producer_api_plugin` in the config file. This is required for the next step. ```bash Pass --plugin eosio::producer_api_plugin on the command line, or plugin = eosio::producer_api_plugin in the config file ``` -------------------------------- ### Get Singleton Data (Get or Default) Source: https://docs.eosnetwork.com/docs/latest/smart-contracts/state-data Retrieves data from a singleton table, returning a default value if the data does not exist. The default value is not persisted. ```cpp ConfigModel config = configs.get_or_default(ConfigModel{ .is_active = true }); ``` -------------------------------- ### Load Chain and HTTP Plugins via Command Line Source: https://docs.eosnetwork.com/docs/latest/node-operation/getting-started/plugins/db-size-api-plugin Load the chain_plugin and http_plugin dependencies for the db_size_api_plugin using command-line arguments. ```bash # command-line nodeos ... --plugin eosio::chain_plugin [operations] [options] \ --plugin eosio::http_plugin [options] ``` -------------------------------- ### Sample config.ini Configuration Source: https://docs.eosnetwork.com/docs/latest/node-operation/getting-started/configuration This is a sample config.ini file demonstrating common settings for nodeos, including access control, agent name, block production, producer identification, signature providers, and enabling various plugins. ```ini # Specify the Access-Control-Allow-Origin to be returned on each request (eosio::http_plugin) access-control-allow-origin = * # The name supplied to identify this node amongst the peers. (eosio::net_plugin) agent-name = "Vaulta Test Agent" # Enable block production, even if the chain is stale. (eosio::producer_plugin) enable-stale-production = true # ID of producer controlled by this node (e.g. inita; may specify multiple times) (eosio::producer_plugin) producer-name = eosio # Key=Value pairs in the form = # Where: # is a string form of a vaild Vaulta public key # # is a string in the form : # # is KEY, KEOSD, or SE # # KEY: is a string form of a valid Vaulta private key which maps to the provided public key # # KEOSD: is the URL where keosd is available and the approptiate wallet(s) are unlocked # # (eosio::producer_plugin) signature-provider = EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV=KEY:5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3 # Use to indicate that the RPC responses will not use ABIs. # Failure to specify this option when there are no trace-rpc-abi configuations will result in an Error. # This option is mutually exclusive with trace-rpc-api (eosio::trace_api_plugin) trace-no-abis = true # Plugin(s) to enable, may be specified multiple times plugin = eosio::producer_plugin plugin = eosio::producer_api_plugin plugin = eosio::chain_plugin plugin = eosio::chain_api_plugin plugin = eosio::http_plugin plugin = eosio::state_history_plugin plugin = eosio::net_plugin plugin = eosio::net_api_plugin plugin = eosio::trace_api_plugin ``` -------------------------------- ### DB Size API Get Request Payload Source: https://docs.eosnetwork.com/apis/spring/latest/db_size.api This is the request payload for the DB Size API's get operation. It is sent with the 'application/json' content type. ```json { } ``` -------------------------------- ### Database Filler Arguments Source: https://docs.eosnetwork.com/docs/latest/node-operation/getting-started/snapshots Arguments for starting a database filler when using a snapshot. On subsequent runs, omit --fpg-create and --fill-skip-to. ```bash ... --fpg-create --fill-skip-to --fill-trim ```