🚀Getting Started
The extensive selection of SDKs, packages, and libraries is specifically designed for various Web3 environments and programming languages, ensuring the appropriate tools are available for your particular application:
Node Package Module containing a Js/Ts library, bots and CLI binaries.
Javascript and Typescript developers willing to interact with the Witnet blockchain.
Node.js Package Module containing a Js/Ts library, bots and CLI binaries.
Developers willing to report notarized oracle queries from the Witnet blockchain into smart contracts in EVM-compatible chains, get smart contracts to build verifiable oracle queries on-chain, or pull them off from the Witnet blockchain. Embeds @witnet/sdk.
Node.js Package Module exporting Witnet-compliant Radon requests for polling, notarizing and reporting price feed updates into smart contracts.
Devops and devs willing to leverage, query or autonomously report notarized price feed updates, subsidized or not by the Witnet Foundation. Embeds: @witnet/sdk and @witnet/solidity.
Dart package containing a library, as well as some CLI helper commands.
A library in Dart to interface with the Witnet Protocol, enabling Dart applications to build, sign, and send value transfers and data requests - communicate with a Witnet nodes, Witnet Wallet servers and/or the Witnet Explorer backend.
Github release package including Rust-compiled binaries for multiple OS platforms. These binaries can run either a full node, archive nodes, Wallet servers and a CLI.
The package implements many components in Rust, like a fully validating node, a separte wallet server for managing Witnet keys and transactions, aside from multiple Rust libraries.
No need to run a Witnet node, stake WIT coins, or pay subscription fees to use any of these packages. They're open-source and distributed under the MIT license.
Interacting with the Witnet blockchain
Native support
Applications in Javascript, Dart and Rust can autonomously create, sign and broadcast well-formed transactions to the Witnet network, as specific native libraries exists for these programming languages. Usage examples for these languages can be found in the How-to Guides in this section:
🏗️How-to GuidesMulti-layered support
Interacting with the Witnet blockchain is still possible from other programming languages, although a different and multi-layer architecture is required for such purpose, leveraging some of the server binaries distributed within any witnet-rust release.
Witnet-rust binary
The Rust-compiled Witnet binary can be easily run:
The Rust-compiled Witnet binary contains two different components that provide different degrees of wallet functionality:
witnet node
Implements a Witnet full node with an internal single-account, single-address wallet and a JSON-RPC API over TCP.
witnet wallet
Implements a BIP-32 compliant, multi-account, multi-address Hierarchical Deterministic wallet, and a JSON-RPC API over WebSockets.
Interacting via a Witnet full- or archival- node
The Witnet-Rust node component is standalone — you can run it on its own and it will provide full-node functionality: syncing up the Witnet block chain, validate transactions and blocks in real time, and (optionally) propose blocks.
Integration architecture:
[YOUR APP] → [WITNET-RUST NODE] → [WITNET NETWORK]Once a node instance is fully synced, its JSON-RPC over TCP API offers a minimal single-account, single-address wallet. Running a Witnet-Rust node with the JSON-RPC API exposed on local port 21338 can easily be achieved with this Docker one-liner:
docker run -d \
--name witnet_node \
--volume ~/.witnet:/.witnet \
--publish 21337:21337 \
--publish 21338:21338 \
--restart always \
witnet/witnet-rustHere is a quick guide on how to interact with a node using the JSON-RPC interface and any TCP client:
The full list of supported JSON-RPC methods is available in the Node API Reference:
Wit/Node JSON-RPC APIInteracting via a Witnet wallet server
The Witnet-Rust wallet component is NOT standalone. It requires a connection to an instance of the node component that will act as its "backend":
Integration architecture:
[YOUR APP] → [WITNET-RUST WALLET] → [WITNET-RUST NODE] → [WITNET NETWORK]Witnet Foundation operates a cluster of publicly available node instances that act as the backend for the wallet component contained within the Sheikah Witnet wallet desktop app, which follows exactly the same architecture:
Sheikah Wallet app architecture:
[SHEIKAH UI*] → [WITNET-RUST WALLET*] → [WITNET-RUST NODE] → [WITNET NETWORK]
* The Sheikah UI and the Witnet-Rust wallet are run in the user's computer.For users looking for the maximum degree of privacy, it is recommended that they run their own instance of the node component, because otherwise they may be disclosing their addresses and balances to 3rd parties, as the queries between the wallet and node components need to be sent over the Internet.
The JSON-RPC API of the wallet component is different than the one from the node not because it has much more advanced wallet functionality, and uses a WebSockets transport instead of plain TCP (this is to enable web wallets and similar apps).
A full reference of the Wallet API can be found here:
Wit/Wallet JSON-RPC APILast updated
Was this helpful?
