Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1160 commits
Select commit Hold shift + click to select a range
ce6fe0c
Added gas estimator calls
thomaspanf Dec 12, 2024
cd2017b
Added bindings for rocketNodeStaking and rocketNodeManager
thomaspanf Dec 12, 2024
8d3ab0d
RocketNodeDeposit and LinkedListStorage bindings
thomaspanf Dec 16, 2024
e1dcbd9
Add beaconStateVerifier bindings
thomaspanf Dec 17, 2024
afc371e
Remove salt and expected minipool address from deposit
0xfornax Dec 17, 2024
b36dd6e
Merge remote-tracking branch 'origin/master' into saturn
0xfornax Dec 17, 2024
fee1963
Add legacy v1.3.1
0xfornax Dec 17, 2024
88e4c1f
Bool pointer
0xfornax Dec 17, 2024
eca37b0
Add Saturn 1 to version checker
0xfornax Dec 17, 2024
5a99db6
Update dependencies
jshufro Dec 18, 2024
c586733
remove RR, add fgprof, support v10
jshufro Dec 18, 2024
2ded980
GetWithdrawalCredentials as common.Hash
0xfornax Dec 19, 2024
91c9b2f
Fix interface
0xfornax Dec 19, 2024
11d0351
Added megapool encodedABI
0xfornax Dec 19, 2024
40d6897
Add GetRocketDepositPoolVersion
0xfornax Dec 19, 2024
1fa6fd0
Fix GetMegapoolExpectedAddress
0xfornax Dec 19, 2024
b678db1
Fix megapool types
0xfornax Dec 20, 2024
db2abad
chore: fix struct field name in comment
loselarry Dec 24, 2024
4ad2fd6
Merge pull request #11 from jshufro/jms/holesky
0xfornax Jan 8, 2025
f81a4ec
Merge pull request #9 from jshufro/jms/generate-voting-power
0xfornax Jan 8, 2025
06c1e4f
Merge branch 'main' into jms/v10
jshufro Jan 8, 2025
5966da1
Merge pull request #12 from jshufro/jms/v10
0xfornax Jan 8, 2025
e1c8986
Add exitQueue
0xfornax Jan 9, 2025
915873f
Add RocketMegapoolProxy calls
thomaspanf Jan 10, 2025
2d33a5f
Add express queue DAO params
0xfornax Jan 10, 2025
c34feb5
Merge branch 'saturn' of github.com:rocket-pool/rocketpool-go into sa…
0xfornax Jan 10, 2025
0bc1d7d
Rename expressQueue functions
0xfornax Jan 12, 2025
dc2837e
Change return type
0xfornax Jan 12, 2025
d723bc2
Rename
0xfornax Jan 12, 2025
6d9c09f
Add GetDelegate and SetUseLatestDelegate
thomaspanf Jan 14, 2025
44a357f
Add GetUseLatestDelegate
thomaspanf Jan 15, 2025
cea7894
Include RocketMegapoolProxy and RocketMegapoolDelegate in Encoded Abi
thomaspanf Jan 15, 2025
30257e0
Add megapool delegateUpgrade
thomaspanf Jan 15, 2025
d008379
Added GetQueueTop
0xfornax Jan 16, 2025
546b868
Added a boolean to GetQueueTop return type
0xfornax Jan 16, 2025
1209a4b
Add assignMegapools
0xfornax Jan 16, 2025
c17d396
Add estimateAssignMegapool
0xfornax Jan 16, 2025
546c291
validator index as big.Int
0xfornax Jan 16, 2025
4b076f6
Add GetValidaotInfo
thomaspanf Jan 21, 2025
f210dad
Add RocketMegapoolFactory contract
0xfornax Jan 22, 2025
4636afa
Use unpackIntoInterface
0xfornax Jan 22, 2025
77fa0c1
Add proof to the estimate call
0xfornax Jan 27, 2025
b4d316d
Fix interface
0xfornax Jan 27, 2025
2597126
Export ValidatorProof struct
0xfornax Jan 27, 2025
8bdaaab
Fix capital letters
0xfornax Jan 27, 2025
7b49ba5
Fix node detail multicall
thomaspanf Jan 28, 2025
edf39bf
Add missing stake param
0xfornax Jan 28, 2025
3697d3f
Merge branch 'saturn' of github.com:rocket-pool/rocketpool-go into sa…
0xfornax Jan 28, 2025
eacd8e2
Fix big int args
0xfornax Jan 29, 2025
8865a33
update ValidatorInfo interface
thomaspanf Jan 30, 2025
24d744a
Init RocketNetworkRevenues bindings
thomaspanf Feb 3, 2025
271d34d
Add GetLastDistributionBlock, update GetValidatorInfo interface
thomaspanf Feb 4, 2025
13b3eab
Add GetDelegateExpired binding
thomaspanf Feb 6, 2025
583d596
New ABI
0xfornax Feb 6, 2025
d1d32cf
Megapool manager
0xfornax Feb 6, 2025
c1ee548
Add GetAllMegapoolValidators
0xfornax Feb 7, 2025
5ee5152
Add abi details to RevenueSlit
0xfornax Feb 10, 2025
20d489f
Add withdraw credit
0xfornax Feb 10, 2025
e340a44
Adds checks if saturn is deployed
0xfornax Feb 11, 2025
b622370
Add HeadMovedBlock
0xfornax Feb 11, 2025
5022086
Add AssignDeposits to legacy v131
0xfornax Feb 11, 2025
3bdd423
Add helper for grabbing the queue position
thomaspanf Feb 11, 2025
ec1f542
Merge branch 'saturn' of github.com:rocket-pool/rocketpool-go into sa…
thomaspanf Feb 11, 2025
a91b1be
Remove AssignMegapools
0xfornax Feb 11, 2025
741edcd
Add GetTotalQueueLength
0xfornax Feb 12, 2025
9f4f50a
Merge branch 'saturn' of github.com:rocket-pool/rocketpool-go into sa…
0xfornax Feb 12, 2025
ad79c50
Fix ptr
0xfornax Feb 12, 2025
e671c11
GetValidatorInfo from mpManager now working - see comments for details
0xfornax Feb 12, 2025
3c04da8
Add standard/express queue length
0xfornax Feb 13, 2025
597b79c
Add CalculatePendingRewards and CalculateRewards
thomaspanf Feb 17, 2025
4410642
Rename 'chunk' to 'slice' and improve error message in Scan
thomaspanf Feb 17, 2025
5b38484
Add GetMegapoolPubkeys
0xfornax Feb 17, 2025
159335e
Add NativeMegapoolDetails
0xfornax Feb 18, 2025
b3c66ca
Fix loop value capture
0xfornax Feb 19, 2025
270925a
Update megapool encoded abi and added GetActiveValidatorCount binding
thomaspanf Feb 20, 2025
4692751
Add EstimateDistribute and Distribute
0xfornax Mar 10, 2025
51fa7bb
Add functions to interface
0xfornax Mar 10, 2025
819230b
Add NotifyExit
0xfornax Mar 19, 2025
c943437
Add NotifyExit to the interface
0xfornax Mar 19, 2025
50776cc
Fix name
0xfornax Mar 19, 2025
d279c20
Adjust return type
0xfornax Mar 19, 2025
4696997
Remove NodeCapital
thomaspanf Mar 24, 2025
8cdf187
Add bindings for getExitingValidatorCount and getSoonestWithdrawableE…
thomaspanf Mar 24, 2025
141fa81
Add new fields to ValidatorInfo struct
thomaspanf Mar 24, 2025
3d1be70
Add bindings and update interface for NotifyFinalBalance
thomaspanf Mar 25, 2025
4423b23
Update Withdrawal type to match beacon chain spec
thomaspanf Mar 26, 2025
b9e89e4
Update Stake and EstimateStakeGas signature
thomaspanf Mar 26, 2025
1b64248
Add ClaimRefund
0xfornax Apr 4, 2025
8aadbd8
Add ClaimRefund to interface
0xfornax Apr 4, 2025
80e4fd3
Add NodeComissionShareSecurityCouncilAdder
0xfornax Apr 4, 2025
d1cf1d4
Fix estimate function name
0xfornax Apr 4, 2025
3f7df25
Add reduceBond function
0xfornax Apr 7, 2025
9200a03
Add ActiveValidatorCount to getNodeMegapoolDetails
0xfornax Apr 8, 2025
b773578
Add megapool Penalise
0xfornax Apr 15, 2025
29d33b2
Remove penalise from interface
0xfornax Apr 15, 2025
25919fb
Update megapool encoded abi, add WithdrawableEpoch to ValidatorInfo
thomaspanf Apr 17, 2025
385946c
chore: remove duplicate package imports
shangchengbabaiban Apr 19, 2025
1b5bee8
Add fields to validator info
0xfornax Apr 26, 2025
47cea17
Using SN v1.15.6
0xfornax Apr 29, 2025
4cb86b6
Remove replace
0xfornax Apr 29, 2025
df5e75a
Bump SN version
0xfornax Apr 30, 2025
e452fb0
Remove ec migrator
jshufro May 6, 2025
14bda54
Merge pull request #790 from jshufro/jms/removeecmigrator
0xfornax May 6, 2025
f68323d
Move repo into folder to prep for merge into monorepo
jshufro May 7, 2025
226d22a
Merge pull request #14 from jshufro/jms/monorepo
0xfornax May 7, 2025
b415b59
Deprecate prune-provisioner container
jshufro May 8, 2025
605b8b9
Fix commands that require escalation
jshufro May 8, 2025
0107eba
Merge pull request #793 from jshufro/jms/fixpurge
0xfornax May 9, 2025
b9edf2b
Merge pull request #792 from jshufro/jms/pruneprovisioner
0xfornax May 9, 2025
6214253
Add AmountWithDecimalsToInt
0xfornax May 12, 2025
269ab0b
Add IntToFloatWithDecimals
0xfornax May 12, 2025
48e87a4
Rename EthToWeiWithDecimals
0xfornax May 12, 2025
d7d9e3e
Fix sending custom tokens without 18 decimals
0xfornax May 12, 2025
7346221
prysm-v6.0.2
0xfornax May 13, 2025
26d0bdb
Merge pull request #797 from rocket-pool/prysm-v6.0.2
0xfornax May 13, 2025
a3d2d91
Copy smartnode-install files in verbatim
jshufro May 13, 2025
658e6f3
Remove invocations to nethermind prune starter container, preferring …
jshufro May 13, 2025
01c848a
Fix ValidatePositiveEthAmount
0xfornax May 13, 2025
cf29863
Using bytes.Equal to compare common.Address
0xfornax May 14, 2025
b36f537
Merge pull request #796 from rocket-pool/fix-sending-custom-tokens
0xfornax May 14, 2025
f987c0f
Change install commands to use local assets instead of downloading fr…
jshufro May 13, 2025
b182a9d
Merge pull request #799 from jshufro/jms/install
0xfornax May 14, 2025
0f8d025
Add missing type assertions for consensusconfigs
jshufro May 14, 2025
b72d14f
Switch to building prysm containers locally from upstreams
jshufro May 14, 2025
af427b8
Merge pull request #800 from jshufro/jms/prunestarter
0xfornax May 15, 2025
cdc96df
Merge pull request #801 from jshufro/jms/install-prysm
0xfornax May 15, 2025
915e15f
Fix import
0xfornax May 15, 2025
a8aefdc
Use prysm containers directly
jshufro May 15, 2025
b5e1f8b
Provision grafana container with default dashboard
jshufro May 15, 2025
1f36f9a
Make provisioned dashboard read-only, use default data source, and do…
jshufro May 15, 2025
26a6cdd
Download genesis from prysm if required
jshufro May 15, 2025
d32e41f
Use correct genesis url for hoodi
jshufro May 15, 2025
2f09d44
Fix packing bytes
0xfornax May 15, 2025
4b4c443
Fix health check for rewards submissions
0xfornax May 15, 2025
acca54a
Check for the first interval
0xfornax May 15, 2025
a300c70
refactor: use slices.Contains to simplify code
studystill May 16, 2025
4fe81a2
Merge pull request #803 from jshufro/jms/install-prysm
0xfornax May 16, 2025
00bd5e6
Merge pull request #807 from rocket-pool/fix-submit-rewards-after-con…
0xfornax May 16, 2025
29b205a
Merge pull request #806 from rocket-pool/fix-packing-bytes-on-submiss…
0xfornax May 16, 2025
28874e1
Merge pull request #805 from jshufro/jms/install-grafana
0xfornax May 16, 2025
f54f983
Merge pull request #808 from studystill/master
0xfornax May 16, 2025
d5b1a22
Merge pull request #722 from loselarry/master
0xfornax May 16, 2025
6e373c2
Merge pull request #781 from shangchengbabaiban/master
0xfornax May 16, 2025
fb92e37
Merge branch 'master' into saturn
0xfornax May 16, 2025
403b19d
Merge branch 'master' into saturn
0xfornax May 16, 2025
859d523
Bump rocketpool-go
0xfornax May 16, 2025
9c3cf3d
Move version to embeddable text file so it can be used in builds
jshufro May 16, 2025
0950f11
Add go.work, go.work.sum, and turn smartnode top level packages into …
jshufro May 6, 2025
1952755
Add Makefile, update github actions, fix build cache
jshufro May 6, 2025
45452d8
Update README to mention Makefile
jshufro May 6, 2025
d7356b1
Remove build scripts superceded by make
jshufro May 6, 2025
e280643
Convert docker build to docker bake
jshufro May 16, 2025
c6954ad
update go.work.sum
jshufro May 16, 2025
919f3f5
lint in a container for consistency
jshufro May 16, 2025
5fbe8d4
Give a cache to the linter
jshufro May 16, 2025
938c216
Remove build-builder.sh
jshufro May 16, 2025
6af07f1
Fix make release to clean properly and create symlinks
jshufro May 16, 2025
cc58c50
Remove build.sh from rocketpool/
jshufro May 16, 2025
05d8bd4
build daemon binaries in docker instead of on host
jshufro May 16, 2025
cd4ecaa
Fix build ci job
jshufro May 16, 2025
9b78c13
Don't try to build daemon in docker when building docker container
jshufro May 18, 2025
bbe7c94
Prefix versions with v char
jshufro May 18, 2025
a054da9
Add build cache to docker daemon image build
jshufro May 18, 2025
43f9e9f
Rework docker builds to better match fornax's workflow
jshufro May 18, 2025
34c2690
Build cli in docker as well
jshufro May 18, 2025
327901e
Combine daemon and cli directories into bin directory
jshufro May 18, 2025
ccaf2d2
Fix CI build
jshufro May 19, 2025
cc58607
set max-parallel on ci-lint so we don't get 429ed by gitub
jshufro May 19, 2025
fc403d8
Merge pull request #789 from jshufro/jms/monorepo
0xfornax May 19, 2025
2b820d7
Merge remote-tracking branch 'treegen/jms/monorepo' into jms/monorepo…
jshufro May 19, 2025
509caf8
Merge pull request #809 from jshufro/jms/monorepo-add-treegen-no-changes
0xfornax May 19, 2025
192a29f
Dependency changes after adding treegen.git
jshufro May 19, 2025
b76eb04
Update treegen to compatible dependencies
jshufro May 19, 2025
f72017f
Simplify makefile dependencies
jshufro May 19, 2025
82282fb
Add treegen to Makefile, update README
jshufro May 19, 2025
658530e
Fix test errors in newly imported treegen project
jshufro May 7, 2025
d31a28d
Pin sszgen version
jshufro May 19, 2025
dd858f3
Bump sszgen and regenerate
jshufro May 19, 2025
53ba4b2
Add beacon_block ssz type with proof helpers
jshufro Mar 25, 2025
ac0a0a3
Add sszgen generated code
jshufro Mar 25, 2025
8e4fdc7
Implement withdrawal proofs
jshufro Mar 25, 2025
da368a7
Add state root validator proof test
jshufro Apr 22, 2025
c6d3dd3
Add withdrawable epoch tests
jshufro Apr 22, 2025
179fdb8
Fix incorrect blob kzg commitments
jshufro Apr 22, 2025
c16dd79
Begin block root proof tests
jshufro Apr 23, 2025
7d0b6b1
Add historical block root proof
jshufro Apr 25, 2025
861b9c5
Fix last couple of issues with withdrawals proofs pre-pectra
jshufro Apr 26, 2025
adc4f44
Slide an interface in front of deneb ssz types to enable multiple forks
jshufro Apr 26, 2025
3a47445
Organize fork into folder
jshufro Apr 27, 2025
da2b878
Add Electra ssz data and paths
jshufro Apr 27, 2025
b096d72
Remove redundant fork qualifiers from symbol names
jshufro Apr 27, 2025
1d01d63
Allow parsing electra responses from bn
jshufro Apr 27, 2025
0254ccd
Add missing type assertions
jshufro Apr 27, 2025
b2e27b8
Fix compilation error
jshufro May 19, 2025
312d3c1
Update build ci job to build all release artifacts
jshufro May 19, 2025
74b3ced
Update push commands
jshufro May 19, 2025
0d28807
Merge pull request #810 from jshufro/jms/monorepo-treegen-2
0xfornax May 19, 2025
b862dcb
Merge pull request #811 from jshufro/jms/withdrawals-proof
0xfornax May 19, 2025
d4558bc
Merge pull request #812 from jshufro/jms/sszgen
0xfornax May 19, 2025
c2e0a93
Fix v8 test by using the original json tag for ValidatorDetails
thomaspanf May 15, 2025
ded9344
Merge pull request #815 from rocket-pool/fix-validator-details-json-tag
0xfornax May 19, 2025
dfdc432
Add cli binaries to docker image
jshufro May 19, 2025
c5390ba
Fix github workflow unit test caching
jshufro May 19, 2025
fdbae0d
Merge pull request #813 from jshufro/jms/ghtestcache
0xfornax May 20, 2025
20d4908
Merge pull request #816 from jshufro/jms/monorepo-cli
0xfornax May 20, 2025
bde1e00
Use last submission event instead of block header
0xfornax May 20, 2025
fa0aae5
Merge pull request #817 from rocket-pool/fix-slot-timestamp-for-price…
0xfornax May 20, 2025
b67dcbc
Searching a range of blocks and using the block as index on the query
0xfornax May 20, 2025
63de825
If the event is not found, find the next submission target anyway
0xfornax May 20, 2025
46992da
Fix lint err
0xfornax May 20, 2025
7dbff3c
Merge pull request #820 from rocket-pool/fix-querying-price-submissio…
0xfornax May 20, 2025
bad0309
Fix block reference
0xfornax May 20, 2025
424b11a
format repo with goimports
jshufro May 21, 2025
f430205
Switch to go 1.21
jshufro May 21, 2025
02f1068
Merge pull request #36 from jshufro/jms/go1.21
0xfornax May 21, 2025
851c122
Merge pull request #35 from jshufro/jms/goimports
0xfornax May 21, 2025
0a40159
Move everything into bindings directory to prepare for monorepo trans…
jshufro May 21, 2025
b75d05d
Merge branch 'master' into saturn
0xfornax May 21, 2025
2aed5a2
Merge remote-tracking branch 'rocketpool-go/jms/monorepo-master' into…
jshufro May 21, 2025
9f9f0dc
Remove unused files
jshufro May 21, 2025
548818d
find . -type f -exec sed -i 's#"github.com/rocket-pool/rocketpool-go#…
jshufro May 21, 2025
35dd5cb
Remove dependencies to rocketpool-go from existing go.mod
jshufro May 21, 2025
d139e75
bump to 1.16.0
0xfornax May 21, 2025
bf23faa
Merge branch 'master' into saturn
0xfornax May 21, 2025
03f32c6
Update dependencies
jshufro May 21, 2025
2dce529
Update build
jshufro May 21, 2025
2b6a267
Merge branch 'master' into saturn
0xfornax May 21, 2025
046e17e
Move everything into bindings directory to prepare for monorepo trans…
jshufro May 21, 2025
9f8e91d
Remove rocketpool-go from test ci for now
jshufro May 21, 2025
3e11705
Remove rocketpool-go from go.work.sum
jshufro May 21, 2025
8d9ad38
Using %s so we can request a 'finalized' block
0xfornax May 19, 2025
a46cdc2
Convert uint64 to string
0xfornax May 21, 2025
bc631c9
Merge remote-tracking branch 'rocketpool-go/saturn' into jms/monorepo…
jshufro May 21, 2025
25da437
Merge branch 'master' into jms/monorepo-saturn
jshufro May 21, 2025
4f526e7
Merge branch 'jms/monorepo' into jms/monorepo-saturn
jshufro May 21, 2025
506daa2
Merge pull request #823 from jshufro/jms/monorepo-rpg-pr1
0xfornax May 21, 2025
6866f53
Run goimports
jshufro May 21, 2025
662238a
Merge pull request #824 from jshufro/jms/monorepo
0xfornax May 21, 2025
88472ed
Merge branch 'master' into jms/monorepo-saturn
jshufro May 21, 2025
d8e5409
Merge branch 'master' into jms/monorepo-saturn
jshufro May 21, 2025
df5a905
Merge branch 'saturn' into jms/monorepo-saturn
jshufro May 21, 2025
d7eefe5
Merge remote-tracking branch 'rocketpool-go/jms/monorepo-master' into…
jshufro May 21, 2025
c7e5665
Merge pull request #826 from jshufro/jms/monorepo-saturn-2
0xfornax May 21, 2025
3c1952e
Revert "Merge pull request #826 from jshufro/jms/monorepo-saturn-2"
jshufro May 21, 2025
1f94760
Merge branch 'master' into jms/monorepo-saturn-2
jshufro May 21, 2025
97eeb21
Merge pull request #827 from jshufro/jms/monorepo-saturn-2
0xfornax May 21, 2025
db6f30d
Merge branch 'saturn' into jms/monorepo-saturn
jshufro May 21, 2025
265d735
Merge pull request #814 from rocket-pool/fix-request-beacon-block-path
0xfornax May 21, 2025
b00e774
Merge pull request #828 from jshufro/jms/monorepo-saturn
0xfornax May 21, 2025
15c6712
Merge branch 'saturn' into jms/monorepo-devnet3
jshufro May 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 1 addition & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@ jobs:
- uses: actions/setup-go@v4
with:
go-version: 1.21.8
- run: cd ${GITHUB_WORKSPACE}/rocketpool-cli && go build .
- run: cd ${GITHUB_WORKSPACE}/rocketpool && go build .
- run: make NO_DOCKER=true
34 changes: 23 additions & 11 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,41 @@ permissions:
# Optional: allow read access to pull request. Use with `only-new-issues` option.
# pull-requests: read
jobs:
golangci:
name: lint
detect-modules:
runs-on: ubuntu-latest
outputs:
modules: ${{ steps.set-modules.outputs.modules }}
steps:
- uses: actions/setup-go@v4
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.21.8
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
- id: set-modules
run: echo "modules=$(go list -m -json | jq -s '.' | jq -c '[.[].Dir]')" >> $GITHUB_OUTPUT
golangci-lint:
needs: detect-modules
runs-on: ubuntu-latest
strategy:
max-parallel: 1
matrix:
modules: ${{ fromJSON(needs.detect-modules.outputs.modules) }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.21.8
- name: golangci-lint ${{ matrix.modules }}
uses: golangci/golangci-lint-action@v8
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: latest
version: v2.1

# Optional: working directory, useful for monorepos
# working-directory: somedir
working-directory: ${{ matrix.modules }}

# Optional: golangci-lint command line arguments.
# args: --issues-exit-code=0

# For now, Smart Node will only enforce goimports linting
args: --disable-all --enable goimports

# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true

Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.21.8
- run: go test ./... -timeout 30m
cache-dependency-path: go.work.sum
- run: make test
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ Dockerfile
/rocketpool/rocketpool-daemon-darwin-arm64
/rocketpool/rocketpool-daemon-linux-arm64
.vscode-ctags
build/
build/
13 changes: 13 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: "2"
linters:
default: none
formatters:
enable:
- goimports
run:
relative-path-mode: cfg
go: '1.21.8'
output:
formats:
text:
path: stderr
161 changes: 161 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
VERSION=v$(shell cat shared/version.txt)
LOCAL_OS=$(shell go env GOOS)-$(shell go env GOARCH)

BUILD_DIR=build
BIN_DIR=${BUILD_DIR}/${VERSION}/bin
DOCKER_DIR=${BUILD_DIR}/${VERSION}/docker

CLI_TARGET_OOS:=linux darwin
ARCHS:=arm64 amd64

CLI_TARGET_STRINGS:=$(foreach oos,$(CLI_TARGET_OOS), $(foreach arch,$(ARCHS),${BIN_DIR}/rocketpool-cli-$(oos)-$(arch)))
DAEMON_TARGET_STRINGS:=$(foreach arch,$(ARCHS),${BIN_DIR}/rocketpool-daemon-linux-$(arch))
TREEGEN_TARGET_STRINGS:=$(foreach arch,$(ARCHS),${BIN_DIR}/treegen-linux-$(arch))

MODULES:=$(foreach path,$(shell find . -name go.mod),$(dir $(path)))
MODULE_GLOBS:=$(foreach module,$(MODULES),$(module)...)
TEST_GLOBS:=$(filter-out ./bindings/...,$(MODULE_GLOBS))

define rocketpool-cli-template
.PHONY: ${BIN_DIR}/rocketpool-cli-$1-$2
${BIN_DIR}/rocketpool-cli-$1-$2: ${bin_deps}
@echo "Building rocketpool-cli-$1-$2"
ifndef NO_DOCKER
docker run --rm -v ./:/src --user $(shell id -u):$(shell id -g) -e CGO_ENABLED=0 \
-e GOARCH=$2 -e GOOS=$1 --workdir /src -v ~/.cache:/.cache rocketpool/smartnode-builder:${VERSION} \
go build -o $$@ rocketpool-cli/rocketpool-cli.go
else
CGO_ENABLED=0 GOOS=$1 GOARCH=$2 go build -o $$@ ./rocketpool-cli/rocketpool-cli.go
endif
endef

# Must be first- so `make` runs this.
.PHONY: default
default: ${BUILD_DIR}/rocketpool-cli ${BUILD_DIR}/rocketpool-daemon ${BUILD_DIR}/treegen lint

.PHONY: all
all: ${BUILD_DIR}/rocketpool-cli ${BUILD_DIR}/rocketpool-daemon ${BUILD_DIR}/treegen lint

.PHONY: release
release: ${CLI_TARGET_STRINGS} ${DAEMON_TARGET_STRINGS} ${TREEGEN_TARGET_STRINGS} ${BUILD_DIR}/rocketpool-cli ${BUILD_DIR}/rocketpool-daemon ${BUILD_DIR}/treegen

# Target for build/rocketpool-cli which is a symlink to an os-specific build
${BUILD_DIR}/rocketpool-cli: ${BIN_DIR}/rocketpool-cli-${LOCAL_OS}
ln -sf $(shell pwd)/${BIN_DIR}/rocketpool-cli-${LOCAL_OS} ${BUILD_DIR}/rocketpool-cli


# Target for build/rocketpool-daemon which is a symlink to an os-specific build
${BUILD_DIR}/rocketpool-daemon: ${BIN_DIR}/rocketpool-daemon-${LOCAL_OS}
ln -sf $(shell pwd)/${BIN_DIR}/rocketpool-daemon-${LOCAL_OS} ${BUILD_DIR}/rocketpool-daemon

# Target for build/treegen which is a symlink to a version-specific build
${BUILD_DIR}/treegen: ${BIN_DIR}/treegen-${LOCAL_OS}
ln -sf $(shell pwd)/${BIN_DIR}/treegen-${LOCAL_OS} ${BUILD_DIR}/treegen

# docker-builder container
.PHONY: docker-builder
docker-builder:
VERSION=${VERSION} docker bake -f docker/daemon-bake.hcl builder

bin_deps = ${BIN_DIR}
ifndef NO_DOCKER
bin_deps += docker-builder
endif

docker_build_cmd_amd64 = docker run --rm -v ./:/src --user $(shell id -u):$(shell id -g) -e CGO_ENABLED=1 -e CGO_C_FLAGS="-O -D__BLST_PORTABLE__" \
-e GOARCH=amd64 -e GOOS=linux --workdir /src -v ~/.cache:/.cache rocketpool/smartnode-builder:${VERSION} \
go build
local_build_cmd_amd64 = CGO_ENABLED=1 CGO_C_FLAGS="-O -D__BLST_PORTABLE__" GOARCH=amd64 GOOS=linux go build
docker_build_cmd_arm64 = docker run --rm -v ./:/src --user $(shell id -u):$(shell id -g) -e CGO_ENABLED=1 -e CGO_C_FLAGS="-O -D__BLST_PORTABLE__" \
-e CC=aarch64-linux-gnu-gcc -e CXX=aarch64-linux-gnu-cpp -e CGO_C_FLAGS="-O -D__BLST_PORTABLE__" -e GOARCH=arm64 -e GOOS=linux \
--workdir /src -v ~/.cache:/.cache rocketpool/smartnode-builder:${VERSION} \
go build
local_build_cmd_arm64 = CGO_ENABLED=1 CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-cpp CGO_C_FLAGS="-O -D__BLST_PORTABLE__" GOARCH=arm64 GOOS=linux go build
# amd64 daemon build
.PHONY: ${BIN_DIR}/rocketpool-daemon-linux-amd64
${BIN_DIR}/rocketpool-daemon-linux-amd64: ${bin_deps}
ifndef NO_DOCKER
${docker_build_cmd_amd64} -o $@ rocketpool/rocketpool.go
else
${local_build_cmd_amd64} -o $@ rocketpool/rocketpool.go
endif

# arm64 daemon build
.PHONY: ${BIN_DIR}/rocketpool-daemon-linux-arm64
${BIN_DIR}/rocketpool-daemon-linux-arm64: ${bin_deps}
ifndef NO_DOCKER
${docker_build_cmd_arm64} -o $@ rocketpool/rocketpool.go
else
${local_build_cmd_arm64} -o $@ rocketpool/rocketpool.go
endif

${BIN_DIR}:
mkdir -p ${BIN_DIR}
${DOCKER_DIR}:
mkdir -p ${DOCKER_DIR}

$(foreach oos,$(CLI_TARGET_OOS),$(foreach arch,$(ARCHS),$(eval $(call rocketpool-cli-template,$(oos),$(arch)))))

# amd64 treegen build
.PHONY: ${BIN_DIR}/treegen-linux-amd64
${BIN_DIR}/treegen-linux-amd64: ${bin_deps}
ifndef NO_DOCKER
${docker_build_cmd_amd64} -o $@ ./treegen/.
else
${local_build_cmd_amd64} -o $@ ./treegen/.
endif

# arm64 treegen build
.PHONY: ${BIN_DIR}/treegen-linux-arm64
${BIN_DIR}/treegen-linux-arm64: ${bin_deps}
ifndef NO_DOCKER
${docker_build_cmd_arm64} -o $@ ./treegen/.
else
${local_build_cmd_arm64} -o $@ ./treegen/.
endif

# Docker containers
.PHONY: docker
docker: ${DOCKER_DIR}
VERSION=${VERSION} docker bake -f docker/daemon-bake.hcl smartnode

.PHONY: docker-push
docker-push: docker
echo
echo -n "Publishing smartnode:${VERSION} containers. Continue? [yN]: " && read ans && if [ $${ans:-'N'} != 'y' ]; then exit 1; fi
rm -rf ~/.docker/manifests/docker.io_rocketpool_smartnode-${VERSION}
docker push rocketpool/smartnode:${VERSION}-amd64
docker push rocketpool/smartnode:${VERSION}-arm64
docker manifest create rocketpool/smartnode:${VERSION} --amend rocketpool/smartnode:${VERSION}-amd64 --amend rocketpool/smartnode:${VERSION}-arm64
docker manifest push --purge rocketpool/smartnode:${VERSION}
echo "Done!"

.PHONY: docker-latest
docker-latest: docker-push
echo
echo -n "Publishing smartnode:${VERSION} as latest. Continue? [yN]: " && read ans && if [ $${ans:-'N'} != 'y' ]; then exit 1; fi
rm -rf ~/.docker/manifests/docker.io_rocketpool_smartnode-latest
docker manifest create rocketpool/smartnode:latest --amend rocketpool/smartnode:${VERSION}-amd64 --amend rocketpool/smartnode:${VERSION}-arm64
docker manifest push --purge rocketpool/smartnode:latest

.PHONY: docker-prune
docker-prune:
docker system prune -af
docker buildx prune -af

define lint-template
.PHONY: lint-$1
lint-$1:
docker run -e GOCACHE=/go/.cache/go-build -e GOLANGCI_LINT_CACHE=/go/.cache/golangci-lint --user $(shell id -u):$(shell id -g) --rm -v ~/.cache:/go/.cache -v .:/smartnode --workdir /smartnode/$1 golangci/golangci-lint:v2.1-alpine golangci-lint fmt --diff
endef
$(foreach module,$(MODULES),$(eval $(call lint-template,$(module))))
.PHONY: lint
lint: $(foreach module,$(MODULES),lint-$(module))

.PHONY: test
test:
go test -test.timeout 20m $(TEST_GLOBS)

.PHONY: clean
clean:
rm -rf ${BUILD_DIR}
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,29 @@ See the [Rocket Pool dockerhub](https://hub.docker.com/u/rocketpool) page for a

See the [Smartnode Installer](https://github.com/rocket-pool/smartnode-install) repository for supported platforms and installation instructions.

## Development

A [Makefile](./Makefile) is included for building, testing, and linting.

* `make` or `make default` will build rocketpool-cli, rocketpool-daemon, treegen, and run the linter.
* build/rocketpool-cli and build/rocketpool-daemon will be symlinked to the version and architecture specific binaries in build/
* `make all` will build rocketpool-cli, rocketpool-daemon, treegen, and run the linter.
* symlinks will be created for the first 3 binaries in build/
* `make release` will build all architecture specific binaries as well as docker images and manifests
* It will tag docker images as latest as well as the version in `shared/version.txt`
* It will put cli and native mode binaries in build/\<version\>
* `make build/rocketpool-cli` builds just the cli
* The build is done in docker, unless you run `make NO_DOCKER=true \<cmd\>`
* `make build/rocketpool-daemon` builds just the daemon
* The build is done in docker, unless you run `make NO_DOCKER=true \<cmd\>`
* `make build/treegen` builds just the treegen stand-alone binary.
* The build is done in docker, unless you run `make NO_DOCKER=true \<cmd\>`
* `make docker` builds the rocketpool/smartnode containers for all supported architectures and saves them in build/\<version\>/docker
* `make docker-push` builds, loads, pushes, creates a multi-arch manifest, and pushes the smartnode containers and manifest.
* `make docker-latest` does the same as docker-push, but tags latest which is also pushed.
* `make lint` runs the linter.
* `make test` runs all unit tests.
* `make clean` deletes any binaries. It does not clear your go caches. It does not clean up old docker images.

## CLI Commands

Expand Down
14 changes: 14 additions & 0 deletions addons/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module github.com/rocket-pool/smartnode/addons

go 1.21

require (
github.com/ethereum/go-ethereum v1.13.5
google.golang.org/protobuf v1.34.2
)

require (
github.com/google/go-cmp v0.6.0 // indirect
golang.org/x/crypto v0.26.0 // indirect
golang.org/x/sys v0.24.0 // indirect
)
Loading
Loading