Skip to content

Commit

Permalink
Merge pull request #3615 from AElfProject/release/1.11.0
Browse files Browse the repository at this point in the history
Release version 1.11.0
  • Loading branch information
JimAelf authored Sep 30, 2024
2 parents 7236a8e + 3e20e4f commit 4deeae5
Show file tree
Hide file tree
Showing 11 changed files with 249 additions and 33 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build
on:
push:
branches:
- dev
- master
- feature/use-github-actions

env:
DOTNET_INSTALL_DIR: "./.dotnet"

jobs:
build:

runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0'

- name: Download AElf build tools
run: bash scripts/download_binary.sh

- name: Install Protobuf
run: bash scripts/install_protobuf.sh

- name: Build Solution
run: bash scripts/build.sh

22 changes: 22 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Test
on:
push:
branches:
- dev
- master
- feature/use-github-actions

jobs:
build-and-test:
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
steps:
- name: Run dotnet ci action
uses: AElfProject/[email protected]
with:
commit-token: ${{ secrets.COMMIT_TOKEN }}
codecov-token: ${{ secrets.CODECOV_TOKEN }}
branch-name: "feature/badge-json"
solution-name: "AElf.All.sln"
53 changes: 23 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,52 +1,45 @@
# AElf - A Decentralized Cloud Computing Blockchain Network
# aelf - A Decentralized Cloud Computing Blockchain Network

[![GitHub closed issues](https://img.shields.io/github/issues-closed/aelfproject/aelf.svg)](https://app.gitkraken.com/glo/board/XKsOZJarBgAPseno)
[![lisence](https://img.shields.io/github/license/AElfProject/AElf.svg)](https://github.com/AElfProject/AElf/blob/dev/LICENSE)
[![Nuget](https://img.shields.io/nuget/v/AElf.OS.svg)](https://www.nuget.org/packages?q=aelf)
[![MyGet (with prereleases)](https://img.shields.io/myget/aelf-project-dev/vpre/aelf.os.svg?label=myget)](https://www.myget.org/gallery/aelf-project-dev)
[![MyGet (with prereleases)](https://img.shields.io/myget/aelf-project/vpre/aelf.os.svg?label=myget)](https://www.myget.org/gallery/aelf-project)
[![Twitter Follow](https://img.shields.io/twitter/follow/aelfblockchain.svg?label=%40aelfblockchain&style=social)](https://twitter.com/aelfblockchain)
[![Telegram](https://badgen.net/badge/telegram/join/blue?icon=telegram)](https://t.me/aelfdeveloper)

BRANCH | AZURE PIPELINES | TESTS | CODE COVERAGE
------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------
MASTER | [![Build Status](https://dev.azure.com/AElfProject/AElf/_apis/build/status/AElfProject.AElf?branchName=master)](https://dev.azure.com/AElfProject/AElf/_build/latest?definitionId=1&branchName=master) | [![Test Status](https://img.shields.io/azure-devops/tests/AElfProject/AElf/1/master)](https://dev.azure.com/AElfProject/AElf/_build/latest?definitionId=1&branchName=master) | [![codecov](https://codecov.io/gh/AElfProject/AElf/branch/master/graph/badge.svg)](https://codecov.io/gh/AElfProject/AElf)
DEV | [![Build Status](https://dev.azure.com/AElfProject/AElf/_apis/build/status/AElfProject.AElf?branchName=dev)](https://dev.azure.com/AElfProject/AElf/_build/latest?definitionId=1&branchName=dev) | [![Test Status](https://img.shields.io/azure-devops/tests/AElfProject/AElf/1/dev)](https://dev.azure.com/AElfProject/AElf/_build/latest?definitionId=1&branchName=dev) | [![codecov](https://codecov.io/gh/AElfProject/AElf/branch/dev/graph/badge.svg)](https://codecov.io/gh/AElfProject/AElf)
BRANCH | GITHUB ACTIONS BUILD | TESTS | CODE COVERAGE
------ |--------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------| ------------------------------------------------------------
MASTER | ![GitHub Workflow Build Status](https://github.com/AElfProject/AElf/actions/workflows/build.yml/badge.svg?branch=master) | ![GitHub Workflow Test Status](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/AElfProject/AElf/feature/badge-json/master-test-results.json) | [![codecov](https://codecov.io/gh/AElfProject/AElf/branch/master/graph/badge.svg)](https://codecov.io/gh/AElfProject/AElf)
DEV | ![GitHub Workflow Build Status](https://github.com/AElfProject/AElf/actions/workflows/build.yml/badge.svg?branch=dev) | ![GitHub Workflow Test Status](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/AElfProject/AElf/feature/badge-json/dev-test-results.json) | [![codecov](https://codecov.io/gh/AElfProject/AElf/branch/dev/graph/badge.svg)](https://codecov.io/gh/AElfProject/AElf)

Welcome to AElf's official GitHub repo !

AElf is a blockchain system aiming to achieve scalability and extensibility through the use of side-chains and a flexible design. To support multiple use cases AElf makes it as easy as possible to extend/customize the system by providing easy to use tools and frameworks in order to customize the chains and write smart contracts. AElf will eventually support various languages that will let developers choose the one they are the most comfortable with.
Welcome to aelf's official GitHub repo !

aelf is a blockchain system aiming to achieve scalability and extensibility through the use of side-chains and a flexible design. To support multiple use cases aelf makes it as easy as possible to extend/customize the system by providing easy to use tools and frameworks in order to customize the chains and write smart contracts. aelf will eventually support various languages that will let developers choose the one they are the most comfortable with.

For more information you can follow these links:
* [Official website](https://aelf.io)
* [Documentation](https://docs.aelf.io/en/latest/)
* [Environment setup](https://docs.aelf.io/en/latest/getting_started/development-environment/index.html)
* [Running a node](https://docs.aelf.io/en/latest/getting_started/development-environment/node.html)
* [Smart contract development](https://docs.aelf.io/en/latest/getting_started/smart_contracts/index.html)
* [Web Api](https://docs.aelf.io/en/latest/reference/web-api/web-api.html)
* [Testnet](https://docs.aelf.io/en/latest/tutorials/testnet.html)
* [White Paper](https://aelf.com/gridcn/aelf_whitepaper_v1.7_en.pdf)

This repository contains the code that runs an AElf node, you'll find bellow other important repositories in the AElf
* [Official website](https://aelf.com/)
* [Documentation](https://docs.aelf.com/)
* [White Paper](https://docs.aelf.com/resources/whitepaper-2/)

This repository contains the code that runs an aelf node, you'll find below other important repositories in the aelf
ecosystem:

TOOL/LIBRARY | description
-------------|-------------
[aelf-sdk.js](https://docs.aelf.io/en/latest/reference/chain-sdk/javascript/js-sdk.html) | Javascript development kit for interacting with an AElf node, useful for dApp developers.
[aelf-command](https://docs.aelf.io/en/latest/reference/cli/methods.html) | CLI tool for interacting with an AElf node and wallet.
[aelf-boilerplate](https://aelf-boilerplate-docs.readthedocs.io/en/latest/) | framework for smart contract and dApp development.
[aelf-sdk.js](https://docs.aelf.com/tools/chain-sdk/javascript-sdk/) | Javascript development kit for interacting with an aelf node, useful for dApp developers.
[aelf-command](https://docs.aelf.com/tools/aelf-cli/introduction/) | CLI tool for interacting with an aelf node and wallet.
[aelf-contract-templates](https://docs.aelf.com/tools/smart-contract-templates/developing-smart-contracts/) | framework for smart contract and dApp development.

## Getting Started

### This repository

This repo is where you will find the code that can use to run an AElf node. It also contains a **tests** folder that centralizes all the unit tests.
This repo is where you will find the code that can use to run an aelf node. It also contains a **tests** folder that centralizes all the unit tests.

### Documentation

We strongly recommend you follow official documentation that will guide you through installing dependencies and running the node,
these two guides will get you started:
* [Environment setup](https://docs.aelf.io/en/latest/getting_started/development-environment/index.html)
* [Running a node](https://docs.aelf.io/en/latest/getting_started/development-environment/node.html)
We strongly recommend you follow [official documentation](https://docs.aelf.com/) that will guide you through installing dependencies and running the node.

## Contributing

Expand All @@ -62,11 +55,11 @@ We currently only use GitHub for tracking issues, feature request and pull reque

If you think you have found a bug in our system feel free to open a GitHub issue, but first:
- check with GitHub's search engine that the bug doesn't already exist.
- in the request give as much information as possible such as: the OS, the version of AElf, how to reproduce...
- in the request give as much information as possible such as: the OS, the version of aelf, how to reproduce...

#### Missing feature

We also use the GitHub issue tracker for features. If you think that some piece of functionality is missing in AElf, you can open an issue with the following in mind:
We also use the GitHub issue tracker for features. If you think that some piece of functionality is missing in aelf, you can open an issue with the following in mind:
- check for similare feature requests already open.
- provide as much detail and context as possible.
- be as convincing as possible as to why we need this feature and how everybody can benefit from it.
Expand All @@ -83,8 +76,8 @@ When you are ready for a review by the core team, just remove ```[WIP]``` from y

## Versioning

We use Semantic Versioning (SemVer) for versioning, if you're intereted in closely following AElf's developement please check out the [SemVer docs](https://semver.org/).
We use Semantic Versioning (SemVer) for versioning, if you're interested in closely following aelf's development please check out the [SemVer docs](https://semver.org/).

## License

AElf is licenced under [MIT](https://github.com/AElfProject/AElf/blob/dev/LICENSE)
aelf is licenced under [MIT](https://github.com/AElfProject/AElf/blob/dev/LICENSE)
10 changes: 10 additions & 0 deletions protobuf/aelf/core.proto
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ message Transaction {
bytes signature = 10000;
}

message TransactionAndChainId {
Transaction transaction = 1;
int32 chain_id = 2;
}

message MultiTransaction {
repeated TransactionAndChainId transactions = 1;
bytes signature = 10000;
}

message StatePath {
// The partial path of the state path.
repeated string parts = 1;
Expand Down
67 changes: 67 additions & 0 deletions src/AElf.Types/Types/MultiTransaction.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
using System;
using System.Linq;
using Google.Protobuf;

namespace AElf.Types
{
public partial class MultiTransaction
{
private Hash _transactionId;

public Hash GetHash()
{
if (_transactionId == null)
_transactionId = HashHelper.ComputeFrom(GetSignatureData());

return _transactionId;
}

public ValidationStatus VerifyFields()
{
if (Transactions.Count < 2)
return ValidationStatus.OnlyOneTransaction;

if (!AllTransactionsHaveSameFrom())
return ValidationStatus.MoreThanOneFrom;

if (Transactions.Any(transaction => string.IsNullOrEmpty(transaction.Transaction.MethodName)))
return ValidationStatus.MethodNameIsEmpty;

if (Transactions.Any(transaction => transaction.Transaction.Signature.IsEmpty))
{
return ValidationStatus.UserSignatureIsEmpty;
}

return ValidationStatus.Success;
}

public enum ValidationStatus
{
Success,
OnlyOneTransaction,
MoreThanOneFrom,
MethodNameIsEmpty,
UserSignatureIsEmpty
}

private bool AllTransactionsHaveSameFrom()
{
var firstFrom = Transactions[0].Transaction.From;
return Transactions.All(transaction => transaction.Transaction.From == firstFrom);
}

private byte[] GetSignatureData()
{
var verifyResult = VerifyFields();
if (verifyResult != ValidationStatus.Success)
throw new InvalidOperationException($"Invalid multi transaction, {verifyResult.ToString()}: {this}");

if (Signature.IsEmpty)
return this.ToByteArray();

var multiTransaction = Clone();
multiTransaction.Signature = ByteString.Empty;
return multiTransaction.ToByteArray();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@ public override void ConfigureServices(ServiceConfigurationContext context)

context.Services
.AddSingleton<ITransactionResultStatusCacheProvider, TransactionResultStatusCacheProvider>();

Configure<MultiTransactionOptions>(context.Services.GetConfiguration()
.GetSection("MultiTransaction"));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace AElf.WebApp.Application.Chain.Dto;

public class SendMultiTransactionInput : SendTransactionsInput
{

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace AElf.WebApp.Application.Chain.Dto;

public class SendMultiTransactionOutput
{
public string[] TransactionIds { get; set; }
}
6 changes: 5 additions & 1 deletion src/AElf.WebApp.Application.Chain/Error.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ public static class Error
public const int InvalidOffset = 20006;
public const int InvalidLimit = 20007;
public const int InvalidTransaction = 20008;
public const int InvalidXTransaction = 20009;
public const int InvalidContractAddress = 20010;
public const int NoMatchMethodInContractAddress = 20011;
public const int InvalidParams = 20012;
public const int InvalidSignature = 20013;
public const int InvalidGatewaySignature = 20014;
public const string NeedBasicAuth = "User name and password for basic auth should be set";

public static readonly Dictionary<int, string> Message = new()
Expand All @@ -26,9 +28,11 @@ public static class Error
{ InvalidOffset, "Offset must greater than or equal to 0" },
{ InvalidLimit, "Limit must between 0 and 100" },
{ InvalidTransaction, "Invalid transaction information" },
{ InvalidXTransaction, "Invalid multi-transaction information" },
{ InvalidContractAddress, "Invalid contract address" },
{ NoMatchMethodInContractAddress, "No match method in contract address" },
{ InvalidParams, "Invalid params" },
{ InvalidSignature, "Invalid signature" }
{ InvalidSignature, "Invalid signature" },
{ InvalidGatewaySignature, "Invalid gateway signature" }
};
}
7 changes: 7 additions & 0 deletions src/AElf.WebApp.Application.Chain/MultiTransactionOptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace AElf.WebApp.Application.Chain;

public class MultiTransactionOptions
{
public string GatewayAddress { get; set; }
public string GatewayContractAddress { get; set; }
}
Loading

0 comments on commit 4deeae5

Please sign in to comment.