### Get Wallet Balance - Response Source: https://docs.dotone.online/developers/api-reference Example JSON-RPC response for eth_getBalance, returning the balance in Wei. Divide by 10^18 to convert to DOTO. ```json { "jsonrpc": "2.0", "id": 1, "result": "0x56BC75E2D63100000" } ``` -------------------------------- ### Example enode URL output Source: https://docs.dotone.online/validator/secure-validator Example output from the admin.nodeInfo.enode command. The [::] represents localhost (127.0.0.1); replace it with the correct IP address (public or local) before adding to the validator's config.toml. ```text enode://f2da64f49c30a0038bba3391f40805d531510c473ec2bcc7c201631ba003c6f1 6fa09e03308e48f87d21c0fed1e4e0bc53428047f6dcf34da344d3f5bb69373b@[::]:30306?discport=0 ``` -------------------------------- ### Start Validator Node Source: https://docs.dotone.online/validator/run-validator Starts the validator node with the required flags. Warning: never expose RPC endpoints to the public network. ```bash geth --config ./config.toml \ --datadir ./node \ -unlock {your-consensus-account-address} \ --miner.etherbase {your-consensus-account-address} \ --password password.txt \ --blspassword blspassword.txt \ --mine \ --vote \ --allow-insecure-unlock \ --cache 18000 \ --history.transactions 0 \ --history.logs.disable ``` -------------------------------- ### GET /api?module=contract&action=getabi&address={contract_address} Source: https://docs.dotone.online/developers/api-reference Returns the ABI for a given contract address on the DotOne Explorer. ```APIDOC ## [GET] /api?module=contract&action=getabi&address={contract_address} ### Description Returns the ABI for a given contract address on the DotOne Explorer. ### Method GET ### Endpoint https://dotscan.one/api/?module=contract&action=getabi&address={contract_address} ### Parameters #### Query Parameters - **module** (string) - Required - Must be "contract". - **action** (string) - Required - Must be "getabi". - **address** (string) - Required - The contract address to query. ``` -------------------------------- ### GET /api?module=account&action=tokentx&address={wallet_address} Source: https://docs.dotone.online/developers/api-reference Returns token transfers for a given wallet address on the DotOne Explorer. ```APIDOC ## [GET] /api?module=account&action=tokentx&address={wallet_address} ### Description Returns token transfers for a given wallet address on the DotOne Explorer. ### Method GET ### Endpoint https://dotscan.one/api/?module=account&action=tokentx&address={wallet_address} ### Parameters #### Query Parameters - **module** (string) - Required - Must be "account". - **action** (string) - Required - Must be "tokentx". - **address** (string) - Required - The wallet address to query. ``` -------------------------------- ### GET /api?module=block&action=getblockreward&blockno={block_number} Source: https://docs.dotone.online/developers/api-reference Returns details for a specific block on the DotOne Explorer. ```APIDOC ## [GET] /api?module=block&action=getblockreward&blockno={block_number} ### Description Returns details for a specific block on the DotOne Explorer. ### Method GET ### Endpoint https://dotscan.one/api/?module=block&action=getblockreward&blockno={block_number} ### Parameters #### Query Parameters - **module** (string) - Required - Must be "block". - **action** (string) - Required - Must be "getblockreward". - **blockno** (number) - Required - The block number to query. ``` -------------------------------- ### GET /api?module=account&action=txlist&address={wallet_address}&page=1&offset=20 Source: https://docs.dotone.online/developers/api-reference Returns the transaction history for a given wallet address on the DotOne Explorer. ```APIDOC ## [GET] /api?module=account&action=txlist&address={wallet_address}&page=1&offset=20 ### Description Returns the transaction history for a given wallet address on the DotOne Explorer. ### Method GET ### Endpoint https://dotscan.one/api/?module=account&action=txlist&address={wallet_address}&page=1&offset=20 ### Parameters #### Query Parameters - **module** (string) - Required - Must be "account". - **action** (string) - Required - Must be "txlist". - **address** (string) - Required - The wallet address to query. - **page** (number) - Optional - Page number for pagination. - **offset** (number) - Optional - Number of records per page. ``` -------------------------------- ### Explorer API - Get Token Transfers for Address Source: https://docs.dotone.online/developers/api-reference GET request to the Explorer API to retrieve token transfers for a wallet address. ```http GET /api?module=account&action=tokentx&address={wallet_address} ``` -------------------------------- ### Explorer API - Get Transaction Details Source: https://docs.dotone.online/developers/api-reference GET request to the Explorer API to retrieve transaction details by transaction hash. ```http GET /api?module=transaction&action=gettxinfo&txhash={tx_hash} ``` -------------------------------- ### GET /api?module=transaction&action=gettxinfo&txhash={tx_hash} Source: https://docs.dotone.online/developers/api-reference Returns details for a specific transaction on the DotOne Explorer. ```APIDOC ## [GET] /api?module=transaction&action=gettxinfo&txhash={tx_hash} ### Description Returns details for a specific transaction on the DotOne Explorer. ### Method GET ### Endpoint https://dotscan.one/api/?module=transaction&action=gettxinfo&txhash={tx_hash} ### Parameters #### Query Parameters - **module** (string) - Required - Must be "transaction". - **action** (string) - Required - Must be "gettxinfo". - **txhash** (string) - Required - The transaction hash to query. ``` -------------------------------- ### Get Wallet Balance - Request Source: https://docs.dotone.online/developers/api-reference Curl command to fetch the balance of a wallet address using eth_getBalance. Replace {wallet_address} with the address. The balance is returned in Wei. ```bash curl -X POST https://rpc.dotone.network \ -H "Content-Type: application/json" \ --data '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x{wallet_address}", "latest"], "id": 1 }' ``` -------------------------------- ### Explorer API - Get Block Details Source: https://docs.dotone.online/developers/api-reference GET request to the Explorer API to retrieve block details by block number. ```http GET /api?module=block&action=getblockreward&blockno={block_number} ``` -------------------------------- ### Get Latest Block Number - Response Source: https://docs.dotone.online/developers/api-reference Example JSON-RPC response for eth_blockNumber, returning the latest block number in hexadecimal. ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1a2b3c" } ``` -------------------------------- ### Explorer API - Get Contract ABI Source: https://docs.dotone.online/developers/api-reference GET request to the Explorer API to retrieve the ABI of a contract by address. ```http GET /api?module=contract&action=getabi&address={contract_address} ``` -------------------------------- ### Retrieve enode information from sentry node console Source: https://docs.dotone.online/validator/secure-validator Run this command in each sentry node's console to get its enode URL, which is needed for configuring the validator's static peers. The output is an enode URL in the format shown below. ```javascript admin.nodeInfo.enode ``` -------------------------------- ### Explorer API - Get Address Transaction History Source: https://docs.dotone.online/developers/api-reference GET request to the Explorer API to retrieve transaction history for a wallet address. ```http GET /api?module=account&action=txlist&address={wallet_address}&page=1&offset=20 ``` -------------------------------- ### Get Transaction by Hash - Request Source: https://docs.dotone.online/developers/api-reference Curl command to fetch transaction details by hash using eth_getTransactionByHash. Replace {transaction_hash} with the actual hash. ```bash curl -X POST https://rpc.dotone.network \ -H "Content-Type: application/json" \ --data '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x{transaction_hash}"], "id": 1 }' ``` -------------------------------- ### Get Latest Block Number - Request Source: https://docs.dotone.online/developers/api-reference Curl command to fetch the latest block number from the DotOne RPC endpoint using the eth_blockNumber method. ```bash curl -X POST https://rpc.dotone.network \ -H "Content-Type: application/json" \ --data '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` -------------------------------- ### Attach to local JSON-RPC console with geth Source: https://docs.dotone.online/developers/json-rpc Use this command to attach to the JSON-RPC console of your own DotOne node, similar to any Geth-based chain. Requires running your own node first (see Node Operators). Standard eth_, net_, and web3_ namespace calls behave as documented in the API Reference. ```bash geth attach http://127.0.0.1:8545 ``` -------------------------------- ### Import BLS Key Source: https://docs.dotone.online/validator/run-validator Imports an existing BLS key from a key file. ```bash geth bls account import ${KEY_FILE} --datadir ${DATA_DIR} ``` -------------------------------- ### Generate Consensus Address Source: https://docs.dotone.online/validator/run-validator Creates a new consensus account and sets a password. DATA_DIR is the path where keystore files will be stored. ```bash geth account new --datadir ${DATA_DIR} ``` -------------------------------- ### Connect with web3.py Source: https://docs.dotone.online/developers/api-reference Python code to connect to the DotOne RPC using web3.py and check connection and latest block number. ```python from web3 import Web3 w3 = Web3(Web3.HTTPProvider("https://rpc.dotone.network")) print("Connected:", w3.is_connected()) print("Latest block:", w3.eth.block_number) ``` -------------------------------- ### Resume Block Production Source: https://docs.dotone.online/validator/run-validator Resumes producing blocks from the node console. ```js miner.start() ``` -------------------------------- ### Confirm sentry node connections with admin.peers Source: https://docs.dotone.online/validator/secure-validator Run in the validator node's geth console to list connected peers. Verify each configured sentry node appears; if missing, check the enode URL, IP address, and port configuration. ```javascript admin.peers ``` -------------------------------- ### Attach to Node Console Source: https://docs.dotone.online/validator/run-validator Connects to the node's console via IPC to stop or resume block production. ```bash geth attach ipc:path/to/geth.ipc ``` -------------------------------- ### WebSocket Connect Source: https://docs.dotone.online/developers/api-reference JavaScript code to establish a WebSocket connection to the DotOne WebSocket endpoint. ```js const ws = new WebSocket("wss://ws.dotone.network"); ``` -------------------------------- ### Connect with ethers.js Source: https://docs.dotone.online/developers/api-reference JavaScript code to connect to the DotOne RPC using ethers.js and fetch the latest block number. ```js import { ethers } from "ethers"; const provider = new ethers.JsonRpcProvider("https://rpc.dotone.network"); const blockNumber = await provider.getBlockNumber(); console.log("Latest block:", blockNumber); ``` -------------------------------- ### Filter Peers by Pattern Source: https://docs.dotone.online/validator/run-validator Disconnects peers running a problematic version by updating config.toml. Restart the node after applying the change; this is a temporary measure. ```toml [Node.P2P] PeerFilterPatterns = ["Geth/v{problematic-version}.*"] ``` -------------------------------- ### Run Metrics Exporter via Docker Source: https://docs.dotone.online/validator/run-validator Runs a metrics exporter container to monitor node status. Reference dashboard: Grafana Dashboard #6976. ```bash docker run -it -d -p 9090:9090 \ -e "GETH=http://your-node-address:8545" \ hunterlong/gethexporter ``` -------------------------------- ### Subscribe to Contract Logs Source: https://docs.dotone.online/developers/api-reference JavaScript code to subscribe to contract logs via WebSocket using eth_subscribe with the logs parameter. Replace {contract_address} with the contract address. ```js ws.send(JSON.stringify({ "jsonrpc": "2.0", "method": "eth_subscribe", "params": [ "logs", { "address": "0x{contract_address}", "topics": [] } ], "id": 3 })); ``` -------------------------------- ### Save Consensus Password to File Source: https://docs.dotone.online/validator/run-validator Saves the consensus account password to a file named password.txt. ```bash echo {your-consensus-account-password} > password.txt ``` -------------------------------- ### Subscribe to New Block Headers Source: https://docs.dotone.online/developers/api-reference JavaScript code to subscribe to new block headers via WebSocket using eth_subscribe with the newHeads parameter. ```js ws.send(JSON.stringify({ "jsonrpc": "2.0", "method": "eth_subscribe", "params": ["newHeads"], "id": 1 })); ``` -------------------------------- ### POST https://rpc.dotone.network - eth_getBalance Source: https://docs.dotone.online/developers/api-reference Returns the balance of the account of a given address. The balance is returned in Wei. This is a standard Ethereum JSON-RPC method. ```APIDOC ## [POST] https://rpc.dotone.network ### Description Returns the balance of the account of a given address. The balance is returned in Wei. This is a standard Ethereum JSON-RPC method. ### Method POST ### Endpoint https://rpc.dotone.network ### Parameters #### Request Body - **jsonrpc** (string) - Required - JSON-RPC version, must be "2.0". - **method** (string) - Required - The method name, "eth_getBalance". - **params** (array) - Required - Array containing the wallet address and the block parameter (e.g., "latest"). - **id** (number) - Required - Request identifier. ### Request Example { "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x{wallet_address}", "latest"], "id": 1 } ### Response #### Success Response (200) - **jsonrpc** (string) - JSON-RPC version. - **id** (number) - Request identifier. - **result** (string) - The balance in Wei as a hexadecimal string. #### Response Example { "jsonrpc": "2.0", "id": 1, "result": "0x56BC75E2D63100000" } ``` -------------------------------- ### Configure validator config.toml with sentry nodes Source: https://docs.dotone.online/validator/secure-validator Add these settings to the validator node's config.toml to hide it from public discovery and connect only to sentry nodes. Replace the enode URLs with your sentry nodes' actual enode information and IP addresses. ```toml # Hide validator from public discovery NoDiscovery = true # Connect exclusively to sentry nodes StaticNodes = [ "enode://f2da64f49c30a0038bba3391f40805d531510c473ec2bcc7c201631ba003c6f16fa09e03308e48f87d21c0fed1e4e0bc53428047f6dcf34da344d3f5bb69373b@[10.1.1.1]:30306", "enode://{sentry-node-2-enode}@[10.1.1.2]:30306" ] ``` -------------------------------- ### Verify BLS Address Source: https://docs.dotone.online/validator/run-validator Lists BLS accounts to verify the BLS address. ```bash geth bls account list --datadir ${DATA_DIR} ``` -------------------------------- ### Save BLS Password to File Source: https://docs.dotone.online/validator/run-validator Saves the BLS wallet password to a file named blspassword.txt. ```bash echo {your-bls-wallet-password} > blspassword.txt ``` -------------------------------- ### WebSocket wss://ws.dotone.network - eth_subscribe (newHeads) Source: https://docs.dotone.online/developers/api-reference Subscribes to new block headers via WebSocket. This is a standard Ethereum JSON-RPC subscription method. ```APIDOC ## [WebSocket] wss://ws.dotone.network ### Description Subscribes to new block headers via WebSocket. This is a standard Ethereum JSON-RPC subscription method. ### Method WebSocket send ### Endpoint wss://ws.dotone.network ### Parameters #### Request Body - **jsonrpc** (string) - Required - JSON-RPC version, must be "2.0". - **method** (string) - Required - The method name, "eth_subscribe". - **params** (array) - Required - Array containing the subscription type "newHeads". - **id** (number) - Required - Request identifier. ### Request Example { "jsonrpc": "2.0", "method": "eth_subscribe", "params": ["newHeads"], "id": 1 } ``` -------------------------------- ### WebSocket wss://ws.dotone.network - eth_subscribe (logs) Source: https://docs.dotone.online/developers/api-reference Subscribes to contract logs via WebSocket. This is a standard Ethereum JSON-RPC subscription method. ```APIDOC ## [WebSocket] wss://ws.dotone.network ### Description Subscribes to contract logs via WebSocket. This is a standard Ethereum JSON-RPC subscription method. ### Method WebSocket send ### Endpoint wss://ws.dotone.network ### Parameters #### Request Body - **jsonrpc** (string) - Required - JSON-RPC version, must be "2.0". - **method** (string) - Required - The method name, "eth_subscribe". - **params** (array) - Required - Array containing the subscription type "logs" and an object with address and topics. - **id** (number) - Required - Request identifier. ### Request Example { "jsonrpc": "2.0", "method": "eth_subscribe", "params": [ "logs", { "address": "0x{contract_address}", "topics": [] } ], "id": 3 } ``` -------------------------------- ### Generate BLS Vote Address Source: https://docs.dotone.online/validator/run-validator Creates a new BLS account for Fast Finality voting. ```bash geth bls account new --datadir ${DATA_DIR} ``` -------------------------------- ### Exit Maintenance Mode Source: https://docs.dotone.online/validator/run-validator Sends a transaction from the validator's consensus address to exit maintenance mode. The node enters maintenance mode after 50 slashes and may be jailed if not exited in time. ```js geth attach geth.ipc web3.eth.sendTransaction({ from: "0x{your-consensus-address}", to: "0x0000000000000000000000000000000000001000", data: "0x04c4fec6" }) ``` -------------------------------- ### Subscribe to Pending Transactions Source: https://docs.dotone.online/developers/api-reference JavaScript code to subscribe to pending transactions via WebSocket using eth_subscribe with the newPendingTransactions parameter. ```js ws.send(JSON.stringify({ "jsonrpc": "2.0", "method": "eth_subscribe", "params": ["newPendingTransactions"], "id": 2 })); ``` -------------------------------- ### Check Slash Count Source: https://docs.dotone.online/validator/run-validator Checks the validator's slash count at the latest block or a specific block number. A well-operating validator should have zero or near-zero daily slashes; more than three in a day signals a problem. ```bash cd /cmd/jsutils # Check slashes at the latest block: node getslashcount.js --Rpc https://rpc.dotone.network # Check slashes at a specific block number: node getslashcount.js --Rpc https://rpc.dotone.network --Num {block_number} ``` -------------------------------- ### WebSocket wss://ws.dotone.network - eth_subscribe (newPendingTransactions) Source: https://docs.dotone.online/developers/api-reference Subscribes to new pending transactions via WebSocket. This is a standard Ethereum JSON-RPC subscription method. ```APIDOC ## [WebSocket] wss://ws.dotone.network ### Description Subscribes to new pending transactions via WebSocket. This is a standard Ethereum JSON-RPC subscription method. ### Method WebSocket send ### Endpoint wss://ws.dotone.network ### Parameters #### Request Body - **jsonrpc** (string) - Required - JSON-RPC version, must be "2.0". - **method** (string) - Required - The method name, "eth_subscribe". - **params** (array) - Required - Array containing the subscription type "newPendingTransactions". - **id** (number) - Required - Request identifier. ### Request Example { "jsonrpc": "2.0", "method": "eth_subscribe", "params": ["newPendingTransactions"], "id": 2 } ``` -------------------------------- ### POST https://rpc.dotone.network - eth_getTransactionByHash Source: https://docs.dotone.online/developers/api-reference Returns information about a transaction specified by its hash. This is a standard Ethereum JSON-RPC method. ```APIDOC ## [POST] https://rpc.dotone.network ### Description Returns information about a transaction specified by its hash. This is a standard Ethereum JSON-RPC method. ### Method POST ### Endpoint https://rpc.dotone.network ### Parameters #### Request Body - **jsonrpc** (string) - Required - JSON-RPC version, must be "2.0". - **method** (string) - Required - The method name, "eth_getTransactionByHash". - **params** (array) - Required - Array containing the transaction hash as a string. - **id** (number) - Required - Request identifier. ### Request Example { "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x{transaction_hash}"], "id": 1 } ``` -------------------------------- ### Stop Block Production Source: https://docs.dotone.online/validator/run-validator Stops producing blocks from the node console. ```js miner.stop() ``` -------------------------------- ### POST https://rpc.dotone.network - eth_blockNumber Source: https://docs.dotone.online/developers/api-reference Returns the number of the most recent block on the DotOne Smart Chain. This is a standard Ethereum JSON-RPC method. ```APIDOC ## [POST] https://rpc.dotone.network ### Description Returns the number of the most recent block on the DotOne Smart Chain. This is a standard Ethereum JSON-RPC method. ### Method POST ### Endpoint https://rpc.dotone.network ### Parameters #### Request Body - **jsonrpc** (string) - Required - JSON-RPC version, must be "2.0". - **method** (string) - Required - The method name, "eth_blockNumber". - **params** (array) - Required - Empty array for this method. - **id** (number) - Required - Request identifier. ### Request Example { "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 } ### Response #### Success Response (200) - **jsonrpc** (string) - JSON-RPC version. - **id** (number) - Request identifier. - **result** (string) - The latest block number as a hexadecimal string. #### Response Example { "jsonrpc": "2.0", "id": 1, "result": "0x1a2b3c" } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.