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
  • Smart contract commands
  • Unbox LiquidX box
  • Create Contract
  • Smart Contract Steps
  • Adding files to Zeus

Was this helpful?

  1. LiquidX Stake Across Chains
  2. Getting Started with LiquidX
  3. Use DAPP Network Services

Smart Contract Steps

Smart contract commands

Unbox LiquidX box

We will unbox the liquidx box to give us all of the logic, contracts, and unit tests

mkir liquidx; cd liquidx
zeus unbox liquidx

Create Contract

Create smart contract, or if you're using thise guide as a part of another guide, you can skip this and go to the compiling section

export MY_CONTRACT_NAME=
zeus create contract $MY_CONTRACT_NAME
cd zeus_boxes/contracts/eos
# edit MY_CONTRACT_NAME.cpp
cd ../../../

Smart Contract Steps

#define LIQUIDX

At the smart contract level, the liquidx box must be unboxed and #define LIQUIDX must be added at the top of the smart contract which uses the DAPP Network services.

If you are already using an existing contract such as tokenpegx then this is already handled for you

Adding files to Zeus

2 files must be added and 2 files deleted as to not conflict

liquidx-mappings/sidechain_name.dappservices.json

update sidechain_name to chain_account

/zeus_boxes/liquidx/models/liquidx-mappings/sidechain_name.dappservices.json - this maps the dappservices account on the mainnet to the dappservicex account name on the new chain

  • sidechain_name - EOS mainnet account that has registered the chain

  • mainnet_account - dappservices account on EOS mainnet

{
    "sidechain_name":"liquidjungl3",
    "mainnet_account":"dappservices",
    "chain_account":"testdappxxxx"
}

eosio-chains/${CHAIN_ACCOUNT}.json

/zeus_boxes/liquidx/models/eosio-chains/${CHAIN_ACCOUNT}.json - this maps the chain’s configuration details

  • dsp_port - port DSP gateway runs on

  • webhook_dapp_port - webhook port

  • nodeos_host - nodeos host address

  • nodeos_port - nodeos port

  • secured - bool true/false for http/https for the nodeos address

  • nodeos_state_history_port - port for nodeos state history websocket

  • nodeos_p2p_port - nodeos peer 2 peer port

  • nodeos_endpoint - full nodeos endpoint

  • demux_port - demux port

  • name - name of the chain account

  • local - bool whether chain is local or not

{
    "dsp_port":13016,
    "webhook_dapp_port": 8813,
    "nodeos_host":"localhost",
    "nodeos_port":2424,
    "secured":false,
    "nodeos_state_history_port":12341,
    "nodeos_p2p_port":12451,
    "nodeos_endpoint":"http://localhost:2424",
    "demux_port":1232,
    "name":"CHAIN_ACCOUNT_HERE",
    "local":true
}
{
    "dsp_port":3117,
    "webhook_dapp_port": 8813,
    "nodeos_host":"localhost",
    "nodeos_port":2424,
    "secured":false,
    "nodeos_state_history_port":12341,
    "nodeos_p2p_port":12451,
    "nodeos_endpoint":"http://localhost:2424",
    "demux_port":1232,
    "name":"liquidjungl3",
    "local":true
}

Remove files:

Removing the following if they exist:

rm ./zeus_boxes/liquidx/models/liquidx-mappings/test1.dappservices.json
rm ./zeus_boxes/liquidx/models/liquidx-mappings/test1.provider1.json
rm ./zeus_boxes/liquidx/models/liquidx-mappings/test1.provider2.json
rm ./zeus_boxes/liquidx/models/eosio-chains/test1.json

Compile Contract Again with new files

export SIDE_CHAIN_NAME=liquidjungl3
zeus compile --sidechain $SIDE_CHAIN_NAME

In order for the compiler to know which network the contract intends to be deployed on the --sidechain flag must be passed to zeus compile --sidechain $SIDE_CHAIN_NAME.

Ensure that you add @eosio.code to the active permission level of the account. This can be done with the --add-code flag on the cleos set account permission command.

The side chain name is the account on the EOS mainnet that has registered the chain. You may find what this contract is by asking a DSP, a BP, or the chain team itself.

dappservices config file

Now let's see why we did all of that, in the ./contracts/eos/dappservices/dappservices.config.hpp we see:

#define DAPPSERVICEX_CONTRACT_TESTDAPPXXXX "liquidjungl3"_n

#define DAPPSERVICESA_CONTRACT "dappservices"_n

#ifdef LIQUIDX

#define DAPPSERVICES_CONTRACT DAPPSERVICEX_CONTRACT_TESTDAPPXXXX

#else

#define DAPPSERVICES_CONTRACT DAPPSERVICESA_CONTRACT

#endif

If you see _TEST1 at all above, something is wrong and likely you need to remove the files suggested above.

Set Contract

cd zeus_boxes/contracts/eos
export EOS_ENDPOINT=
export ACCOUNT=
cleos -u $EOS_ENDPOINT set contract $ACCOUNT $MY_CONTRACT_NAME

PreviousUse DAPP Network ServicesNextAdd DSP on New Chain

Last updated 3 years ago

Was this helpful?

chain_account - dappservicex account on new chain - enter the sidechain_name as the scope for the table, the dappservices_contract key will list the account name needed

chain_account for jungle3 is

Jungle3 sidechain name:

⛓️
chainentry
testdappxxxx
liquidjungl3