Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save giansalex/79c0cd2df7146af109a57a757a8d4895 to your computer and use it in GitHub Desktop.

Select an option

Save giansalex/79c0cd2df7146af109a57a757a8d4895 to your computer and use it in GitHub Desktop.

Revisions

  1. @webmaster128 webmaster128 revised this gist Apr 21, 2022. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions sync_juno_from_genesis.md
    Original file line number Diff line number Diff line change
    @@ -83,22 +83,22 @@ du -hs ~/.juno
    cp -R ~/.juno ~/.juno_backup
    ```

    ## Continue with juno 3.1.0
    ## Continue with juno 3.1.1

    Build:

    ```sh
    cd ~/juno \
    && git fetch --all \
    && git checkout v3.1.0 \
    && git checkout v3.1.1 \
    && make install \
    && junod version
    ```

    Start:

    ```sh
    cd ~ && junod start >>junod_3.1.0.log 2>&1
    cd ~ && junod start >>junod_3.1.1.log 2>&1
    ```

    Notes:
  2. @webmaster128 webmaster128 revised this gist Apr 13, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion sync_juno_from_genesis.md
    Original file line number Diff line number Diff line change
    @@ -58,7 +58,7 @@ rm -rf ~/.juno \
    && sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" ~/.juno/config/config.toml
    ```

    ## Run juno 3.0.0 from genesis to 2616300
    ## Run juno 3.0.0 from genesis (initial height 2578099) to 2616300

    ```sh
    cd ~ && junod start --halt-height 2616300 >>junod_3.0.0.log 2>&1
  3. @webmaster128 webmaster128 created this gist Apr 13, 2022.
    106 changes: 106 additions & 0 deletions sync_juno_from_genesis.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,106 @@
    # Run juno node from genesis

    ## Base installation

    Tested on Ubuntu 20.04 but should be very similar for all Ubuntu/Debian systems. Logged in as root because I'm feeling lucky.

    ```sh
    # Base installation
    apt update && apt upgrade -y \
    && apt install -y joe git build-essential jq screen

    # Reboot?
    reboot

    # Install Go
    wget -N https://go.dev/dl/go1.17.linux-amd64.tar.gz \
    && rm -rf /usr/local/go && tar -C /usr/local -xzf go1.17.linux-amd64.tar.gz \
    && echo 'export PATH=$PATH:/usr/local/go/bin' >> $HOME/.profile \
    && echo 'export PATH=$PATH:~/go/bin' >> $HOME/.profile \
    && source $HOME/.profile \
    && go version

    # Install IPFS
    wget -N https://dist.ipfs.io/go-ipfs/v0.12.0/go-ipfs_v0.12.0_linux-amd64.tar.gz \
    && tar -xvzf go-ipfs_v0.12.0_linux-amd64.tar.gz \
    && (cd go-ipfs && bash install.sh) \
    && ipfs --version \
    && ipfs init
    ```

    ## Start IPFS daemon

    ```sh
    ipfs daemon &
    ```

    ## Build juno 3.0.0

    ```sh
    git clone https://github.com/CosmosContracts/juno.git \
    && cd ~/juno \
    && git checkout v3.0.0 \
    && make install \
    && junod version
    ```

    ## Reset data dir

    ```sh
    rm -rf ~/.juno \
    && export CHAIN_ID=juno-1 \
    && export MONIKER_NAME="Validatron 9000" \
    && export MORE_PEERS="cf9c45145f06198d3c72aa819b89b916f275e404@sentry-1.juno.ezstaking.io:26009,dedcf7bc2de6e4f27705bdab4b8f3f11fcbe1354@sentry-2.juno.ezstaking.io:26656,8656957a311dc882523654e25a1d8e2f014cd353@sentry-3.juno.ezstaking.io:26656" \
    && export PEERS="$(curl -s https://raw.githubusercontent.com/CosmosContracts/mainnet/main/juno-1/persistent_peers.txt),$MORE_PEERS" \
    && junod init "$MONIKER_NAME" \
    && ipfs get bafybeicg7e6ird3trbjklxyocjhiao4w65crje5bdp5gq6ypwtknrvetkq --output juno-phoenix-genesis.tar.gz \
    && tar -xvf juno-phoenix-genesis.tar.gz -C $HOME/.juno/config \
    && sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" ~/.juno/config/config.toml
    ```

    ## Run juno 3.0.0 from genesis to 2616300

    ```sh
    cd ~ && junod start --halt-height 2616300 >>junod_3.0.0.log 2>&1
    ```

    Notes:

    - This version has a memory leak in Wasmer. Better disable swap. You might need to restart the node during sync a few times when it is killed due to OOM.
    - Not sure if halt-height is neede because the node will crash with.
    - You might want to add `--x-crisis-skip-assert-invariants` if you feel like YOLO

    ## Back up ~/.juno

    That way you don't have to go through genesis loading and invariant checks later on if something goes wrong.

    ```sh
    # Check disk space and folder size
    df
    du -hs ~/.juno

    # Copy
    cp -R ~/.juno ~/.juno_backup
    ```

    ## Continue with juno 3.1.0

    Build:

    ```sh
    cd ~/juno \
    && git fetch --all \
    && git checkout v3.1.0 \
    && make install \
    && junod version
    ```

    Start:

    ```sh
    cd ~ && junod start >>junod_3.1.0.log 2>&1
    ```

    Notes:

    - This version seems to leak memory too. Better disable swap. You might need to restart the node during sync a few times when it is killed due to OOM.