Skip to content

Commit 24146a3

Browse files
committed
Initial comit
0 parents  commit 24146a3

File tree

445 files changed

+57083
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

445 files changed

+57083
-0
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @LeoHChen @AndyBoWu @jdubpark @edisonz0718 @ezreal1997 @limengformal @Narangde @leeren

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: Bug report
3+
about: Submit a bug ticket if you have an issue. If you're a user, check out the Story Protocol Discord server for faster assistance.
4+
title: ''
5+
labels: 'bug'
6+
assignees: ''
7+
---
8+
<!--- Fill out the fields if you're an integrator or contributor. -->
9+
10+
## Description and context
11+
<!--- Provide a detailed description of the problem to expedite the process. -->
12+
13+
14+
## Steps to reproduce
15+
<!--- Describe what happened step by step. -->
16+
<!--- If applicable, provide a link to a live example or include code to reproduce. -->
17+
18+
1.
19+
2.
20+
3.
21+
22+
## Experienced behavior
23+
<!--- Describe what happened after the last step. -->
24+
25+
26+
## Expected behavior
27+
<!--- Describe what was expected to happen instead. -->
28+
29+
30+
## Solution recommendation
31+
<!--- Not mandatory, but feel free to recommend a way fix the issue. -->

.github/ISSUE_TEMPLATE/config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Story Protocol Official Discord
4+
url: https://discord.gg/storyprotocol
5+
about: If you're a user, this is the fastest way to get help. Do not give your wallet private key or mnemonic words to anyone.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature Request
3+
about: Create a feature request item to be picked up by a contributor.
4+
title: ''
5+
labels: 'enhancement'
6+
assignees: ''
7+
8+
---
9+
10+
## Description and context
11+
<!--- Write a description or todo list as the scope. A task should be: -->
12+
<!--- Actionable: can be acted on right away. -->
13+
<!--- Clearly defined scope: has precise limits/boundaries. -->
14+
<!--- Small scope: break complex tasks into smaller ones if they involve multiple system parts, multiple people/PRs, or parallelizable work. -->
15+
16+
## Suggested solution
17+
<!--- Optionally write a description of suggested solution for this feature request -->
18+
19+
## Definition of done
20+
<!--- Describe completion: e.g. code merged, deployment is done, or release published etc. -->

.github/ISSUE_TEMPLATE/task.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Task
3+
about: Create a regular work item to be picked up by a contributor.
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
## Description and context
11+
<!--- Write a description or todo list as the scope. A task should be: -->
12+
<!--- Actionable: can be acted on right away. -->
13+
<!--- Clearly defined scope: has precise limits/boundaries. -->
14+
<!--- Small scope: break complex tasks into smaller ones if they involve multiple system parts, multiple people/PRs, or parallelizable work. -->
15+
16+
## Suggested solution
17+
<!--- Optionally write a description of suggested solution for this feature request -->
18+
19+
## Definition of done
20+
<!--- Describe completion: e.g. code merged, deployment is done, or release published etc. -->
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Tracking issue
3+
about: Tracking issues are task lists used to better organize regular work items.
4+
title: 'Tracking issue for *ADD_PROJECT* - *ADD_COMPONENT*'
5+
labels: 'epic'
6+
assignees: ''
7+
8+
---
9+
10+
This issue is for grouping *ADD_COMPONENT* related tasks that are necessary for *ADD_PROJECT*.
11+
12+
### Other tracking issues for the same project:
13+
<!--- Link related tracking issues within the project for easier navigation. -->
14+
<!--- Assign tasks to the appropriate tracking issue if there is more than one. -->
15+
16+
- #XXXX
17+
- #XXXX
18+
- #XXXX
19+
20+
<!--- Subtasks MUST be inside the ``` -> ``` code block. -->
21+
```[tasklist]
22+
### Task list
23+
- [ ] XXXX
24+
- [ ] XXXX
25+
```

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "gomod"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"

.github/pull-request-template.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<!-- Add a description of the changes that this PR introduces. Must be less than 50 characters, all lower case and no special characters -->
2+
3+
issue: <!-- fixes/closes/resolves #<issue number> -->
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: ci docs
2+
env:
3+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
4+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_DOCS_PROJECT_ID }}
5+
on:
6+
workflow_dispatch:
7+
push:
8+
branches:
9+
- main
10+
paths:
11+
- 'docs/site/**'
12+
jobs:
13+
deploy:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout Repository
17+
uses: actions/checkout@v4
18+
- name: Install PNPM
19+
uses: pnpm/action-setup@v3
20+
with:
21+
version: 8
22+
- name: Install Vercel CLI
23+
run: pnpm install --global vercel@latest
24+
- name: Pull Vercel Environment Information
25+
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
26+
- name: Build Project Artifacts
27+
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
28+
- name: Deploy Project Artifacts to Vercel
29+
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}

.github/workflows/ci-iliad-s3.yml

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
name: Build and Upload iliad Binary
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
9+
permissions:
10+
id-token: write
11+
contents: write
12+
pull-requests: write
13+
actions: write
14+
15+
env:
16+
NUM_INTERNAL_BINARIES_TO_KEEP: 50
17+
NUM_PUBLIC_BINARIES_TO_KEEP: 400
18+
19+
jobs:
20+
# Add timestamp
21+
Timestamp:
22+
uses: storyprotocol/gha-workflows/.github/workflows/reusable-timestamp.yml@main
23+
24+
# Build and upload the iliad binary
25+
build_and_push:
26+
needs: Timestamp
27+
runs-on: ubuntu-latest
28+
strategy:
29+
matrix:
30+
platform: [linux-386, linux-amd64, linux-arm, linux-arm64, darwin-amd64, darwin-arm64, windows-amd64, windows-386]
31+
32+
steps:
33+
- name: Checkout code
34+
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
35+
36+
- name: Configure AWS credentials
37+
uses: aws-actions/configure-aws-credentials@v1
38+
with:
39+
role-to-assume: arn:aws:iam::478656756051:role/iac-max-role
40+
aws-region: us-west-1
41+
role-session-name: github-actions
42+
43+
- name: Extract the version
44+
run: |
45+
PARAMS_FILE="./lib/buildinfo/buildinfo.go"
46+
VERSION_MAJOR=$(awk -F= '/VersionMajor/ {gsub(/[^0-9]/, "", $2); printf "%s", $2}' $PARAMS_FILE)
47+
VERSION_MINOR=$(awk -F= '/VersionMinor/ {gsub(/[^0-9]/, "", $2); printf "%s", $2}' $PARAMS_FILE)
48+
VERSION_PATCH=$(awk -F= '/VersionPatch/ {gsub(/[^0-9]/, "", $2); printf "%s", $2}' $PARAMS_FILE)
49+
VERSION_META=$(awk -F\" '/VersionMeta/ {print $2; exit}' $PARAMS_FILE)
50+
51+
VERSION="$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH"
52+
if [ "$VERSION_META" != "stable" ]; then
53+
VERSION+="-${VERSION_META}"
54+
fi
55+
56+
echo "Version extracted: $VERSION"
57+
echo "VERSION=$VERSION" >> $GITHUB_ENV
58+
59+
- name: Build the iliad binary
60+
run: |
61+
IFS="-" read -r GOOS GOARCH <<< "${{ matrix.platform }}"
62+
bin_name=iliad
63+
if [ "$GOOS" = "windows" ]; then
64+
bin_name+='.exe'
65+
fi
66+
67+
echo "Building for $GOOS/$GOARCH..."
68+
cd client
69+
env GOOS=$GOOS GOARCH=$GOARCH go build -o $bin_name > /dev/null 2>&1
70+
chmod +x $bin_name
71+
72+
- name: Upload the iliad binary to S3
73+
run: |
74+
export TZ=America/Los_Angeles
75+
IFS="-" read -r GOOS GOARCH <<< "${{ matrix.platform }}"
76+
TIMESTAMP=$(date +%Y%m%d%H%M%S)
77+
HUMAN_READABLE_VERSION=$(date)
78+
COMMIT_HASH=$(git rev-parse --short HEAD)
79+
FOLDER_NAME="iliad-${{ matrix.platform }}-${VERSION}-${COMMIT_HASH}"
80+
ARCHIVE_NAME="${FOLDER_NAME}.tar.gz"
81+
82+
bin_name=./client/iliad
83+
if [ "$GOOS" = "windows" ]; then
84+
bin_name+='.exe'
85+
fi
86+
87+
mkdir $FOLDER_NAME
88+
mv $bin_name $FOLDER_NAME/
89+
90+
echo "Archiving the iliad binary..."
91+
tar -czvf $ARCHIVE_NAME $FOLDER_NAME
92+
93+
if [ $? -ne 0 ]; then
94+
echo "Failed to create the archive: $ARCHIVE_NAME"
95+
exit 1
96+
fi
97+
98+
aws s3 cp $ARCHIVE_NAME s3://iliad-geth-binaries/iliad-public/$ARCHIVE_NAME --quiet
99+
100+
if [ "${{ matrix.platform }}" = "linux-amd64" ]; then
101+
102+
echo "Uploading binary for internal use..."
103+
aws s3 cp $ARCHIVE_NAME s3://iliad-geth-binaries/iliad/iliad-$TIMESTAMP --quiet
104+
105+
# Update manifest file
106+
aws s3 cp s3://iliad-geth-binaries/iliad/manifest.txt manifest.txt --quiet || touch manifest.txt
107+
echo "$TIMESTAMP" >> manifest.txt
108+
aws s3 cp manifest.txt s3://iliad-geth-binaries/iliad/manifest.txt --quiet
109+
fi
110+
111+
cleanup:
112+
runs-on: ubuntu-latest
113+
needs: build_and_push
114+
steps:
115+
- name: Configure AWS credentials
116+
uses: aws-actions/configure-aws-credentials@v1
117+
with:
118+
role-to-assume: arn:aws:iam::478656756051:role/iac-max-role
119+
aws-region: us-west-1
120+
role-session-name: github-actions
121+
122+
- name: Cleanup internal binaries
123+
run: |
124+
cleanup_s3() {
125+
PREFIX=$1
126+
KEEP=$2
127+
128+
echo "Cleaning up in bucket iliad-geth-binaries with prefix: $PREFIX, keeping latest $KEEP binaries"
129+
130+
aws s3api list-objects-v2 --bucket iliad-geth-binaries --prefix $PREFIX --query "sort_by(Contents,&LastModified)[*].Key" > all_binaries.json
131+
132+
# Extract the list of keys, remove the latest $KEEP binaries
133+
BINARIES_TO_DELETE=$(jq -r ".[0:-${KEEP}][]" all_binaries.json)
134+
135+
if [ -n "$BINARIES_TO_DELETE" ]; then
136+
# Delete old binaries
137+
for key in $BINARIES_TO_DELETE; do
138+
aws s3 rm s3://iliad-geth-binaries/$key --quiet
139+
done
140+
echo "Deleted old binaries: $BINARIES_TO_DELETE"
141+
else
142+
echo "No old binaries to delete."
143+
fi
144+
}
145+
146+
# Cleanup internal binaries
147+
cleanup_s3 "iliad/" "${NUM_INTERNAL_BINARIES_TO_KEEP}"
148+
149+
# Cleanup public binaries
150+
cleanup_s3 "iliad-public/" "${NUM_PUBLIC_BINARIES_TO_KEEP}"

0 commit comments

Comments
 (0)