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

fix: move Gql from broker to consumer #107

Merged
merged 654 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
654 commits
Select commit Hold shift + click to select a range
5d6284f
Fix query tracker
pouya-eghbali Jan 23, 2024
e86a05a
Bump version
pouya-eghbali Jan 23, 2024
cd1334f
0.10.24
pouya-eghbali Jan 23, 2024
db3df3a
Temporarily increase max rpc request size to infinity
pouya-eghbali Jan 23, 2024
4737eb1
Bump version
pouya-eghbali Jan 23, 2024
88c5eb7
0.10.25
pouya-eghbali Jan 23, 2024
5bbda9e
Fix an issue with socket selection
pouya-eghbali Jan 23, 2024
af5820d
0.10.26
pouya-eghbali Jan 23, 2024
3205fc0
Fix public key storage issue
pouya-eghbali Jan 23, 2024
dab3037
0.10.27
pouya-eghbali Jan 23, 2024
a0112ca
More type checks
pouya-eghbali Jan 25, 2024
27fbd8e
Merge pull request #52 from KenshiTech/0.10.28
pouya-eghbali Jan 25, 2024
b612275
0.10.28
pouya-eghbali Jan 25, 2024
a250ea0
Migrate to Go
pouya-eghbali Jan 29, 2024
304f46b
Migrate to Go
pouya-eghbali Jan 29, 2024
6b9423f
Migrate to Go
pouya-eghbali Jan 29, 2024
b9af671
Migrate to Go
pouya-eghbali Jan 29, 2024
0e4ab1b
Update workflow name
pouya-eghbali Jan 29, 2024
22b8a9c
Mark built files as executable
pouya-eghbali Jan 29, 2024
9045415
Make test
pouya-eghbali Jan 29, 2024
e1089e3
Get secret key and ethereum rpc from config
pouya-eghbali Jan 29, 2024
3d1ae12
Refactor
pouya-eghbali Jan 29, 2024
5561831
Migrate more features to Go
pouya-eghbali Jan 30, 2024
96ee0c8
docker deployment for go
iDmple Jan 30, 2024
603ef54
Merge pull request #54 from KenshiTech/docker-go
pouya-eghbali Jan 30, 2024
2acc001
docker github workflow
iDmple Jan 30, 2024
9b45983
docker github workflow fix
iDmple Jan 30, 2024
b7322f0
Fix docker release
pouya-eghbali Jan 30, 2024
84980cc
Sequential build
pouya-eghbali Jan 30, 2024
ba684bb
Migrate to ESM file ext
pouya-eghbali Jan 30, 2024
592f70e
Enable go cache
pouya-eghbali Jan 30, 2024
2f67703
Migrate to ESM file ext
pouya-eghbali Jan 30, 2024
20571a6
Migrate to ESM file ext
pouya-eghbali Jan 30, 2024
8c6bbb0
Fix release tag
pouya-eghbali Jan 30, 2024
2fe8889
Fix release tag
pouya-eghbali Jan 30, 2024
e7c241f
Fix docker config file
pouya-eghbali Jan 30, 2024
2f732ff
Add retry policy, fix scores
pouya-eghbali Jan 31, 2024
1734168
Fix debounce functions
pouya-eghbali Jan 31, 2024
df50432
changed alpine to ubuntu
iDmple Jan 31, 2024
78939d1
Merge branch 'go' of github.com:KenshiTech/unchained into go
iDmple Jan 31, 2024
52f59ae
Fix relation insert
pouya-eghbali Jan 31, 2024
fc6a686
Fix db table case
pouya-eghbali Jan 31, 2024
56216a6
Resend hello on reconnect
pouya-eghbali Jan 31, 2024
501ceb7
Fix race issues
pouya-eghbali Jan 31, 2024
1aff1e6
updated docs
iDmple Jan 31, 2024
3cd7d21
Add secrets config
pouya-eghbali Jan 31, 2024
d595016
Update quickstart.md
iDmple Jan 31, 2024
90c94ac
Fix docker build tags
pouya-eghbali Jan 31, 2024
c30c660
Auto generate the config if it doesn't exist
pouya-eghbali Jan 31, 2024
36cc99a
Fix workflow tags
pouya-eghbali Jan 31, 2024
8873b4c
Protect against empty names
pouya-eghbali Jan 31, 2024
ce393ae
Fix empty names
pouya-eghbali Feb 1, 2024
7e291d6
updated docker deployment for go
iDmple Feb 1, 2024
1570e2f
updated quickstart
iDmple Feb 1, 2024
237a93f
updated quickstart
iDmple Feb 1, 2024
dae5d7c
Merge pull request #53 from KenshiTech/go
pouya-eghbali Feb 1, 2024
2212cf9
Bump version
pouya-eghbali Feb 1, 2024
28b86d9
Update Readme.md
pouya-eghbali Feb 2, 2024
1191f37
Update Readme.md
pouya-eghbali Feb 2, 2024
5abedda
Request price at block instead of the latest price
pouya-eghbali Feb 2, 2024
28941c6
Merge pull request #55 from KenshiTech/fix-eth-block-req
pouya-eghbali Feb 2, 2024
c46fc41
Fix prerelease
pouya-eghbali Feb 2, 2024
d76aabb
Create FUNDING.yml
pouya-eghbali Feb 6, 2024
b22e297
Update Readme.md
pouya-eghbali Feb 6, 2024
58f4460
Update Readme.md
pouya-eghbali Feb 6, 2024
a64680a
Update Readme.md
pouya-eghbali Feb 6, 2024
b004bdb
Switch to shorter signatures
pouya-eghbali Feb 6, 2024
b8442bb
Add versioned endpoints
pouya-eghbali Feb 6, 2024
cdef55b
Add versioned endpoints
pouya-eghbali Feb 6, 2024
c661f8d
Add shortkey for backwards compatibility
pouya-eghbali Feb 6, 2024
4f6c4eb
Add base32 addresses
pouya-eghbali Feb 7, 2024
4ddc124
Improve address computation
pouya-eghbali Feb 7, 2024
3338a7c
Improve address computation
pouya-eghbali Feb 7, 2024
79de059
Merge pull request #56 from KenshiTech/v0.11.2
pouya-eghbali Feb 7, 2024
f7d7a21
Fix update key
pouya-eghbali Feb 7, 2024
fa12552
Remove unique constraint on key
pouya-eghbali Feb 7, 2024
14182c1
Properly check for ws client errors
pouya-eghbali Feb 7, 2024
b96d453
Fix an issue where short public key wasn't set
pouya-eghbali Feb 7, 2024
256a07a
Fix client connection issues
pouya-eghbali Feb 7, 2024
3cb6b14
Merge pull request #57 from KenshiTech/master
pouya-eghbali Feb 7, 2024
b31f8f4
updated k8s deployment for go
iDmple Feb 7, 2024
9db8921
updated k8s deployment scaling strategy
iDmple Feb 8, 2024
2f00462
fixed typo
iDmple Feb 16, 2024
aef97b6
Stability fixes
pouya-eghbali Feb 16, 2024
a07629e
Write address to secrets file
pouya-eghbali Feb 16, 2024
0b6c8b6
Merge pull request #59 from KenshiTech/v0.11.4
pouya-eghbali Feb 16, 2024
86fbbf6
Merge pull request #58 from KenshiTech/k8s
pouya-eghbali Feb 16, 2024
d070c10
Add logging, prepare for consumers
pouya-eghbali Feb 17, 2024
5bc9a78
Merge pull request #60 from KenshiTech/v0.11.5
pouya-eghbali Feb 17, 2024
884249c
Seperate different functions into separate modules
pouya-eghbali Feb 18, 2024
adc1044
Fix protocol version
pouya-eghbali Feb 18, 2024
5e47b01
Merge pull request #61 from KenshiTech/v0.11.6
pouya-eghbali Feb 18, 2024
5f70951
Update go sums
pouya-eghbali Feb 18, 2024
e628164
Add multi-asset price tracking
pouya-eghbali Feb 19, 2024
a97f73f
Fix template files
pouya-eghbali Feb 20, 2024
1900323
Merge pull request #62 from KenshiTech/v0.11.7
pouya-eghbali Feb 20, 2024
5d0ea01
Add consumers & logs plugin
pouya-eghbali Feb 21, 2024
79774c7
Fix the broker flag
pouya-eghbali Feb 21, 2024
72bcd0b
Merge pull request #63 from KenshiTech/v0.11.8
pouya-eghbali Feb 21, 2024
1587c23
Add cross feature, schedules, and multichain
pouya-eghbali Feb 23, 2024
7dc9c07
Refactor
pouya-eghbali Feb 23, 2024
fc15d52
Add event log table
pouya-eghbali Feb 23, 2024
a03ed89
Add persistence, multichain
pouya-eghbali Feb 23, 2024
10ca530
Update go deps
pouya-eghbali Feb 23, 2024
41269c1
Add a mini consensus
pouya-eghbali Feb 24, 2024
8fe7587
Check for supported tokens
pouya-eghbali Feb 24, 2024
9fedc38
Add standalone mode, add event log storage and RPC
pouya-eghbali Feb 24, 2024
3fd7dbc
Bug fixes
pouya-eghbali Feb 24, 2024
5a2e59c
Add historical direct store mode
pouya-eghbali Feb 24, 2024
2c9552c
Add support for indexed types
pouya-eghbali Feb 24, 2024
d3c2fb1
Replace inConfig with isSet
pouya-eghbali Feb 24, 2024
fabcaa5
Update config templates
pouya-eghbali Feb 24, 2024
ca4379a
Update license
pouya-eghbali Feb 24, 2024
9937512
added context to docker deployment
iDmple Feb 24, 2024
8a31c8f
Update config templates
pouya-eghbali Feb 24, 2024
cd39b44
Update config templates
pouya-eghbali Feb 24, 2024
df16984
Update config templates
pouya-eghbali Feb 24, 2024
b2c4a0c
Update config templates
pouya-eghbali Feb 24, 2024
7723285
added context to gitignore
iDmple Feb 24, 2024
ac28986
Merge branch 'v0.11.9' of github.com:KenshiTech/unchained into v0.11.9
iDmple Feb 24, 2024
6b9a97e
added standalone node type
iDmple Feb 24, 2024
124a7fb
added standalone node type
iDmple Feb 24, 2024
c523281
added standalone node type
iDmple Feb 24, 2024
a7d05fe
Update config templates
pouya-eghbali Feb 24, 2024
4051aaf
added abi dir
iDmple Feb 24, 2024
6bf652d
Merge branch 'v0.11.9' of github.com:KenshiTech/unchained into v0.11.9
iDmple Feb 24, 2024
23aa64a
added abi dir
iDmple Feb 24, 2024
969bf9f
Update .gitignore
pouya-eghbali Feb 24, 2024
a8234a1
Merge pull request #64 from KenshiTech/v0.11.9
pouya-eghbali Feb 24, 2024
8f2bb05
Remove leading whitespace
pouya-eghbali Feb 24, 2024
ed023a4
Fix concurrency issues
pouya-eghbali Feb 26, 2024
284f859
Merge pull request #65 from KenshiTech/v0.11.10
pouya-eghbali Feb 26, 2024
143d84c
Add GraphQL support
pouya-eghbali Feb 26, 2024
7f32f1e
Check if client pointer is initialized
pouya-eghbali Feb 26, 2024
51ec740
Merge pull request #66 from KenshiTech/v0.11.11
pouya-eghbali Feb 26, 2024
d2bc219
Fix logs indexing
pouya-eghbali Feb 26, 2024
30e5ebc
Fix ethereum arg type marshaling
pouya-eghbali Feb 26, 2024
bcd7358
Bump version
pouya-eghbali Feb 26, 2024
b353c2d
Merge pull request #67 from KenshiTech/v0.11.12
pouya-eghbali Feb 26, 2024
fd52bb6
Add installation scripts
pouya-eghbali Feb 29, 2024
0170fa5
Properly handle client errors
pouya-eghbali Feb 29, 2024
4fed27c
Merge pull request #68 from KenshiTech/v0.11.13
pouya-eghbali Feb 29, 2024
1916cde
Fix server errors; Add better type safety to token payloads
pouya-eghbali Mar 1, 2024
843377f
Fix Asset -> Asset.Name
pouya-eghbali Mar 1, 2024
1e54370
Merge pull request #69 from KenshiTech/v0.11.14
pouya-eghbali Mar 1, 2024
5ef2248
Fix broker problems
pouya-eghbali Mar 4, 2024
2c8c6e1
Bump version
pouya-eghbali Mar 4, 2024
2a0364c
Merge pull request #70 from KenshiTech/v0.11.15
pouya-eghbali Mar 4, 2024
d18b1d5
Separate storage and network functions into consumers and brokers
pouya-eghbali Mar 6, 2024
61bcba7
Add EVM wallet to config
pouya-eghbali Mar 8, 2024
5e53cc1
Fix the version number
pouya-eghbali Mar 8, 2024
f9811e0
Merge pull request #71 from KenshiTech/v0.11.16
pouya-eghbali Mar 8, 2024
2c714da
Bump protocol version
pouya-eghbali Mar 8, 2024
3a1870d
Move evmwallet to secrets
pouya-eghbali Mar 8, 2024
ce9a013
Add PoS contract
pouya-eghbali Mar 9, 2024
96da3ee
Add full PoS on all modules
pouya-eghbali Mar 10, 2024
f3b87bd
Add NFT support
pouya-eghbali Mar 10, 2024
0bb5b57
Merge pull request #72 from KenshiTech/v0.11.18
pouya-eghbali Mar 10, 2024
e60f5da
Add sepolia rpc to templates
pouya-eghbali Mar 10, 2024
e029231
Fix consensus issues
pouya-eghbali Mar 12, 2024
724ed46
Merge pull request #73 from KenshiTech/v0.11.19
pouya-eghbali Mar 12, 2024
6fc90fb
Log voting power error messages
pouya-eghbali Mar 15, 2024
1219246
Bump version
pouya-eghbali Mar 15, 2024
da3a197
Create CONTRIBUTING.md
pouya-eghbali Mar 19, 2024
2304862
Add correctness plugin, upgrade pos
pouya-eghbali Mar 20, 2024
1fc1247
Update PoS contract
pouya-eghbali Mar 21, 2024
c014591
Merge pull request #74 from KenshiTech/v0.11.20
pouya-eghbali Mar 21, 2024
b62a3be
Add consume methods for correctness
pouya-eghbali Mar 21, 2024
dad18bb
Add consume methods for correctness
pouya-eghbali Mar 21, 2024
1c21cb8
Call plugin Setup for correctness
pouya-eghbali Mar 21, 2024
6e95805
Fix config path for the correctness plugin
pouya-eghbali Mar 21, 2024
5636e47
Go tidy
pouya-eghbali Mar 21, 2024
07f396e
Fix config path for the correctness plugin
pouya-eghbali Mar 21, 2024
ffef18f
Fix GraphQL resolvers for the correctness plugin
pouya-eghbali Mar 21, 2024
406add7
Fix broadcast packet type
pouya-eghbali Mar 22, 2024
7b51b49
feat: add golang lint config file and some alise in makefile
Mar 22, 2024
03bda26
Add custom byte where input resolvers for gql
pouya-eghbali Mar 22, 2024
81221d7
Fix GitHub workflow for alpha and beta builds
pouya-eghbali Mar 22, 2024
d2f6407
Merge pull request #79 from KenshiTech/add-simple-byte-queries
pouya-eghbali Mar 22, 2024
23b896c
non
logicalangel Mar 22, 2024
a47e69c
Convert signer on correctness to M2M
pouya-eghbali Mar 22, 2024
d680c42
fix: new line at end of file
logicalangel Mar 22, 2024
52ae5e6
Merge pull request #78 from KenshiTech/feature-linter-76
pouya-eghbali Mar 22, 2024
78216b6
Fix goroutine memory leaks in debounce
pouya-eghbali Mar 23, 2024
07d745f
Expose signers to gql
pouya-eghbali Mar 23, 2024
3201239
Update dependencies
pouya-eghbali Mar 23, 2024
bb89adb
Use xsync.Map to fix race conditions
pouya-eghbali Mar 23, 2024
0ad6586
Run db operations in goroutines
pouya-eghbali Mar 24, 2024
c78ac55
Run db operations in goroutines
pouya-eghbali Mar 24, 2024
75b5d56
Fix mutex issues
pouya-eghbali Mar 24, 2024
93ff21e
Merge pull request #83 from KenshiTech/fix-leak-82
pouya-eghbali Mar 24, 2024
ab5419f
feat: fix all linters and add ci to check linters
logicalangel Mar 24, 2024
4ced427
feat: add ci for linters
logicalangel Mar 25, 2024
21a61e1
fix: some misspeling
logicalangel Mar 25, 2024
a787ef4
fix: some fixes according to comments
logicalangel Mar 25, 2024
9f45dd8
fix: problem in wd in CI
logicalangel Mar 25, 2024
049e527
fix: problem in wd in CI
logicalangel Mar 25, 2024
7450610
Fix minor issues in message marshalling and config files
pouya-eghbali Mar 25, 2024
57e0bb1
Merge pull request #84 from KenshiTech/fix-errcheck-80
logicalangel Mar 25, 2024
98666c9
Replace base58 with hex
pouya-eghbali Mar 25, 2024
d913d69
Merge pull request #91 from KenshiTech/replace-base58-87
pouya-eghbali Mar 25, 2024
5d07527
Update Readme.md
pouya-eghbali Mar 26, 2024
61fcce2
Update Readme.md
pouya-eghbali Mar 26, 2024
cfd7c83
Add Sia
pouya-eghbali Mar 27, 2024
aae2a27
Merge pull request #96 from KenshiTech/feat-add-sia-85
pouya-eghbali Mar 27, 2024
cf55d1f
Get rid of consensus and aggregate cache
pouya-eghbali Mar 25, 2024
6936a28
Remove incorrect comments
pouya-eghbali Mar 27, 2024
8bef073
Merge pull request #92 from KenshiTech/remove-correctness-cache-86
pouya-eghbali Mar 27, 2024
7a630e1
feat: collecting all configs to one place and some refactoring
logicalangel Mar 28, 2024
f1bf803
Merge branch 'develop' into fix-configs-90
logicalangel Mar 28, 2024
76e0f4a
feat: update config templates
logicalangel Mar 28, 2024
02ee290
Merge branch 'fix-configs-91' of github.com:KenshiTech/unchained into…
logicalangel Mar 28, 2024
94f0211
fix: loggers of config file
logicalangel Mar 28, 2024
dbc208c
fix: updating quickstart and config templates
logicalangel Mar 28, 2024
eb26e68
fix: dep cycle problem
logicalangel Mar 28, 2024
375f2d5
Bump the protocol version
pouya-eghbali Mar 30, 2024
bd08560
Merge pull request #103 from KenshiTech/develop
pouya-eghbali Mar 30, 2024
555b8b6
fix: add idea directory in gitignore
logicalangel Mar 30, 2024
91a707d
fix: move Gql from broker to consumer
logicalangel Mar 30, 2024
c4dad58
removed deprecated version property
iDmple Mar 30, 2024
9cf4e39
Merge pull request #108 from KenshiTech/master
iDmple Mar 30, 2024
4c25af4
Merge pull request #106 from KenshiTech/fix-idea-in-gitignore-104
logicalangel Mar 30, 2024
45fe94d
fix: format of nodes list
logicalangel Mar 31, 2024
0dacbbf
Merge pull request #101 from KenshiTech/fix-configs-90
logicalangel Mar 31, 2024
8af20ad
Run go mod tidy
pouya-eghbali Mar 31, 2024
246de4f
Fix error on entry not found
pouya-eghbali Mar 31, 2024
517b61e
Cherry pick from master
pouya-eghbali Mar 31, 2024
c99826b
Add logo
pouya-eghbali Apr 1, 2024
07414dc
rename src to internal / move gql to consumer / refactoring
logicalangel Apr 2, 2024
b02b4da
fix: deleted some unused
logicalangel Apr 2, 2024
df2b431
fix: merge
logicalangel Apr 2, 2024
ac255dd
fix: merge
logicalangel Apr 2, 2024
76a822d
fix: linters
logicalangel Apr 2, 2024
5ba7897
fix: linters
logicalangel Apr 2, 2024
1c7fa73
fix: linters
logicalangel Apr 2, 2024
7a24bb7
fix: remove bin file
logicalangel Apr 3, 2024
af108e5
fix: rename o to option
logicalangel Apr 3, 2024
82e6866
fix: rename pos and add default path for secrets
logicalangel Apr 3, 2024
ef9244f
fix: merge
logicalangel Apr 3, 2024
0247d94
fix: extract siner from checkPublicKey
logicalangel Apr 3, 2024
4613289
fix: extract siner from checkPublicKey
logicalangel Apr 3, 2024
5770cdd
fix: change structure of configs
logicalangel Apr 3, 2024
3acba97
fix: remove scheduler from consumer \ move correctness to services
logicalangel Apr 3, 2024
7a99799
feat: make complete DI and some fix
logicalangel Apr 4, 2024
3a6b509
fix: linters and update quickstart
logicalangel Apr 4, 2024
cf691b5
fix: ignore plugins if is null
logicalangel Apr 5, 2024
2538aba
fix: ignore plugins if is null
logicalangel Apr 5, 2024
3611fa3
fix: consumer for worker and some fixes
logicalangel Apr 6, 2024
f2bed6d
Improve log messages
pouya-eghbali Apr 8, 2024
049c383
Rename Consume to NewRPC
pouya-eghbali Apr 8, 2024
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
6 changes: 3 additions & 3 deletions .github/workflows/go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ jobs:
cache: false

- name: Install Tools
working-directory: "src"
working-directory: "internal"
run: make tools

- name: Lint
working-directory: "src"
working-directory: "internal"
run: make lint

- name: Error Check
working-directory: "src"
working-directory: "internal"
run: make errors
6 changes: 3 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ jobs:
with:
go-version: "stable"
cache-dependency-path: |
src/go.sum
internal/go.sum
- name: Build
run: cd src && make prod
run: cd internal && make prod

- name: "Run release script"
run: node scripts/docker-release.mjs ${{ github.ref_name }}

- name: "Release"
uses: softprops/action-gh-release@v1
with:
files: ./src/bin/*
files: ./internal/bin/*
name: Unchained ${{ github.ref_name}}
tag_name: ${{ github.ref_name }}
prerelease: ${{ contains(github.ref_name, 'alpha') || contains(github.ref_name, 'beta') }}
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ docker/data
docker/pgadmin
.clinic
node_trace.*
src/bin
internal/bin
conf.*.private
.idea
5 changes: 3 additions & 2 deletions conf.worker.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ system:
log: info
name: <name>

broker:
uri: wss://shinobi.brokers.kenshi.io
network:
bind: 127.0.0.1:9123
broker-uri: ws://127.0.0.1:9123

rpc:
- name: ethereum
Expand Down
2 changes: 1 addition & 1 deletion go.work
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
go 1.22.1

use (
./src
./internal
./zk
)
2 changes: 0 additions & 2 deletions go.work.sum
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aov
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.0 h1:gggzg0SUMs6SQbEw+3LoSsYf9YMjkupeAnHMX8O9mmY=
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.0/go.mod h1:+6KLcKIVgxoBDMqMO/Nvy7bZ9a0nbU3I1DtFQK3YvB4=
github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA=
github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8=
github.com/aead/siphash v1.0.1 h1:FwHfE/T45KPKYuuSAKyyvE+oPWcaQ+CUmFW0bPlM+kg=
github.com/alecthomas/kong v0.7.0 h1:YIjJUiR7AcmHxL87UlbPn0gyIGwl4+nYND0OQ4ojP7k=
Expand Down
2 changes: 1 addition & 1 deletion src/.golangci.yml → internal/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ run:
linters-settings:
cyclop:
max-complexity: 35
package-average: 13.0
package-average: 25.0

gosec:
excludes:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
45 changes: 45 additions & 0 deletions internal/cmd/broker.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package cmd

import (
"github.com/KenshiTech/unchained/config"
"github.com/KenshiTech/unchained/constants"
"github.com/KenshiTech/unchained/crypto/bls"
"github.com/KenshiTech/unchained/ethereum"
"github.com/KenshiTech/unchained/log"
"github.com/KenshiTech/unchained/pos"
"github.com/KenshiTech/unchained/transport/server"
"github.com/KenshiTech/unchained/transport/server/websocket"

"github.com/spf13/cobra"
)

var brokerCmd = &cobra.Command{
Use: "broker",
Short: "Run the Unchained client in broker mode",
Long: `Run the Unchained client in broker mode`,
Run: func(cmd *cobra.Command, args []string) {
log.Start(config.App.System.Log)
log.Logger.
With("Version", constants.Version).
With("Protocol", constants.ProtocolVersion).
Info("Running Unchained | Broker")

err := config.Load(configPath, secretsPath)
if err != nil {
panic(err)
}

bls.InitClientIdentity()

ethRPC := ethereum.New()
pos.New(ethRPC)

server.New(
websocket.WithWebsocket(),
)
logicalangel marked this conversation as resolved.
Show resolved Hide resolved
},
}

func init() {
rootCmd.AddCommand(brokerCmd)
}
63 changes: 27 additions & 36 deletions src/cmd/consumer.go → internal/cmd/consumer.go
Original file line number Diff line number Diff line change
@@ -1,75 +1,66 @@
/*
Copyright © 2024 NAME HERE <EMAIL ADDRESS>
*/
package cmd

import (
"github.com/KenshiTech/unchained/config"
"github.com/KenshiTech/unchained/constants"
"github.com/KenshiTech/unchained/consumers"
"github.com/KenshiTech/unchained/crypto/bls"
"github.com/KenshiTech/unchained/db"
"github.com/KenshiTech/unchained/ethereum"
"github.com/KenshiTech/unchained/log"
"github.com/KenshiTech/unchained/net/client"
"github.com/KenshiTech/unchained/plugins/correctness"
"github.com/KenshiTech/unchained/plugins/logs"
"github.com/KenshiTech/unchained/plugins/uniswap"
"github.com/KenshiTech/unchained/pos"

correctnessService "github.com/KenshiTech/unchained/service/correctness"
evmlogService "github.com/KenshiTech/unchained/service/evmlog"
uniswapService "github.com/KenshiTech/unchained/service/uniswap"
"github.com/KenshiTech/unchained/transport/client"
logicalangel marked this conversation as resolved.
Show resolved Hide resolved
"github.com/KenshiTech/unchained/transport/client/handler"
"github.com/KenshiTech/unchained/transport/server"
"github.com/KenshiTech/unchained/transport/server/gql"
"github.com/spf13/cobra"
)

// consumerCmd represents the consumer command.
var consumerCmd = &cobra.Command{
Use: "consumer",
Short: "Run the Unchained client in consumer mode",
Long: `Run the Unchained client in consumer mode`,

PreRun: func(cmd *cobra.Command, args []string) {
config.App.Broker.URI = cmd.Flags().Lookup("broker").Value.String()
config.App.Network.BrokerURI = cmd.Flags().Lookup("broker").Value.String()
},

Run: func(cmd *cobra.Command, args []string) {
log.Start(config.App.System.Log)
log.Logger.
With("Version", constants.Version).
With("Protocol", constants.ProtocolVersion).
Info("Running Unchained | Consumer")

err := config.Load(configPath, secretsPath)
if err != nil {
panic(err)
}

log.Start(config.App.System.Log)

log.Logger.
With("Version", constants.Version).
With("Protocol", constants.ProtocolVersion).
Info("Running Unchained")

ethereum.Start()
bls.InitClientIdentity()
pos.Start()

ethRPC := ethereum.New()
pos := pos.New(ethRPC)
db.Start()
uniswap.New()
correctness.New()
logs.New()
client.StartClient()
consumers.StartConsumer()
client.Listen()

server.New(
gql.WithGraphQL(),
)

correctnessService := correctnessService.New(ethRPC)
evmLogService := evmlogService.New(ethRPC, pos)
uniswapService := uniswapService.New(ethRPC, pos)

handler := handler.New(correctnessService, uniswapService, evmLogService)
client.Consume(handler)
},
}

func init() {
rootCmd.AddCommand(consumerCmd)

// Here you will define your flags and configuration settings.

// Cobra supports Persistent Flags which will work for this command
// and all subcommands, e.g.:
// consumerCmd.PersistentFlags().String("foo", "", "A help for foo")

// Cobra supports local flags which will only run when this command
// is called directly, e.g.:
// consumerCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")

consumerCmd.Flags().StringP(
"broker",
"b",
Expand Down
14 changes: 1 addition & 13 deletions src/cmd/root.go → internal/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ var secretsPath string
var contextPath string
var printVersion bool

// rootCmd represents the base command when called without any subcommands.
var rootCmd = &cobra.Command{
Use: "unchained",
Short: "Unchained is the universal data validation and processing protocol",
Long: `Unchained is the universal data validation and processing protocol`,
// Uncomment the following line if your bare application
// has an action associated with it:

Run: func(cmd *cobra.Command, args []string) {
if printVersion {
fmt.Println(constants.Version)
Expand All @@ -31,8 +29,6 @@ var rootCmd = &cobra.Command{
},
}

// Execute adds all child commands to the root command and sets flags appropriately.
// This is called by main.main(). It only needs to happen once to the rootCmd.
func Execute() {
err := rootCmd.Execute()
if err != nil {
Expand All @@ -41,14 +37,6 @@ func Execute() {
}

func init() {
// Here you will define your flags and configuration settings.
// Cobra supports persistent flags, which, if defined here,
// will be global for your application.

// rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.unchained.yaml)")

// Cobra also supports local flags, which will only run
// when this action is called directly.
rootCmd.Flags().BoolVarP(&printVersion, "version", "v", false, "Print the Unchained version number and die")

rootCmd.PersistentFlags().StringVarP(&configPath, "config", "c", "./conf.yaml", "Config file")
Expand Down
61 changes: 27 additions & 34 deletions src/cmd/worker.go → internal/cmd/worker.go
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
/*
Copyright © 2024 NAME HERE <EMAIL ADDRESS>
*/
package cmd

import (
"github.com/KenshiTech/unchained/config"
"github.com/KenshiTech/unchained/constants"
"github.com/KenshiTech/unchained/crypto/bls"
"github.com/KenshiTech/unchained/db"
"github.com/KenshiTech/unchained/ethereum"
"github.com/KenshiTech/unchained/log"
"github.com/KenshiTech/unchained/net/client"
"github.com/KenshiTech/unchained/persistence"
"github.com/KenshiTech/unchained/plugins/logs"
"github.com/KenshiTech/unchained/plugins/uniswap"
"github.com/KenshiTech/unchained/pos"

"github.com/KenshiTech/unchained/scheduler"
correctnessService "github.com/KenshiTech/unchained/service/correctness"
evmlogService "github.com/KenshiTech/unchained/service/evmlog"
uniswapService "github.com/KenshiTech/unchained/service/uniswap"
"github.com/KenshiTech/unchained/transport/client"
"github.com/KenshiTech/unchained/transport/client/handler"
"github.com/spf13/cobra"
)

Expand All @@ -26,49 +24,44 @@ var workerCmd = &cobra.Command{
Long: `Run the Unchained client in worker mode`,

PreRun: func(cmd *cobra.Command, args []string) {
config.App.Broker.URI = cmd.Flags().Lookup("broker").Value.String()
config.App.Network.BrokerURI = cmd.Flags().Lookup("broker").Value.String()
},

Run: func(cmd *cobra.Command, args []string) {
err := config.Load(configPath, secretsPath)
if err != nil {
panic(err)
}

log.Start(config.App.System.Log)
log.Logger.
With("Version", constants.Version).
With("Protocol", constants.ProtocolVersion).
Info("Running Unchained")
Info("Running Unchained | Worker")

err := config.Load(configPath, secretsPath)
if err != nil {
panic(err)
}

ethereum.Start()
bls.InitClientIdentity()
pos.Start()
db.Start()
client.StartClient()

uniswap.Listen()
logs.New()
logs.Listen()
ethRPC := ethereum.New()
pos := pos.New(ethRPC)
badger := persistence.New(contextPath)

correctnessService := correctnessService.New(ethRPC)
evmLogService := evmlogService.New(ethRPC, pos)
uniswapService := uniswapService.New(ethRPC, pos)

persistence.Start(contextPath)
client.Listen()
scheduler.New(
scheduler.WithEthLogs(evmLogService, ethRPC, badger),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing happens when I start my worker node. It doesn't look like the scheduler is working.

scheduler.WithUniswapEvents(uniswapService, ethRPC),
)

handler := handler.New(correctnessService, uniswapService, evmLogService)
client.Consume(handler)
},
logicalangel marked this conversation as resolved.
Show resolved Hide resolved
}

func init() {
rootCmd.AddCommand(workerCmd)

// Here you will define your flags and configuration settings.

// Cobra supports Persistent Flags which will work for this command
// and all subcommands, e.g.:
// workerCmd.PersistentFlags().String("foo", "", "A help for foo")

// Cobra supports local flags which will only run when this command
// is called directly, e.g.:
// workerCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")

workerCmd.Flags().StringP(
"broker",
"b",
Expand Down
Loading
Loading