-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
* 0.1.0 Initial commit of Reti Open Pooling development work. --------- Co-authored-by: Doug Richar <[email protected]> Co-authored-by: Patrick Bennett <[email protected]> Co-authored-by: John Mizzoni <[email protected]> Co-authored-by: gitbook-bot <[email protected]>
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
nodemgr/.env.sandbox | ||
**/node_modules/ | ||
go.work |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
on: | ||
release: | ||
types: [created] | ||
|
||
permissions: | ||
contents: write | ||
packages: write | ||
|
||
jobs: | ||
releases-matrix: | ||
name: Release Go Binary | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
# build and publish in parallel: linux/windows/darwin, amd64/arm64 | ||
goos: [linux, windows, darwin] | ||
goarch: [amd64, arm64] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: wangyoucao577/go-release-action@v1 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
goos: ${{ matrix.goos }} | ||
goarch: ${{ matrix.goarch }} | ||
extra_files: LICENSE README.md | ||
goversion: '1.21' | ||
project_path: './nodemgr' | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.env.* | ||
node_modules/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"editor.formatOnSave": true, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": "explicit" | ||
}, | ||
"typescript.tsdk": "./ui/node_modules/typescript/lib" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
* @pbennett @drichar | ||
/contracts/ @pbennett | ||
/nodemgr/ @pbennett | ||
/ui/ @drichar | ||
/docs/ @johnmizz |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM golang:1.21-alpine as builder | ||
# Install git and certificates | ||
RUN apk --no-cache add tzdata zip ca-certificates git | ||
# Make repository path | ||
RUN mkdir -p /go/src/app | ||
WORKDIR /go/src/app | ||
|
||
# just fetch the dependencies in a cachable layer | ||
COPY nodemgr/go.* ./nodemgr/ | ||
RUN cd nodemgr && go mod download && cd .. | ||
|
||
# Copy all project files (.env's are skipped due to .dockerignore) | ||
COPY . ./ | ||
RUN --mount=type=cache,target=/root/.cache/go-build env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -C nodemgr -v -o /out/ . | ||
|
||
FROM scratch | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
COPY --from=builder /out/* /app/ | ||
|
||
ENTRYPOINT ["/app/reti"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.PHONY: none load_env docker-push docker-build | ||
|
||
.DEFAULT_GOAL := none | ||
|
||
none: | ||
@echo bleha bleah | ||
|
||
IMAGE_REPO ?= us-central1-docker.pkg.dev/nfd-nodes/nodes | ||
|
||
# preference would be to fetch version from latest vX.X tag in git | ||
VERSION ?= latest | ||
|
||
IMAGE := reti:$(VERSION) | ||
|
||
docker-build: | ||
docker build --no-cache --platform linux/amd64 -f Dockerfile-nodemgr -t $(IMAGE_REPO)/$(IMAGE) . | ||
|
||
docker-push: docker-build | ||
docker push $(IMAGE_REPO)/$(IMAGE) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,13 @@ | ||
# reti | ||
Contracts and node sidecar for Algorand 'The Reti' consensus incentives | ||
# Reti Open Pooling | ||
|
||
See [Reti Open Pooling](./docs/reti-open-pooling.md) for details on the proposal this implementation is for. | ||
|
||
## Tealscript Contracts | ||
|
||
See [Contracts](./contracts/README.md) | ||
|
||
## Node Daemon | ||
|
||
## UI | ||
|
||
See [UI](./ui/README.md) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"forwardPorts": [4001, 4002, 8980], | ||
"portsAttributes": { | ||
"4001": { | ||
"label": "algod" | ||
}, | ||
"4002": { | ||
"label": "kmd" | ||
}, | ||
"8980": { | ||
"label": "indexer" | ||
} | ||
}, | ||
"postCreateCommand": "pipx install algokit-cli", | ||
"postStartCommand": "algokit localnet start" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
es2021: true, | ||
}, | ||
extends: [ | ||
'airbnb-base', | ||
'plugin:import/errors', | ||
'plugin:import/warnings', | ||
'plugin:import/typescript', | ||
'plugin:prettier/recommended', | ||
], | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
sourceType: 'module', | ||
}, | ||
plugins: ['@typescript-eslint'], | ||
rules: { | ||
'@typescript-eslint/no-explicit-any': 'error', | ||
'@typescript-eslint/ban-ts-comment': 'warn', | ||
'import/prefer-default-export': 'off', | ||
'import/extensions': [ | ||
'error', | ||
'ignorePackages', | ||
{ | ||
js: 'never', | ||
jsx: 'never', | ||
ts: 'never', | ||
tsx: 'never', | ||
}, | ||
], | ||
'import/no-extraneous-dependencies': [ | ||
'error', | ||
{ | ||
devDependencies: ['**/*.test.ts'], | ||
}, | ||
], | ||
'prettier/prettier': [ | ||
'error', | ||
{ | ||
tabWidth: 4, | ||
}, | ||
], | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['*.ts'], | ||
rules: { | ||
'no-continue': 'off', | ||
}, | ||
}, | ||
{ | ||
files: ['*.algo.ts'], | ||
rules: { | ||
'import/no-extraneous-dependencies': 'off', | ||
'object-shorthand': 'off', | ||
'class-methods-use-this': 'off', | ||
'no-undef': 'off', | ||
'max-classes-per-file': 'off', | ||
'no-bitwise': 'off', | ||
'operator-assignment': 'off', | ||
'prefer-template': 'off', | ||
'prefer-destructuring': 'off', | ||
'no-param-reassign': 'off', | ||
'no-restricted-syntax': 'off', | ||
'no-continue': 'off', | ||
}, | ||
}, | ||
{ | ||
files: ['*.test.ts'], | ||
rules: { | ||
'no-await-in-loop': 'off', | ||
}, | ||
}, | ||
], | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules/ | ||
/bootstrap/dist/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# .prettierrc.toml | ||
trailingComma = "es5" | ||
tabWidth = 4 | ||
semi = true | ||
singleQuote = true | ||
printWidth = 120 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"recommendations": [ | ||
"dbaeumer.vscode-eslint", | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": "explicit" | ||
}, | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Reti Open Pooling | ||
|
||
## Documentation | ||
|
||
These contracts, node daemon, and UI are for the proposal described in [Reti Open Pooling](../docs/reti-open-pooling.md). | ||
|
||
The contracts themselves are written in Tealscript. See [Tealscript](https://tealscript.algo.xyz) for details. | ||
|
||
## Usage | ||
|
||
### Algokit | ||
|
||
This repository assumes you have [AlgoKit](https://github.com/algorandfoundation/algokit-cli) installed and have a local network running on your machine. The default 'devmode' sandbox (`algokit localnet start`) is required for the system tests as they manipulate the block time offsets.template assumes you have a local network running on your machine. | ||
|
||
### PNPM | ||
|
||
The PNPM package manager was used for this project. See [pnpm](https://pnpm.io/) for installation details. Be sure to `pnpm install` first. | ||
|
||
### Build Contracts | ||
|
||
`pnpm run build` will compile the contracts to TEAL and generate ABI and appspec JSON files in [./contracts/artifacts](./contracts/artifacts/) and AlgoKit TypeScript clients in [./contracts/clients](./contracts/clients/). | ||
|
||
`pnpm run compile-contract` or `pnpm run generate-client` can be used to compile the contract or generate the contract seperately. | ||
|
||
### Run Tests | ||
|
||
`pnpm run test` will execute the tests defined in [./\_\_test\_\_](./__test__) | ||
|
||
## Deploying | ||
|
||
### Bootstrap script | ||
|
||
A bootstrap script is in the ./bootstrap directory. Running `pnpm run bootstrap --network {network}` will bootstrap the validator. The localnet networkbootstraps the local sandbox and also funds two new test accounts - updating an .env.sandbox file inside the nodemgr directory for local CLI use/testing. It is recommended to use a named sandbox configuration that has devmode disabled so blocks proceed normally. | ||
|