This a web3 fork of the ethereum version, it was adapted to the Bowhead GAHT network echosystem.
npm install git+https://github.com/bowhead/web3.js.gityarn add https://github.com/bowhead/web3.js.gitYou must include web3 first:
const Web3 = require('web3')Then you can use it like this:
console.log(Web3); // {aht: .., shh: ...} // it's here!Set a provider (HttpProvider)
if (typeof Web3 !== 'undefined') {
web3 = new Web3(web3.currentProvider);
} else {
// set the provider you want from Web3.providers
web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:9634"));
}Set a provider (HttpProvider using HTTP Basic Authentication)
web3.setProvider(new web3.providers.HttpProvider('http://host.url', 0, BasicAuthUsername, BasicAuthPassword));There you go, now you can use it:
var coinbase = web3.aht.coinbase;
var balance = web3.aht.getBalance(coinbase);You can find more examples in example directory.
- Node.js
- npm
sudo apt-get update
sudo apt-get install nodejs
sudo apt-get install npm
sudo apt-get install nodejs-legacynpm run-script buildnpm test