pentajs
v0.4.0-alpha
Published
Penta SDK for javascript
Downloads
6
Readme
Introduction
pentajs is a collection of JavaScript libraries communicating with penta nodes that support calling local or remote Penta peers through http, websocket, or IPC connections. Use cases: Penta wallet, Dapp development, smart contract IDE and other applications developed based on Penta node.
Features
- Port encapsulation communicating with Penta nodes that support calling RPC, IPC
- Create and manage Penta account
- Signature/send transactions
- Delegate voting
- Protocal governance
- Deploy/call smart contracts(Coming soon)
Environment
Node and browser (es2015)
Install
Node.js
npm install pentajs
Browser
dist ./penta.min.js
Usage
Set request
var penta = new Penta();
if (window.IpcRequest) {
//ipc
penta.setRequest(window.IpcRequest);
} else {
//http
penta.setRequest(new penta.HttpRequest());
}
now you can use it
var blockchain = penta.blockchain;
blockchain.blockNumber().then(function(result) {
console.log(penta.toDecimal(result)); // 67
});
more than examples
- web-example an example that use penta-sdk-js to call Penta nodes using browser
- nodejs-example an example that use penta-sdk-js to call Penta nodes using nodejs
- ipcRequest-example an example that use penta-sdk-js to call Penta nodes using client
Documentation
Penta Blockchain JavaScript API Documentation
Or build API documentation run yarn docs
Development
requirment
installation dependencies
yarn
package the penta-sdk-js
yarn build
test the penta-sdk-js
yarn test
creact the penta-sdk-js documentation:
yarn docs
run node.js environment
node ./example/node-app.js
run IPC request demo
node ipcTest/indexPre.js
Contributions
Support
If you have any questions or encounter any problems, feel free to contact our support technical team ([email protected]).
We appreciate your help!
If you could have any good ideas about this project and be willing to share with us, we would really appreciate your help!
You can either fork, fix, commit and open a pull request with a signed commit or send your code as emails to the developer mailing list([email protected]).
Please make sure your contributions adhere to our coding guidelines:
- Code must adhere to the [Prettier] guidelines(https://github.com/prettier/prettier)
- Code must be checked by eslint, using command
yarn lint
- Pull requests need to be based on and opened against the
master
branch. - Commit messages should be prefixed with the package(s) they modify.
- E.g. "account:add parameter ‘passphrase’ on method newAccount"
Also, we will provide latest information regarding our project or the block chain technology via our mailing list. You're welcome to join our mailing list or developer forum.
License
This project is licensed under the MIT License. You can read the LICENSE file in the root directory for details.