-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #662 from UnUniFi/newDevelop
New develop
- Loading branch information
Showing
1,104 changed files
with
179,897 additions
and
66,377 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.vscode/ | ||
go.work | ||
go.work.sum | ||
*.md | ||
Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
permissions: | ||
contents: read | ||
pull-requests: write | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
code-review: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: anc95/ChatGPT-CodeReview@main | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
# Optional | ||
LANGUAGE: English | ||
MODEL: gpt-3.5-turbo | ||
top_p: 1 | ||
temperature: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
// Place your uni_tmp_work workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and | ||
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope | ||
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is | ||
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are: | ||
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. | ||
// Placeholders with the same ids are connected. | ||
// Example: | ||
"print clipborad for debugging": { | ||
"scope": "go", | ||
"prefix": [ | ||
"fmtl", | ||
"log" | ||
], | ||
"body": [ | ||
"fmt.Println(\"$CLIPBOARD\");", | ||
"fmt.Println($CLIPBOARD);", | ||
], | ||
"description": "print clipboard" | ||
}, | ||
"print current number": { | ||
"scope": "go", | ||
"prefix": [ | ||
"ll", | ||
"logLine", | ||
"trace" | ||
], | ||
"body": [ | ||
"fmt.Println(\"$TM_FILENAME:$TM_LINE_NUMBER\");", | ||
], | ||
"description": "print line number" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "build then Launch and auto throw Tx", | ||
"type": "go", | ||
"request": "launch", | ||
"mode": "auto", | ||
"program": "./cmd/ununifid/main.go", | ||
"args": [ | ||
"start", | ||
"--home", | ||
"./data/test" | ||
], | ||
"cwd": "${workspaceFolder}", | ||
"preLaunchTask": "prepare tx", | ||
}, | ||
{ | ||
"name": "just Launch", | ||
"type": "go", | ||
"request": "launch", | ||
"mode": "auto", | ||
"program": "./cmd/ununifid/main.go", | ||
"args": [ | ||
"start", | ||
"--home", | ||
"./data/test" | ||
], | ||
"cwd": "${workspaceFolder}", | ||
}, | ||
{ | ||
"name": "build then Launch", | ||
"type": "go", | ||
"request": "launch", | ||
"mode": "auto", | ||
"program": "./cmd/ununifid/main.go", | ||
"args": [ | ||
"start", | ||
"--home", | ||
"./data/test" | ||
], | ||
"cwd": "${workspaceFolder}", | ||
"preLaunchTask": "init config", | ||
}, | ||
{ | ||
"name": "debug alpha node", | ||
"type": "go", | ||
"request": "launch", | ||
"mode": "auto", | ||
"program": "./cmd/ununifid/main.go", | ||
"args": [ | ||
"start", | ||
"--home", | ||
"./data/test" | ||
], | ||
"cwd": "${workspaceFolder}", | ||
"preLaunchTask": "copy_alpha_node_data", | ||
}, | ||
{ | ||
"name": "debug debudata", | ||
"type": "go", | ||
"request": "launch", | ||
"mode": "auto", | ||
"program": "./cmd/ununifid/main.go", | ||
"args": [ | ||
"start", | ||
"--home", | ||
"./debug_data" | ||
], | ||
"cwd": "${workspaceFolder}", | ||
}, | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,31 @@ | ||
{ | ||
"editor.tabSize": 2, | ||
"editor.detectIndentation": false, | ||
"editor.formatOnSave": true | ||
} | ||
"editor.formatOnSave": true, | ||
"cSpell.enabled": true, | ||
"go.lintTool": "golangci-lint", | ||
"go.formatTool": "goimports", | ||
"go.useLanguageServer": true, | ||
"[go.mod]": { | ||
"editor.formatOnSave": true, | ||
"editor.codeActionsOnSave": { | ||
"source.organizeImports": true | ||
} | ||
}, | ||
"[go]": { | ||
"editor.snippetSuggestions": "top", | ||
"editor.formatOnSave": true, | ||
"editor.codeActionsOnSave": { | ||
"source.organizeImports": true | ||
}, | ||
"editor.suggest.snippetsPreventQuickSuggestions": true | ||
}, | ||
"gopls": { | ||
"local": "github.com/UnUniFi/chain" | ||
}, | ||
"files.eol": "\n", | ||
"[proto3]": { | ||
"editor.defaultFormatter": "zxh404.vscode-proto3" | ||
}, | ||
"clang-format.style": "{BasedOnStyle: Google, IndentWidth: 2, ColumnLimit: 120, AlignConsecutiveAssignments: true, AlignConsecutiveDeclarations: true, SpacesInSquareBrackets: true}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{ | ||
// See https://go.microsoft.com/fwlink/?LinkId=733558 | ||
// for the documentation about the tasks.json format | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "build", | ||
"type": "shell", | ||
"cwd": "${workspaceFolder}", | ||
"command": "make build -B", | ||
"problemMatcher": [ | ||
"$go" | ||
] | ||
}, | ||
{ | ||
"label": "init config", | ||
"type": "shell", | ||
"cwd": "${workspaceFolder}", | ||
"command": "scripts/setup/init.sh", | ||
"problemMatcher": [ | ||
"$go" | ||
], | ||
"dependsOn": [ | ||
"build", | ||
] | ||
}, | ||
{ | ||
"label": "prepare tx", | ||
"type": "shell", | ||
"cwd": "${workspaceFolder}", | ||
"command": "nohup scripts/commands/prepare.sh sleep ... & sleep 0.1", | ||
"dependsOn": [ | ||
"init config", | ||
], | ||
}, | ||
{ | ||
"label": "prepare tx direct", | ||
"type": "shell", | ||
"cwd": "${workspaceFolder}", | ||
"command": "scripts/commands/prepare.sh sleep", | ||
}, | ||
{ | ||
"label": "run pricefeed", | ||
"type": "shell", | ||
"cwd": "${workspaceFolder}", | ||
"command": "scripts/commands/derivatives/setup_pricefeed.sh", | ||
}, | ||
{ | ||
"label": "copy_alpha_node_data", | ||
"type": "shell", | ||
"cwd": "${workspaceFolder}", | ||
"command": "scripts/utils/get-backup-data.sh", | ||
}, | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
# > docker build -t ununifid . | ||
# > docker run -it -p 26656:26656 -p 26657:26657 -v ~/.ununifi:/root/.ununifi ghcr.io/ununifi/ununifid ununifid init | ||
# > docker run -it -p 26656:26656 -p 26657:26657 -v ~/.ununifi:/root/.ununifi ghcr.io/ununifi/ununifid ununifid start | ||
FROM golang:1.17-alpine AS build-env | ||
FROM golang:1.19-alpine AS build-env | ||
|
||
# Set up dependencies | ||
ENV PACKAGES curl make git libc-dev bash gcc linux-headers eudev-dev python3 | ||
|
@@ -16,20 +16,24 @@ COPY . . | |
RUN go version | ||
|
||
# Install minimum necessary dependencies, build Cosmos SDK, remove packages | ||
RUN apk add --no-cache $PACKAGES | ||
RUN apk add $PACKAGES | ||
|
||
# install and setup glibc | ||
RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub | ||
RUN wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.25-r0/glibc-2.25-r0.apk | ||
RUN wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.25-r0/glibc-bin-2.25-r0.apk | ||
RUN wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.25-r0/glibc-i18n-2.25-r0.apk | ||
RUN apk add --no-cache glibc-2.25-r0.apk glibc-bin-2.25-r0.apk glibc-i18n-2.25-r0.apk | ||
ENV LD_LIBRARY_PATH /usr/glibc-compat/lib | ||
RUN /usr/glibc-compat/bin/localedef -i en_US -f UTF-8 en_US.UTF-8 | ||
RUN make install | ||
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.2.4/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a | ||
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.2.4/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a | ||
RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep 682a54082e131eaff9beec80ba3e5908113916fcb8ddf7c668cb2d97cb94c13c | ||
RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep ce3d892377d2523cf563e01120cb1436f9343f80be952c93f66aa94f5737b661 | ||
ARG arch=x86_64 | ||
RUN cp /lib/libwasmvm_muslc.${arch}.a /lib/libwasmvm_muslc.a | ||
|
||
# for cosmwasm build option | ||
RUN BUILD_TAGS=muslc LINK_STATICALLY=true make install | ||
|
||
RUN apk add --update util-linux | ||
RUN whereis ununifid | ||
|
||
# Final image | ||
FROM alpine:edge | ||
FROM alpine:3.15 | ||
|
||
# Install ca-certificates | ||
RUN apk add --update ca-certificates | ||
|
@@ -38,10 +42,6 @@ WORKDIR /root | |
|
||
# Copy over binaries from the build-env | ||
COPY --from=build-env /go/bin/ununifid /usr/bin/ununifid | ||
COPY --from=build-env /go/pkg/mod/github.com/!cosm!wasm/[email protected]/api/libwasmvm.so /usr/lib/libwasmvm.so | ||
COPY --from=build-env /lib/ld-musl-x86_64.so.1 /usr/lib/ld-musl-x86_64.so.1 | ||
COPY --from=build-env /usr/lib/libgcc_s.so.1 /usr/lib/libgcc_s.so.1 | ||
COPY --from=build-env /usr/glibc-compat/lib/ld-linux-x86-64.so.2 /usr/lib/ld-linux-x86-64.so.2 | ||
|
||
# Run ununifid by default, omit entrypoint to ease using container with ununificli | ||
CMD ["ununifid"] |
Oops, something went wrong.