Skip to content

Commit

Permalink
Smart Contract API
Browse files Browse the repository at this point in the history
  • Loading branch information
AelfHarsh committed Jun 26, 2024
1 parent 99bad18 commit 5a53cbe
Show file tree
Hide file tree
Showing 21 changed files with 7,365 additions and 27 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ This guide will walk you through the steps required to run an aelf node on Googl

1. Go to the [Google Cloud Marketplace](https://console.cloud.google.com/marketplace) and search for "aelf blockchain for enterprise".

![image](gcp-step1.png)
![image](../../../static/img/gcp-step1.png)

2. Find the aelf image and click on "LAUNCH ON COMPUTE ENGINE".

![image](gcp-step2-b.png)
![image](../../../static/img/gcp-step2-b.png)

3. Keep the default settings and click "DEPLOY" at the bottom left of the page.

![image](gcp-deployed.png)
![image](../../../static/img/gcp-deployed.png)

## Step 2: Access and Start the Chain

1. Login to the launched VM instance via SSH. You can do this by clicking the SSH drop-down and selecting "Open in browser window".

![image](gcp-ssh-select.png)
![image](../../../static/img/gcp-ssh-select.png)

2. In the SSH session, execute `sudo bash` to elevate your privileges.

Expand All @@ -35,7 +35,7 @@ This guide will walk you through the steps required to run an aelf node on Googl
cd /opt/aelf-node && docker-compose up -d
```

![image](gcp-docker-compose.png)
![image](../../../static/img/gcp-docker-compose.png)

## Step 3: Verify Chain Status

Expand All @@ -45,6 +45,6 @@ This guide will walk you through the steps required to run an aelf node on Googl
curl -X GET "http://127.0.0.1:8001/api/blockChain/chainStatus" -H "accept: text/plain; v=1.0"
```

![image](gcp-curl-chain-stat.png)
![image](../../../static/img/gcp-curl-chain-stat.png)

2. If everything is working normally, you should see the chain status increase with each request.
415 changes: 414 additions & 1 deletion docs/references/smart-contract-api/association-contract/index.md

Large diffs are not rendered by default.

211 changes: 210 additions & 1 deletion docs/references/smart-contract-api/configuration-contract/index.md

Large diffs are not rendered by default.

724 changes: 723 additions & 1 deletion docs/references/smart-contract-api/consensus-contract/index.md

Large diffs are not rendered by default.

626 changes: 625 additions & 1 deletion docs/references/smart-contract-api/cross-chain-contract/index.md

Large diffs are not rendered by default.

226 changes: 225 additions & 1 deletion docs/references/smart-contract-api/economic-contract/index.md

Large diffs are not rendered by default.

529 changes: 528 additions & 1 deletion docs/references/smart-contract-api/election-contract/index.md

Large diffs are not rendered by default.

427 changes: 426 additions & 1 deletion docs/references/smart-contract-api/genesis-contract/index.md

Large diffs are not rendered by default.

405 changes: 404 additions & 1 deletion docs/references/smart-contract-api/index.md

Large diffs are not rendered by default.

1,098 changes: 1,097 additions & 1 deletion docs/references/smart-contract-api/multi-token-contract/index.md

Large diffs are not rendered by default.

393 changes: 392 additions & 1 deletion docs/references/smart-contract-api/parliament-contract/index.md

Large diffs are not rendered by default.

457 changes: 456 additions & 1 deletion docs/references/smart-contract-api/profit-contract/index.md

Large diffs are not rendered by default.

490 changes: 489 additions & 1 deletion docs/references/smart-contract-api/referendum-contract/index.md

Large diffs are not rendered by default.

306 changes: 305 additions & 1 deletion docs/references/smart-contract-api/token-convert-contract/index.md

Large diffs are not rendered by default.

299 changes: 298 additions & 1 deletion docs/references/smart-contract-api/token-holder-contract/index.md

Large diffs are not rendered by default.

361 changes: 360 additions & 1 deletion docs/references/smart-contract-api/treasury-contract/index.md

Large diffs are not rendered by default.

400 changes: 399 additions & 1 deletion docs/references/smart-contract-api/vote-contract/index.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/understanding-aelf/core/implementation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: Core Implementation

# Design Principles

![image](node-archi.png)
![image](../../../../static/img/node-archi.png)

The diagram above shows the conceptual structure of the node and the separation between the OS and Kernel.

Expand Down
4 changes: 2 additions & 2 deletions docs/understanding-aelf/cross-chain/architecture/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Through this link, messages are exchanged, and indexing is performed to ensure t

In the current architecture, both the side chain node and the main chain node have one server and exactly one client. This forms the basis for AElf's two-way communication between the main chain and side chains. Both the server and the client are implemented as node plugins (a node has a collection of plugins). Interaction (listening and requesting) can start once both nodes are running.

![Node Level Architecture](side-chain-nodes.png)
![Node Level Architecture](../../../../static/img/side-chain-nodes.png)

The diagram above illustrates two nodes run by an entity: one main chain node and one side chain node. Note that the nodes don't have to be in the same physical location.

Expand Down Expand Up @@ -63,4 +63,4 @@ Apart from the data in blocks, most cross-chain data will be stored by the cross

Conceptually, the node operates as described in the following diagram. The main/side chain node receives cross-chain data from the other side and stores it in local memory. The indexing transaction is packed by the miner, and the cross-chain data is written into the `State` through the `Crosschain Contract`.

![Data Flow](architecture-node.png)
![Data Flow](../../../../static/img/architecture-node.png)
7 changes: 5 additions & 2 deletions docs/understanding-aelf/cross-chain/introduction/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,19 @@ One of the major issues with current blockchain systems is scalability. This is
To address this issue, AElf introduced side chains in its initial design. The concept is that each side-chain handles one or more similar business scenarios, distributing different tasks across multiple chains to improve overall processing efficiency.

## Key Points:

- **Independent and Specialized**: Side-chains are designed to be independent and specialized, ensuring that the dApps running on them perform efficiently and smoothly.
- **Network Link**: There is a network link between the main-chain node and side-chain nodes, with communication indirectly facilitated through a Merkle root.

![image](introduction-topology.png)
![image](../../../../static/img/introduction-topology.png)

*The diagram above illustrates the conceptual idea behind side chains.*
_The diagram above illustrates the conceptual idea behind side chains._

Side chains are isolated but still need a way to interact with each other. To enable cross-chain verification scenarios, AElf introduces a communication mechanism through **Merkle roots** and **indexing**.

## Overview

The following sections of this documentation will provide:

- An overview of the architecture of AElf's side chains.
- A guide explaining how to set up a main-chain and a side chain node.

0 comments on commit 5a53cbe

Please sign in to comment.