Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mixed styling/content fixes and changes #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/api/grpc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Using gRPC
gRPC is a standard for RPC APIs using protobuffer messages for data exchange.
The main advantages are typed messages and efficiency: data is packed tightly and sent over HTTP2.

If you want to use the gRPC API directly, please refer to the `official documentation <https://grpc.io/>`_ to get started.
If you want to use the gRPC API directly, please refer to the `grpc's official documentation <https://grpc.io/>`_ to get started.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

grpc -> gRPC

You can find the protobuf definitions in `aergoio/aergo-protobuf <https://github.com/aergoio/aergo-protobuf>`_.

Alternatively, you can use one of the `SDKs <../sdks/index.html>`_ which wrap the same functionality in language-specific styles.
12 changes: 7 additions & 5 deletions source/smart-contracts/lua/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ function query_names(ids)
end
```

.. warning::
**Warning:**
**DO NOT** concatenate values when building SQL commands!

This would make your smart contract vulnerable to `SQL injection` attacks.
Expand All @@ -614,10 +614,12 @@ end
[LiteTree](https://github.com/aergoio/litetree) is used as the SQL processing engine for Aergo smart contracts.
LiteTree is implemented based on SQLite.

Detailed SQL usage can be found at https://sqlite.org/lang.html and https://sqlite.org/lang_corefunc.html
Detailed SQL usage can be found at [SQL as understood by SQLite](https://sqlite.org/lang.html) and [Built-in Scalar SQL functions](https://sqlite.org/lang_corefunc.html)

However, we do not provide full SQL functionality. There are some limitations due to stability and security.

When working with SQL functionality, please consider the following:

**Data types**

Allow only SQL datatypes corresponding to Lua strings and numbers(int, float).
Expand Down Expand Up @@ -655,9 +657,9 @@ A list of other functions and descriptions is available via the links below.
* data and time : https://www.sqlite.org/lang_datefunc.html
* aggregation : https://www.sqlite.org/lang_aggfunc.html

**contraints**
**Constraints**

You can use the following contraints:
You can use the following constraints:

* NOT NULL
* DEFAULT
Expand All @@ -683,7 +685,7 @@ It provides smart contract-related commands as follows:
* receipt get
* event list/stream

* [Reference](../../tools/aergocli.html)
* [Reference](../../tools/aergocli.rst)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

html


### brick

Expand Down
8 changes: 4 additions & 4 deletions source/smart-contracts/lua/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,9 @@ The following is an unavailable list
* sqlite_XXX function

For a list of other functions and descriptions, please refer to the links below.
* Core: <https://www.sqlite.org/lang_corefunc.html>
* Date and time: <https://www.sqlite.org/lang_datefunc.html>
* Aggregation: <https://www.sqlite.org/lang_aggfunc.html>
* [Core](https://sqlite.org/lang_corefunc.html)
* [Date and time](https://www.sqlite.org/lang_datefunc.html)
* [Aggregation](https://www.sqlite.org/lang_aggfunc.html)

#### Constraint
The following constraints can be used.
Expand Down Expand Up @@ -366,7 +366,7 @@ end


## json package
Json package is provided for user convenience in input and output. This package allows automatic conversion between JSON format strings and Lua Table structures.
JSON package is provided for user convenience in input and output. This package allows automatic conversion between JSON format strings and Lua Table structures.

### encode(arg)
This function returns a JSON-formatted string with the given lua value.
Expand Down
22 changes: 11 additions & 11 deletions source/specs/p2p/peerconnect.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,6 @@ Dynamic peer discovery
----------------------
Aergo server requests peer list from other connected peers as well as Polaris if it cannot find enough peers.

Choosing remote peers
---------------------

(This feature is currently work in progress)

The list of peers to connect to is managed in Kademlia-like manner.
The number of peers that are closer to the peer is larger and the number of peers that are connected to the peer is smaller.
The peer's distance is based on the difference based on the hash value, not the physical distance.

Peer connect process
====================
The network communication of Aergo server operates on libp2p basis, and libp2p is responsible for encryption and node distinction at transmission level.
Expand All @@ -51,11 +42,20 @@ Aergo server maintains a connection-based communication.
Both peers disconnect when the internally defined retention score increases beyond a certain level.
This score decreases to a low level when a query is requested, and increases when a bad block or TX notification is sent.


Ongoing Development Features
============================

Peer blacklist
--------------

(This feature is currently work in progress)

When an internally defined ban score exceeds a certain level, the Aergo server blocks the peer's connection.
This score increases due to the connection being disconnected due to exceeding the connection maintenance score, etc., and the blocking period is also changed by calculating the score or the number of blocking times.
You can also permanently block by specifying a block address in the configuration file.

Choosing remote peers
---------------------

The list of peers to connect to is managed in Kademlia-like manner.
The number of peers that are closer to the peer is larger and the number of peers that are connected to the peer is smaller.
The peer's distance is based on the difference based on the hash value, not the physical distance.