Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
mialbu committed Dec 3, 2024
2 parents dff3e9b + 03c8f85 commit 5bff237
Show file tree
Hide file tree
Showing 18 changed files with 357 additions and 888 deletions.
36 changes: 9 additions & 27 deletions docs/neo-n3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@

<h1 id="cover-header">neow3j <small>3.23.0</small></h1>

Neow3j is a development toolkit that provides easy and reliable tools to build Neo dApps and Smart Contracts using the Java
platform (Java, Kotlin, Android). It is an open-source project developed by the Neo community and maintained by
[AxLabs](https://axlabs.com).
Neow3j is a development toolkit that provides easy and reliable tools to build Neo dApps and Smart Contracts using the Java platform (Java, Kotlin, Android). It is an open-source project developed by the Neo community and maintained by [AxLabs](https://axlabs.com).

<table>
<tr>
Expand Down Expand Up @@ -43,13 +41,11 @@ platform (Java, Kotlin, Android). It is an open-source project developed by the
* Smart contract invocations
* Smart contract deployment
* Smart contract development and compilation in Java
* Android support from API 24, which covers [~49%](https://developer.android.com/about/dashboards/)
of all active Android devices ([~1 billion devices](https://www.youtube.com/watch?v=vWLcyFtni6U#t=2m46s))
* Android support from API 24, which covers [~49%](https://developer.android.com/about/dashboards/) of all active Android devices ([~1 billion devices](https://www.youtube.com/watch?v=vWLcyFtni6U#t=2m46s))

## Quickstart

Neow3j is composed of an **SDK** for dApp development and a **devpack** for smart contract development.
The following sections describes how to get started with them.
Neow3j is composed of an **SDK** for dApp development and a **devpack** for smart contract development. The following sections describes how to get started with them.

### SDK

Expand All @@ -73,8 +69,7 @@ __Maven__

### Devpack

The neow3j devpack is a Java library that provides the Neo-specific functionality required to write smart contracts. If
you want to play around with the devpack, add the `io.neow3j:devpack` dependency to your project.
The neow3j devpack is a Java library that provides the Neo-specific functionality required to write smart contracts. If you want to play around with the devpack, add the `io.neow3j:devpack` dependency to your project.

__Gradle__

Expand All @@ -92,18 +87,13 @@ __Maven__
</dependency>
```

For information on how to compile a smart contract hop over to the
[Setup & Compilation](neo-n3/smart_contract_development/setup_and_compilation.md) section.
For information on how to compile a smart contract hop over to the [Setup & Compilation](neo-n3/smart_contract_development/setup_and_compilation.md) section.

## Requirements

Neow3j requires **Java 8** or higher. For Android applications this implies the use of API level >= 24.

Neow3j does **not include a blockchain node**. I.e., it does not synchronize with other nodes nor store or verify
blockchain information locally. It depends on a connection to a Neo node to retrieve blockchain information. If you want
to run your own node check out the [official documentation](https://docs.neo.org/v3/docs/en-us/node/introduction.html)
on how to set one up. For local development we recommend using
[Neo Express](https://github.com/neo-project/neo-express).
Neow3j does **not include a blockchain node**. I.e., it does not synchronize with other nodes nor store or verify blockchain information locally. It depends on a connection to a Neo node to retrieve blockchain information. If you want to run your own node check out the [official documentation](https://docs.neo.org/docs/n3/node/Introduction.html) on how to set one up. For local development we recommend using [Neo Express](https://github.com/neo-project/neo-express).

## Why the name "neow3j"? 🤔

Expand All @@ -113,15 +103,9 @@ Well... then, it was simply natural to imagine [Bongo Cat](https://knowyourmeme.

## Versioning

First of all, don't be confused by the number *3* in the name *neow3j*. It is not related to the
version of Neo as explained above.
First of all, don't be confused by the number *3* in the name *neow3j*. It is not related to the version of Neo as explained above.

Versioning of neow3j partially follows an adapted variant of semantic versioning. To be consistent
with Neo's major versions, neow3j keeps the first number fixed to the current Neo version. I.e.,
neow3j 3.x.x for versions of the library that are compatible with Neo N3. The semantics of the
version number is therefore shifted to the right by one position. Incrementing the second number
means that breaking changes were applied. Incrementing the third number implies
backward-compatible features and bug fixes were added.
Versioning of neow3j partially follows an adapted variant of semantic versioning. To be consistent with Neo's major versions, neow3j keeps the first number fixed to the current Neo version. I.e., neow3j 3.x.x for versions of the library that are compatible with Neo N3. The semantics of the version number is therefore shifted to the right by one position. Incrementing the second number means that breaking changes were applied. Incrementing the third number implies backward-compatible features and bug fixes were added.

## Donate 💰

Expand All @@ -133,9 +117,7 @@ Help the development of neow3j by donating to the following addresses:
| ETH | `0xe85EbabD96943655e2DcaC44d3F21DC75F403B2f` |
| BTC | `3L4br7KQ8DCJEZ77nBjJfrukWEdVRXoKiy` |


## Thanks and Credits 🙏

* [NEO Foundation](https://neo.org/team) & [NEO Global Development (NGD)](https://neo.org/team)
* This project was strongly based on [web3j](https://web3j.io), latest on [this commit](https://github.com/web3j/web3j/commit/2a259ece9736c0338fbb66b1be4c04aba0855254).
We are really thankful for it. 😄
* This project was strongly based on [web3j](https://web3j.io), latest on [this commit](https://github.com/web3j/web3j/commit/2a259ece9736c0338fbb66b1be4c04aba0855254). We are really thankful for it. 😄
14 changes: 3 additions & 11 deletions docs/neo-n3/dapp_development/advanced.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
## Iterators

**TL;DR** You can use `SmartContract.callFunctionReturningIterator(...)` to invoke a method that returns an iterator and
traverse through the iterator using the resulting `Iterator` object and its utility methods.
**TL;DR:** You can use `SmartContract.callFunctionReturningIterator(...)` to invoke a method that returns an iterator and traverse through the iterator using the resulting `Iterator` object and its utility methods.

A smart contract method can return an iterator that makes it easier to read through storage with many entries. When
calling such a method using an RPC (e.g., `invokefunction`), the node you're connected to opens a session and returns a
`sessionId` and an `iteratorId`. You can then use these values with the RPC `traverseIterator` providing a number `n` of
entries you want to iterate through with each call. When first using this RPC, you will get the first `n` entries of the
iterator. If there are more entries in the iterator, using the same RPC again will return the next `n` entries of the
iterator, etc.
A smart contract method can return an iterator to simplify reading through storage with many entries. When calling such a method using an RPC (e.g., `invokefunction`), the node you're connected to opens a session and returns a `sessionId` and an `iteratorId`. You can then use these values with the RPC `traverseIterator`, specifying the number `n` of entries you want to iterate through with each call. Initially, this RPC returns the first `n` entries of the iterator. If there are more entries, subsequent calls to the same RPC return the next `n` entries of the iterator, and so on.

**Note 1:** You cannot traverse an iterator that is returned as the result of a write transaction.

**Note 2:** Some nodes (especially public nodes) have sessions disabled due to DoS concerns. If this is the case, neow3j
provides a custom utility method to unwrap the iterator on the NeoVM level and return an array of entries with the
method `SmartContract.callFunctionAndUnwrapIterator(...)`.
**Note 2:** Some nodes (especially public nodes) have disabled sessions due to DoS concerns. If this is the case, neow3j provides a custom utility method to unwrap the iterator on the NeoVM level and return an array of entries with the method `SmartContract.callFunctionAndUnwrapIterator(...)`.
Loading

0 comments on commit 5bff237

Please sign in to comment.