ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

New WINDEV and WEBDEV 2024 feature!
Help / WLanguage / WLanguage functions / Standard functions / Windows functions / BitcoinCore functions
  • Overview
  • Server configuration
  • Prerequisites
  • Setting up a Bitcoin server
  • RPC server configuration
  • Using WLanguage functions on client computers
  • Server access configuration
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Overview
WLanguage offers several functions for manipulating a Bitcoin Core server. This help page explains how to:
Server configuration

Prerequisites

To use a Bitcoin Core server, you must have:
  • a server with 1 TB of free disk space,
  • access to this server, either through a local network or via an SSH tunnel. For security reasons, it is not recommended to use public networks.

Setting up a Bitcoin server

To set up a Bitcoin server:
  1. Download the program from: https://bitcoin.org/en/download.
  2. Install the software and follow the steps.
  3. Once setup is complete, click "Settings" and then select "Options". In the "Main" tab, check "Start Bitcoin Core on system login".
  4. Run "bitcoin-qt.exe". Let the program synchronize with the Bitcoin network (this may take several days).

RPC server configuration

To enable RPC calls:
  1. Click "Settings" and then select "Options".
  2. In the "Main" tab, check "Enable RPC server".
  3. Also, modify the Bitcoin Core configuration file via one of the following methods:
    • in the "Options" window, "Main" tab, click "Open Configuration File".
    • edit the "bitcoin.conf" file directly (in the "%APPDATA%\Bitcoin" folder). For example: "C:\Users\bob\AppData\Roaming\Bitcoin\bitcoin.conf"
  4. Add the following lines in the file:
    # Enable JSON/RPC API
    server=1
    # Server IP address, found with IPConfig, for example
    rpcbind=172.17.1.255
    # IP addresses of clients allowed to make calls:
    # All computers with address 172.17.2.xxx
    rpcallowip=172.17.2.1/255.255.255.1
    # Port number
    rpcport=8332
    # Username and password
    rpcuser=username
    rpcpassword=password
Using WLanguage functions on client computers

Server access configuration

To configure access to the server, use BitcoinCoreConfigure:
// Initializes Bitcoin server connection parameters
BitcoinCoreConfigure(btcRpcServerAddress, "172.17.1.255")
BitcoinCoreConfigure(btcRpcPortNumber, 8332)
BitcoinCoreConfigure(btcRpcUser, "username")
BitcoinCoreConfigure(btcRpcPassword, "password")
BitcoinCoreConfigure(btcTimeout, 3) // 3 seconds
You can then use WLanguage functions:
dateBlock is DateTime = BitcoinCoreDateTimeLatestBlock()
IF ErrorOccurred THEN
    Error()
    RETURN
END
Info("Latest block " + dateBlock)
Minimum version required
  • Version 2024
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 01/17/2024

Send a report | Local help