## What is Tron-Web?
## Installing Tron-Web
You can install Tron-Web using the latest release on NPM or by downloading the latest distributable js files.
Note on Version
For the latest **Java-Tron Odyssey 3.5** release, the **minimum compatible TronWeb version is TronWeb 2.3.0**. Please ensure you have this version installed.
## Creating an Instance
## Tron-Web Object
To instantiate a TronWeb object within your DApp, please see the API reference for<a href="https://developers.tron.network/reference#tronweb-object" target="_blank"> instantiating a TronWeb Object</a>
Providers are used to provide methods of transport for requests. At the moment, Tron-Web only supports a single transport - HTTP.
### HTTP Provider
If you wish to provide more options to the node endpoints, such as user authentication or custom headers, you can pass a `
|constructor()||Column Title||Column Title|
|`||||The host URI of the node|
|`||`||Optional default timeout when dispatching requests|
|`||`||Optional username for user authentication|
|`||`||Optional password for user authentication|
|`||`||Optional headers to pass to requests|
|`||`||Optional status page to query when checking if the node is connected|
## Default Values
Tron-Web allows you to set a number of default values for fetching, creating, and dispatching transactions.
### setDefaultBlock(blockID = false)
This allows you to set the default block (hash or number) for use when querying transactions (and in some instances, creating).
### setPrivateKey(privateKey = false)
When set, this private key will sign transactions without the need to pass a private key argument to each function call.
### setAddress(address = false)
For use when creating unsigned transactions. This will fill in the `
owner_address` property for each transaction created by the HTTP API. **This is automatically set if you call** `
## Promises vs. Callbacks
Tron-Web has been designed to be as compatible with Ethereum's Web3 implementation as possible. This means we support callbacks in the majority of our functions.
That doesn't mean Tron-Web is limited in any shape or form. This means that we also support promises. By default, calling a function will return a promise. If you provide a callback function, then a promise will not be returned and the callback will act as the response trigger instead.
_**Note:** Don't worry if a method takes optional arguments - the last argument provided will always be treated as the callback._
For testing TronWeb API functions, it would be best to setup a private network on your local machine using the <a href="https://developers.tron.network/docs/getting-started-1" target="_blank">TRON Docker Quickstart guide</a>. The Docker guide sets up a Full Node, Solidity Node, and Event Server on your machine. You can then deploy smart contracts on your network and interact with them via TronWeb. If you wish to test TronWeb with other users, it would be best to deploy your contracts/DApps on the Shasta test network and interact from there.