-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
22 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,11 +2,13 @@ | |
|
||
AI Network Client Library for Node.js | ||
|
||
|
||
## Installation | ||
``` | ||
yarn add @ainblockchain/ain-js | ||
``` | ||
|
||
|
||
## Examples | ||
``` | ||
const Ain = require('./lib/ain').default; | ||
|
@@ -30,6 +32,26 @@ const accounts = ain.db.ref('/accounts').getValue().then(result => { | |
}); | ||
``` | ||
|
||
## Test How-To | ||
1. Clone AIN Blockchain and install | ||
``` | ||
git clone [email protected]:ainblockchain/ain-blockchain.git | ||
yarn install | ||
``` | ||
|
||
2. Start blockchain locally | ||
``` | ||
bash start_local_blockchain.sh | ||
``` | ||
* Note that the node 2 of the blockchain needs to be started with ENABLE_EVENT_HANDLER=true env variable for the event manager test cases. | ||
|
||
3. Run tests | ||
``` | ||
yarn run test | ||
yarn run test_snapshot # update test snapshot files | ||
``` | ||
|
||
|
||
## API | ||
|
||
### Ain | ||
|
@@ -288,25 +310,6 @@ eventCallback?: BlockchainEventCallback, errorCallback?: (error: any) => void): | |
`unsubscribe(filterId: string, callback: ErrorFirstCallback<EventFilter>)` | ||
- Unsubscribe from a previously subscribed event. | ||
|
||
## Test How-To | ||
1. Clone AIN Blockchain and install | ||
``` | ||
git clone [email protected]:ainblockchain/ain-blockchain.git | ||
yarn install | ||
``` | ||
|
||
2. Start blockchain locally | ||
``` | ||
bash start_local_blockchain.sh | ||
``` | ||
* Note that the node 2 of the blockchain needs to be started with ENABLE_EVENT_HANDLER=true env variable for the event manager test cases. | ||
|
||
3. Run tests | ||
``` | ||
yarn run test | ||
yarn run test_snapshot # update test snapshot files | ||
``` | ||
|
||
|
||
## LICENSE | ||
|
||
|