Skip to content

Commit f602860

Browse files
resolved conflicts for main to develop pull (#366)
1 parent 516c87e commit f602860

File tree

10 files changed

+403
-31
lines changed

10 files changed

+403
-31
lines changed

.env.example

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
FEEDBACK_CONTENT_SET_ID=
1+
FEEDBACK_CONTENT_SET_ID=
2+
HOTJAR_ID=abc

.github/workflows/main.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
# GitHub recommends pinning actions to a commit SHA.
7+
# To get a newer version, you will need to update the SHA.
8+
# You can also reference a tag or branch, but the action may change without warning.
9+
10+
name: Publish Docker image
11+
12+
on:
13+
push:
14+
branches: [main]
15+
16+
jobs:
17+
build:
18+
name: Build and Push Docker image to Docker Hub
19+
runs-on: ubuntu-latest
20+
environment: ${{ github.ref == 'refs/heads/main' && 'production' || 'development' }}
21+
permissions:
22+
contents: read
23+
steps:
24+
- name: Check out the repo
25+
uses: actions/checkout@v4
26+
27+
- uses: actions/setup-node@v4
28+
with:
29+
node-version: 18
30+
cache: 'npm'
31+
32+
- run: npm install
33+
- name: create env file
34+
run: |
35+
touch .env
36+
echo TYPESENSE_COLLECTION_NAME=${{ vars.TYPESENSE_COLLECTION_NAME }} >> .env
37+
echo TYPESENSE_SERVER_HOST=${{ vars.TYPESENSE_SERVER_HOST }} >> .env
38+
echo TYPESENSE_SEARCH_ONLY_APIKEY=${{ vars.TYPESENSE_SEARCH_ONLY_APIKEY }} >> .env
39+
echo HOTJAR_ID=${{ vars.HOTJAR_ID }} >> .env
40+
41+
- run: npm run build
42+
43+
- name: Log in to Docker Hub
44+
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
45+
with:
46+
username: ${{ secrets.DOCKER_USERNAME }}
47+
password: ${{ secrets.DOCKER_PASSWORD }}
48+
49+
- name: Extract metadata (tags, labels) for Docker
50+
id: meta
51+
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
52+
with:
53+
images: ${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}
54+
tags: |
55+
type=sha
56+
# set latest tag for default branch
57+
type=raw,value=latest,enable={{is_default_branch}}
58+
59+
- name: Build and push Docker image
60+
id: push
61+
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
62+
with:
63+
context: .
64+
file: ./Dockerfile
65+
push: true
66+
tags: ${{ steps.meta.outputs.tags }}
67+
labels: ${{ steps.meta.outputs.labels }}
68+
69+
- name: Set short git commit SHA
70+
id: vars
71+
run: |
72+
calculatedSha=$(git rev-parse --short ${{ github.sha }})
73+
echo "short_sha=$calculatedSha" >> "$GITHUB_OUTPUT"
74+
75+
- name: Deploy
76+
uses: actions/github-script@v6
77+
with:
78+
github-token: ${{ secrets.WORKFLOW_DISPATCH }}
79+
script: |
80+
await github.rest.actions.createWorkflowDispatch({
81+
owner: 'poc-aaa',
82+
repo: 'devops',
83+
workflow_id: 'deploy.yaml',
84+
ref: 'main',
85+
inputs: {
86+
env: '${{ github.ref == 'refs/heads/main' && 'production' || 'development' }}',
87+
appName: 'docs',
88+
appProject: 'aelf-docs',
89+
commit_sha: 'sha-${{ steps.vars.outputs.short_sha }}',
90+
}
91+
})

.github/workflows/s3.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
name: Deploy to S3
2-
32
on:
43
push:
54
branches: [ "main", "develop" ]
65
workflow_dispatch:
7-
86
jobs:
9-
107
build:
118
environment: ${{ github.ref == 'refs/heads/main' && 'production' || 'development' }}
129
permissions:
@@ -23,14 +20,13 @@ jobs:
2320
run: |
2421
touch .env
2522
echo FEEDBACK_CONTENT_SET_ID=${{ vars.FEEDBACK_CONTENT_SET_ID }} >> .env
23+
echo HOTJAR_ID=${{ vars.HOTJAR_ID }} >> .env
2624
- run: npm run build
27-
2825
- name: Configure AWS Credentials
2926
uses: aws-actions/configure-aws-credentials@v2
3027
with:
3128
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
3229
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
3330
aws-region: ap-northeast-1
34-
3531
- name: Sync to S3
36-
run: aws s3 sync ./build s3://${{ secrets.AWS_S3_BUCKET }}
32+
run: aws s3 sync ./build s3://${{ secrets.AWS_S3_BUCKET }}

docs/legal/privacy-policy/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
sidebar_position: 2
33
title: Privacy Policy
44
---
5-
**Last updated: 25 June 2024**
5+
**Last updated: 3 September 2024**
66

77
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.
88

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

141141
\- Website Hosting Service Providers
142142

143-
**7. Use Cookies And Other Tracking Technologies?**
143+
**7. Use of Cookies And Other Tracking Technologies**
144144

145-
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.
145+
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).
146146

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

docs/tools/aelf-playground/index.md

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,19 @@ The interaction with the workspace project code inside `src` and `test` folders
5050

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

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

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

6162
### Features of the aelf-playground
6263

6364
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:
65+
6466
- src/Protobuf/contract/`contract_proto_file_name`.proto file
6567
- src/`ContractName`.cs
6668
- src/`ContractName`State.cs
@@ -70,18 +72,20 @@ Once all the changes are done in the above files and all other required files (w
7072

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

73-
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.
75+
![AI-Audit](/img/playground-9.png)
76+
77+
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.
7478

75-
![Save-Gas-Fee](/img/playground-10.png)
79+
![Save-Gas-Fee](/img/playground-10.png)
7680

7781
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.
7882

79-
![Build](/img/playground-11.png)
80-
83+
![Build](/img/playground-11.png)
84+
8185
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.
8286

83-
![Test](/img/playground-12.png)
84-
87+
![Test](/img/playground-12.png)
88+
8589
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).
8690

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

97101
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.
98102

99-
![Share](/img/playground-15.png)
103+
![Share](/img/playground-15.png)
100104

101105
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.
102106

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

109113
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.
110114

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

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

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

117121
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).
118122

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

121125
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.
122126

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

125129
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.
126130
![Add a New File](/img/playground-24.png)
127131

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

130-
![Add a New File](/img/playground-22.png)
131-
134+
![Add a New File](/img/playground-22.png)
132135

133136
## 4. Example
134137

@@ -249,7 +252,7 @@ namespace AElf.Contracts.ToDo
249252

250253
- 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.
251254

252-
#### Implement ToDo Smart Contract
255+
#### Implement ToDo Smart Contract
253256

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

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

451454
## Conclusion
452-
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.
455+
456+
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.

docusaurus.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ const config: Config = {
3535
defaultLocale: "en",
3636
locales: ["en"],
3737
},
38-
3938
presets: [
4039
[
4140
"classic",

0 commit comments

Comments
 (0)