VeChain Docs
  • Welcome to VeChain
  • Blockchain Basics
    • Introduction to blockchain
    • Introduction to digital property
    • The evolution of the internet
  • Introduction to VeChain
    • About the VeChain blockchain
      • Consensus Deep Dive
      • Governance
    • Dual-Token Economic Model
      • VeChain (VET)
      • VeThor (VTHO)
    • Acquire VeChain Assets
    • Sustainability
  • Core Concepts
    • Networks
      • Thor Solo Node
      • Testnet
      • Mainnet
    • Nodes
      • Node Rewards Programme
    • Blocks
      • Block Model
    • Transactions
      • Transaction Model
      • Transaction Fees
      • Transaction Calculation
      • Meta Transaction Features
        • Transaction Uniqueness
        • Controllable Transaction Lifecycle
        • Clauses (Multi-Task Transaction)
        • Fee Delegation
          • Multi-Party Payment (MPP)
          • Designated Gas Payer (VIP-191)
        • Transaction Dependency
    • Block Explorers
    • Wallets
      • VeWorld
        • User Guide
          • Setup
          • Wallet
          • Signing
          • Activities
          • Settings
        • FAQ
      • Sync2
        • User Guide
          • Setup
          • Wallet
          • Signing
          • Activities
          • Settings
        • FAQ
      • Sync
        • User Guide
          • Wallet
          • Ledger Device
          • Browser dApps and web
          • Interact with dApps
          • Activities
          • Settings
          • Report an Issue
          • Contributing
        • FAQ
    • EVM Compatibility
      • VeChain Modifications
      • Methodology
      • Test Coverage
        • Gas model
        • Raw transaction
        • hardhat specific
          • Ganache failures
          • evm_increaseTime
        • Failures in constructor
        • eth_sign
        • Contract address prediction
        • BadBeacon proxy address at 0x1
      • How to Recreate
      • Additional Information
        • Using Governance Contracts
        • ERC1820/ERC777 Testnet
        • Delegate Options
    • Account Abstraction
      • UserOperation
      • Bundler
      • EntryPoint Contract
      • Account Factory Contract
      • Paymaster Contract
    • Token Bound Accounts
  • How to run a node
    • Nodes
    • How to run a Thor Solo Node
    • Custom Network
    • Connect Sync2 to a Thor Solo Node
  • Developer Resources
    • Getting Started
    • How to build on VeChain
      • Connect to the Network
      • Read Data
        • Read Blocks
        • Read Transactions
        • Read Accounts
        • States & Views
        • Events & Logs
        • VET Transfers
      • Write Data
        • Transactions
        • Fee Delegation
      • Listen to Changes
        • Events
        • VET Transfers
        • Transactions
        • Blocks
        • Beats
      • Build with Hardhat
      • Utilities
        • BigInt and Unit-Handling
        • Name Service Lookups
    • Example dApps
      • Buy me a Coffee
      • Token Bound Accounts
      • PWA with Privy and Account Abstraction
    • EVM Compatibility for Developers
      • Key Architectural Differences and Optimizations
      • Practical Implications for Developers: Key Considerations
      • RPC Methods (Detailed Breakdown)
      • Frequently Asked Questions (FAQs)
      • VeChain Blockchain Specifications
      • Key Differences Between VeChain and Ethereum (Summary)
      • Best Practices for Developing on VeChainThor
    • How to verify Address-Ownership
      • Next.js Session Verification
    • Debug Reverted Transactions
    • Account Abstraction
    • VIP-191: Designated Gas Payer
      • How to Integrate VIP-191 (I)
      • How to Integrate VIP-191 (II)
      • How to Integrate VIP-191 (III)
    • Index with Graph Node
      • Setup with Docker
      • Index with OpenZeppelin
        • Create Subgraph Project
        • Configure Contracts
        • Deploy Subgraph and start Indexing
        • Track Subgraph Indexing
        • Access Subgraph
        • Update Subgraph
    • SDKs & Providers
      • SDK
        • Architecture
        • Accounts
        • Bloom Filter
        • Certificates
        • Contracts
        • Cryptography
        • Debug
        • Encoding
        • Polls
        • Subscriptions
        • Thor Client
        • Transactions
      • Thor DevKit
        • Installation
        • Usage
          • Cryptography
          • Accounts
          • Encoding
          • Transactions
          • Certificates
          • Bloom Filter
      • DApp Kit
        • v2
          • Installation
          • React
            • Installation
            • Usage
          • Vanilla JS
            • Installation
            • Usage
          • Core
            • Installation
            • Usage
          • Theme Variables
          • i18n
        • v1
          • Installation
          • React
            • Installation
            • Usage
          • Vanilla JS
            • Installation
            • Usage
          • Core
            • Installation
            • Usage
          • Theme Variables
          • i18n
          • Node Polyfills
          • V0 to V1
        • v0
          • Installation
          • Usage
          • React
            • Installation
            • Usage
          • Vanilla (UI)
            • Installation
            • Usage
          • Styles (UI)
          • i18n
      • DevPal
      • Web3-Providers-Connex
        • Installation
        • Usage
      • Connex
        • Installation
        • API Specification
    • Frameworks & IDEs
      • Hardhat
      • Remix
    • Built-in Contracts
    • VORJ
    • Useful Links
  • How to contribute
Powered by GitBook
On this page
  • RPC Proxy
  • Installation
  • CLI Options
  • CLI options list
  • Configuration file
  • Example Configuration
  • Connecting with Remix IDE
  • Known Issues and Workaround

Was this helpful?

  1. Developer Resources
  2. Frameworks & IDEs

Remix

PreviousHardhatNextBuilt-in Contracts

Last updated 2 months ago

Was this helpful?

is a comprehensive, web-based integrated development environment (IDE) for smart contract creation and deployment. It caters to developers of all skill levels, serving as both a powerful toolset for the entire contract development lifecycle and an educational platform for learning and experimenting with Ethereum-based technologies.

Our VeChain integration with Remix enables our community to leverage this robust IDE when developing smart contracts and decentralized applications (dApps) on the VeChain blockchain. By providing an RPC proxy, we've made it possible for VeChain developers to seamlessly use Remix's feature-rich environment while targeting the VeChain network, combining the familiarity of Ethereum development tools with the unique advantages of the VeChain ecosystem.

RPC Proxy

The RPC Proxy is designed to bridge the gap between Thor's RESTful API and Ethereum's JSON-RPC, enabling seamless interaction with the VeChainThor blockchain through RPC calls. It is particularly useful for integrating with tools such as the Remix IDE.

Installation

To install the RPC proxy, use the following command:

yarn add @vechain/sdk-rpc-proxy

By default, the proxy is configured to be used with a solo node running on your local machine. There are two options if you want to change the default behavior, or use a custom configuration:

  • Create a config.json file and pass it to the command when launching the RPC Proxy.

  • Use CLI options.

CLI Options

With rpc-proxy, you can use the following CLI options. CLI options override the configuration file. So you can run the rpc-proxy with:

  • a configuration file with the default values and override them with the cli options

    • -e.g.- npx rpc-proxy -p 8545 -v ...

  • a custom configuration file and override some values with the cli options

    • -e.g.- npx rpc-proxy -c /path/of/custom-config.json -p 8545 -v ...

CLI options list

Provide the configuration file

  • -c, --configurationFile <config>: The path to the configuration file.

    • -e.g.- npx rpc-proxy -c /path/of/custom-config.json OR rpc-proxy --configurationFile custom-config.json

  • -p, --port <port>: The port on which the proxy server will run.

    • -e.g.- npx rpc-proxy -p 8545 OR rpc-proxy --port 8545

  • -u, --url <url>: The URL of the VeChain Thor node.

    • -e.g.- npx rpc-proxy -u http://testnet.vechain.org OR rpc-proxy --url http://testnet.vechain.org

  • -v, --verbose: Whether to enable verbose logging.

    • -e.g.- npx rpc-proxy -v OR rpc-proxy --verbose

Provide the accounts

  • -a, --accounts <accounts>: The accounts (private keys) that the proxy server will use to sign transactions. It is a space-separated list of private keys.

    • -e.g.- npx rpc-proxy -a "7f9290cc44c5fd2b95fe21d6ad6fe5fa9c177e1cd6f3b4c96a97b13e09eaa158 8f9290cc44c5fd2b95fe21d6ad6fe5fa9c177e1cd6f3b4c96a97b13e09eaa158" OR npx rpc-proxy --accounts "7f9290cc44c5fd2b95fe21d6ad6fe5fa9c177e1cd6f3b4c96a97b13e09eaa158 8f9290cc44c5fd2b95fe21d6ad6fe5fa9c177e1cd6f3b4c96a97b13e09eaa158"

  • -m, --mnemonic <mnemonic>: The mnemonic that the proxy server will use to sign transactions.

  • -mc, --mnemonicCount <mnemonicCount>: The number of accounts to derive from the mnemonic.

  • -mi, --mnemonicInitialIndex <mnemonicInitialIndex>: The index from which to start deriving accounts from the mnemonic.

    • -e.g.- npx rpc-proxy -m "denial kitchen pet squirrel other broom bar gas better priority spoil cross" -mc 10 -mi 1 OR npx rpc-proxy --mnemonic "denial kitchen pet squirrel other broom bar gas better priority spoil cross" --mnemonicCount 10 --mnemonicInitialIndex 1

    • NOTE: --mnemonic, --mnemonicCount, and --mnemonicInitialIndex MUST be used together.

Use delegation

  • -e, --enableDelegation: Whether to enable delegation.

  • -dp, --gasPayerPrivateKey <gasPayerPrivateKey>: The private key of the gasPayer.

  • -du, --gasPayerUrl <gasPayerUrl>: The URL of the gasPayer.

    • -e.g.- npx rpc-proxy -e -dp 8f9290cc44c5fd2b95fe21d6ad6fe5fa9c177e1cd6f3b4c96a97b13e09eaa158 OR npx rpc-proxy --enableDelegation --gasPayerPrivateKey 8f9290cc44c5fd2b95fe21d6ad6fe5fa9c177e1cd6f3b4c96a97b13e09eaa158

    • -e.g.- npx rpc-proxy -e -du https://sponsor-testnet.vechain.energy/by/... OR npx rpc-proxy --enableDelegation --gasPayerUrl https://sponsor-testnet.vechain.energy/by/...

    • NOTE: --gasPayerPrivateKey and --gasPayerUrl are mutually exclusive.

    • NOTE: if --enableDelegation is used, --gasPayerPrivateKey OR --gasPayerUrl MUST be used.

Configuration file

Create a config.json with your desired settings. The configuration file includes the following fields:

  • url: The URL of the VeChain Thor node.

  • port: The port of the proxy server.

  • accounts: The accounts that the proxy server will use to sign transactions (can be a mnemonic or an array of private keys).

  • verbose: Wheter to enable verbose logging.

  • debug: Whether to enable debug mode.

  • enableDelegation: Whether to enable delegation.

After creating your configuration file, run the proxy using one of the following commands:

rpc-proxy -c <json config file>

Or:

rpc-proxy --configurationFile <json config file>

Example Configuration

{
    "url": "http://127.0.0.1:8669",
    "port": 8545,
    "accounts": {
        "mnemonic": "denial kitchen pet squirrel other broom bar gas better priority spoil cross",
        "count": 10
    },
    "verbose": true,
    "enableDelegation": false
}

If you want to use VeChain testnet or mainnet use the following urls: https://testnet.vechain.org/ or https://mainnet.vechain.org/. and remember also to change the accounts field by passing the correct account you want to use.

Connecting with Remix IDE

1. Go to DEPLOY & RUN TRANSACTIONS section

2. Choose Custom - External HTTP provider

3. Choose the URL to your proxy (default is http://127.0.0.1:8545) and click Ok

4. Compile and deploy contracts

5. Interact with contracts via provided interface

Known Issues and Workaround

Currently there are some limitations when using this proxy. One of them is the fact that when deploying contracts you could get an error of the following type creation of ContractName errored: [TIMEOUT] Timeout for call deployMetadataOf from udapp. This usually happens after 3 or more deployments one after another.

Fortunately there is a workaround for this, if all contracts are required in the same workspace. When deploying contracts note their address as well as the contract name. When you get the aforementioned error refresh Remix and recompile the contracts. When navigating to the DEPLOY & RUN TRANSACTIONS section instead of re-deploying the contract paste the address in the AtAddress section and it will load from your previous deployment. You can now succesfully interact with a previously deployed contract.

If you are launching the RPC Proxy with the provided example configuration, make sure to have Thor running locally in solo mode. Find out more about Thors different options and how to build it .

Remix
here