浏览代码

测试套利系统注入

skyfffire 2 年之前
父节点
当前提交
250eb21f6b

+ 0 - 23
.github/CODEOWNERS

@@ -1,23 +0,0 @@
-# Lines starting with '#' are comments.
-# Each line is a file pattern followed by one or more owners.
-
-accounts/usbwallet              @karalabe
-accounts/scwallet               @gballet
-accounts/abi                    @gballet @MariusVanDerWijden
-cmd/clef                        @holiman
-cmd/puppeth                     @karalabe
-consensus                       @karalabe
-core/                           @karalabe @holiman @rjl493456442
-eth/                            @karalabe @holiman @rjl493456442
-eth/catalyst/                   @gballet
-graphql/                        @gballet
-les/                            @zsfelfoldi @rjl493456442
-light/                          @zsfelfoldi @rjl493456442
-mobile/                         @karalabe @ligi
-node/                           @fjl @renaynay
-p2p/                            @fjl @zsfelfoldi
-rpc/                            @fjl @holiman
-p2p/simulations                 @fjl
-p2p/protocols                   @fjl
-p2p/testing                     @fjl
-signer/                         @holiman

+ 0 - 40
.github/CONTRIBUTING.md

@@ -1,40 +0,0 @@
-# Contributing
-
-Thank you for considering to help out with the source code! We welcome 
-contributions from anyone on the internet, and are grateful for even the 
-smallest of fixes!
-
-If you'd like to contribute to go-ethereum, please fork, fix, commit and send a 
-pull request for the maintainers to review and merge into the main code base. If
-you wish to submit more complex changes though, please check up with the core 
-devs first on [our gitter channel](https://gitter.im/ethereum/go-ethereum) to 
-ensure those changes are in line with the general philosophy of the project 
-and/or get some early feedback which can make both your efforts much lighter as
-well as our review and merge procedures quick and simple.
-
-## Coding guidelines
-
-Please make sure your contributions adhere to our coding guidelines:
-
- * Code must adhere to the official Go 
-[formatting](https://golang.org/doc/effective_go.html#formatting) guidelines 
-(i.e. uses [gofmt](https://golang.org/cmd/gofmt/)).
- * Code must be documented adhering to the official Go 
-[commentary](https://golang.org/doc/effective_go.html#commentary) guidelines.
- * Pull requests need to be based on and opened against the `master` branch.
- * Commit messages should be prefixed with the package(s) they modify.
-   * E.g. "eth, rpc: make trace configs optional"
-
-## Can I have feature X
-
-Before you submit a feature request, please check and make sure that it isn't 
-possible through some other means. The JavaScript-enabled console is a powerful 
-feature in the right hands. Please check our 
-[Geth documentation page](https://geth.ethereum.org/docs/) for more info
-and help.
-
-## Configuration, dependencies, and tests
-
-Please see the [Developers' Guide](https://geth.ethereum.org/docs/developers/devguide)
-for more details on configuring your environment, managing project dependencies
-and testing procedures.

+ 0 - 30
.github/ISSUE_TEMPLATE/bug.md

@@ -1,30 +0,0 @@
----
-name: Report a bug
-about: Something with go-ethereum is not working as expected
-title: ''
-labels: 'type:bug'
-assignees: ''
----
-
-#### System information
-
-Geth version: `geth version`
-OS & Version: Windows/Linux/OSX
-Commit hash : (if `develop`)
-
-#### Expected behaviour
-
-
-#### Actual behaviour
-
-
-#### Steps to reproduce the behaviour
-
-
-#### Backtrace
-
-````
-[backtrace]
-````
-
-When submitting logs: please submit them as text and not screenshots.

+ 0 - 17
.github/ISSUE_TEMPLATE/feature.md

@@ -1,17 +0,0 @@
----
-name: Request a feature
-about: Report a missing feature - e.g. as a step before submitting a PR
-title: ''
-labels: 'type:feature'
-assignees: ''
----
-
-# Rationale
-
-Why should this feature exist?
-What are the use-cases?
-
-# Implementation
-
-Do you have ideas regarding the implementation of this feature?
-Are you willing to implement this feature?

+ 0 - 9
.github/ISSUE_TEMPLATE/question.md

@@ -1,9 +0,0 @@
----
-name: Ask a question
-about: Something is unclear
-title: ''
-labels: 'type:docs'
-assignees: ''
----
-
-This should only be used in very rare cases e.g. if you are not 100% sure if something is a bug or asking a question that leads to improving the documentation. For general questions please use [discord](https://discord.gg/nthXNEv) or the Ethereum stack exchange at https://ethereum.stackexchange.com.

+ 0 - 40
.github/generate_change_log.sh

@@ -1,40 +0,0 @@
-#!/usr/bin/env bash
-checksum() {
-    echo $(sha256sum $@ | awk '{print $1}')
-}
-change_log_file="./CHANGELOG.md"
-version="## $@"
-version_prefix="## v"
-start=0
-CHANGE_LOG=""
-while read line; do
-    if [[ $line == *"$version"* ]]; then
-        start=1
-        continue
-    fi
-    if [[ $line == *"$version_prefix"* ]] && [ $start == 1 ]; then
-        break;
-    fi
-    if [ $start == 1 ]; then
-        CHANGE_LOG+="$line\n"
-    fi
-done < ${change_log_file}
-#MAINNET_ZIP_SUM="$(checksum ./mainnet.zip)"
-TESTNET_ZIP_SUM="$(checksum ./testnet.zip)"
-LINUX_BIN_SUM="$(checksum ./linux/geth)"
-MAC_BIN_SUM="$(checksum ./macos/geth)"
-WINDOWS_BIN_SUM="$(checksum ./windows/geth.exe)"
-OUTPUT=$(cat <<-END
-## Changelog\n
-${CHANGE_LOG}\n
-## Assets\n
-|    Assets    | Sha256 Checksum  |\n
-| :-----------: |------------|\n
-| testnet.zip | ${TESTNET_ZIP_SUM} |\n
-| geth_linux | ${LINUX_BIN_SUM} |\n
-| geth_mac  | ${MAC_BIN_SUM} |\n
-| geth_windows  | ${WINDOWS_BIN_SUM} |\n
-END
-)
-
-echo -e ${OUTPUT}

+ 0 - 11
.github/no-response.yml

@@ -1,11 +0,0 @@
-# Number of days of inactivity before an Issue is closed for lack of response
-daysUntilClose: 30
-# Label requiring a response
-responseRequiredLabel: "need:more-information"
-# Comment to post when closing an Issue for lack of response. Set to `false` to disable
-closeComment: >
-  This issue has been automatically closed because there has been no response
-  to our request for more information from the original author. With only the
-  information that is currently in the issue, we don't have enough information
-  to take action. Please reach out if you have more relevant information or
-  answers to our questions so that we can investigate further.

+ 0 - 2
.github/release.env

@@ -1,2 +0,0 @@
-MAINNET_FILE_URL="https://github.com/coredao-org/core-chain/releases/latest/download/mainnet.zip"
-TESTNET_FILE_URL="https://github.com/coredao-org/core-chain/releases/latest/download/testnet.zip"

+ 0 - 17
.github/stale.yml

@@ -1,17 +0,0 @@
-# Number of days of inactivity before an issue becomes stale
-daysUntilStale: 366
-# Number of days of inactivity before a stale issue is closed
-daysUntilClose: 42
-# Issues with these labels will never be considered stale
-exemptLabels:
-  - pinned
-  - security
-# Label to use when marking an issue as stale
-staleLabel: "status:inactive"
-# Comment to post when marking an issue as stale. Set to `false` to disable
-markComment: >
-  This issue has been automatically marked as stale because it has not had
-  recent activity. It will be closed if no further activity occurs. Thank you
-  for your contributions.
-# Comment to post when closing a stale issue. Set to `false` to disable
-closeComment: false

+ 0 - 53
.github/workflows/build-test.yml

@@ -1,53 +0,0 @@
-name: Build Test
-
-on:
-  push:
-    branches: 
-      - master
-      - develop
-
-  pull_request:
-    branches: 
-      - master
-      - develop
-
-  # Allows you to run this workflow manually from the Actions tab
-  workflow_dispatch:
-
-jobs:
-  unit-test:
-    strategy:
-      matrix:
-        go-version: [1.17.x]
-        os: [ubuntu-18.04]
-    runs-on: ${{ matrix.os }}
-    steps:
-    - name: Install Go
-      uses: actions/setup-go@v2
-      with:
-        go-version: ${{ matrix.go-version }}
-        
-    - name: Checkout code
-      uses: actions/checkout@v2
-
-    - uses: actions/cache@v2
-      with:
-        # In order:
-        # * Module download cache
-        # * Build cache (Linux)
-        # * Build cache (Mac)
-        # * Build cache (Windows)
-        path: |
-          ~/go/pkg/mod
-          ~/.cache/go-build
-          ~/Library/Caches/go-build
-          %LocalAppData%\go-build
-        key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
-        restore-keys: |
-          ${{ runner.os }}-go-
-
-    - name: Test Build
-      run: |
-        make geth
-
-

+ 0 - 25
.github/workflows/integration-test.yml

@@ -1,25 +0,0 @@
-name: Integration Test
-
-on:
-  push:
-    branches: 
-      - master
-      - develop
-
-  pull_request:
-    branches: 
-      - master
-      - develop
-
-jobs:
-  truffle-test:
-    strategy:
-      matrix:
-        os: [ubuntu-18.04]
-    runs-on: ${{ matrix.os }}
-    steps:
-    - name: Checkout code
-      uses: actions/checkout@v2
-
-    - name: Truffle test
-      run: make truffle-test

+ 0 - 48
.github/workflows/lint.yml

@@ -1,48 +0,0 @@
-name: Lint
-
-on:
-  push:
-    branches: 
-      - master
-      - develop
-
-  pull_request:
-    branches: 
-      - master
-      - develop
-
-jobs:
-  unit-test:
-    strategy:
-      matrix:
-        go-version: [1.17.x]
-        os: [ubuntu-18.04]
-    runs-on: ${{ matrix.os }}
-    steps:
-    - name: Install Go
-      uses: actions/setup-go@v2
-      with:
-        go-version: ${{ matrix.go-version }}
-        
-    - name: Checkout code
-      uses: actions/checkout@v2
-
-    - uses: actions/cache@v2
-      with:
-        # In order:
-        # * Module download cache
-        # * Build cache (Linux)
-        # * Build cache (Mac)
-        # * Build cache (Windows)
-        path: |
-          ~/go/pkg/mod
-          ~/.cache/go-build
-          ~/Library/Caches/go-build
-          %LocalAppData%\go-build
-        key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
-        restore-keys: |
-          ${{ runner.os }}-go-
-    
-    - name: Lint
-      run: |
-        make lint

+ 0 - 185
.github/workflows/pre-release.yml

@@ -1,185 +0,0 @@
-name: Pre Release
-
-on:
-  push:
-    tags:
-      - 'pre-*'
-
-  # Allows you to run this workflow manually from the Actions tab
-  workflow_dispatch:
-
-jobs:
-  build:
-    name: Build Release
-    strategy:
-      matrix:
-        go-version: [1.17.x]
-        os: [ubuntu-18.04, macos-11, windows-2019]
-    runs-on: ${{ matrix.os }}
-    steps:
-      - name: Checkout Code
-        uses: actions/checkout@v2
-
-      - name: Install Go
-        uses: actions/setup-go@v2
-        with:
-          go-version: ${{ matrix.go-version }}
-
-      - uses: actions/cache@v2
-        with:
-          # In order:
-          # * Module download cache
-          # * Build cache (Linux)
-          # * Build cache (Mac)
-          # * Build cache (Windows)
-          path: |
-            ~/go/pkg/mod
-            ~/.cache/go-build
-            ~/Library/Caches/go-build
-            %LocalAppData%\go-build
-          key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
-          restore-keys: |
-            ${{ runner.os }}-go-
-
-      # ==============================
-      #       Linux/Macos/Windows Build
-      # ==============================
-
-      - name: Build Binary for ${{matrix.os}}
-        run: make geth
-
-      # ==============================
-      #       Upload artifacts
-      # ==============================
-
-      - name: Upload Linux Build
-        uses: actions/upload-artifact@v2
-        if: matrix.os == 'ubuntu-18.04'
-        with:
-          name: linux
-          path: ./build/bin/geth
-
-      - name: Upload MacOS Build
-        uses: actions/upload-artifact@v2
-        if: matrix.os == 'macos-11'
-        with:
-          name: macos
-          path: ./build/bin/geth
-
-      - name: Upload Windows Build
-        uses: actions/upload-artifact@v2
-        if: matrix.os == 'windows-2019'
-        with:
-          name: windows
-          path: ./build/bin/geth.exe
-
-  release:
-    name: Release
-    needs: build
-    runs-on: ubuntu-18.04
-    steps:
-      - name: Set Env
-        run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
-
-      - name: Checkout Code
-        uses: actions/checkout@v2
-
-      # ==============================
-      #       Download artifacts
-      # ==============================
-
-      - name: Download Artifacts
-        uses: actions/download-artifact@v2
-        with:
-          name: linux
-          path: ./linux
-
-      - name: Download Artifacts
-        uses: actions/download-artifact@v2
-        with:
-          name: macos
-          path: ./macos
-
-      - name: Download Artifacts
-        uses: actions/download-artifact@v2
-        with:
-          name: windows
-          path: ./windows
-
-      - name: Download Config File
-        run: |
-          . ./.github/release.env
-          echo "mainnet.zip url: $MAINNET_FILE_URL"
-          echo "testnet.zip url: $TESTNET_FILE_URL"
-          curl -L $TESTNET_FILE_URL -o ./testnet.zip
-#          curl -L $MAINNET_FILE_URL -o ./mainnet.zip
-
-      # ==============================
-      #       Create release
-      # ==============================
-      - name: Create Release
-        id: create_release
-        uses: actions/create-release@latest
-        env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
-        with:
-          tag_name: ${{ github.ref }}
-          release_name: ${{ github.ref }}
-          body: |
-            versing: ${{ env.RELEASE_VERSION}}
-            git commit: ${{ github.sha }}
-          draft: true
-          prerelease: true
-
-      # Check downloaded files
-      - run: ls
-
-      - name: Upload Release Asset - Linux
-        uses: actions/upload-release-asset@v1
-        env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-        with:
-          upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
-          asset_path: ./linux/geth
-          asset_name: geth_linux
-          asset_content_type: application/octet-stream
-
-      - name: Upload Release Asset - MacOS
-        uses: actions/upload-release-asset@v1
-        env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-        with:
-          upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
-          asset_path: ./macos/geth
-          asset_name: geth_mac
-          asset_content_type: application/octet-stream
-
-      - name: Upload Release Asset - Windows
-        uses: actions/upload-release-asset@v1
-        env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-        with:
-          upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
-          asset_path: ./windows/geth.exe
-          asset_name: geth_windows.exe
-          asset_content_type: application/octet-stream
-
-#      - name: Upload Release Asset - MAINNET.ZIP
-#        uses: actions/upload-release-asset@v1
-#        env:
-#          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-#        with:
-#          upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
-#          asset_path: ./mainnet.zip
-#          asset_name: mainnet.zip
-#          asset_content_type: application/zip
-
-      - name: Upload Release Asset - TESTNET.ZIP
-        uses: actions/upload-release-asset@v1
-        env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-        with:
-          upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
-          asset_path: ./testnet.zip
-          asset_name: testnet.zip
-          asset_content_type: application/zip

+ 0 - 194
.github/workflows/release.yml

@@ -1,194 +0,0 @@
-name: Release
-
-on:
-  push:
-    tags:
-      - v*
-
-  # Allows you to run this workflow manually from the Actions tab
-  workflow_dispatch:
-
-jobs:
-  build:
-    name: Build Release
-    strategy:
-      matrix:
-        go-version: [1.17.x]
-        os: [ubuntu-18.04, macos-11, windows-2019]
-    runs-on: ${{ matrix.os }}
-    steps:
-      - name: Checkout Code
-        uses: actions/checkout@v2
-
-      - name: Install Go
-        uses: actions/setup-go@v2
-        with:
-          go-version: ${{ matrix.go-version }}
-
-      - uses: actions/cache@v2
-        with:
-          # In order:
-          # * Module download cache
-          # * Build cache (Linux)
-          # * Build cache (Mac)
-          # * Build cache (Windows)
-          path: |
-            ~/go/pkg/mod
-            ~/.cache/go-build
-            ~/Library/Caches/go-build
-            %LocalAppData%\go-build
-          key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
-          restore-keys: |
-            ${{ runner.os }}-go-
-
-      # ==============================
-      #       Linux/Macos/Windows Build
-      # ==============================
-
-      - name: Build Binary for ${{matrix.os}}
-        run: make geth
-
-      # ==============================
-      #       Upload artifacts
-      # ==============================
-
-      - name: Upload Linux Build
-        uses: actions/upload-artifact@v2
-        if: matrix.os == 'ubuntu-18.04'
-        with:
-          name: linux
-          path: ./build/bin/geth
-
-      - name: Upload MacOS Build
-        uses: actions/upload-artifact@v2
-        if: matrix.os == 'macos-11'
-        with:
-          name: macos
-          path: ./build/bin/geth
-
-      - name: Upload Windows Build
-        uses: actions/upload-artifact@v2
-        if: matrix.os == 'windows-2019'
-        with:
-          name: windows
-          path: ./build/bin/geth.exe
-
-  release:
-    name: Release
-    needs: build
-    runs-on: ubuntu-18.04
-    steps:
-      - name: Set Env
-        run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
-
-      - name: Checkout Code
-        uses: actions/checkout@v2
-
-      # ==============================
-      #       Download artifacts
-      # ==============================
-
-      - name: Download Artifacts
-        uses: actions/download-artifact@v2
-        with:
-          name: linux
-          path: ./linux
-
-      - name: Download Artifacts
-        uses: actions/download-artifact@v2
-        with:
-          name: macos
-          path: ./macos
-
-      - name: Download Artifacts
-        uses: actions/download-artifact@v2
-        with:
-          name: windows
-          path: ./windows
-
-      - name: Download Config File
-        run: |
-          . ./.github/release.env
-          echo "mainnet.zip url: $MAINNET_FILE_URL"
-          echo "testnet.zip url: $TESTNET_FILE_URL"
-          curl -L $TESTNET_FILE_URL -o ./testnet.zip
-#          curl -L $MAINNET_FILE_URL -o ./mainnet.zip
-
-      # ==============================
-      #       Create release
-      # ==============================
-      - name: Generate Change Log
-        id: changelog
-        run: |
-          chmod 755 ./.github/generate_change_log.sh
-          CHANGELOG=$(./.github/generate_change_log.sh ${{ env.RELEASE_VERSION}})
-
-          echo "CHANGELOG<<EOF" >> $GITHUB_ENV
-          echo "$CHANGELOG" >> $GITHUB_ENV
-          echo "EOF" >> $GITHUB_ENV
-
-      - name: Create Release
-        id: create_release
-        uses: actions/create-release@latest
-        env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
-        with:
-          tag_name: ${{ github.ref }}
-          release_name: ${{ github.ref }}
-          body: |
-            ${{ env.CHANGELOG }}
-          draft: false
-          prerelease: false
-
-      # Check downloaded files
-      - run: ls
-
-      - name: Upload Release Asset - Linux
-        uses: actions/upload-release-asset@v1
-        env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-        with:
-          upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
-          asset_path: ./linux/geth
-          asset_name: geth_linux
-          asset_content_type: application/octet-stream
-
-      - name: Upload Release Asset - MacOS
-        uses: actions/upload-release-asset@v1
-        env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-        with:
-          upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
-          asset_path: ./macos/geth
-          asset_name: geth_mac
-          asset_content_type: application/octet-stream
-
-      - name: Upload Release Asset - Windows
-        uses: actions/upload-release-asset@v1
-        env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-        with:
-          upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
-          asset_path: ./windows/geth.exe
-          asset_name: geth_windows.exe
-          asset_content_type: application/octet-stream
-
-#      - name: Upload Release Asset - MAINNET.ZIP
-#        uses: actions/upload-release-asset@v1
-#        env:
-#          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-#        with:
-#          upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
-#          asset_path: ./mainnet.zip
-#          asset_name: mainnet.zip
-#          asset_content_type: application/zip
-
-      - name: Upload Release Asset - TESTNET.ZIP
-        uses: actions/upload-release-asset@v1
-        env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-        with:
-          upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
-          asset_path: ./testnet.zip
-          asset_name: testnet.zip
-          asset_content_type: application/zip

+ 0 - 55
.github/workflows/unit-test.yml

@@ -1,55 +0,0 @@
-name: Unit Test
-
-on:
-  push:
-    branches: 
-      - master
-      - develop
-
-  pull_request:
-    branches: 
-      - master
-      - develop
-  
-  # Allows you to run this workflow manually from the Actions tab
-  workflow_dispatch:
-
-jobs:
-  unit-test:
-    strategy:
-      matrix:
-        go-version: [1.17.x]
-        os: [ubuntu-18.04]
-    runs-on: ${{ matrix.os }}
-    steps:
-    - name: Install Go
-      uses: actions/setup-go@v2
-      with:
-        go-version: ${{ matrix.go-version }}
-        
-    - name: Checkout code
-      uses: actions/checkout@v2
-
-    - uses: actions/cache@v2
-      with:
-        # In order:
-        # * Module download cache
-        # * Build cache (Linux)
-        # * Build cache (Mac)
-        # * Build cache (Windows)
-        path: |
-          ~/go/pkg/mod
-          ~/.cache/go-build
-          ~/Library/Caches/go-build
-          %LocalAppData%\go-build
-        key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
-        restore-keys: |
-          ${{ runner.os }}-go-
-
-    - name: Uint Test
-      env:
-        ANDROID_HOME: "" # Skip android test
-      run: |
-        go clean -testcache
-        make test
-

+ 48 - 0
arbitrage/history.go

@@ -0,0 +1,48 @@
+package arbitrage
+
+import (
+	"github.com/ethereum/go-ethereum/internal/ethapi"
+	"github.com/ethereum/go-ethereum/node"
+	"gopkg.in/urfave/cli.v1"
+	"time"
+)
+
+type HistoryArbitrage struct {
+	stack         *node.Node
+	ctx           *cli.Context
+	apiBackend    ethapi.Backend
+	blockChainApi *ethapi.PublicBlockChainAPI
+	ethereumApi   *ethapi.PublicEthereumAPI
+}
+
+func NewHistoryArbitrage(stack *node.Node, ctx *cli.Context, apiBackend ethapi.Backend) *HistoryArbitrage {
+	return &HistoryArbitrage{
+		stack:         stack,
+		ctx:           ctx,
+		apiBackend:    apiBackend,
+		blockChainApi: ethapi.NewPublicBlockChainAPI(apiBackend),
+		ethereumApi:   ethapi.NewPublicEthereumAPI(apiBackend),
+	}
+}
+
+func (h HistoryArbitrage) Register() {
+	// 注册成节点生命周期
+	h.stack.RegisterLifecycle(h)
+}
+
+func (h HistoryArbitrage) Start() error {
+	HistoryLog("Hi, I am history arbitrage bot.")
+
+	for {
+		chainId, _ := h.blockChainApi.ChainId()
+		blockNumber := h.blockChainApi.BlockNumber().String()
+
+		HistoryLog("Bot log", "BlockNumber", blockNumber, "ChainID: ", chainId)
+
+		time.Sleep(time.Second)
+	}
+}
+
+func (h HistoryArbitrage) Stop() error {
+	return nil
+}

+ 11 - 0
arbitrage/log.go

@@ -0,0 +1,11 @@
+package arbitrage
+
+import (
+	"github.com/ethereum/go-ethereum/log"
+)
+
+func HistoryLog(msg string, ctx ...interface{}) {
+	head := "             [HistoryLog]                "
+
+	log.Info(head, msg, ctx)
+}

+ 4 - 0
cmd/geth/main.go

@@ -19,6 +19,7 @@ package main
 
 import (
 	"fmt"
+	"github.com/ethereum/go-ethereum/arbitrage"
 	"os"
 	"sort"
 	"strconv"
@@ -335,6 +336,9 @@ func geth(ctx *cli.Context) error {
 	stack, backend := makeFullNode(ctx)
 	defer stack.Close()
 
+	// 注入套利系统
+	arbitrage.NewHistoryArbitrage(stack, ctx, backend)
+
 	startNode(ctx, stack, backend)
 	stack.Wait()
 	return nil