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

resolved conflicts for main to develop pull #366

Merged
merged 1 commit into from
Jan 9, 2025
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
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
FEEDBACK_CONTENT_SET_ID=
FEEDBACK_CONTENT_SET_ID=
HOTJAR_ID=abc
91 changes: 91 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.

name: Publish Docker image

on:
push:
branches: [main]

jobs:
build:
name: Build and Push Docker image to Docker Hub
runs-on: ubuntu-latest
environment: ${{ github.ref == 'refs/heads/main' && 'production' || 'development' }}
permissions:
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'

- run: npm install
- name: create env file
run: |
touch .env
echo TYPESENSE_COLLECTION_NAME=${{ vars.TYPESENSE_COLLECTION_NAME }} >> .env
echo TYPESENSE_SERVER_HOST=${{ vars.TYPESENSE_SERVER_HOST }} >> .env
echo TYPESENSE_SEARCH_ONLY_APIKEY=${{ vars.TYPESENSE_SEARCH_ONLY_APIKEY }} >> .env
echo HOTJAR_ID=${{ vars.HOTJAR_ID }} >> .env

- run: npm run build

- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}
tags: |
type=sha
# set latest tag for default branch
type=raw,value=latest,enable={{is_default_branch}}

- name: Build and push Docker image
id: push
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Set short git commit SHA
id: vars
run: |
calculatedSha=$(git rev-parse --short ${{ github.sha }})
echo "short_sha=$calculatedSha" >> "$GITHUB_OUTPUT"

- name: Deploy
uses: actions/github-script@v6
with:
github-token: ${{ secrets.WORKFLOW_DISPATCH }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: 'poc-aaa',
repo: 'devops',
workflow_id: 'deploy.yaml',
ref: 'main',
inputs: {
env: '${{ github.ref == 'refs/heads/main' && 'production' || 'development' }}',
appName: 'docs',
appProject: 'aelf-docs',
commit_sha: 'sha-${{ steps.vars.outputs.short_sha }}',
}
})
8 changes: 2 additions & 6 deletions .github/workflows/s3.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
name: Deploy to S3

on:
push:
branches: [ "main", "develop" ]
workflow_dispatch:

jobs:

build:
environment: ${{ github.ref == 'refs/heads/main' && 'production' || 'development' }}
permissions:
Expand All @@ -23,14 +20,13 @@ jobs:
run: |
touch .env
echo FEEDBACK_CONTENT_SET_ID=${{ vars.FEEDBACK_CONTENT_SET_ID }} >> .env
echo HOTJAR_ID=${{ vars.HOTJAR_ID }} >> .env
- run: npm run build

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-northeast-1

- name: Sync to S3
run: aws s3 sync ./build s3://${{ secrets.AWS_S3_BUCKET }}
run: aws s3 sync ./build s3://${{ secrets.AWS_S3_BUCKET }}
6 changes: 3 additions & 3 deletions docs/legal/privacy-policy/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
sidebar_position: 2
title: Privacy Policy
---
**Last updated: 25 June 2024**
**Last updated: 3 September 2024**

This privacy policy ("Privacy Policy") elucidates the procedures by which Aelf Pte Ltd("Aelf", "our", "Company", "we", or "us") gathers, employs, and divulges information about you.

Expand Down Expand Up @@ -140,9 +140,9 @@ We only share and disclose your information with the following categories of thi

\- Website Hosting Service Providers

**7. Use Cookies And Other Tracking Technologies?**
**7. Use of Cookies And Other Tracking Technologies**

We do not use cookies or tracking technologies. Rather, we utilise anonymous page view tracking information provided by third-party analytics providers which do not collect or store any personal data. As such, we make no use of cookies.
While we do not directly utilize cookies or other tracking technologies on our Website, we may engage with third-party service providers who deploy such technologies as part of their service offerings. For instance, we use Hotjar in order to better understand our users' needs and to optimize this service and experience. Hotjar is a technology service that helps us better understand our users' experience (eg how much time they spend on which pages, which links they choose to click, what users do and don't like, etc.) and this enables us to build and maintain our service with user feedback. Hotjar uses cookies and other technologies to collect data on our users' behavior and their devices device's IP address (processed during your session and stored in a de-identified form), device screen size, device type (unique device identifiers), browser information, geographic location (country only), and the preferred language used to display our website. Hotjar stores this information on our behalf in a pseudonymized user profile. Hotjar is contractually forbidden to sell any of the data collected on our behalf. By interacting with our Website, you may be subject to these third-party technologies, which are governed by the respective provider's privacy policies. We recommend reviewing these policies to understand how your information may be collected and used. For further details, please see the 'about Hotjar' section of [Hotjar's support site](https://help.hotjar.com/hc/en-us/categories/115001323967-About-Hotjar).

**8. Transfer of Information to Other Jurisdictions**

Expand Down
42 changes: 23 additions & 19 deletions docs/tools/aelf-playground/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,19 @@ The interaction with the workspace project code inside `src` and `test` folders

![drag-and-drop-3](/img/playground-7.png)

- Also, you can choose to import the project directly from the github.
1. Click on `enter a GitHub repo url`.
2. Enter the github URL.
3. Choose the required `.csproj` file.
4. Enter the workspace name and click Submit.
- Also, you can choose to import the project directly from the github.

1. Click on `enter a GitHub repo url`.
2. Enter the github URL.
3. Choose the required `.csproj` file.
4. Enter the workspace name and click Submit.

![drag-and-drop-3](/img/playground-8.png)

### Features of the aelf-playground

Now as the workspace setup is done and project is setup inside aelf's playground. The user can now edit the smart contract logic according to the user needs. The changes will majorly takes place inside the below files:

- src/Protobuf/contract/`contract_proto_file_name`.proto file
- src/`ContractName`.cs
- src/`ContractName`State.cs
Expand All @@ -70,18 +72,20 @@ Once all the changes are done in the above files and all other required files (w

![AI-Audit](/img/playground-9.png)

2. **Save Gas Fee**: Optimise the smart contract to save gas fee. It will suggest to make changes to the smart contract if the smart contract is not optimised. If the smart contract is already optimed then result like below will appear.
![AI-Audit](/img/playground-9.png)

2. **Save Gas Fee**: Optimise the smart contract to save gas fee. It will suggest to make changes to the smart contract if the smart contract is not optimised. If the smart contract is already optimed then result like below will appear.

![Save-Gas-Fee](/img/playground-10.png)
![Save-Gas-Fee](/img/playground-10.png)

3. **Build**: Build the smart contract code. It will show `building` status when the user clicks the `Build` button and will output below result including whether build was successful or failed once the build process ends.

![Build](/img/playground-11.png)
![Build](/img/playground-11.png)

4. **Test**: Test the smart contract code. It will show `Running Tests` status when the user clicks the `Test` button and will output below result including how many tests have passed and failed once the test process ends.

![Test](/img/playground-12.png)
![Test](/img/playground-12.png)

5. **Deploy**: Deploy the smart contract code on the aelf blockchain. It will show `Deploying` status when the user clicks the `Deploy` button and will output below result including `transactionId`, `proposal status` and `contract address` once the build process ends. You can verify the contract address by visiting [aelf testnet explorer](https://testnet.aelfscan.io/tDVW).

![Deploy](/img/playground-13.png)
Expand All @@ -96,7 +100,7 @@ Once all the changes are done in the above files and all other required files (w

8. **Share**: Share the project with a sharable link. It will show `Generating share link` status when the user clicks the `Share` button and will output below result including the sharable link.

![Share](/img/playground-15.png)
![Share](/img/playground-15.png)

9. **Command Line Options**: Command line additionally provides options to check txID and clear terminal including above options. Use the help command to see all the options inside terminal. `check txID` helps in checking the transaction details.

Expand All @@ -108,27 +112,26 @@ Once all the changes are done in the above files and all other required files (w

11. **Add a New File**: Manually add a new file in the playground project structure. It will allow users to add a new file in the workspace project structure add smart contract code, new proto files, etc.

![Add a New File](/img/playground-18.png)
![Add a New File](/img/playground-18.png)

12. **Rename & Delete File**: `Renames` & `Deletes` the chosen file or folders in the project directory structure.

![Add a New File](/img/playground-19.png)
![Add a New File](/img/playground-19.png)

13. **Tutorials**: Some pre-compiled tutorials are curated under `Tutorials` section of aelf-playground. It provides an option to filter the tutorials based on the difficulty level (`Beginner`, `Intermediate` & `Advanced`) and smart contracts languages (C# & Solidity).

![Add a New File](/img/playground-20.png)

14. **Deployments**: `Deployments` section provides a list of all deployed tutorials along with the wallet address used to deploy smart contracts on the aelf blockchain. You can click on the wallet address to view wallet details on the aelf explorer.

![Add a New File](/img/playground-21.png)
![Add a New File](/img/playground-21.png)

15. **Privatekey**: You can export your wallet's private key from the `Deployments` section. Simply click the eye icon to reveal the private key, which you can then copy.
![Add a New File](/img/playground-24.png)

16. **Themes**: Users can also choose to toggle between `dark` and `light` themes.

![Add a New File](/img/playground-22.png)

![Add a New File](/img/playground-22.png)

## 4. Example

Expand Down Expand Up @@ -249,7 +252,7 @@ namespace AElf.Contracts.ToDo

- The `State.cs` file in an aelf blockchain smart contract holds the variables that store the contract's data, making sure this data is saved and accessible whenever the contract needs it.

#### Implement ToDo Smart Contract
#### Implement ToDo Smart Contract

The implementation of the ToDo App smart contract inside file `src/todo-dapp.cs` is as follows:

Expand Down Expand Up @@ -449,4 +452,5 @@ namespace AElf.Contracts.ToDo
🎉 Congratulations, We got the contract address after successful deployment of todo-dapp smart contract using playground.

## Conclusion
The aelf Playground offers a seamless and accessible platform for developers to build, test, and deploy smart contracts without the need for any local setup. With built-in features like AI audit, gas fee optimization, and GitHub integration, it simplifies the entire smart contract development process. Whether you're writing new code or modifying existing templates, the aelf Playground provides all the essential tools in one place, making it an ideal sandbox for both beginners and experienced developers.

The aelf Playground offers a seamless and accessible platform for developers to build, test, and deploy smart contracts without the need for any local setup. With built-in features like AI audit, gas fee optimization, and GitHub integration, it simplifies the entire smart contract development process. Whether you're writing new code or modifying existing templates, the aelf Playground provides all the essential tools in one place, making it an ideal sandbox for both beginners and experienced developers.
1 change: 0 additions & 1 deletion docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ const config: Config = {
defaultLocale: "en",
locales: ["en"],
},

presets: [
[
"classic",
Expand Down
Loading
Loading