API Node

How to run an API Node

API Nodes

API nodes are special types of nodes that run on the VinuChain network and provide access to the full history of transactions, balances, and smart contract interactions. They are often exposed to the public via HTTP or WebSocket protocols, allowing developers and users to interact with the VinuChain network.

API nodes also support transaction tracing, which is a feature that enables tracking the execution of smart contracts and their internal calls.

API nodes are useful for building applications that require querying historical data or tracing smart contract logic on the VinuChain network.

Initial steps

Install Opera

# Install Opera
(validator)$ git clone https://github.com/VinuChain/VinuChain
(validator)$ cd VinuChain/
(validator)$ make

Mainnet

Download genesis file

#Download genesis file
(validator)$ curl https://vinu-blockchain-mainnet-genesis.s3.us-east-1.amazonaws.com/vitainu-genesis-mainnet-with-contracts.g 
--output vitainu-genesis-mainnet-with-contracts.g

Run node

You can turn on and off http and ws options, use your ports and addresses.

# Run node
(validator)$ cd build

(validator)$ nohup ./opera \
    --genesis ../vitainu-genesis-mainnet-with-contracts.g \
    --datadir ./datadir \
    --http \
    --http.addr=your_hostname \
    --http.port 4000  --http.corsdomain=* --http.vhosts=* \
    --http.api=eth,debug,net,admin,web3,personal,txpool,vc,dag \
    --ws \ 
    --ws.addr=your_hostname \
    --ws.port 4100 \
    --ws.api=eth,debug,net,admin,web3,personal,txpool,vc,dag \
    --ws.rpcprefix "/" \
    --bootnodes enode://105ecea3fafaa01a329b9ce988d69ad7d9af233b04ad2c3b637b2f42862623c38f358bd7a7cfead5ae61991681965629abe2749131168bdd9ce573f8085380ab@node-0.vinuchain-rpc.com:3000 \
    --verbosity=3 --tracing > ./opera_read_node.log &
  • Replace your_hostname variables.

Testnet

Download genesis file

# Download Testnet genesis file
(validator)$ curl https://vinu-blockchain-genesis.s3.us-east-1.amazonaws.com/vitainu-genesis-testnet.g 
--output vitainu-genesis-testnet.g

Run node

You can turn on and off http and ws options, use your ports and addresses.

# Run node
(validator)$ cd build

(validator)$ nohup ./opera \
    --genesis ../vitainu-genesis-mainnet-with-contracts.g \
    --datadir ./datadir \
    --http \
    --http.addr=your_hostname \
    --http.port 4000  --http.corsdomain=* --http.vhosts=* \
    --http.api=eth,debug,net,admin,web3,personal,txpool,vc,dag \
    --ws \ 
    --ws.addr=your_hostname \
    --ws.port 4100 \
    --ws.api=eth,debug,net,admin,web3,personal,txpool,vc,dag \
    --ws.rpcprefix "/" \
    --bootnodes enode://105ecea3fafaa01a329b9ce988d69ad7d9af233b04ad2c3b637b2f42862623c38f358bd7a7cfead5ae61991681965629abe2749131168bdd9ce573f8085380ab@node-0.vinuchain-rpc.com:3000 \
    --verbosity=3 --tracing > ./opera_read_node.log &
  • Replace your_hostname variables.

Last updated