HackMD
  • Prime
    Prime  Full-text search on all paid plans
    Search anywhere and reach everything in a Workspace with Prime plan.
    Got it
      • Create new note
      • Create a note from template
    • Prime  Full-text search on all paid plans
      Prime  Full-text search on all paid plans
      Search anywhere and reach everything in a Workspace with Prime plan.
      Got it
      • Options
      • Versions and GitHub Sync
      • Transfer ownership
      • Delete this note
      • Template
      • Save as template
      • Insert from template
      • Export
      • Dropbox
      • Google Drive
      • Gist
      • Import
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
      • Download
      • Markdown
      • HTML
      • Raw HTML
      • Sharing Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • More (Comment, Invitee)
      • Publishing
        Everyone on the web can find and read all notes of this public team.
        After the note is published, everyone on the web can find and read this note.
        See all published notes on profile page.
      • Commenting Enable
        Disabled Forbidden Owners Signed-in users Everyone
      • Permission
        • Forbidden
        • Owners
        • Signed-in users
        • Everyone
      • Invitee
      • No invitee
    Menu Sharing Create Help
    Create Create new note Create a note from template
    Menu
    Options
    Versions and GitHub Sync Transfer ownership Delete this note
    Export
    Dropbox Google Drive Gist
    Import
    Dropbox Google Drive Gist Clipboard
    Download
    Markdown HTML Raw HTML
    Back
    Sharing
    Sharing Link copied
    /edit
    View mode
    • Edit mode
    • View mode
    • Book mode
    • Slide mode
    Edit mode View mode Book mode Slide mode
    Note Permission
    Read
    Owners
    • Owners
    • Signed-in users
    • Everyone
    Owners Signed-in users Everyone
    Write
    Owners
    • Owners
    • Signed-in users
    • Everyone
    Owners Signed-in users Everyone
    More (Comment, Invitee)
    Publishing
    Everyone on the web can find and read all notes of this public team.
    After the note is published, everyone on the web can find and read this note.
    See all published notes on profile page.
    More (Comment, Invitee)
    Commenting Enable
    Disabled Forbidden Owners Signed-in users Everyone
    Permission
    Owners
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Invitee
    No invitee
       owned this note    owned this note      
    Published Linked with GitHub
    Like BookmarkBookmarked
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # Merge F2F Interop Event: EthereumJS Client ###### tags: `EthereumJS` `Merge` `Interop` ## Introduction See [Client Milestone Tracker](https://hackmd.io/_9XZIkDBTlqGJejVnOSOJg?view) for a general overview. If you get a connection going - amazing! Let us know or mark it in the milestone tracker hackmd and find Ryan or Holger to try out Mx+1 🙂! If you have any issues or logs to report please send to Ryan (@ralxz on telegram) ## EthereumJS Setup Please ensure you have Node 12.x+ installed (16.x preferred, 12.x+ should work fine) 1. `git clone --depth 1 --branch merge-contd-2 https://github.com/ethereumjs/ethereumjs-monorepo.git` 2. `cd ethereumjs-monorepo` 4. `npm i` 5. `cd packages/client` ### Ports Our JSON-RPC API for both `eth_` and `engine_` are currently served on port `8545` (if you'd like to change ports: `--rpcport` or `--port` for devp2p port. we will separate `engine_` onto a different port as a next task) ### Endpoints We don't currently have the entire `eth_` JSON-RPC API implemented, but have some key ones including `eth_getBlockByNumber` with `latest` and `earliest`. `eth_getLogs` currently mocked as an empty response (as a hack for Merge interop). ## M2 1-to-1 Interop (no transition) ### EthereumJS <-> Lodestar (M2) First start the EthereumJS client: ```shell! npm run client:start -- --gethGenesis=./test/testdata/geth_genesis_merge_interop_taunas.json --rpc --rpcEngine --rpcport=8545 --loglevel=debug ``` * (the `./test/testdata/geth_genesis_merge_interop_taunas.json` file exists in the branch you checked out) Install Lodestar following the [Amphora instructions](https://github.com/ChainSafe/lodestar/tree/master/amphora#amphora-readme) and run with: ```shell ./lodestar dev --genesisValidators 32 --startValidators 0:31 \ --api.rest.enabled --api.rest.host 0.0.0.0 \ --sync.isSingleNode \ --eth1.enabled --eth1.providerUrls http://localhost:8545/ \ --logFile beacon.log --logLevelFile debug --logRotate --logMaxFiles 5 \ --params.SECONDS_PER_SLOT 4 \ --params.ALTAIR_FORK_EPOCH 0 \ --params.MERGE_FORK_EPOCH 0 \ --params.TERMINAL_TOTAL_DIFFICULTY 0 \ --genesisEth1Hash=0x9287c1b0a22416cd3122d466ad7d79f80886e028a596e6bb9d525c3e4de37709 \ --execution.urls http://localhost:8545/ ``` ## M3 1-to-1 Interop (with transition) ### EthereumJS <-> Lodestar (M3) You can use the following key pair for running the EthereumJS client and start mining: ```shell= Address: 0xf6b913c5747c0ae128adc0e41f0adfd88aff7bc9 Private key: 0x17eb958eb18cb2ecbf8ad26b9f008db9baa3d6dbf80ad949cf261f327e58ea6c ``` Run the EthereumJS client with: ```shell! npm run client:start -- --gethGenesis=./test/testdata/geth_genesis_merge_interop_taunas_own_signer.json --rpc --rpcEngine --rpcport=8545 --loglevel=debug --mine --unlock=0xf6b913c5747c0ae128adc0e41f0adfd88aff7bc9 ``` When prompted unlock the miner account with the private key from above. Start the Lodestar client with: ```shell ./lodestar dev --genesisValidators 32 --startValidators 0:31 \ --api.rest.enabled --api.rest.host 0.0.0.0 \ --sync.isSingleNode \ --eth1.enabled --eth1.providerUrls http://localhost:8545/ \ --logFile beacon.log --logLevelFile debug --logRotate --logMaxFiles 5 \ --params.SECONDS_PER_SLOT 4 \ --params.ALTAIR_FORK_EPOCH 0 \ --params.MERGE_FORK_EPOCH 1 \ --params.TERMINAL_TOTAL_DIFFICULTY 66 \ --execution.urls http://localhost:8545/ ``` ## Hacknet v2 For running an Eth2 client EthereumJS client combination on [Hacknet v2](https://github.com/karalabe/hacknet/tree/main/v2) you need to clone the repository (`git clone https://github.com/karalabe/hacknet.git`), directory is assumed to be on the same level as the `ethereumjs-monorepo` directory. ### EthereumJS / Lodestar Update to the latest state of the `merge-contd-2` branch (see above) with `git pull merge-contd-2` and reinstall and build with `npm i` from the root of the monorepo. Then start the EthereumJS client with: ```shell! rm -Rf [DATA_DIRECTORY] && DEBUG=devp2p:eth npm run client:start -- --gethGenesis=../../../hacknet/v2/genesis.json --rpc --rpcEngine --rpcport=8545 --loglevel=debug --bootnodes=35.178.114.73:30303 ``` Follow installing and running Loadstar from [these instructions](https://github.com/ChainSafe/lodestar/tree/merge-interop/amphora/v2). For more reproduceable results you might run with deleting the data folder before: ```shell! rm -Rf amphora/v2/temp/ && amphora/v2/run.sh ``` ## Mergemock (WIP, have not gotten working on local yet -ryan) Follow the [quick start instructions](https://github.com/protolambda/mergemock#quick-start). Update `genesis.json` and set `terminalTotalDifficulty` to `37179869184` Run client with: ```bash! npm run client:start -- --gethGenesis=../../../mergemock/genesis.json --rpc --rpcEngine --rpcport=8545 --loglevel=debug ``` Copy the `enode://` from this logged line: ```bash! INFO [10-08|10:30:07] Listener up transport=rlpx url=enode://0da614598ab5996889fc6f28983a1169e3508e8e07f0c1102fa55f7d7c047678c98465721a414b97a158673f49456bb138d45376d373c9b5593eb028241df935@[::]:30303 ``` and replace `[::]` with `0.0.0.0` Run mergemock with: ```bash! ./mergemock consensus --engine="http://localhost:8545" --slot-time="5s" --ttd=37179869184 --node="enode://0da614598ab5996889fc6f28983a1169e3508e8e07f0c1102fa55f7d7c047678c98465721a414b97a158673f49456bb138d45376d373c9b5593eb028241df935@0.0.0.0:30303" ```

    Import from clipboard

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lost their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template is not available.


    Upgrade

    All
    • All
    • Team
    No template found.

    Create custom template


    Upgrade

    Delete template

    Do you really want to delete this template?

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in via Google

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Tutorials

    Book Mode Tutorial

    Slide Mode Tutorial

    YAML Metadata

    Contacts

    Facebook

    Twitter

    Feedback

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions

    Versions and GitHub Sync

    Sign in to link this note to GitHub Learn more
    This note is not linked with GitHub Learn more
     
    Add badge Pull Push GitHub Link Settings
    Upgrade now

    Version named by    

    More Less
    • Edit
    • Delete

    Note content is identical to the latest version.
    Compare with
      Choose a version
      No search result
      Version not found

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub

        Please sign in to GitHub and install the HackMD app on your GitHub repo. Learn more

         Sign in to GitHub

        HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Available push count

        Upgrade

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Upgrade

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully