Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
43 changes: 43 additions & 0 deletions .github/workflows/image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: shisui latest image

on:
push:
branches: [main]

defaults:
run:
shell: bash

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: write

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
push_image_to_github:
name: Push Docker image to Github
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile.portal
push: true
tags: ${{ env.REGISTRY }}/${{ github.repository }}:latest
7 changes: 3 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
FROM --platform=linux/amd64 golang:1.23 as builder
FROM golang:1.23 as builder

WORKDIR /app

COPY . .
RUN go env -w GOPROXY=https://goproxy.cn,direct
# RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build ./cmd/shisui/main.go

RUN make shisui


FROM --platform=linux/amd64 ubuntu:22.04
FROM ubuntu:22.04

COPY --from=builder /app/build/bin/shisui /usr/local/bin/app

Expand Down
4 changes: 3 additions & 1 deletion portalwire/portal_protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ func (p *PortalProtocol) RoutingTableInfo() [][]string {
}

func (p *PortalProtocol) AddEnr(n *enode.Node) {
added := p.table.AddInboundNode(n)
added := p.table.AddFoundNode(n, true)
if !added {
p.Log.Warn("add node failed", "id", n.ID(), "ip", n.IPAddr())
return
Expand Down Expand Up @@ -970,6 +970,8 @@ func (p *PortalProtocol) handleFindNodes(fromAddr *net.UDPAddr, request *FindNod
enrs := p.truncateNodes(nodes, maxPayloadSize, enrOverhead)

nodesMsg := &Nodes{
// https://github.com/ethereum/portal-network-specs/blob/master/portal-wire-protocol.md
// total: The total number of Nodes response messages being sent. Currently fixed to only 1 response message.
Total: 1,
Enrs: enrs,
}
Expand Down
Loading