Installing Neb.js
Neb.js provides API interface for JavaScript development
- Create a Neb folder, enter the folder in the terminal command line, clone neb.js
git clone https://github.com/nebulasio/neb.js.git
- Creates a new Neb.js folder, enters the folder, installs all dependent
npm install
- Installing Gulp
npm install gulp
- Packaging and generating neb.js files
gulp
- Successful execution will generate the/dist folder, and the folder will generate the JS file we want to use.
- neb.js:Used in Browser side. including outside dependency.
- neb-light.js:used in REPL console. Not including outside dependency.
- nebulas.js:Fully functional in the browser. Users can create an address, sign a transaction, and Deploy/call a smart contract.
Installing Nebpay
The Nebpay SDK provides a unified payment interface for trading on different platforms, and developers can use the Nebpay API on the Dapp page to make transaction payments and contract calls via the browser plugin wallet, mobile app wallet, and more.
GitHub Address: Https://github.com/nebulasio/nebPay
Installation method is the same as above. The Nebpay.js file is generated
Development Dapp
The functionality to implement is very simple:
- Call the Save method in the contract to publish information
- Call the Read method in the contract to read the information
Build a project
Put the previously generated nebulas.js and Nebpay.js in the Libs folder, my directory structure is as follows:
Index.html Source
<!DOCTYPE html>
Nebula Chain Intelligent Contract Development (VII): DAPP Development