### Example Nodeos Output Source: https://github.com/antelopeio/spring/blob/main/docs/01_nodeos/02_usage/03_development-environment/01_local-multi-node-testnet.md This is example output from a newly started node, showing producer and network plugin activity. It may differ based on timing and previous actions. ```console 2393147ms thread-0 producer_plugin.cpp:176 plugin_startup ] producer plugin: plugin_startup() end 2393157ms thread-0 net_plugin.cpp:1271 start_sync ] Catching up with chain, our last req is 0, theirs is 8249 peer dhcp15.ociweb.com:9876 - 295f5fd 2393158ms thread-0 chain_controller.cpp:1402 validate_block_heade ] head_block_time 2018-03-01T12:00:00.000, next_block 2018-04-05T22:31:08.500, block_interval 500 2393158ms thread-0 chain_controller.cpp:1404 validate_block_heade ] Did not produce block within block_interval 500ms, took 3061868500ms) 2393512ms thread-0 producer_plugin.cpp:241 block_production_loo ] Not producing block because production is disabled until we receive a recent block (see: --enable-stale-production) 2395680ms thread-0 net_plugin.cpp:1385 recv_notice ] sync_manager got last irreversible block notice 2395680ms thread-0 net_plugin.cpp:1271 start_sync ] Catching up with chain, our last req is 8248, theirs is 8255 peer dhcp15.ociweb.com:9876 - 295f5fd 2396002ms thread-0 producer_plugin.cpp:226 block_production_loo ] Previous result occurred 5 times 2396002ms thread-0 producer_plugin.cpp:244 block_production_loo ] Not producing block because it isn't my turn, its eosio ``` -------------------------------- ### Install Spring using make Source: https://github.com/antelopeio/spring/blob/main/README.md Install the Spring project using the make install command. Omit sudo if running in a Docker container. ```bash sudo make install ``` -------------------------------- ### Cleos Wallet Open Output Example Source: https://github.com/antelopeio/spring/blob/main/docs/02_cleos/03_command-reference/wallet/open.md Example output when a wallet is successfully opened. ```console Opened: default ``` -------------------------------- ### Nodeos Example: Starting a Block Producing Node Source: https://github.com/antelopeio/spring/blob/main/docs/01_nodeos/02_usage/01_nodeos-configuration.md This command starts a producing node with block production enabled, specifies the producer name, sets data and configuration directories, loads essential plugins, and configures options for chain, HTTP, and state history plugins. It also redirects output to a log file and runs in the background. ```sh nodeos \ -e -p eosio \ --data-dir /users/mydir/eosio/data \ --config-dir /users/mydir/eosio/config \ --plugin eosio::producer_plugin \ --plugin eosio::chain_plugin \ --plugin eosio::http_plugin \ --plugin eosio::state_history_plugin \ --contracts-console \ --access-control-allow-origin='*' \ --http-validate-host=false \ --verbose-http-errors \ --state-history-dir /shpdata \ --trace-history \ --chain-state-history \ >> nodeos.log 2>&1 & ``` -------------------------------- ### Copy and Install Executable Source: https://github.com/antelopeio/spring/blob/main/programs/cleos/CMakeLists.txt Copies the built executable to the installation's binary directory and installs it as a component named 'base'. ```cmake copy_bin( ${CLI_CLIENT_EXECUTABLE_NAME} ) install( TARGETS ${CLI_CLIENT_EXECUTABLE_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} COMPONENT base ) ``` -------------------------------- ### Running WAVM Examples Source: https://github.com/antelopeio/spring/blob/main/libraries/wasm-jit/README.md Execute sample WebAssembly programs using the `wavm` command. These examples cover basic functionality, benchmarking, and specific libraries like zlib. ```bash wavm Test/wast/helloworld.wast ``` ```bash wavm Test/Benchmark/Benchmark.wast ``` ```bash wavm Test/zlib/zlib.wast ``` -------------------------------- ### Keystore Signing and Installation Source: https://github.com/antelopeio/spring/blob/main/programs/keosd/CMakeLists.txt Applies signing to the keystore executable and copies it to the installation directory. This ensures the executable is properly signed and placed for runtime. ```cmake mas_sign(${KEY_STORE_EXECUTABLE_NAME}) copy_bin( ${KEY_STORE_EXECUTABLE_NAME} ) install( TARGETS ${KEY_STORE_EXECUTABLE_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} COMPONENT base ) ``` -------------------------------- ### Install Spring using apt-get Source: https://github.com/antelopeio/spring/blob/main/README.md Install the Spring binary package using apt-get. Ensure you update your package list first. Omit sudo if running in a Docker container. ```bash sudo apt-get update sudo apt-get install -y ./spring_*.deb ``` -------------------------------- ### Install Dependencies and Run Bios Boot Tutorial Source: https://github.com/antelopeio/spring/blob/main/tutorials/bios-boot-tutorial/README.md Installs the numpy package, clones the spring repository, and then executes the bios-boot-tutorial.py script. Ensure that cleos, nodeos, and keosd are in your PATH, and provide the correct paths for core and vaulta contracts. ```bash pip install numpy cd ~ git clone -b release/*latest* https://github.com/AntelopeIO/spring cd ./spring/tutorials/bios-boot-tutorial/ python3 bios-boot-tutorial.py --cleos=cleos --nodeos=nodeos --keosd=keosd --core-contracts-dir="${CORE_CONTRACTS_DIRECTORY}" --vaulta-contracts-dir="${VAULTA_CONTRACTS_DIRECTOR}" --symbol="EOS" -w -a ``` -------------------------------- ### Install Executable Source: https://github.com/antelopeio/spring/blob/main/programs/nodeos/CMakeLists.txt Installs the executable to the runtime directory. This command is part of the CMake installation process. ```cmake install( TARGETS ${NODE_EXECUTABLE_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} COMPONENT base ) ``` -------------------------------- ### Example Output of Account Creation Source: https://github.com/antelopeio/spring/blob/main/docs/02_cleos/02_how-to-guides/how-to-create-an-account.md This is an example of the output you might see after successfully executing the `cleos create account` command. It confirms the transaction execution and provides details about the transaction. ```console executed transaction: 4d65a274de9f809f9926b74c3c54aadc0947020bcfb6dd96043d1bcd9c46604c 200 bytes 166 us # eosio <= eosio::newaccount {"creator":"eosio","name":"bob","owner":{"threshold":1,"keys":[{"key":"EOS87TQktA5RVse2EguhztfQVEh6X... warning: transaction executed locally, but may not be confirmed by the network yet ] ``` -------------------------------- ### Node Info Output Example Source: https://github.com/antelopeio/spring/blob/main/docs/01_nodeos/02_usage/03_development-environment/00_local-single-node-testnet.md Example JSON output from the `cleos get info` command, detailing the blockchain's state and configuration. ```json { "server_version": "0f9df63e", "chain_id": "cf057bbfb72640471fd910bcb67639c22df9f92470936cddc1ade0e2f2e7dc4f", "head_block_num": 134, "last_irreversible_block_num": 133, "last_irreversible_block_id": "00000085060e9872849ef87bef3b19ab07de9faaed71154510c7f0aeeaddae2c", "head_block_id": "000000861e3222dce1c7c2cfb938940d8aac22c816cc8b0b89f6bf65a8ad5bdc", "head_block_time": "2019-11-18T22:13:10.500", "head_block_producer": "eosio", "virtual_block_cpu_limit": 228396, "virtual_block_net_limit": 1197744, "block_cpu_limit": 199900, "block_net_limit": 1048576, "server_version_string": "v2.0.0-rc2", "fork_db_head_block_num": 134, "fork_db_head_block_id": "000000861e3222dce1c7c2cfb938940d8aac22c816cc8b0b89f6bf65a8ad5bdc", "server_full_version_string": "v2.0.0-rc2-0f9df63e1eca4dda4cb7df30683f4a1220599444" } ``` -------------------------------- ### Install Executable and Libraries Source: https://github.com/antelopeio/spring/blob/main/plugins/trace_api_plugin/utils/CMakeLists.txt Installs the trace_api_util executable to the runtime directory and its associated libraries to the library directory. This ensures the built targets are placed in standard locations after installation. ```cmake copy_bin( trace_api_util ) install( TARGETS trace_api_util COMPONENT base RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR} ) ``` -------------------------------- ### Install EOSIO Chain Library and Headers Source: https://github.com/antelopeio/spring/blob/main/libraries/chain/CMakeLists.txt Configures the installation of the 'eosio_chain' library and its header files. This specifies the destination directories and components for installation, typically for development purposes. ```cmake install( TARGETS eosio_chain RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} COMPONENT dev EXCLUDE_FROM_ALL LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR} COMPONENT dev EXCLUDE_FROM_ALL ARCHIVE DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR} COMPONENT dev EXCLUDE_FROM_ALL ) install( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/eosio/chain/ DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/eosio/chain COMPONENT dev EXCLUDE_FROM_ALL FILES_MATCHING PATTERN "*.hpp" PATTERN "*.h" EXCLUDE ) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/eosio/chain/core_symbol.hpp DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/eosio/chain COMPONENT dev EXCLUDE_FROM_ALL) ``` -------------------------------- ### Example: Delegate Network Bandwidth Source: https://github.com/antelopeio/spring/blob/main/docs/02_cleos/02_how-to-guides/how-to-delegate-net-resource.md This example demonstrates delegating 0.01 SYS network bandwidth from the 'bob' account to the 'alice' account. Ensure 'bob' has sufficient balance to cover the stake. ```sh cleos system delegatebw bob alice "0.01 SYS" "0 SYS" ``` ```text executed transaction: 5487afafd67bf459a20fcc2dbc5d0c2f0d1f10e33123eaaa07088046fd18e3ae 192 bytes 503 us # eosio <= eosio::delegatebw {"from":"bob","receiver":"alice","stake_net_quantity":"0.0100 SYS","stake_cpu_quantity":"0.0000 SYS"... # eosio.token <= eosio.token::transfer {"from":"bob","to":"eosio.stake","quantity":"0.0010 SYS","memo":"stake bandwidth"} # bob <= eosio.token::transfer {"from":"bob","to":"eosio.stake","quantity":"0.0010 SYS","memo":"stake bandwidth"} # eosio.stake <= eosio.token::transfer {"from":"bob","to":"eosio.stake","quantity":"0.0010 SYS","memo":"stake bandwidth"} ``` -------------------------------- ### Starting a Local Testnet Node Source: https://context7.com/antelopeio/spring/llms.txt Instructions on how to start a single-node testnet using the `nodeos` daemon, enabling block production and essential plugins. Includes verification steps using `curl` and `cleos`. ```APIDOC ## Starting a Local Testnet Node The `nodeos` daemon is the core service that processes smart contracts, validates transactions, produces blocks, and maintains blockchain state. ```bash # Start a single-node testnet with block production enabled nodeos -e -p eosio \ --plugin eosio::chain_api_plugin \ --plugin eosio::http_plugin \ --plugin eosio::producer_plugin \ --http-server-address 127.0.0.1:8888 # Example output when blocks are being produced: # eosio generated block 046b9984... #101527 @ 2024-01-15T14:24:58.000 with 0 trxs # eosio generated block 5e527ee2... #101528 @ 2024-01-15T14:24:58.500 with 0 trxs # Verify node is running curl http://127.0.0.1:8888/v1/chain/get_info # Response: # { # "server_version": "7451e092", # "head_block_num": 134, # "last_irreversible_block_num": 133, # "head_block_producer": "eosio", # "chain_id": "cf057bbfb72640471fd910bcb67639c22df9f92470936cddc1ade0e2f2e7dc4f" # } ``` ``` -------------------------------- ### Cleos Version Output Example Source: https://github.com/antelopeio/spring/blob/main/docs/02_cleos/03_command-reference/version/index.md This is an example of the output you can expect when querying the cleos client version. ```console Build version: 7f854a61 ``` -------------------------------- ### Install WAVM Include Directory Source: https://github.com/antelopeio/spring/blob/main/libraries/wasm-jit/CMakeLists.txt Installs the WAVM Include directory to the system's include path for development components. ```cmake install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Include/ DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/wasm-jit COMPONENT dev EXCLUDE_FROM_ALL) ``` -------------------------------- ### Verify Spring Installation Source: https://github.com/antelopeio/spring/blob/main/README.md Confirm that Spring has been installed correctly by checking its full version. The output should be a semantic version string followed by a git commit hash. ```bash nodeos --full-version ``` -------------------------------- ### Install Spring Binary Package Source: https://github.com/antelopeio/spring/blob/main/README.md Install the Spring binary package using apt-get after downloading the .deb file. Adjust the path if your download location differs. Omit sudo if running in an Ubuntu docker container as root. ```bash sudo apt-get update sudo apt-get install -y ~/Downloads/spring*.deb ``` -------------------------------- ### Configure and Install Spring Configuration Files Source: https://github.com/antelopeio/spring/blob/main/CMakeLists.txt Configures and installs CMake configuration files for Spring. Ensure the CMAKE_INSTALL_FULL_LIBDIR and CMAKE_INSTALL_FULL_DATAROOTDIR variables are correctly set. ```cmake configure_file(${CMAKE_SOURCE_DIR}/CMakeModules/spring-config.cmake.in ${CMAKE_BINARY_DIR}/modules/spring-config.cmake @ONLY) install(FILES ${CMAKE_BINARY_DIR}/modules/spring-config.cmake DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/cmake/spring COMPONENT dev EXCLUDE_FROM_ALL) install(FILES ${CMAKE_BINARY_DIR}/modules/EosioTester.cmake DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/cmake/spring COMPONENT dev EXCLUDE_FROM_ALL) install(FILES ${CMAKE_SOURCE_DIR}/CMakeModules/EosioCheckVersion.cmake DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/cmake/spring COMPONENT dev EXCLUDE_FROM_ALL) ``` -------------------------------- ### Install Bash Completion Files Source: https://github.com/antelopeio/spring/blob/main/CMakeLists.txt Installs the bash completion files for spring-util. These files provide command-line autocompletion for the utility. ```cmake install(FILES libraries/cli11/bash-completion/completions/spring-util DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/bash-completion/completions COMPONENT base) ``` -------------------------------- ### Install ChainBase Library and Headers Source: https://github.com/antelopeio/spring/blob/main/libraries/chaindb/CMakeLists.txt These CMake commands specify the installation directories for the ChainBase library files and header files. ```cmake install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/chainbase DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR} COMPONENT dev EXCLUDE_FROM_ALL) install(TARGETS chainbase LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR} COMPONENT dev EXCLUDE_FROM_ALL ARCHIVE DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR} COMPONENT dev EXCLUDE_FROM_ALL) ``` -------------------------------- ### Start Wallet Manager (keosd) Source: https://github.com/antelopeio/spring/blob/main/docs/01_nodeos/02_usage/03_development-environment/01_local-multi-node-testnet.md Starts the `keosd` wallet management application. Ensure it's listening on the correct port (default 8899) before proceeding. ```sh keosd --http-server-address 127.0.0.1:8899 ``` -------------------------------- ### Example: Delegate 0.01 SYS CPU Bandwidth Source: https://github.com/antelopeio/spring/blob/main/docs/02_cleos/02_how-to-guides/how-to-delegate-CPU-resource.md Example of delegating 0.01 SYS CPU bandwidth from 'bob' to 'alice'. The output shows the executed transaction details and involved contract actions. ```sh cleos system delegatebw bob alice "0 SYS" "0.01 SYS" ``` ```text executed transaction: 5487afafd67bf459a20fcc2dbc5d0c2f0d1f10e33123eaaa07088046fd18e3ae 192 bytes 503 us # eosio <= eosio::delegatebw {"from":"bob","receiver":"alice","stake_net_quantity":"0.0000 SYS","stake_cpu_quantity":"0.0100 SYS"... # eosio.token <= eosio.token::transfer {"from":"bob","to":"eosio.stake","quantity":"0.0010 SYS","memo":"stake bandwidth"} # bob <= eosio.token::transfer {"from":"bob","to":"eosio.stake","quantity":"0.0010 SYS","memo":"stake bandwidth"} # eosio.stake <= eosio.token::transfer {"from":"bob","to":"eosio.stake","quantity":"0.0010 SYS","memo":"stake bandwidth"} ``` -------------------------------- ### Node Configuration Example (config.ini) Source: https://context7.com/antelopeio/spring/llms.txt This is an example of a production node configuration in config.ini, covering core plugins, HTTP settings, chain configuration, P2P networking, block production, and WASM runtime. ```ini # config.ini - Production node example # Core plugins plugin = eosio::chain_plugin plugin = eosio::chain_api_plugin plugin = eosio::http_plugin plugin = eosio::net_plugin plugin = eosio::producer_plugin plugin = eosio::producer_api_plugin # HTTP configuration http-server-address = 0.0.0.0:8888 http-max-response-time-ms = 100 http-threads = 4 access-control-allow-origin = * # Chain configuration chain-state-db-size-mb = 8192 read-mode = head validation-mode = full # P2P networking p2p-listen-endpoint = 0.0.0.0:9876 p2p-peer-address = peer1.example.com:9876 p2p-peer-address = peer2.example.com:9876 # Block production (for producers only) enable-stale-production = false producer-name = myproducer signature-provider = EOS6MRy...=KEY:5KQwr... # WASM runtime wasm-runtime = eos-vm-jit eos-vm-oc-enable = auto # Logging contracts-console = false ``` -------------------------------- ### Start Second Nodeos Instance as Producer Source: https://github.com/antelopeio/spring/blob/main/docs/01_nodeos/02_usage/03_development-environment/01_local-multi-node-testnet.md Use this command to start a second nodeos instance configured as a producer. Adjust keys and ports as necessary to avoid conflicts with existing instances. Ensure signature provider details are correct. ```sh nodeos --producer-name inita --plugin eosio::chain_api_plugin --plugin eosio::net_api_plugin --http-server-address 127.0.0.1:8889 --p2p-listen-endpoint 127.0.0.1:9877 --p2p-peer-address 127.0.0.1:9876 --config-dir node2 --data-dir node2 --signature-provider EOS6hMjoWRF2L8x9YpeqtUEcsDKAyxSuM1APicxgRU1E3oyV5sDEg=KEY:5JgbL2ZnoEAhTudReWH1RnMuQS6DBeLZt4ucV6t8aymVEuYg7sr ``` -------------------------------- ### Install secp256k1 Library Source: https://github.com/antelopeio/spring/blob/main/libraries/libfc/secp256k1/CMakeLists.txt Configures installation rules for the secp256k1 library, specifying destinations for runtime, library, and archive components. These components are part of the 'dev' component and excluded from 'ALL'. ```cmake install( TARGETS secp256k1 RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} COMPONENT dev EXCLUDE_FROM_ALL LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR} COMPONENT dev EXCLUDE_FROM_ALL ARCHIVE DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR} COMPONENT dev EXCLUDE_FROM_ALL ) ``` -------------------------------- ### Get Cleos Client Version Source: https://github.com/antelopeio/spring/blob/main/docs/02_cleos/03_command-reference/version/client.md Use this command to retrieve the version information for the cleos client. No specific setup or imports are required beyond having cleos installed. ```sh cleos version client ``` -------------------------------- ### ChainBase Database Operations Example Source: https://github.com/antelopeio/spring/blob/main/libraries/chaindb/README.md Demonstrates opening a ChainBase database, adding indices, creating, modifying, and removing book objects, and querying the data. This example illustrates basic CRUD operations within ChainBase. ```c++ /** This simple program will open database_dir and add two new books every time it is run and then print out all of the books in the database. */ int main( int argc, char** argv ) { chainbase::database db; db.open( "database_dir", database::read_write, 1024*1024*8 ); db.add_index< book_index >(); const auto& book_idx = db.get_index().indices(); /** Returns a const reference to the book, this pointer will remain valid until the book is removed from the database. */ const auto& new_book300 = db.create( [&]( book& b ) { b.pages = 300+book_idx.size(); } ); const auto& new_book400 = db.create( [&]( book& b ) { b.pages = 300+book_idx.size(); } ); /** You modify a book by passing in a lambda that receives a non-const reference to the book you wish to modify. */ db.modify( new_book300, [&]( book& b ) { b.pages++; }); for( const auto& b : book_idx ) { std::cout << b.pages << "\n"; } auto itr = book_idx.get().lower_bound( 100 ); if( itr != book_idx.get().end() ) { std::cout << itr->pages; } db.remove( new_book400 ); return 0; } ``` -------------------------------- ### Node Configuration (config.ini) Source: https://context7.com/antelopeio/spring/llms.txt Example configuration for a production node using config.ini. ```APIDOC ## Node Configuration (config.ini) ### Description Configure nodeos behavior through the config.ini file or command-line arguments. ### Example: Production Node ```ini # Core plugins plugin = eosio::chain_plugin plugin = eosio::chain_api_plugin plugin = eosio::http_plugin plugin = eosio::net_plugin plugin = eosio::producer_plugin plugin = eosio::producer_api_plugin # HTTP configuration http-server-address = 0.0.0.0:8888 http-max-response-time-ms = 100 http-threads = 4 access-control-allow-origin = * # Chain configuration chain-state-db-size-mb = 8192 read-mode = head validation-mode = full # P2P networking p2p-listen-endpoint = 0.0.0.0:9876 p2p-peer-address = peer1.example.com:9876 p2p-peer-address = peer2.example.com:9876 # Block production (for producers only) enable-stale-production = false producer-name = myproducer signature-provider = EOS6MRy...=KEY:5KQwr... # WASM runtime wasm-runtime = eos-vm-jit eos-vm-oc-enable = auto # Logging contracts-console = false ``` ``` -------------------------------- ### Get Formatted Account Data Source: https://github.com/antelopeio/spring/blob/main/docs/02_cleos/03_command-reference/get/account.md Use this command to retrieve account details in a human-readable format. No special setup is required beyond having 'cleos' installed and connected to a node. ```sh cleos get account eosio ``` ```console privileged: true permissions: owner 1: 1 EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV active 1: 1 EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV memory: quota: -1 bytes used: 1.22 Mb net bandwidth: (averaged over 3 days) used: -1 bytes available: -1 bytes limit: -1 bytes cpu bandwidth: (averaged over 3 days) used: -1 us available: -1 us limit: -1 us producers: ``` -------------------------------- ### Load Net and HTTP Plugins via Command Line Source: https://github.com/antelopeio/spring/blob/main/docs/01_nodeos/03_plugins/net_api_plugin/index.md Example command-line arguments for loading both the net_plugin and http_plugin. ```sh # command-line nodeos ... --plugin eosio::net_plugin [options] \ --plugin eosio::http_plugin [options] ``` -------------------------------- ### Initialize Appbase Application with Plugins Source: https://github.com/antelopeio/spring/blob/main/plugins/usage_pattern.md Demonstrates how to initialize an appbase application with specified plugins and handle potential exceptions or specific return codes indicating normal exit or configuration errors. ```c++ try { ... if(!app->initialize(argc, argv, initialize_logging)) { const auto& opts = app->get_options(); if( opts.count("help") || opts.count("version") || opts.count("full-version") || opts.count("print-default-config") ) { return SUCCESS; } return INITIALIZE_FAIL; } ... app->startup(); app->exec(); } // other catch blocks } catch( ... ) { elog("unknown exception"); return OTHER_FAIL; } ``` -------------------------------- ### Contract Deployment Output Source: https://github.com/antelopeio/spring/blob/main/docs/02_cleos/03_command-reference/set/set-contract.md This is an example of the console output you can expect after successfully deploying a contract. ```console Reading WAST... Assembling WASM... Publishing contract... ``` -------------------------------- ### Chain API - Get Finalizer Info Response Example Source: https://context7.com/antelopeio/spring/llms.txt Example JSON response for the /v1/chain/get_finalizer_info endpoint, showing active and pending finalizer policies, and last tracked votes. ```json { "active_finalizer_policy": { "generation": 1, "threshold": 15, "finalizers": [{ "description": "finalizerone", "weight": 1, "public_key": "PUB_BLS_PcJG7lYgwZcsFGe..." }] }, "pending_finalizer_policy": null, "last_tracked_votes": [{ "description": "finalizerone", "public_key": "PUB_BLS_PcJG7lYgwZcsFGe...", "is_vote_strong": true, "finalizer_policy_generation": 1, "voted_for_block_num": 1234 }] } ``` -------------------------------- ### Configure EOSIO CMake Files Source: https://github.com/antelopeio/spring/blob/main/CMakeLists.txt Generates the eosio-config.cmake file from a template and installs it. This is part of the legacy EOSIO CMake setup. ```cmake configure_file(${CMAKE_SOURCE_DIR}/CMakeModules/eosio-config.cmake.in ${CMAKE_BINARY_DIR}/modules/eosio-config.cmake @ONLY) ``` ```cmake install(FILES ${CMAKE_BINARY_DIR}/modules/eosio-config.cmake DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/cmake/eosio COMPONENT dev EXCLUDE_FROM_ALL) ``` ```cmake install(FILES ${CMAKE_BINARY_DIR}/modules/EosioTester.cmake DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/cmake/eosio COMPONENT dev EXCLUDE_FROM_ALL) ``` ```cmake install(FILES ${CMAKE_SOURCE_DIR}/CMakeModules/EosioCheckVersion.cmake DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/cmake/eosio COMPONENT dev EXCLUDE_FROM_ALL) ``` -------------------------------- ### Configure Leap CMake Files Source: https://github.com/antelopeio/spring/blob/main/CMakeLists.txt Generates the leap-config.cmake file from a template and installs it, along with related helper scripts. This is for legacy Leap CMake setup. ```cmake configure_file(${CMAKE_SOURCE_DIR}/CMakeModules/leap-config.cmake.in ${CMAKE_BINARY_DIR}/modules/leap-config.cmake @ONLY) ``` ```cmake install(FILES ${CMAKE_BINARY_DIR}/modules/leap-config.cmake DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/cmake/leap COMPONENT dev EXCLUDE_FROM_ALL) ``` ```cmake install(FILES ${CMAKE_BINARY_DIR}/modules/EosioTester.cmake DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/cmake/leap COMPONENT dev EXCLUDE_FROM_ALL) ``` ```cmake install(FILES ${CMAKE_SOURCE_DIR}/CMakeModules/EosioCheckVersion.cmake DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/cmake/leap COMPONENT dev EXCLUDE_FROM_ALL) ``` -------------------------------- ### Deploy eosio.token Contract Source: https://context7.com/antelopeio/spring/llms.txt Example of deploying the standard `eosio.token` contract. Ensure the contract files are correctly located. ```bash cleos set contract eosio.token contracts/eosio.token ``` -------------------------------- ### Start Node from Snapshot Source: https://context7.com/antelopeio/spring/llms.txt Initialize the nodeos with a blockchain snapshot using the --snapshot flag, followed by the path to the snapshot file. ```bash # Start from snapshot nodeos --snapshot /path/to/snapshot.bin ``` -------------------------------- ### Install License Directory Source: https://github.com/antelopeio/spring/blob/main/CMakeLists.txt Installs the directory containing all collected project licenses. This ensures licenses are available in the standard location after installation. ```cmake install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/licenses/spring" DESTINATION "${CMAKE_INSTALL_FULL_DATAROOTDIR}/licenses/" COMPONENT base) ``` -------------------------------- ### Install CLI Bash Completion Source: https://github.com/antelopeio/spring/blob/main/CMakeLists.txt Installs the 'cleos' bash completion script to the system's completion directory. This is part of the base component installation. ```cmake install(FILES libraries/cli11/bash-completion/completions/cleos DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/bash-completion/completions COMPONENT base) ``` -------------------------------- ### Create Account Command Example Source: https://github.com/antelopeio/spring/blob/main/docs/02_cleos/03_command-reference/create/account.md This command demonstrates how to create a new account named 'tester' by the 'inita' account, providing the necessary public keys for owner and active permissions. Ensure you have generated Antelope keys beforehand. ```sh cleos create account inita tester EOS4toFS3YXEQCkuuw1aqDLrtHim86Gz9u3hBdcBw5KNPZcursVHq EOS7d9A3uLe6As66jzN8j44TXJUqJSK3bFjjEEqR4oTvNAB3iM9SA ``` -------------------------------- ### Load Wallet and HTTP Plugins via Command Line Source: https://github.com/antelopeio/spring/blob/main/docs/03_keosd/15_plugins/wallet_plugin/index.md Load both the wallet and http plugins using the --plugin flag on the command line. ```sh # command-line nodeos ... --plugin eosio::wallet_plugin [options] \ --plugin eosio::http_plugin [options] ``` -------------------------------- ### Install Spring Utility Executable Source: https://github.com/antelopeio/spring/blob/main/programs/spring-util/CMakeLists.txt Installs the Spring utility executable to the system's runtime destination directory. This makes the executable part of the installed package. ```cmake install( TARGETS ${SPRING_UTIL_EXECUTABLE_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} COMPONENT base ) ``` -------------------------------- ### Install BoringSSL Libraries Source: https://github.com/antelopeio/spring/blob/main/libraries/libfc/libraries/boringssl/CMakeLists.txt Installs the 'crypto' and 'decrepit' libraries to the system's library directory. These components are marked for the 'dev' installation group and excluded from default builds. ```cmake install( TARGETS crypto LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR} COMPONENT dev EXCLUDE_FROM_ALL ARCHIVE DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR} COMPONENT dev EXCLUDE_FROM_ALL ) install( TARGETS decrepit LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR} COMPONENT dev EXCLUDE_FROM_ALL ARCHIVE DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR} COMPONENT dev EXCLUDE_FROM_ALL ) ``` -------------------------------- ### Install Spring Testing Contracts Source: https://github.com/antelopeio/spring/blob/main/CMakeLists.txt Installs directories containing Spring testing contracts and unittests. Excludes CMake cache files, CMakeLists.txt files, and Makefiles from the installation. ```cmake install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/libraries/testing/contracts DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/spring_testing/libraries/testing COMPONENT dev EXCLUDE_FROM_ALL PATTERN "CMakeFiles" EXCLUDE PATTERN "*.cmake" EXCLUDE PATTERN "Makefile" EXCLUDE) install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unittests/contracts DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/spring_testing/unittests COMPONENT dev EXCLUDE_FROM_ALL PATTERN "CMakeFiles" EXCLUDE PATTERN "*.cmake" EXCLUDE PATTERN "Makefile" EXCLUDE) ``` -------------------------------- ### Install Test Harness Symlinks (CMake < 3.21) Source: https://github.com/antelopeio/spring/blob/main/CMakeLists.txt Installs symbolic links for the Test Harness using a script. This is a fallback for CMake versions older than 3.21, which require a separate script for symlink installation. ```cmake install(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/scripts/install_testharness_symlinks.cmake COMPONENT dev EXCLUDE_FROM_ALL) ``` -------------------------------- ### Load chain and http plugins via command-line Source: https://github.com/antelopeio/spring/blob/main/docs/01_nodeos/03_plugins/chain_api_plugin/index.md This example demonstrates loading the chain_plugin and http_plugin using command-line arguments, which are necessary for the chain_api_plugin to function. ```sh # command-line nodeos ... --plugin eosio::chain_plugin [operations] [options] \ --plugin eosio::http_plugin [options] ``` -------------------------------- ### Startup Sequence for Initialized Plugins Source: https://github.com/antelopeio/spring/blob/main/plugins/usage_pattern.md Illustrates the process of starting initialized plugins within an appbase application. It includes error handling for exceptions during plugin startup and initiates an orderly shutdown if any plugin fails. ```c++ try { for( auto plugin : initialized_plugins ) { if( is_quiting() ) break; plugin->startup(); } } catch( ... ) { clean_up_signal_thread(); shutdown(); throw; } ``` -------------------------------- ### Start Keosd Service Source: https://github.com/antelopeio/spring/blob/main/docs/02_cleos/02_how-to-guides/how-to-list-all-key-pairs.md Starts the keosd service. This is necessary if you encounter errors related to keosd not running. ```sh keosd ``` -------------------------------- ### Create New Account with Keys Source: https://github.com/antelopeio/spring/blob/main/docs/01_nodeos/02_usage/03_development-environment/01_local-multi-node-testnet.md Creates a new account, 'inita', which will be used as a producer. This command requires the owner and active public keys for the new account. The example uses the same public key for both owner and active keys. ```sh cleos --wallet-url http://127.0.0.1:8899 create account eosio inita EOS6hMjoWRF2L8x9YpeqtUEcsDKAyxSuM1APicxgRU1E3oyV5sDEg EOS6hMjoWRF2L8x9YpeqtUEcsDKAyxSuM1APicxgRU1E3oyV5sDEg ``` -------------------------------- ### Load Producer Plugin via nodeos Startup Parameters Source: https://github.com/antelopeio/spring/blob/main/docs/01_nodeos/03_plugins/producer_plugin/index.md Alternatively, load the producer_plugin using nodeos startup parameters. Ensure to include any necessary options. ```sh # nodeos startup params nodeos ... -- plugin eosio::producer_plugin [options] ``` -------------------------------- ### Replay nodeos from snapshot Source: https://github.com/antelopeio/spring/blob/main/docs/01_nodeos/04_replays/how-to-replay-from-a-snapshot.md Use this command to start nodeos and replay from a specified snapshot file. Ensure the snapshot file is in the correct directory or specify its path. Plugins like producer, chain_api, and http are commonly included for node operation. ```sh nodeos --snapshot yoursnapshot.name \ --plugin eosio::producer_plugin \ --plugin eosio::chain_api_plugin \ --plugin eosio::http_plugin \ >> nodeos.log 2>&1 & ``` -------------------------------- ### Load Net and HTTP Plugins in config.ini Source: https://github.com/antelopeio/spring/blob/main/docs/01_nodeos/03_plugins/net_api_plugin/index.md Example configuration for loading both the net_plugin and http_plugin in the config.ini file. ```ini # config.ini plugin = eosio::net_plugin [options] plugin = eosio::http_plugin [options] ``` -------------------------------- ### Nodeos Configuration with Plugins Source: https://github.com/antelopeio/spring/blob/main/docs/01_nodeos/03_plugins/trace_api_plugin/index.md Example of configuring nodeos with chain and http plugins using a config.ini file and command-line arguments. ```ini # config.ini plugin = eosio::chain_plugin [options] plugin = eosio::http_plugin [options] ``` ```sh # command-line nodeos ... --plugin eosio::chain_plugin [options] \ --plugin eosio::http_plugin [options] ``` -------------------------------- ### Transaction Report Example Source: https://github.com/antelopeio/spring/wiki/Perf-Harness-Usage-and-How-To This is an example of a transaction report entry, showing a transaction ID, timestamp, status, and a numerical value. ```text 3fff15e403e57b3e4b897e4cc32ad05757e93f0fe76f7a86b8dec22f4c1fc844,2024-06-12T21:15:11.751,NA,-1 ``` -------------------------------- ### Load producer_api_plugin via nodeos startup parameters Source: https://github.com/antelopeio/spring/blob/main/docs/01_nodeos/03_plugins/producer_api_plugin/index.md Alternatively, you can load the producer_api_plugin using command-line arguments when starting nodeos. ```sh # nodeos startup params nodeos ... --plugin eosio::producer_api_plugin ``` -------------------------------- ### Install WASM Library Source: https://github.com/antelopeio/spring/blob/main/libraries/wasm-jit/Source/WASM/CMakeLists.txt Installs the WASM library targets to the specified library directory, including library, archive, and development components. ```cmake install(TARGETS WASM LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT dev EXCLUDE_FROM_ALL) ``` -------------------------------- ### Import Private Key Source: https://github.com/antelopeio/spring/blob/main/docs/02_cleos/02_how-to-guides/how-to-import-a-key.md Run this command to initiate the private key import process. It will prompt you to enter the private key. ```sh cleos wallet import ``` -------------------------------- ### Delete All Blocks and Start Fresh Source: https://context7.com/antelopeio/spring/llms.txt Use the --delete-all-blocks flag to completely clear the blockchain data and start from genesis. This is a destructive operation. ```bash # Delete all blocks and start fresh nodeos --delete-all-blocks ``` -------------------------------- ### Load Wallet Plugin via Command Line Source: https://github.com/antelopeio/spring/blob/main/docs/03_keosd/15_plugins/wallet_plugin/index.md Load the wallet plugin using the --plugin flag on the command line. ```sh # command-line nodeos ... --plugin eosio::wallet_plugin ``` -------------------------------- ### Install Boost Submodule for Development Source: https://github.com/antelopeio/spring/blob/main/CMakeLists.txt Installs the Boost submodule headers to a specific directory for development purposes. Excludes version control and test-related files. ```cmake install(DIRECTORY "${CMAKE_SOURCE_DIR}/libraries/boost/" DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/spring_boost COMPONENT dev EXCLUDE_FROM_ALL PATTERN ".git/*" EXCLUDE PATTERN "example/*" EXCLUDE PATTERN "bench/*" EXCLUDE PATTERN "doc/*" EXCLUDE PATTERN "libs/*/test" EXCLUDE PATTERN "tools/*/test" EXCLUDE ) ``` -------------------------------- ### Load Wallet and HTTP Plugins Source: https://github.com/antelopeio/spring/blob/main/docs/03_keosd/15_plugins/wallet_api_plugin/index.md Load the wallet_plugin and http_plugin with default settings in config.ini or via the command line. ```sh # config.ini plugin = eosio::wallet_plugin [options] plugin = eosio::http_plugin [options] ``` ```sh # command-line keosd ... --plugin eosio::wallet_plugin [options] \ --plugin eosio::http_plugin [options] ``` -------------------------------- ### Cleos Get Servants Command Usage Source: https://github.com/antelopeio/spring/blob/main/docs/02_cleos/03_command-reference/get/servants.md This shows the general usage of the `cleos get servants` command, indicating that an account name is required as an argument. ```sh cleos get servants ``` -------------------------------- ### Configure and Build Spring (Ubuntu 20.04) Source: https://github.com/antelopeio/spring/blob/main/README.md Configures the build using CMake, specifying GCC 10 as the C and C++ compiler, and then builds the project. Ensure you are in the 'build' directory within the 'spring' repo root. The CMAKE_PREFIX_PATH should point to your LLVM installation. ```bash mkdir -p build cd build ## on Ubuntu 20, specify the gcc-10 compiler cmake -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/usr/lib/llvm-11 .. ## on Ubuntu 22, the default gcc version is 11, using the default compiler is fine cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/usr/lib/llvm-11 .. make -j "$(nproc)" package ``` -------------------------------- ### Install Test Harness Files Source: https://github.com/antelopeio/spring/blob/main/CMakeLists.txt Installs the Test Harness directory, including Python scripts and JSON configuration files. Excludes cache directories and Makefiles. ```cmake install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/tests/TestHarness DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/spring_testing/tests COMPONENT dev EXCLUDE_FROM_ALL FILES_MATCHING PATTERN "*.py" PATTERN "*.json" PATTERN "__pycache__" EXCLUDE PATTERN "CMakeFiles" EXCLUDE) ``` -------------------------------- ### Create Keypair and Print to Console Source: https://github.com/antelopeio/spring/blob/main/docs/02_cleos/02_how-to-guides/how-to-create-key-pairs.md Use this command to generate a new public/private keypair and immediately display it in the terminal. No additional setup is required. ```sh cleos create key --to-console ``` ```console Private key: 5KPzrqNMJdr6AX6abKg*******************************cH Public key: EOS4wSiQ2jbYGrqiiKCm8oWR88NYoqnmK4nNL1RCtSQeSFkGtqsNc ``` -------------------------------- ### Install Dependencies on FreeBSD 13.1 Source: https://github.com/antelopeio/spring/blob/main/docs/00_install/01_build-from-source/00_build-unsupported-os.md Installs necessary packages for building Antelope on FreeBSD 13.1. Ensure your system's package manager is up-to-date before running. ```bash pkg update && pkg install \ git \ cmake \ curl \ boost-all \ python3 \ llvm11 \ pkgconf ``` -------------------------------- ### Example EOS WIF Private Key Source: https://github.com/antelopeio/spring/blob/main/docs/03_keosd/35_wallet-specification.md This is an example of a WIF encoded private key for EOS. WIF is used for copy-pasting and including keys in text formats. ```plaintext 5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAbuatmU ```