├── .github
├── CONTRIBUTING.md
├── ISSUE_TEMPLATE.md
└── PULL_REQUEST_TEMPLATE.md
├── .gitignore
├── .npmrc
├── .prettierrc
├── BOOTSTRAP_FILES.md
├── EVENT_EMITTERS.md
├── LICENSE.md
├── OPTIONAL_PARAMETERS.md
├── README.md
├── dist
├── analyzers
│ ├── block-analyzer.d.ts
│ ├── block-analyzer.js
│ └── block-analyzer.js.map
├── common
│ ├── constants.d.ts
│ ├── constants.js
│ ├── constants.js.map
│ ├── profiles.d.ts
│ ├── profiles.js
│ └── profiles.js.map
├── core
│ ├── api.d.ts
│ ├── api.js
│ ├── api.js.map
│ ├── mesh.d.ts
│ ├── mesh.js
│ ├── mesh.js.map
│ ├── node.d.ts
│ ├── node.js
│ ├── node.js.map
│ ├── syncer.d.ts
│ ├── syncer.js
│ └── syncer.js.map
├── delegates
│ ├── rpc-delegate.d.ts
│ ├── rpc-delegate.js
│ └── rpc-delegate.js.map
├── helpers
│ ├── block-helper.d.ts
│ ├── block-helper.js
│ └── block-helper.js.map
├── neo.d.ts
├── neo.js
├── neo.js.map
├── storages
│ ├── memory-storage.d.ts
│ ├── memory-storage.js
│ ├── memory-storage.js.map
│ ├── mongodb-storage.d.ts
│ ├── mongodb-storage.js
│ ├── mongodb-storage.js.map
│ └── mongodb
│ │ ├── block-dao.d.ts
│ │ ├── block-dao.js
│ │ ├── block-dao.js.map
│ │ ├── block-meta-dao.d.ts
│ │ ├── block-meta-dao.js
│ │ ├── block-meta-dao.js.map
│ │ ├── schemas.d.ts
│ │ ├── schemas.js
│ │ ├── schemas.js.map
│ │ ├── transaction-meta-dao.d.ts
│ │ ├── transaction-meta-dao.js
│ │ ├── transaction-meta-dao.js.map
│ │ ├── utils.d.ts
│ │ ├── utils.js
│ │ └── utils.js.map
└── validators
│ ├── endpoint-validator.d.ts
│ ├── endpoint-validator.js
│ ├── endpoint-validator.js.map
│ ├── mongodb-validator.d.ts
│ ├── mongodb-validator.js
│ ├── mongodb-validator.js.map
│ ├── neo-validator.d.ts
│ ├── neo-validator.js
│ ├── neo-validator.js.map
│ ├── rpc-validator.d.ts
│ ├── rpc-validator.js
│ └── rpc-validator.js.map
├── docs
├── assets
│ ├── css
│ │ ├── main.css
│ │ └── main.css.map
│ ├── images
│ │ ├── icons.png
│ │ ├── icons@2x.png
│ │ ├── widgets.png
│ │ └── widgets@2x.png
│ └── js
│ │ ├── main.js
│ │ └── search.js
├── classes
│ ├── _analyzers_block_analyzer_.blockanalyzer.html
│ ├── _core_api_.api.html
│ ├── _core_mesh_.mesh.html
│ ├── _core_node_.node.html
│ ├── _core_syncer_.syncer.html
│ ├── _delegates_rpc_delegate_.rpcdelegate.html
│ ├── _helpers_block_helper_.blockhelper.html
│ ├── _neo_.neo.html
│ ├── _storages_memory_storage_.memorystorage.html
│ ├── _storages_mongodb_block_dao_.blockdao.html
│ ├── _storages_mongodb_block_meta_dao_.blockmetadao.html
│ ├── _storages_mongodb_storage_.mongodbstorage.html
│ ├── _storages_mongodb_transaction_meta_dao_.transactionmetadao.html
│ ├── _storages_mongodb_utils_.mongodbutils.html
│ ├── _validators_endpoint_validator_.endpointvalidator.html
│ ├── _validators_mongodb_validator_.mongodbvalidator.html
│ ├── _validators_neo_validator_.neovalidator.html
│ └── _validators_rpc_validator_.rpcvalidator.html
├── globals.html
├── index.html
├── interfaces
│ ├── _analyzers_block_analyzer_.blockanalyzeroptions.html
│ ├── _core_api_.apioptions.html
│ ├── _core_api_.storageinsertpayload.html
│ ├── _core_mesh_.meshoptions.html
│ ├── _core_node_.nodemeta.html
│ ├── _core_node_.nodeoptions.html
│ ├── _core_syncer_.synceroptions.html
│ ├── _neo_.neooptions.html
│ ├── _storages_memory_storage_.blockitem.html
│ ├── _storages_memory_storage_.memorystorageoptions.html
│ └── _storages_mongodb_storage_.mongodbstorageoptions.html
└── modules
│ ├── _analyzers_block_analyzer_.html
│ ├── _common_constants_.html
│ ├── _common_profiles_.html
│ ├── _core_api_.html
│ ├── _core_mesh_.html
│ ├── _core_node_.html
│ ├── _core_syncer_.html
│ ├── _delegates_rpc_delegate_.html
│ ├── _helpers_block_helper_.html
│ ├── _neo_.html
│ ├── _storages_memory_storage_.html
│ ├── _storages_mongodb_block_dao_.html
│ ├── _storages_mongodb_block_meta_dao_.html
│ ├── _storages_mongodb_schemas_.html
│ ├── _storages_mongodb_storage_.html
│ ├── _storages_mongodb_transaction_meta_dao_.html
│ ├── _storages_mongodb_utils_.html
│ ├── _validators_endpoint_validator_.html
│ ├── _validators_mongodb_validator_.html
│ ├── _validators_neo_validator_.html
│ └── _validators_rpc_validator_.html
├── package-lock.json
├── package.json
├── src
├── analyzers
│ └── block-analyzer.ts
├── common
│ ├── constants.ts
│ └── profiles.ts
├── core
│ ├── api.ts
│ ├── mesh.ts
│ ├── node.ts
│ └── syncer.ts
├── delegates
│ └── rpc-delegate.ts
├── helpers
│ └── block-helper.ts
├── neo.ts
├── storages
│ ├── memory-storage.ts
│ ├── mongodb-storage.ts
│ └── mongodb
│ │ ├── block-dao.ts
│ │ ├── block-meta-dao.ts
│ │ ├── schemas.ts
│ │ ├── transaction-meta-dao.ts
│ │ └── utils.ts
└── validators
│ ├── endpoint-validator.ts
│ ├── mongodb-validator.ts
│ ├── neo-validator.ts
│ └── rpc-validator.ts
├── test
└── test.js
├── tsconfig.json
└── tslint.json
/.github/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to `neo-js`
2 |
3 | 1. [Getting Involved](#getting-involved)
4 | 1. [Questions and Discussion](#questions-and-discussion)
5 | 1. [Core Style Guide](#core-style-guide)
6 | 1. [Pull Request Process](#pull-request-process)
7 | 1. [Code of Conduct](#code-of-conduct)
8 |
9 | ## Getting Involved
10 |
11 | We're always looking for help identifying bugs, writing and reducing test cases, and improving documentation. Whether it is new feature or code improvement, anything passing our guidelines will be considered.
12 |
13 | When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.
14 |
15 | ## Questions and Discussion
16 |
17 | Please start by search the issue tracker as your issue may have already been discussed or fixed. If it is something that is not yet discussed, please file a new issue in the issue tracker.
18 |
19 | You may also use the [official community chat](https://discord.gg/R8v48YA) and join the software discussion on its developer channel.
20 |
21 | ## Core Style Guide
22 |
23 | `neo-js` is current under rapid developments and improvements, please follow core contributors' recommendation when raised.
24 |
25 | Before submitted a pull request, ensure you tested your code against ESLint rules in the project:
26 |
27 | ```js
28 | npm run format && npm run lint
29 | ```
30 |
31 | ## Pull Request Process
32 |
33 | 1. Ensure any install or build dependencies are removed before the end of the layer when doing a build.
34 | 1. Update the `README.md` with details of changes to the interface, this includes new environment variables, exposed ports, useful file locations and container parameters.
35 | 1. Pull requests are made against feature branches and the develop branch.
36 | 1. You may merge the Pull Request in once you have the sign-off of a developer on the project.
37 |
38 | ## Code of Conduct
39 |
40 | ### Our Pledge
41 |
42 | In the interest of fostering an open and welcoming environment, we as
43 | contributors and maintainers pledge to making participation in our project and
44 | our community a harassment-free experience for everyone, regardless of age, body
45 | size, disability, ethnicity, gender identity and expression, level of experience,
46 | nationality, personal appearance, race, religion, or sexual identity and
47 | orientation.
48 |
49 | ### Our Standards
50 |
51 | Examples of behavior that contributes to creating a positive environment
52 | include:
53 |
54 | * Using welcoming and inclusive language
55 | * Being respectful of differing viewpoints and experiences
56 | * Gracefully accepting constructive criticism
57 | * Focusing on what is best for the community
58 | * Showing empathy towards other community members
59 |
60 | Examples of unacceptable behavior by participants include:
61 |
62 | * The use of sexualized language or imagery and unwelcome sexual attention or advances
63 | * Trolling, insulting/derogatory comments, and personal or political attacks
64 | * Public or private harassment
65 | * Publishing others' private information, such as a physical or electronic address, without explicit permission
66 | * Other conduct which could reasonably be considered inappropriate in a professional setting
67 |
68 | ### Our Responsibilities
69 |
70 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
71 |
72 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
73 |
74 | ### Scope
75 |
76 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail
77 | address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
78 |
79 | ### Enforcement
80 |
81 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [INSERT EMAIL ADDRESS]. All complaints will be reviewed and investigated and will result in a response that
82 | is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
83 |
84 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
85 |
86 | ### Attribution
87 |
88 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
89 | available at [http://contributor-covenant.org/version/1/4][version]
90 |
91 | [homepage]: http://contributor-covenant.org
92 | [version]: http://contributor-covenant.org/version/1/4/
93 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | ## Context (Environment)
4 |
5 | * **`neo-js` Version**:
6 | * **`node` Version**:
7 | * **Operation System**:
8 | * **MongoDB Version** (if applicable):
9 |
10 | ## Expected behavior
11 |
12 | ## Actual behavior
13 |
14 | ## Steps to reproduce the behavior
15 |
16 | 1.
17 | 1.
18 | 1.
19 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | ## Description
4 |
5 |
6 | ## Motivation and Context
7 |
8 |
9 |
10 | ## How Has This Been Tested?
11 |
12 |
13 |
14 |
15 | ## Types of changes:
16 |
17 |
18 | - [ ] Bug fix (non-breaking change which fixes an issue)
19 | - [ ] New feature (non-breaking change which adds functionality)
20 | - [ ] Breaking change (fix or feature that would cause existing functionality to change)
21 |
22 | ## Checklist:
23 |
24 |
25 |
26 | - [ ] My code follows the code style of this project.
27 | - [ ] My change requires a change to the documentation.
28 | - [ ] I have updated the documentation accordingly.
29 | - [ ] I have read the **CONTRIBUTING** document.
30 | - [ ] I have added tests to cover my changes.
31 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .examples
3 |
--------------------------------------------------------------------------------
/.npmrc:
--------------------------------------------------------------------------------
1 | tag-version-prefix=""
2 | message="Version bump to %s"
3 |
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "printWidth": 240,
3 | "singleQuote": true,
4 | "trailingComma": "es5",
5 | "semi": false,
6 | "arrowParens": "always"
7 | }
8 |
--------------------------------------------------------------------------------
/BOOTSTRAP_FILES.md:
--------------------------------------------------------------------------------
1 | # Blockchain Bootstrap Files
2 |
3 | MongoDB bootstrap files comes in 2 flavors:
4 |
5 | * [`mongoexport`](https://docs.mongodb.com/manual/reference/program/mongoexport/)
6 | * [`mongodump`](https://docs.mongodb.com/manual/reference/program/mongodump/)
7 |
8 | ## `mongoexport`
9 |
10 | Raw JSON file exports, human readable and can be imported into any specified database and collection.
11 |
12 | After extracted, you can choose to import JSON objects manually (through `db.collection.insert()`) or via `mongoimport`:
13 |
14 | * Example usage:
15 |
16 | ```
17 | mongoimport -d DATABASE_NAME -c COLLECTION_NAME --file IMPORT_FILE.json
18 | ```
19 |
20 | ### Mainnet block 1 - 1,000,000
21 |
22 | * Date Created: 2018-12-04
23 | * Filename: `neo_mainnet_blocks_1_1000000.7z`
24 | * File Size: 0.47GB
25 | * URL: https://drive.google.com/file/d/1hJxbJdVEX5jAViyZ-cYmlrZOmhcrhWtv/view?usp=sharing
26 | * MD5: `49db7bd858915ea846c4aa517589cb76`
27 | * SHA256: `a30b8660d9c014bed1c86b2e6dd95e35a87628c4e247213424850ce019c2a8c3`
28 |
29 | ### Mainnet block 1,000,001 - 2,000,000
30 |
31 | * Date Created: 2018-12-04
32 | * Filename: `neo_mainnet_blocks_1000001_2000000.7z`
33 | * File Size: 1.79GB
34 | * URL: https://drive.google.com/file/d/1njUMFSN9nI9AYmq2btFSgG2_Vvxi-SRs/view?usp=sharing
35 | * MD5: `dfda4757622c69964da8c2274175f29c`
36 | * SHA256: `ae93993e4fdcebde4b1dbe1c71066c8e50933355d3aad9c6aa03b82c9e803fbc`
37 |
38 | ### Mainnet block 2,000,001 - 2,500,000
39 |
40 | * Date Created: 2018-12-04
41 | * Filename: `neo_mainnet_blocks_2000001_2500000.7z`
42 | * File Size: 1.35GB
43 | * URL: https://drive.google.com/file/d/1uQ_hYzoO1RGjoXXV7sgL19yYyvYh7TtB/view?usp=sharing
44 | * MD5: `d552da04c12f3191210337b9345566d8`
45 | * SHA256: `b053eff2eb9e308e82741dcfe0de95ee3de3451913808a46b6a7258e7d7889fb`
46 |
47 | ### Mainnet block 2,500,001 - 3,000,000
48 |
49 | * Date Created: 2018-12-04
50 | * Filename: `neo_mainnet_blocks_2500001_3000000.7z`
51 | * File Size: 1.30GB
52 | * URL: https://drive.google.com/file/d/1QSoRo09ElwqDHQ2-OoQRLIjNjg3dDwqf/view?usp=sharing
53 | * MD5: `3b09948c2c755969df4798efdf6308af`
54 | * SHA256: `f781c4eda2295fc4b46c99cd3d36d28ac5a4a4b6a1adaad54bbba032ffd137fc`
55 |
56 |
57 |
58 | ## `mongodump`
59 |
60 | MongoDB archive file that can be used to restore an entire database via `mongorestore`.
61 |
62 | * Example usage:
63 |
64 | ```
65 | mongorestore --gzip --archive=BACKUP_FILE.archive.gz
66 | ```
67 |
68 | ### Mainnet up to block 2,980,149
69 |
70 | * Date Created: 2018-11-19
71 | * Database name: `neo_mainnet`
72 | * Collection names:
73 | * Block: `blocks`
74 | * Block range: from 1 to 2,980,149
75 | * Filename: `neo_mainnet_blocks_2980149.archive.gz`
76 | * File size: 6.7GB
77 | * URL: https://drive.google.com/file/d/1WSqwHs9imjD-5Kf03Mx23iCy_ABtdV5r/view?usp=sharing
78 | * MD5: `6ee692dabc51af2531b15048fd3ede23`
79 | * SHA256: `dc0c856959fd9ee28d412f007c226623742a4af987b756f93503ba987f247775`
80 |
--------------------------------------------------------------------------------
/EVENT_EMITTERS.md:
--------------------------------------------------------------------------------
1 | # Event Emitters
2 |
3 | Events emitters per class and possible payload properties.
4 |
5 | ### `neo`
6 |
7 | N/A
8 |
9 |
10 |
11 | ### `core/api`
12 |
13 | #### `ready`
14 |
15 | ```js
16 | null
17 | ```
18 |
19 | #### `storage:insert`
20 |
21 | ```js
22 | {
23 | method: string
24 | result: any
25 | }
26 | ```
27 |
28 |
29 |
30 | ### `core/mesh`
31 |
32 | #### `ready`
33 |
34 | ```js
35 | null
36 | ```
37 |
38 |
39 |
40 | ### `core/syncer`
41 |
42 | #### `start`
43 |
44 | ```js
45 | null
46 | ```
47 |
48 | #### `stop`
49 |
50 | ```js
51 | null
52 | ```
53 |
54 | #### `query:worker:complete`
55 |
56 | ```js
57 | {
58 | isSuccess: boolean
59 | }
60 | ```
61 |
62 | #### `blockVerification:init`
63 |
64 | ```js
65 | null
66 | ```
67 |
68 | #### `blockVerification:complete`
69 |
70 | ```js
71 | {
72 | isSkipped: boolean
73 | }
74 | ```
75 |
76 | #### `blockVerification:missingBlocks`
77 |
78 | ```js
79 | {
80 | count: number
81 | }
82 | ```
83 |
84 | #### `blockVerification:excessiveBlocks`
85 |
86 | ```js
87 | {
88 | count: number
89 | }
90 | ```
91 |
92 | #### `storeBlock:init`
93 |
94 | ```js
95 | {
96 | height: number
97 | }
98 | ```
99 |
100 | #### `storeBlock:complete`
101 |
102 | ```js
103 | {
104 | isSuccess?: boolean
105 | isSkipped?: boolean
106 | height: number
107 | }
108 | ```
109 |
110 | #### `upToDate`
111 |
112 | ```js
113 | null
114 | ```
115 |
116 |
117 |
118 | ### `core/node`
119 |
120 | #### `query:init`
121 |
122 | ```js
123 | {
124 | method: string
125 | params: object
126 | id: string
127 | }
128 | ```
129 |
130 | #### `query:complete`
131 |
132 | ```js
133 | {
134 | isSuccess: boolean
135 | method: string
136 | latency?: number
137 | blockHeight?: number
138 | userAgent?: string
139 | error?: object
140 | }
141 | ```
142 |
143 |
144 |
145 | ### `storages/memory-storage`
146 |
147 | #### `ready`
148 |
149 | ```js
150 | null
151 | ```
152 |
153 |
154 |
155 | ### `storages/mongodb-storage`
156 |
157 | #### `ready`
158 |
159 | ```js
160 | null
161 | ```
162 |
163 | #### `reviewIndexes:init`
164 |
165 | ```js
166 | null
167 | ```
168 |
169 | #### `reviewIndexes:complete`
170 |
171 | ```js
172 | {
173 | isSuccess: boolean
174 | }
175 | ```
176 |
177 |
178 |
179 | ### `analyzers/block-meta-analyzer`
180 |
181 | #### `start`
182 |
183 | ```js
184 | null
185 | ```
186 |
187 | #### `stop`
188 |
189 | ```js
190 | null
191 | ```
192 |
193 | #### `query:worker:complete`
194 |
195 | ```js
196 | {
197 | isSuccess: boolean
198 | task: object
199 | }
200 | ```
201 |
202 | #### `blockMetaVerification:init`
203 |
204 | ```js
205 | null
206 | ```
207 |
208 | #### `blockMetaVerification:complete`
209 |
210 | ```js
211 | {
212 | isSuccess?: boolean
213 | isSkipped?: boolean
214 | }
215 | ```
216 |
217 | #### `blockMetaVerification:blockMetas:missing`
218 |
219 | ```js
220 | {
221 | count: number
222 | }
223 | ```
224 |
225 | #### `blockMetaVerification:blockMetas:legacy`
226 |
227 | ```js
228 | {
229 | count: number
230 | }
231 | ```
232 |
233 | #### `blockMetaVerification:transactionMetas:legacy`
234 |
235 | ```js
236 | {
237 | metaCount: number
238 | }
239 | ```
240 |
241 | #### `upToDate`
242 |
243 | ```js
244 | null
245 | ```
246 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017-2018 City Of Zion
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/OPTIONAL_PARAMETERS.md:
--------------------------------------------------------------------------------
1 | # Optional Parameters
2 |
3 | Possible options and default values.
4 |
5 | ### `neo`
6 |
7 | ```js
8 | const neoOptions = {
9 | network: 'testnet',
10 | storageType: undefined,
11 | endpoints: undefined,
12 | enableSyncer: true,
13 | enableBlockAnalyzer: false,
14 | nodeOptions: undefined,
15 | meshOptions: undefined,
16 | storageOptions: undefined,
17 | apiOptions: undefined,
18 | syncerOptions: undefined,
19 | blockMetaAnalyzerOptions: undefined,
20 | loggerOptions: {},
21 | }
22 | ```
23 |
24 | ### `core/api`
25 |
26 | ```js
27 | const apiOptions = {
28 | insertToStorage: true,
29 | checkReadyIntervalMs: 200,
30 | loggerOptions: {},
31 | }
32 | ```
33 |
34 | ### `core/mesh`
35 |
36 | ```js
37 | const meshOptions = {
38 | startBenchmarkOnInit: true,
39 | toFetchUserAgent: true,
40 | benchmarkIntervalMs: 2000,
41 | fetchMissingUserAgentIntervalMs: 5000,
42 | refreshUserAgentIntervalMs: 5 * 60 * 1000,
43 | minActiveNodesRequired: 2,
44 | pendingRequestsThreshold: 5,
45 | loggerOptions: {},
46 | }
47 | ```
48 |
49 | ### `core/syncer`
50 |
51 | ```js
52 | const syncerOptions = {
53 | minHeight: 1,
54 | maxHeight: undefined,
55 | blockRedundancy: 1,
56 | checkRedundancyBeforeStoreBlock: true,
57 | startOnInit: true,
58 | toSyncIncremental: true,
59 | toSyncForMissingBlocks: true,
60 | toPruneRedundantBlocks: true,
61 | storeQueueConcurrency: 30,
62 | pruneQueueConcurrency: 10,
63 | enqueueBlockIntervalMs: 5000,
64 | verifyBlocksIntervalMs: 1 * 60 * 1000,
65 | maxStoreQueueLength: 1000,
66 | retryEnqueueDelayMs: 5000,
67 | standardEnqueueBlockPriority: 5,
68 | retryEnqueueBlockPriority: 3,
69 | missingEnqueueStoreBlockPriority: 1,
70 | enqueuePruneBlockPriority: 5,
71 | maxPruneChunkSize: 1000,
72 | loggerOptions: {},
73 | }
74 | ```
75 |
76 | ### `core/node`
77 |
78 | ```js
79 | const nodeOptions = {
80 | toLogReliability: false,
81 | truncateRequestLogIntervalMs: 30 * 1000,
82 | requestLogTtl: 5 * 60 * 1000, // In milliseconds
83 | timeout: 30000,
84 | loggerOptions: {},
85 | }
86 | ```
87 |
88 | ### `storages/memory-storage`
89 |
90 | ```js
91 | const memoryStorageOptions = {
92 | loggerOptions: {},
93 | }
94 | ```
95 |
96 | ### `storages/mongodb-storage`
97 |
98 | ```js
99 | const mongodbStorageOptions = {
100 | connectOnInit: true,
101 | reviewIndexesOnConnect: false,
102 | userAgent: 'Unknown',
103 | collectionNames: {
104 | blocks: 'blocks',
105 | blockMetas: 'block_metas',
106 | transactionMetas: 'transaction_metas',
107 | },
108 | loggerOptions: {},
109 | }
110 | ```
111 |
112 | ### `analyzers/block-meta-analyzer`
113 |
114 | ```js
115 | const blockMetaAnalyzerOptions = {
116 | minHeight: 1,
117 | maxHeight: undefined,
118 | startOnInit: true,
119 | toEvaluateTransactions: true,
120 | toEvaluateAssets: false,
121 | blockQueueConcurrency: 5,
122 | transactionQueueConcurrency: 10,
123 | enqueueEvaluateBlockIntervalMs: 5 * 1000,
124 | verifyBlocksIntervalMs: 30 * 1000,
125 | maxBlockQueueLength: 30 * 1000,
126 | maxTransactionQueueLength: 100 * 1000,
127 | standardEvaluateBlockPriority: 5,
128 | missingEvaluateBlockPriority: 3,
129 | legacyEvaluateBlockPriority: 3,
130 | standardEvaluateTransactionPriority: 5,
131 | missingEvaluateTransactionPriority: 5,
132 | legacyEvaluateTransactionPriority: 5,
133 | loggerOptions: {},
134 | }
135 | ```
136 |
137 | ### `Logger`
138 |
139 | ```js
140 | const loggerOptions = {
141 | level: 'warn', // silent | error | warn | info | debug | trace
142 | displayTimestamp: true,
143 | displayName: true,
144 | displayLevel: true,
145 | useLevelInitial: false,
146 | useLocalTime: false,
147 | timestampFormat: 'YYYY-MM-DD HH:mm:ss.SSS'
148 | }
149 | ```
150 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 | neo-js
10 |
11 |
12 |
13 | Running NEO blockchain full node with Node.js and MongoDB.
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | ## Overview
23 |
24 | `neo-js` package is designed to interface with the NEO blockchain in a number of different ways that are configured by options that are used to initialize a node. A few examples of these different interaction mechanics are defined in the quickstart below as well as in the examples.
25 |
26 | **This is not a SDK library for interacting with NEO blockchain. You are looking for [`neon-js`](https://github.com/cityofzion/neon-js).**
27 |
28 | ## Getting Started
29 |
30 | ### Preparations
31 |
32 | Currently this module only support MongoDB for synchronizing the blockchain. You are expect to be connected to an
33 | instance of MongoDB 3.2+ to use most of its features.
34 |
35 | ### System Recommendations
36 |
37 | * NodeJS 8+
38 | * MongoDB 3.2+
39 |
40 | ## Installation
41 |
42 | Install the package using:
43 |
44 | ```bash
45 | $ npm install --save @cityofzion/neo-js
46 | ```
47 |
48 | Alternatively, to access to the latest available code, you can reference to the git repository directly:
49 |
50 | ```bash
51 | $ npm install --save git://github.com/CityOfZion/neo-js.git#develop
52 | ```
53 |
54 | ## Quick Start
55 |
56 | More comprehensive examples can be found at [`neo-js-examples`](https://github.com/rockacola/neo-js-examples) repository.
57 |
58 | ```js
59 | const Neo = require('@cityofzion/neo-js').Neo
60 | ```
61 |
62 | To create a new blockchain instance:
63 |
64 | ```js
65 | // Create a neo instances to interface with RPC methods
66 | const testnetNeo = new Neo({ network: 'testnet' })
67 |
68 | // Wait for mesh to be ready before attempt to fetch block information
69 | testnetNeo.mesh.on('ready', () => {
70 | testnetNeo.api.getBlockCount()
71 | .then((res) => {
72 | console.log('Testnet getBlockCount:', res)
73 | })
74 | })
75 |
76 | // To connect to the mainnet:
77 | const mainnetNeo = new Neo({ network: 'mainnet' })
78 |
79 | mainnetNeo.mesh.on('ready', () => {
80 | mainnetNeo.api.getBlock(1000)
81 | .then((res) => {
82 | console.log('Mainnet getBlock(1000).hash:', res.hash)
83 | })
84 | })
85 | ```
86 |
87 | This will create a new node instance and configure it to sync the blockchain to the defined mongoDB collections:
88 |
89 | ```js
90 | const options = {
91 | network: 'testnet',
92 | storageType: 'mongodb',
93 | storageOptions: {
94 | connectionString: 'mongodb://localhost/neo_testnet',
95 | },
96 | }
97 |
98 | // Create a neo instance
99 | const neo = new Neo(options)
100 |
101 | // Get block height
102 | neo.storage.on('ready', () => {
103 | neo.storage.getHighestBlockHeight()
104 | .then((res) => {
105 | console.log('Block height:', res)
106 | })
107 | })
108 | ```
109 |
110 | ## Documentation
111 |
112 | Documentation for the project can be found at:
113 |
114 | * [http://cityofzion.io/neo-js/](http://cityofzion.io/neo-js/)
115 |
116 | You can find more code examples at repository:
117 |
118 | * [https://github.com/rockacola/neo-js-examples](https://github.com/rockacola/neo-js-examples)
119 |
120 | ## Blockchain Bootstrap Files
121 |
122 | [_Please refer to Bootstrap Files document_](https://github.com/CityOfZion/neo-js/blob/master/BOOTSTRAP_FILES.md)
123 |
124 | ## Options
125 |
126 | [_Please refer to Optional Parameters document_](https://github.com/CityOfZion/neo-js/blob/master/OPTIONAL_PARAMETERS.md)
127 |
128 | ## Events
129 |
130 | [_Please refer to Event Emitters document_](https://github.com/CityOfZion/neo-js/blob/master/EVENT_EMITTERS.md)
131 |
132 | ## Contribution
133 |
134 | `neo-js` always encourages community code contribution. Before contributing please read the [contributor guidelines](https://github.com/CityOfZion/neo-js/blob/master/.github/CONTRIBUTING.md) and search the issue tracker as your issue may have already been discussed or fixed. To contribute, fork `neo-js`, commit your changes and submit a pull request.
135 |
136 | By contributing to `neo-js`, you agree that your contributions will be licensed under its MIT license.
137 |
138 | ## License
139 |
140 | * Open-source [MIT](https://github.com/CityOfZion/neo-js/blob/master/LICENSE.md).
141 | * Authors:
142 | * [@lllwvlvwlll](https://github.com/lllwvlvwlll)
143 | * [@rockacola](https://github.com/rockacola)
144 |
--------------------------------------------------------------------------------
/dist/analyzers/block-analyzer.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | import { EventEmitter } from 'events';
3 | import { LoggerOptions } from 'node-log-it';
4 | import { MemoryStorage } from '../storages/memory-storage';
5 | import { MongodbStorage } from '../storages/mongodb-storage';
6 | export interface BlockAnalyzerOptions {
7 | minHeight?: number;
8 | maxHeight?: number;
9 | startOnInit?: boolean;
10 | toEvaluateTransactions?: boolean;
11 | toEvaluateAssets?: boolean;
12 | blockQueueConcurrency?: number;
13 | transactionQueueConcurrency?: number;
14 | enqueueEvaluateBlockIntervalMs?: number;
15 | verifyBlocksIntervalMs?: number;
16 | maxBlockQueueLength?: number;
17 | maxTransactionQueueLength?: number;
18 | standardEvaluateBlockPriority?: number;
19 | missingEvaluateBlockPriority?: number;
20 | legacyEvaluateBlockPriority?: number;
21 | standardEvaluateTransactionPriority?: number;
22 | missingEvaluateTransactionPriority?: number;
23 | legacyEvaluateTransactionPriority?: number;
24 | loggerOptions?: LoggerOptions;
25 | }
26 | export declare class BlockAnalyzer extends EventEmitter {
27 | private BLOCK_META_API_LEVEL;
28 | private TRANSACTION_META_API_LEVEL;
29 | private _isRunning;
30 | private blockQueue;
31 | private transactionQueue;
32 | private blockWritePointer;
33 | private storage?;
34 | private options;
35 | private logger;
36 | private enqueueEvaluateBlockIntervalId?;
37 | private blockVerificationIntervalId?;
38 | private isVerifyingBlocks;
39 | constructor(storage?: MemoryStorage | MongodbStorage, options?: BlockAnalyzerOptions);
40 | isRunning(): boolean;
41 | start(): void;
42 | stop(): void;
43 | close(): void;
44 | private validateOptionalParameters;
45 | private getPriorityQueue;
46 | private initEvaluateBlock;
47 | private setBlockWritePointer;
48 | private initBlockVerification;
49 | private doBlockVerification;
50 | private verifyBlockMetas;
51 | private verifyTransactionMetas;
52 | private doEnqueueEvaluateBlock;
53 | private isReachedMaxHeight;
54 | private isReachedMaxQueueLength;
55 | private increaseBlockWritePointer;
56 | private enqueueEvaluateBlock;
57 | private evaluateBlock;
58 | private enqueueEvaluateTransaction;
59 | private enqueueEvaluateTransactionWithHeight;
60 | private evaluateTransaction;
61 | private getNumberArray;
62 | }
63 |
--------------------------------------------------------------------------------
/dist/analyzers/block-analyzer.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"block-analyzer.js","sourceRoot":"","sources":["../../src/analyzers/block-analyzer.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,mCAAqC;AACrC,iCAAyD;AACzD,6CAAmD;AACnD,mCAAsE;AAGtE,0DAAqD;AAErD,MAAM,WAAW,GAAG,eAAe,CAAA;AACnC,MAAM,eAAe,GAAyB;IAC5C,SAAS,EAAE,CAAC;IACZ,SAAS,EAAE,SAAS;IACpB,WAAW,EAAE,IAAI;IACjB,sBAAsB,EAAE,IAAI;IAC5B,gBAAgB,EAAE,KAAK;IACvB,qBAAqB,EAAE,CAAC;IACxB,2BAA2B,EAAE,EAAE;IAC/B,8BAA8B,EAAE,CAAC,GAAG,IAAI;IACxC,sBAAsB,EAAE,EAAE,GAAG,IAAI;IACjC,mBAAmB,EAAE,EAAE,GAAG,IAAI;IAC9B,yBAAyB,EAAE,GAAG,GAAG,IAAI;IACrC,6BAA6B,EAAE,CAAC;IAChC,4BAA4B,EAAE,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AAI,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAA;YACnF,MAAM,QAAQ,GAAuB,gBAAO,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAA;YAChF,MAAM,eAAe,GAAG;gBACtB,MAAM;gBACN,IAAI;gBACJ,aAAa,EAAE,EAAE,CAAC,IAAI;gBACtB,IAAI,EAAE,EAAE,CAAC,IAAI;gBACb,IAAI,EAAE,EAAE,CAAC,IAAI;gBACb,UAAU,EAAE,EAAE,CAAC,OAAO;gBACtB,SAAS,EAAE,EAAE,CAAC,OAAO;gBACrB,SAAS;gBACT,QAAQ;gBACR,QAAQ,EAAE,IAAI,CAAC,0BAA0B;aAC1C,CAAA;YAED,MAAM,IAAI,CAAC,OAAQ,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAA;QACzD,CAAC;KAAA;IAEO,cAAc,CAAC,KAAa,EAAE,GAAW;QAC/C,MAAM,GAAG,GAAa,EAAE,CAAA;QACxB,KAAK,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,EAAE,EAAE;YACjC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;SACZ;QACD,OAAO,GAAG,CAAA;IACZ,CAAC;CACF;AAhYD,sCAgYC"}
--------------------------------------------------------------------------------
/dist/common/constants.d.ts:
--------------------------------------------------------------------------------
1 | declare const C: {
2 | network: {
3 | testnet: string;
4 | mainnet: string;
5 | };
6 | storage: {
7 | memory: string;
8 | mongodb: string;
9 | };
10 | rpc: {
11 | getblock: string;
12 | getblockcount: string;
13 | getversion: string;
14 | getrawtransaction: string;
15 | };
16 | transaction: {
17 | MinerTransaction: string;
18 | ContractTransaction: string;
19 | InvocationTransaction: string;
20 | ClaimTransaction: string;
21 | };
22 | };
23 | export default C;
24 |
--------------------------------------------------------------------------------
/dist/common/constants.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | const C = {
4 | network: {
5 | testnet: 'testnet',
6 | mainnet: 'mainnet',
7 | },
8 | storage: {
9 | memory: 'memory',
10 | mongodb: 'mongodb',
11 | },
12 | rpc: {
13 | getblock: 'getblock',
14 | getblockcount: 'getblockcount',
15 | getversion: 'getversion',
16 | getrawtransaction: 'getrawtransaction',
17 | },
18 | transaction: {
19 | MinerTransaction: 'MinerTransaction',
20 | ContractTransaction: 'ContractTransaction',
21 | InvocationTransaction: 'InvocationTransaction',
22 | ClaimTransaction: 'ClaimTransaction',
23 | },
24 | };
25 | exports.default = C;
26 | //# sourceMappingURL=constants.js.map
--------------------------------------------------------------------------------
/dist/common/constants.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/common/constants.ts"],"names":[],"mappings":";;AAAA,MAAM,CAAC,GAAG;IACR,OAAO,EAAE;QACP,OAAO,EAAE,SAAS;QAClB,OAAO,EAAE,SAAS;KACnB;IACD,OAAO,EAAE;QACP,MAAM,EAAE,QAAQ;QAChB,OAAO,EAAE,SAAS;KACnB;IACD,GAAG,EAAE;QACH,QAAQ,EAAE,UAAU;QACpB,aAAa,EAAE,eAAe;QAC9B,UAAU,EAAE,YAAY;QACxB,iBAAiB,EAAE,mBAAmB;KACvC;IACD,WAAW,EAAE;QACX,gBAAgB,EAAE,kBAAkB;QACpC,mBAAmB,EAAE,qBAAqB;QAC1C,qBAAqB,EAAE,uBAAuB;QAC9C,gBAAgB,EAAE,kBAAkB;KACrC;CACF,CAAA;AAED,kBAAe,CAAC,CAAA"}
--------------------------------------------------------------------------------
/dist/common/profiles.d.ts:
--------------------------------------------------------------------------------
1 | declare const profiles: {
2 | rpc: {
3 | mainnet: {
4 | endpoint: string;
5 | }[];
6 | testnet: {
7 | endpoint: string;
8 | }[];
9 | };
10 | assets: {
11 | id: string;
12 | name: string;
13 | symbol: string;
14 | type: string;
15 | precision: number;
16 | }[];
17 | };
18 | export default profiles;
19 |
--------------------------------------------------------------------------------
/dist/common/profiles.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | const profiles = {
4 | rpc: {
5 | mainnet: [
6 | { endpoint: 'https://seed1.switcheo.network:10331' },
7 | { endpoint: 'https://seed2.switcheo.network:10331' },
8 | { endpoint: 'https://seed3.switcheo.network:10331' },
9 | { endpoint: 'https://seed4.switcheo.network:10331' },
10 | { endpoint: 'https://seed5.switcheo.network:10331' },
11 | { endpoint: 'https://seed1.cityofzion.io:443' },
12 | { endpoint: 'https://seed2.cityofzion.io:443' },
13 | { endpoint: 'https://seed3.cityofzion.io:443' },
14 | { endpoint: 'https://seed4.cityofzion.io:443' },
15 | { endpoint: 'https://seed5.cityofzion.io:443' },
16 | { endpoint: 'https://seed6.cityofzion.io:443' },
17 | { endpoint: 'https://seed7.cityofzion.io:443' },
18 | { endpoint: 'https://seed8.cityofzion.io:443' },
19 | { endpoint: 'https://seed9.cityofzion.io:443' },
20 | { endpoint: 'https://seed0.cityofzion.io:443' },
21 | { endpoint: 'http://node1.ams2.bridgeprotocol.io' },
22 | { endpoint: 'http://node2.ams2.bridgeprotocol.io' },
23 | { endpoint: 'http://node1.nyc3.bridgeprotocol.io' },
24 | { endpoint: 'http://node2.nyc3.bridgeprotocol.io' },
25 | { endpoint: 'http://node1.sgp1.bridgeprotocol.io' },
26 | { endpoint: 'http://node2.sgp1.bridgeprotocol.io' },
27 | { endpoint: 'https://seed1.redpulse.com:443' },
28 | { endpoint: 'https://seed2.redpulse.com:443' },
29 | { endpoint: 'http://seed1.aphelion-neo.com:10332' },
30 | { endpoint: 'http://seed2.aphelion-neo.com:10332' },
31 | { endpoint: 'http://seed3.aphelion-neo.com:10332' },
32 | { endpoint: 'http://seed4.aphelion-neo.com:10332' },
33 | { endpoint: 'http://seed1.ngd.network:10332' },
34 | { endpoint: 'http://seed2.ngd.network:10332' },
35 | { endpoint: 'http://seed3.ngd.network:10332' },
36 | { endpoint: 'http://seed4.ngd.network:10332' },
37 | { endpoint: 'http://seed5.ngd.network:10332' },
38 | { endpoint: 'http://seed6.ngd.network:10332' },
39 | { endpoint: 'http://seed7.ngd.network:10332' },
40 | { endpoint: 'http://seed8.ngd.network:10332' },
41 | { endpoint: 'http://seed9.ngd.network:10332' },
42 | { endpoint: 'http://seed10.ngd.network:10332' },
43 | ],
44 | testnet: [
45 | { endpoint: 'https://test1.cityofzion.io:443' },
46 | { endpoint: 'https://test2.cityofzion.io:443' },
47 | { endpoint: 'https://test3.cityofzion.io:443' },
48 | { endpoint: 'https://test4.cityofzion.io:443' },
49 | { endpoint: 'https://test5.cityofzion.io:443' },
50 | ],
51 | },
52 | assets: [
53 | { id: '0xc56f33fc6ecfcd0c225c4ab356fee59390af8560be0e930faebe74a6daff7c9b', name: 'NEO', symbol: 'NEO', type: 'GoverningToken', precision: 0 },
54 | { id: '0x602c79718b16e442de58778e148d0b1084e3b2dffd5de6b7b16cee7969282de7', name: 'GAS', symbol: 'GAS', type: 'UtilityToken', precision: 8 },
55 | ],
56 | };
57 | exports.default = profiles;
58 | //# sourceMappingURL=profiles.js.map
--------------------------------------------------------------------------------
/dist/common/profiles.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"profiles.js","sourceRoot":"","sources":["../../src/common/profiles.ts"],"names":[],"mappings":";;AAAA,MAAM,QAAQ,GAAG;IACf,GAAG,EAAE;QACH,OAAO,EAAE;YACP,EAAE,QAAQ,EAAE,sCAAsC,EAAE;YACpD,EAAE,QAAQ,EAAE,sCAAsC,EAAE;YACpD,EAAE,QAAQ,EAAE,sCAAsC,EAAE;YACpD,EAAE,QAAQ,EAAE,sCAAsC,EAAE;YACpD,EAAE,QAAQ,EAAE,sCAAsC,EAAE;YACpD,EAAE,QAAQ,EAAE,iCAAiC,EAAE;YAC/C,EAAE,QAAQ,EAAE,iCAAiC,EAAE;YAC/C,EAAE,QAAQ,EAAE,iCAAiC,EAAE;YAC/C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C/C,EAAE,QAAQ,EAAE,iCAAiC,EAAE;YAC/C,EAAE,QAAQ,EAAE,iCAAiC,EAAE;YAC/C,EAAE,QAAQ,EAAE,iCAAiC,EAAE;YAC/C,EAAE,QAAQ,EAAE,iCAAiC,EAAE;SAChD;KACF;IACD,MAAM,EAAE;QACN,EAAE,EAAE,EAAE,oEAAoE,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAAE,SAAS,EAAE,CAAC,EAAE;QAC9I,EAAE,EAAE,EAAE,oEAAoE,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,SAAS,EAAE,CAAC,EAAE;KAC7I;CACF,CAAA;AAED,kBAAe,QAAQ,CAAA"}
--------------------------------------------------------------------------------
/dist/core/api.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | import { EventEmitter } from 'events';
3 | import { LoggerOptions } from 'node-log-it';
4 | import { Mesh } from './mesh';
5 | import { MemoryStorage } from '../storages/memory-storage';
6 | import { MongodbStorage } from '../storages/mongodb-storage';
7 | export interface ApiOptions {
8 | insertToStorage?: boolean;
9 | checkReadyIntervalMs?: number;
10 | loggerOptions?: LoggerOptions;
11 | }
12 | export declare class Api extends EventEmitter {
13 | private mesh;
14 | private storage?;
15 | private options;
16 | private logger;
17 | private checkReadyIntervalId?;
18 | constructor(mesh: Mesh, storage?: MemoryStorage | MongodbStorage, options?: ApiOptions);
19 | getBlockCount(): Promise;
20 | getBlock(height: number): Promise