Skip to content
Merged
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
21 changes: 10 additions & 11 deletions docs/Concepts/AlethioOverview.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
description: Alethio Lite Block Explorer And EthStats Lite Network Monitor Overview
description: Alethio Lite Block Explorer And EthStats Lite Network Monitor overview
<!--- END of page meta data -->

# Alethio

Alethio offers a set of tools including the [Block Explorer](https://aleth.io/) and
[EthStats Network Monitor](https://ethstats.io/). The Alethio tools are developed by [Alethio](https://company.aleth.io/).
[Alethio](https://company.aleth.io/) develops a set of tools, including
[Block Explorer](https://aleth.io/) and [EthStats Network Monitor](https://ethstats.io/), which
give a comprehensive view into the activity in a public or private Enterprise Ethereum network.
The statistics are at the network level and the block, transaction, and account level.

The Block Explorer and EthStats provide a comprehensive view into the activity in a
public or private Enterprise Ethereum network. The statistics are at the network level
and the block, transaction, and account level.
To use Block Explorer and EthStats for testing and private networks, run the the
[Lite Block Explorer](../HowTo/Deploy/Lite-Block-Explorer.md) and
[EthStats Lite](../HowTo/Deploy/Lite-Network-Monitor.md).

To use the Block Explorer and EthStats for testing and private networks, run the the [Lite Block
Explorer](../HowTo/Deploy/Lite-Block-Explorer.md) and [EthStats Lite](../HowTo/Deploy/Lite-Network-Monitor.md).

Contact [Alethio](https://company.aleth.io/) at [contact@aleth.io](mailto:contact@aleth.io) for
details about the full versions and enterprise solutions.
For more information about the full versions of these products and other enterprise solutions,
contact [Alethio](https://company.aleth.io/) at [contact@aleth.io](mailto:contact@aleth.io).
10 changes: 5 additions & 5 deletions docs/Concepts/ArchitectureOverview.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
description: Hyperledger Besu Architecture
description: Hyperledger Besu architecture
<!--- END of page meta data -->

# Hyperledger Besu Architecture
# Hyperledger Besu architecture

The high-level architecture of Hyperledger Besu is:
The following diagram outlines the Hyperledger Besu high-level architecture.

![Architecture](../images/Architecture.png)

If you've got questions about the architecture of Hyperledger Besu,
contact us on [Hyperledger Besu chat](https://chat.hyperledger.org/channel/besu).
For more information about the Hyperledger Besu architecture, contact us on
[Hyperledger Besu chat](https://chat.hyperledger.org/channel/besu).
21 changes: 14 additions & 7 deletions docs/Concepts/Client-Libraries.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
description: Hyperledger Besu client libraries
description: Hyperledger Besu client libraries
<!--- END of page meta data -->

# Client Libraries
# Client libraries

Client libraries such as [web3.js](https://github.com/ethereum/web3.js/), [web3j](https://github.com/web3j/web3j), or [ethereumj](https://github.com/ethereum/ethereumj) are used by Dapps to forward JSON-RPC requests to Hyperledger Besu. Any
client library that implements core Ethereum RPC methods can be used with Besu.
Dapps use client libraries, such as [web3.js](https://github.com/ethereum/web3.js/),
[web3j](https://github.com/web3j/web3j), or [ethereumj](https://github.com/ethereum/ethereumj), to
forward JSON-RPC requests to Hyperledger Besu. Any client library implementing core Ethereum RPC
methods works with Besu.

Use the [web3.js-eea library](../HowTo/Interact/Client-Libraries/eeajs.md) with Besu for [privacy features](../Concepts/Privacy/Privacy-Overview.md).
Use the [web3.js-eea library](../HowTo/Interact/Client-Libraries/eeajs.md) with Besu for
[privacy features](../Concepts/Privacy/Privacy-Overview.md).

![Client Libraries](../images/Hyperledger-Besu-Client-Libraries.png)

Use client libraries to:

* [create signed transactions](../HowTo/Develop-Dapps/Use-web3js.md)
* [create and send private transactions](../HowTo/Send-Transactions/Creating-Sending-Private-Transactions.md).
* [Create signed transactions](../HowTo/Develop-Dapps/Use-web3js.md)
* [Create and send private transactions].

<!-- Links -->
[Create and send private transactions]: ../HowTo/Send-Transactions/Creating-Sending-Private-Transactions.md
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Assuming this link displays OK when built locally? I normally put them right next to the linked text so not sure of the syntax.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This is a case where the link exceeds 100 characters. As per Nico's suggestion (and I didn't know this until he suggested it), this is valid markdown syntax for constructing links.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yep, the link is fine when built locally.


184 changes: 98 additions & 86 deletions docs/Concepts/Events-and-Logs.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
# Events and Logs
# Events and logs

When a transaction is mined, smart contracts emit events and write logs to the blockchain.
Transaction mining causes smart contracts to emit events and write logs to the blockchain.

Logs are associated with the contract address and included in the blockchain but logs are not accessible
from within contracts. Log storage is cheaper than contract storage (that is, it costs less gas) so if the required data can
be stored in and accessed from logs, the cost is reduced. For example, you can use logs to display all
transfers made using a specific contract but not the current state of the contract.
The smart contract address is the link to the logs and the blockchain includes the logs, but
contracts cannot access logs. Log storage is cheaper than contract storage (that is, it costs less
gas) so storing and accessing the required data in logs reduces the cost. For example, use logs to
display all transfers made using a specific contract, but not the current state of the contract.

A Dapp front end can either request logs using the [JSON-RPC API filter methods](../HowTo/Interact/Filters/Accessing-Logs-Using-JSON-RPC.md)
or subscribe to logs using the [RPC Pub/Sub API](../HowTo/Interact/APIs/RPC-PubSub.md#logs).
A Dapp front end can either access logs using the
[JSON-RPC API filter methods](../HowTo/Interact/Filters/Accessing-Logs-Using-JSON-RPC.md) or
subscribe to logs using the [RPC Pub/Sub API](../HowTo/Interact/APIs/RPC-PubSub.md#logs).

Use [`admin_generateLogBloomCache`](../Reference/API-Methods.md#admin_generatelogbloomcache) to
improve log retrieval performance.

## Topics

Log entries contain up to four topics. The first topic is the [event signature hash](#event-signature-hash) and up to three topics
are the indexed [event parameters](#event-parameters).
Log entries contain up to four topics. The first topic is the
[event signature hash](#event-signature-hash) and up to three topics are the indexed
[event parameters](#event-parameters).

!!! example
Log entry for an event with one indexed parameter:

A log entry for an event with one indexed parameter:

```json
{
Expand All @@ -38,38 +41,41 @@ are the indexed [event parameters](#event-parameters).
}
```

## Event Parameters
## Event parameters

Up to three event parameters can have the `indexed` attribute. Indexed parameters are stored as `topics`
in the logs. Indexed parameters can be searched and filtered.
Up to three event parameters can have the `indexed` attribute. Logs store these indexed parameters
as `topics`. Indexed parameters are searchable and filterable.

Topics are 32 bytes. If an indexed argument is an array (including `string` and `byte` datatypes),
the keccak-256 hash of the paramater is stored as a topic.
the log stores the the keccak-256 hash of the paramater as a topic.

Non-indexed parameters are included in the logs `data` but cannot be easily searched or filtered.
Log `data` includes non-indexed parameters but is difficult to search or filter.

!!! example

A Solidity contract that stores one indexed and one non-indexed parameter and has an event that emits the value of each parameter:
A Solidity contract storing one indexed and one non-indexed parameter and has an event emitting
the value of each parameter:

```solidity
pragma solidity ^0.5.1;
contract Storage {
uint256 public valueIndexed;
uint256 public valueNotIndexed;
uint256 public valueIndexed;
uint256 public valueNotIndexed;

event Event1(uint256 indexed valueIndexed, uint256 valueNotIndexed);
event Event1(uint256 indexed valueIndexed, uint256 valueNotIndexed);

function setValue(uint256 _valueIndexed, uint256 _valueNotIndexed) public {
valueIndexed = _valueIndexed;
valueNotIndexed = _valueNotIndexed;
emit Event1(_valueIndexed, _valueNotIndexed);
}
function setValue(uint256 _valueIndexed, uint256 _valueNotIndexed) public {
valueIndexed = _valueIndexed;
valueNotIndexed = _valueNotIndexed;
emit Event1(_valueIndexed, _valueNotIndexed);
}
}
```

!!! example
Log entry created by invoking the contract above with `valueIndexed` set to 5 and `valueNotIndexed` set to 7:
!!! example

A log entry created by invoking the contract in the previous example with `valueIndexed` set to
5 and `valueNotIndexed` set to 7:

```json
{
Expand All @@ -88,100 +94,106 @@ Non-indexed parameters are included in the logs `data` but cannot be easily sear
}
```

## Event Signature Hash
## Event signature hash

The first topic in a log entry is always the the event signature hash. The event signature hash is a keccak-256
hash of the event name and input argument types. Argument names are ignored. For example, the event `Hello(uint256 worldId)`
has the signature hash `keccak('Hello(uint256)')`. The signature identifies to which event log topics belong.
The first topic in a log entry is always the the event signature hash. The event signature hash is
a keccak-256 hash of the event name and input argument types, with argument names ignored. For
example, the event `Hello(uint256 worldId)` has the signature hash `keccak('Hello(uint256)')`. The
signature identifies to which event log topics belong.

!!! example

A Solidity contract with two different events:

``` solidity
pragma solidity ^0.5.1;
pragma solidity ^0.5.1;
contract Storage {
uint256 public valueA;
uint256 public valueA;
uint256 public valueB;

event Event1(uint256 indexed valueA);
event Event2(uint256 indexed valueB);
event Event1(uint256 indexed valueA);
event Event2(uint256 indexed valueB);

function setValue(uint256 _valueA) public {
valueA = _valueA;
emit Event1(_valueA);
}
function setValue(uint256 _valueA) public {
valueA = _valueA;
emit Event1(_valueA);
}

function setValueAgain(uint256 _valueB) public {
valueB = _valueB;
emit Event2(_valueB);
}
function setValueAgain(uint256 _valueB) public {
valueB = _valueB;
emit Event2(_valueB);
}
}
```

The event signature hash for event 1 is `keccak('Event1(uint256)')` and the event signature hash for event
2 is `keccak('Event2(uint256)')`. The hashes are:
The event signature hash for event 1 is `keccak('Event1(uint256)')` and the event signature hash
for event 2 is `keccak('Event2(uint256)')`. The hashes are:

* `04474795f5b996ff80cb47c148d4c5ccdbe09ef27551820caa9c2f8ed149cce3` for event 1
* `06df6fb2d6d0b17a870decb858cc46bf7b69142ab7b9318f7603ed3fd4ad240e` for event 2
* `04474795f5b996ff80cb47c148d4c5ccdbe09ef27551820caa9c2f8ed149cce3` for event 1
* `06df6fb2d6d0b17a870decb858cc46bf7b69142ab7b9318f7603ed3fd4ad240e` for event 2.

!!! tip
You can use a library keccak (sha3) hash function such as provided in [Web3.js](https://github.com/ethereum/wiki/wiki/JavaScript-API#web3sha3)
or an an online tool such as https://emn178.github.io/online-tools/keccak_256.html to generate event signature hashes.

You can use a library keccak (sha3) hash function, such as provided in
[Web3.js](https://github.com/ethereum/wiki/wiki/JavaScript-API#web3sha3), or an an online tool,
such as https://emn178.github.io/online-tools/keccak_256.html, to generate event signature
hashes.

!!! example
Log entries from invoking the Solidity contract above:

Log entries from invoking the Solidity contract in the previous example:

```json
[
{
"logIndex": "0x0",
"removed": false,
"blockNumber": "0x84",
"blockHash": "0x5fc573d76ec48ec80cbc43f299ebc306a8168112e3a4485c23e84e9a40f5d336",
"transactionHash": "0xcb52f02342c2498df82c49ac26b2e91e182155c8b2a2add5b6dc4c249511f85a",
"transactionIndex": "0x0",
"address": "0x42699a7612a82f1d9c36148af9c77354759b210b",
"data": "0x",
"topics": [
"0x04474795f5b996ff80cb47c148d4c5ccdbe09ef27551820caa9c2f8ed149cce3",
"0x0000000000000000000000000000000000000000000000000000000000000001"
]
},
{
"logIndex": "0x0",
"removed": false,
"blockNumber": "0x87",
"blockHash": "0x6643a1e58ad857f727552e4572b837a85b3ca64c4799d085170c707e4dad5255",
"transactionHash": "0xa95295fcea7df3b9e47ab95d2dadeb868145719ed9cc0e6c757c8a174e1fcb11",
"transactionIndex": "0x0",
"address": "0x42699a7612a82f1d9c36148af9c77354759b210b",
"data": "0x",
"topics": [
"0x06df6fb2d6d0b17a870decb858cc46bf7b69142ab7b9318f7603ed3fd4ad240e",
"0x0000000000000000000000000000000000000000000000000000000000000002"
]
}
{
"logIndex": "0x0",
"removed": false,
"blockNumber": "0x84",
"blockHash": "0x5fc573d76ec48ec80cbc43f299ebc306a8168112e3a4485c23e84e9a40f5d336",
"transactionHash": "0xcb52f02342c2498df82c49ac26b2e91e182155c8b2a2add5b6dc4c249511f85a",
"transactionIndex": "0x0",
"address": "0x42699a7612a82f1d9c36148af9c77354759b210b",
"data": "0x",
"topics": [
"0x04474795f5b996ff80cb47c148d4c5ccdbe09ef27551820caa9c2f8ed149cce3",
"0x0000000000000000000000000000000000000000000000000000000000000001"
]
},
{
"logIndex": "0x0",
"removed": false,
"blockNumber": "0x87",
"blockHash": "0x6643a1e58ad857f727552e4572b837a85b3ca64c4799d085170c707e4dad5255",
"transactionHash": "0xa95295fcea7df3b9e47ab95d2dadeb868145719ed9cc0e6c757c8a174e1fcb11",
"transactionIndex": "0x0",
"address": "0x42699a7612a82f1d9c36148af9c77354759b210b",
"data": "0x",
"topics": [
"0x06df6fb2d6d0b17a870decb858cc46bf7b69142ab7b9318f7603ed3fd4ad240e",
"0x0000000000000000000000000000000000000000000000000000000000000002"
]
}
]
```

## Topic Filters
## Topic filters

[Filter options objects](../Reference/API-Objects.md#filter-options-object) have a `topics` key to filter logs by topics.
[Filter options objects](../Reference/API-Objects.md#filter-options-object) have a `topics` key to
filter logs by topics.

Topics are order-dependent. A transaction with a log containing topics `[A, B]` is matched with the following topic filters:
Topics are order-dependent. A transaction with a log containing topics `[A, B]` matches with the
following topic filters:

* `[]` - Match any topic
* `[A]` - Match A in first position
* `[[null], [B]]` - Match any topic in first position AND B in second position
* `[[A],[B]]` - Match A in first position AND B in second position
* `[[A, C], [B, D]]` - Match (A OR C) in first position AND (B OR D) in second position


* `[[A, C], [B, D]]` - Match (A OR C) in first position AND (B OR D) in second position.

!!! example
The following filter option object returns log entries for the [Event Parameters example contract](#event-parameters) where `valueIndexed` is set to
5 or 9:

The following filter option object returns log entries for the
[Event Parameters example contract](#event-parameters) with `valueIndexed` set to 5 or 9:

```json
{
Expand Down
8 changes: 5 additions & 3 deletions docs/Concepts/Mining.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
description: Mining overview
<!--- END of page meta data -->

Hyperledger Besu supports CPU and GPU mining which are [configured using command line options](../HowTo/Configure/Configure-Mining.md).
Hyperledger Besu supports CPU and GPU mining, which are
[configured using command line options](../HowTo/Configure/Configure-Mining.md).

Besu supports GPU mining and has been tested using [Ethminer](https://github.com/ethereum-mining/ethminer) with the `stratum+tcp` and `getwork` schemes.
GPU mining support testing used [Ethminer](https://github.com/ethereum-mining/ethminer) with
the `stratum+tcp` and `getwork` schemes.

!!! note
The `getwork` scheme is supported as the `http` scheme in certain mining software.
Some mining software supports the `getwork` scheme as the `http` scheme.
14 changes: 8 additions & 6 deletions docs/Concepts/Monitoring.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
description: Monitoring using metrics and logging
description: Monitoring using metrics and logging
<!--- END of page meta data -->

# Monitoring
# Monitoring

Monitoring enables identification of node and network issues. Specifically, configuring metrics and logging enables:
Monitoring enables identification of node and network issues. Specifically, configuring metrics and
logging enables:

* [Visual representation of declining node or network performance](../HowTo/Monitor/Metrics.md)
* [Collection of log files to enable issue diagnosis](../HowTo/Monitor/Logging.md).
* [Visual representation of declining node or network performance](../HowTo/Monitor/Metrics.md)
* [Collection of log files to enable issue diagnosis](../HowTo/Monitor/Logging.md).

[This recording](https://www.youtube.com/watch?v=7BuutRe0I28&feature=youtu.be) gives an overview of monitoring Hyperledger Besu.
For an overview of monitoring Hyperledger Besu, view
[this recording](https://www.youtube.com/watch?v=7BuutRe0I28&feature=youtu.be).

Loading