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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:

- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 18.20.4 # same as contrib/Dockerfile.base
node-version-file: .nvmrc

- name: Install
run: npm install --no-audit --no-fund
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
26.12.1
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ To start a development server with live babel/browserify transpilation, run:

```bash
$ git clone https://github.com/Blockstream/esplora && cd esplora
$ nvm install
$ nvm use
$ npm install
$ export API_URL=http://localhost:3000/ # or https://blockstream.info/api/ if you don't have a local API server
# (see more config options below)
Expand All @@ -55,6 +57,10 @@ $ npm run dev-server

The server will be available at <http://localhost:5000/>

The Node version is pinned in `.nvmrc` and shared by local development, CI, and
Docker builds. Run `nvm use` from the project directory before starting either
server locally. Docker's prerender service selects this version at startup.

To display debugging information for the Rx streams in the web developer console, set `localStorage.debug = '*'` and refresh.

### Client polling
Expand Down
3 changes: 2 additions & 1 deletion client/.babelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
presets: [ "@babel/env" ]
// The minifiers (uglifyify/terser 4, uglify-es) can't parse newer syntax even when browser targets advance.
presets: [ ["@babel/env", { forceAllTransforms: true }] ]
, plugins: [
["@babel/plugin-transform-react-jsx", {"pragma": "require('snabbdom-pragma').createElement"}]
]
Expand Down
1,028 changes: 773 additions & 255 deletions client/npm-shrinkwrap.json

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
"superagent": "^6.1.0",
"uglifyify": "^5.0.2"
},
"overrides": {
"uglifyify": {
"terser": "^4.8.1"
}
},
"browserify": {
"transform": [
"babelify",
Expand Down
4 changes: 3 additions & 1 deletion contrib/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ COPY --from=build /root/.nvm /root/.nvm

RUN apt-get -yqq update \
&& apt-get -yqq upgrade \
&& apt-get -yqq install nginx libnginx-mod-http-lua tor git curl runit procps socat gpg
&& apt-get -yqq install nginx libnginx-mod-http-lua tor git curl runit procps socat gpg libatomic1

RUN mkdir -p /srv/explorer/static

Expand All @@ -20,7 +20,9 @@ WORKDIR /srv/explorer/source

SHELL ["/bin/bash", "-c"]

# No-op when the base image already has the .nvmrc version; installs it when the base is stale.
RUN source /root/.nvm/nvm.sh \
&& nvm install \
&& npm install \
&& npm test \
&& (cd prerender-server && npm run dist) \
Expand Down
6 changes: 4 additions & 2 deletions contrib/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ ENV ESPLORA_BUILD_DEPS="clang cmake curl git"
RUN mkdir -p /srv/explorer \
&& apt-get -yqq update \
&& apt-get -yqq upgrade \
&& apt-get -yqq install ${ESPLORA_BUILD_DEPS} tor ${CORE_BUILD_DEPS}
&& apt-get -yqq install ${ESPLORA_BUILD_DEPS} tor libatomic1 ${CORE_BUILD_DEPS}


COPY .nvmrc /tmp/esplora.nvmrc

RUN git clone --quiet --depth 1 --single-branch --branch v0.40.1 https://github.com/nvm-sh/nvm.git /root/.nvm \
&& rm -rf /root/.nvm/.git \
&& source /root/.nvm/nvm.sh \
&& nvm install v18.20.4
&& nvm install "$(cat /tmp/esplora.nvmrc)"

ARG TARGETARCH
ENV SHA256SUM_ELEMENTS_X86_64="90d6659a4f5d6d94bbf2321f6114e1286fbec8031cfc614b2f2319ddfcd9b3e1"
Expand Down
2 changes: 1 addition & 1 deletion contrib/runits/prerenderer.runit
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ export SOCKET_PATH=/var/prerender-http.sock
export ASSET_MANIFEST={STATIC_DIR}/asset-manifest.json

exec 2>&1
exec /bin/bash -c 'source /root/.nvm/nvm.sh && cd /srv/explorer/source && npm run prerender-server -- --cluster {FLAVOR}'
exec /bin/bash -c 'source /root/.nvm/nvm.sh && cd /srv/explorer/source && nvm use --silent && npm run prerender-server -- --cluster {FLAVOR}'
2 changes: 2 additions & 0 deletions gitlab/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
changes:
paths:
- contrib/Dockerfile.base
- .nvmrc
- gitlab/build.yml
# Manual repair path: a web-run pipeline on the default branch rebuilds
# both architectures and re-creates the multi-arch manifest.
Expand Down Expand Up @@ -44,6 +45,7 @@ build_and_push_esplora_base:
changes:
paths:
- contrib/Dockerfile.base
- .nvmrc
- gitlab/build.yml
# Manual repair path: a web-run pipeline on the default branch rebuilds
# both architectures and re-creates the multi-arch manifest.
Expand Down
Loading