LiquidApps Documentation
  • Introduction
  • 🧙‍♂️The DAPP Network
    • The DAPP Token
      • DAPP Token Overview
      • DAPP Tokens Tracks
      • Claiming DAPP Tokens
      • DAPP Tokens Distribution
      • Air-HODL
    • Cross Chain Bridges
    • Examples
      • Token bridge
      • Price Feed
      • Elemental Battles
      • LiquidChess
      • LiquidPortfolio
    • DAPP Network Resources
      • @liquidapps/dapp-client
        • vRAM
        • LiquidAccounts
        • DAPP Services
        • Air-Hodl
      • eosio-push-guarantee
      • Link Library
        • EOSIO Link
          • Tables
          • Crons
          • Macros
          • Variables
        • EVM Link - Solidity (Coming Soon)
  • ⚡Working with Zeus
    • Introduction
      • Requirements
      • Install Zeus and Unboxing
        • More on zeus-box.json
      • Get Started fast! (Zeus-IDE)
      • Docker CI/CD
      • Example Github Using Zeus
      • Getting started with AntelopeIO Contracts (formerly EOSIO)
    • Zeus Basics
      • Compiling Contracts
        • Clean CMake Files
      • Unit Testing
        • Printing Console
        • Fetching Table
        • Helper Functions
        • Example
      • Create ...
        • Contract/Unit Test
          • All DAPP Network Services
        • DSP Service
        • Contract Deployment
      • Import/Export Keys
      • Migrate Contract
      • Start local environment
        • Kill Services
      • Upgrade
      • Zeus RC File
      • Zeus Config File
    • Zeus Box Basics
      • Zeus Boxes Directory
        • Services
          • Oracles
        • Sample Boxes
        • Other Boxes
          • DAPP Network
          • SDKs
            • ETH-SDK
            • EOS SDK
          • Frontends
          • Extensions
          • Tests
          • Seeds
          • Microservices
          • Meta Boxes
          • Libraries
          • Game
          • EOS Framework
          • Economics
          • Templates
      • Add/Remove
      • Deploy
      • List Boxes
  • ⚙️DAPP Network Services
    • DAPP Network Services
      • vRAM
        • Getting Started Guide
          • Compile and Deploy
          • Staking for services
          • Test
          • Basic implementation
        • Smart Contract Macros
          • dapp::multi_index
        • Tools
          • DAPP Client Integration
            • get_vram_row
          • Zeus Commands
          • Scripts
            • Get table
            • Get ordered keys
        • Additional Features
          • Save load and reset dapp::multi_index data
          • Advanced Features
      • LiquidAccounts
        • Getting Started Guide
          • Compile and Deploy
          • Staking for services
          • Test
            • DAPP Client
          • Basic Implementation
          • DAPP Account
        • Smart Contract Macros
          • payload
          • VACCOUNTS_APPLY
          • require_vaccount
          • VACCOUNTS_DELAYED_CLEANUP
        • Tools
          • DAPP Client Integration
            • push_liquid_account_transaction
          • Zeus Commands
            • Zeus vaccounts push-action
          • Scripts
            • Deserialize Payload
        • Use between contracts
        • Use Between Chains
      • LiquidHarmony
        • Getting Started Guide
          • Compile and Deploy
          • Staking for services
          • Test
          • Basic Implementation
          • API DSP Key Storage
        • Smart Contract Macros
          • geturi
          • ORACLE_HOOK_FILTER
        • Creating an Oracle Request
          • HTTP/HTTPS GET/POST JSON
            • HTTP/HTTPS GET
            • HTTP/HTTPS GET JSON
            • HTTP/HTTPS POST
            • HTTP/HTTPS POST JSON
          • ECHO GET/POST JSON
            • ECHO GET
            • ECHO GET JSON
            • ECHO POST
            • ECHO POST JSON
          • Nodeos History Get
          • Sister Chain Fetch
            • sister_chain_block
            • sister_chain_history
            • sister_chain_info
            • sister_chain_last_irreversible
            • sister_chain_table_row
          • Foreign Chain Fetch
            • ethereum
              • endpoints
              • block_number
              • history
              • balance
              • storage
            • tron
              • endpoints
              • balance
              • block_number
              • block
              • transactions
              • transaction
            • cardano
              • endpoints
              • blocks
              • history
              • state
            • ripple
              • endpoints
              • balance
              • ledger
              • transactions
            • bitcoin
              • endpoints
              • balance
              • block
              • history
              • transaction
            • litecoin
              • endpoints
              • balance
              • block
              • history
              • transaction
            • bitcoin cash
              • endpoints
              • balance
              • block
              • history
              • transaction
          • Wolfram Alpha
          • Random Number
          • Stockfish
          • SQL
        • Additional Features
          • Pre geturi hook
          • Don't spend CPU condition
      • LiquidScheduler
        • Getting Started Guide
          • Compile and Deploy
          • Staking for Services
          • Basic Implementation
        • Smart Contract Macros
          • schedule_timer
          • remove_timer
          • timer_callback
          • start_interval
          • remove_interval
        • Additional Features
          • Don't spend CPU condition
      • LiquidStorage
        • Getting Started Guide
          • Compile and Deploy
          • Staking for Services
          • Test
          • Basic Implementation
        • Tools
          • Zeus Commands
            • zeus storage upload
            • zeus storage unpin
          • DAPP Client Integration
            • get_uri
            • unpin_public_file
            • upload_archive_to_liquidstorage
            • upload_file_to_liquidstorage
            • upload_public_file_from_vaccount
        • Example GET Static Web Page
      • LiquidLink
        • Getting Started Guide
          • Compile and Deploy
          • Staking for services
          • Test
          • Basic Implementation
        • Smart Contract Macros
          • svc_sign_signtrx
      • LiquidAuth
        • Getting Started Guide
          • Compile and Deploy
          • Staking for services
          • Test
          • Basic Implementation
        • Tools
          • DAPP Client Integration
            • invokeAuthedCall
      • DAPP Service Macros
        • CONTRACT_START
        • CONTRACT_END
        • DAPPSERVICES_ACTIONS
        • DAPPSERVICE_ACTIONS_COMMANDS
      • Additional Services
      • Smart Contract Console Log Syntax
      • Using on_notify with services
    • Packages and Staking
  • 👨‍🚀DAPP Service Providers
    • Introduction to DAPP Service Providers
    • DSPs
      • Architecture Overview
      • Setup DSP
        • Blockchain Account
        • EOSIO Node
          • Firehose Setup
        • IPFS
          • Adding peers
            • Reconnecting Peers Periodically
          • Bootsrapping from an existing IPFS Cluster
          • Running a private network
        • PostgreSQL Database Backend
          • How to wipe local database
        • Ethereum Virtual Machine Node Setup
        • DSP Node
          • Logs
            • Monitor all logs script
        • Register Package
          • Modify Package metadata
          • Enable/Disable Package
          • Update cost per action in QUOTA
          • More on Packages
          • Whitelist Stakers
        • Test Setup
        • Known attack vectors
      • DSP Maintenance
        • Upgrade DSP Node
        • Claim Rewards
        • Replay Contract
        • Cleanup IPFS and Oracle Entries
        • Consumer Pays CPU Permissions
      • DSP API Endpoints
        • Event
        • Version
        • vRAM
        • LiquidLink
        • LiquidStorage
        • LiquidAccounts
  • 👨‍💻DAPP NETWORK LABS
    • Introduction
    • DAPP Workers
    • EdgeDSPs
    • EdgeOS
  • 🌉CROSS CHAIN BRIDGES
    • Getting Started with LiquidBridge
      • EOSIO.token <> EOSIO.token Fungible Tokens
      • EOSIO.token <> ERC20 Fungible Tokens
        • EOSIO Side Setup
        • EVM Side Setup
          • Setup EVM Contracts
            • Setup EVM Token Contract
              • Initialize Token and Transfer Ownership
            • Setup EVM Tokenpeg Contract
            • Verify and Publish Source Code
              • token contract and overview
              • tokenpeg contract
        • Initialize EOSIO Side
        • Test bridge
      • EOSIO <> EOSIO Atomic Assets Non-Fungible Tokens
      • EOSIO Atomic Assets <> ERC721 Non-Fungible Tokens
        • EOSIO Side Setup
        • EVM Side Setup
          • Setup EVM ERC721 Contract
          • Setup EVM Atomictokenpeg Contract
          • Transfer Ownership
          • Verify Source Code
        • Initialize EOSIO Side
        • Test bridge
      • EOSIO Atomic Assets <> ERC1155 Non-Fungible Tokens
        • EOSIO Side Setup
        • EVM Side Setup
          • Setup Proxy Contract
          • Setup EVM ERC1155 Contract
          • Setup EVM ERC1155 Tradeable Contract
          • Transfer Ownership of ERC1155 contract to atomictokenpeg1155 contract
        • Initialize EOSIO Side
        • Test bridge
  • ⛓️LiquidX Stake Across Chains
    • Getting Started with LiquidX
      • Use DAPP Network Services
        • Smart Contract Steps
        • Add DSP on New Chain
        • Map Mainnet to New Chain
        • Map New Chain to Mainnet
      • Become a DSP on another chain
        • Editing config.toml file
        • Push DSP account mapping action
      • Example Chains to Add
        • CoVax
        • WAX
        • WAX Test
        • Telos
        • Telos Test
        • BOS
      • Add a Chain to LiquidX
        • Create accounts and set dappservicex contract
        • Register chain
  • 😷COVAX
    • Getting Started with CoVax Chain
      • Become a DAPP Service Provider
      • Become a Block Producer
  • 🗂️Blockchain Guides
    • Testnet Creation Guides
      • Create Binance Smart Chain Testnet Account
        • Add Binance Smart Chain Testnet Network to Metamask
        • Create EVM keypair
        • Get faucet funds
      • Create WAX Testnet Account
      • Creating Jungle 3 account
      • Create Mumbai Testnet Account (Matic-Polygon)
        • Get faucet funds
      • Creating CryptoKylin Account
      • Create Rinkeby Testnet Account
        • Change Metamask network to Rinkeby
        • Get faucet funds
    • Governance Guides
      • How to submit a proposal
      • How the Proposal System Works
      • Governance Rewards
      • How to Propose an MSIG
      • Update dappservices contract by msig
      • Setup MSIG Telegram Bot
      • Governance Contracts
      • Governance Frontend
      • Propose Payment by Msig
  • 🗒️Release Notes
    • Latest
    • History
      • 2.0.8191
      • 2.0.7966
      • 2.0.7931
      • 2.1.7848
      • 2.0.7735
      • 2.0.7661
      • 2.0.7644
      • 2.0.7622
      • 2.1.7420
      • 2.1.7301
      • 2.1.7111
      • 2.0.6808
      • 2.0.5328
      • 2.0.4719
      • 2.0.4002
      • 2.0.3107
      • 2.0.2812
      • 2.0.2527
  • 🙋‍♀️FAQs
    • Frequently Asked Questions The DAPP Token
    • Frequently Asked Questions DAPP Service Providers (DSPs)
    • Frequently Asked Questions vRAM
Powered by GitBook
On this page
  • Mandatory:
  • In Config.toml
  • Sidechain:
  • Optional:
  • How to know if it is running correctly:

Was this helpful?

  1. DAPP Service Providers
  2. DSPs
  3. DSP Maintenance

Replay Contract

PreviousClaim RewardsNextCleanup IPFS and Oracle Entries

Last updated 2 years ago

Was this helpful?

As a DSP, you will want the ability to replay a contract’s vRAM (IPFS) related transactions to load that data into your IPFS cluster. We provide a file that does just that .

To do this you will need to sign up for an API key from , you can select the Server to Server option from the dropdown when creating it. Dfuse offers free keys that last 24 hours, so there’s no need to pay.

There are some mandatory and optional environment variables.

Hyperion may also be used thanks to Christoph Michel: . List of endpoints here: , status of endpoint (UP/DOWN) here:

The dfuse GET /v0/search/transactions API has been discontinued, so Hyperion is currently the only option unless you have access to your own dfuse API.

Mandatory:

# contract to replay
export CONTRACT=
export NODEOS_CHAINID="aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906" # < mainnet | kylin > "5fff1dae8dc8e2fc4d5b23b2c7665c97f9e9d8edf2b6485a86ba311c25639191"
# make sure NO TRAILING FORWARD SLASH
# this good: export DSP_ENDPOINT=https://kylin-dsp-1.liquidapps.io
# this leads to an error export DSP_ENDPOINT=https://kylin-dsp-1.liquidapps.io/
export DSP_ENDPOINT=
# using Dfuse?
export DFUSE_API_KEY=
# using Hyperion?
export HYPERION_ENDPOINT=https://eos.hyperion.eosrio.io
export HYPERION_SORT_DIRECTION=asc # can also be desc, ascending starts from first block, descending starts from head block of chains

In Config.toml

Enable:

# under [dsp] section
allow_api_non_broadcast = true
# under [ipfs] section
postgresql = true # if wanting to replay to also fill PostgreSQL db in addition to IPFS
postgresql_force_replay = true # if wanting to replay to also fill PostgreSQL db in addition to IPFS

Restart the DSP with these.

Be sure to set allow_api_non_broadcast and postgresql_force_replay to false and restart the DSP after running the replay script. This is to prevent external actors from pushing unauthorized transactions to the DSP to drain CPU and to allow cache retrieval of IPFS data. As a note, the sign service will never process externally sourced transactions as a safety precaution.

Sidechain:

If replaying an account on a sidechain, must add the following environment variables.

  • SIDECHAIN_DSP_PORT if using a sidechain, must specify sidechain DSP’s port

  • DSP_LIQUIDX_CONTRACT the liquidx contract name must be set liquidx.dsp on mainnet if cleaning a sidechain

  • NODEOS_MAINNET_ENDPOINT set mainnet nodeos endpoint

Optional:

export LAST_BLOCK= # defaults to 35000000, this is the last block to sync from, find the first vRAM transaction for the contract and set the block before it
export DFUSE_ENDPOINT= # defaults to 'eos.dfuse.eosnation.io', can set to `kylin.dfuse.eosnation.io`
export BLOCK_COUNT_PER_QUERY= # defaults to 1000000
export NODEOS_SECURED= # defaults to true
export NODEOS_HOST= # defaults to localhost
export NODEOS_PORT= # defaults to 13115

Once you’ve set those, simply run with:

sudo find / -name replay-contract.js
node /root/.nvm/versions/node/v10.16.0/lib/node_modules/@liquidapps/dsp/utils/ipfs-service/replay-contract.js
# or hyperion
node /root/.nvm/versions/node/v10.16.0/lib/node_modules/@liquidapps/dsp/utils/ipfs-service/replay-contract-hyperion.js

# sent 6513 saved 7725.26KB 6.42KB/s Block:77756949

How to know if it is running correctly:

In the IPFS logs, you SHOULD see this log because this is a replay. You will not see this log for normal IPFS related transactions, only ones sent from the replay script.

logger.warn(`commit PASSIVE_DSP_NODE ${process.env.PASSIVE_DSP_NODE} || replay: ${replay} || exception ${exception}`)

You should NOT see this log because you have set DSP_ALLOW_API_NON_BROADCAST=true.

logger.warn(`Attempt to broadcast event for non broadcastable request, not processing trx, to enable non-broadcast events, set the allow_api_non_broadcast config.toml var to true under [dsp] section - ${JSON.stringify(act.event)}`);

SIDECHAIN if using a sidechain, must specify sidechain name (sidechain names can be found )

👨‍🚀
replay-contract.js
dfuse.io
replay-contract-hyperion.js
https://hyperion.docs.eosrio.io/endpoint/
https://bloks.io/hyperion
here