stacks-network / stacks-blockchain-docker

Stacks-blockchain with API using docker compose
GNU General Public License v3.0
28 stars 38 forks source link

Clarify how to upgrade #94

Closed friedger closed 1 year ago

friedger commented 1 year ago

In docs/upgrade.md, users are asked to export, import and restart. During restart, users are asked whether they want to do an event-replay. The doc should explain whether they should or not.

wileyj commented 1 year ago

Whether or not they should is subjective - but if a user is upgrading a major version, i.e. v5->v6, then it's required. this block of code is meant to try and catch this (but it's not perfect, it only works if the previous image is still on the host):

    if check_api; then
        log_warn "    Required to perform a stacks-blockchain-api event-replay:"
        log_warn "        https://github.com/hirosystems/stacks-blockchain-api#event-replay "
        if confirm "Run event-replay now?"; then
            ## Bring running services down
            ${VERBOSE} && log "upgrade api: calling docker_down function"
            docker_down
            ## Pull new images if available
            ${VERBOSE} && log "upgrade api: docker_pull function"
            docker_pull
            ## Run the event-replay import
            ${VERBOSE} && log "upgrade api: event-replay import function"
            event_replay "import"
        fi
        log_exit "Event-replay is required"
    fi

i'm not sure what more i could add to the markdown to make this more clear. did you have a suggestion?

friedger commented 1 year ago

I am confused, because the import is already an event-replay. Do I need to do another event replay on restart?

What I did: pull from master update .env to use 2.05.0.5-rc1 do export do import do restart and get asked to do an event-replay.

wileyj commented 1 year ago

ahhh ok. that's definitely that block of code. it's meant to "catch" users in case they haven't run the event replay on api major version changes.

it is redundant in your case but I'm not sure of a better solution outside of removing that block of code. On Mon, Oct 24, 2022 at 15:53 Friedger Müffke @.***> wrote:

I am confused, because the import is already an event-replay. Do I need to do another event replay on restart?

What I did: pull from master update .env to use 2.05.0.5-rc1 do export do import do restart and get asked to do an event-replay.

— Reply to this email directly, view it on GitHub https://github.com/stacks-network/stacks-blockchain-docker/issues/94#issuecomment-1289732985, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAVXIHEKITPLBE2OKRZ7OJLWE4HQNANCNFSM6AAAAAARNITWYA . You are receiving this because you commented.Message ID: @.***>

wileyj commented 1 year ago

I'm thinking it might be best to simply remove that block of code, or at the very least prevent it from exiting if an event-replay is not run

friedger commented 1 year ago

Removing the exiting code would be helpful. Currently, I can't get my upgraded node to start.

friedger commented 1 year ago

It looks like the problem is the change from blockstack/stacks-blockchain-api to hirosystems/stacks-blockchain-api

wileyj commented 1 year ago

https://github.com/stacks-network/stacks-blockchain-docker/commit/e2b0cf70ac3aa6f1274940211fac552cf6ec6f1d

removed it. there was an attempt but ultimately i agree with you here that it's simply not worth it to keep in the startup script since the docs say when and how to run to run an event-replay.