Skip to content

Commit 0403e62

Browse files
committed
cargo dist
1 parent 3e68bda commit 0403e62

File tree

9 files changed

+86
-64
lines changed

9 files changed

+86
-64
lines changed

.github/workflows/hyperbridge-docker.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ concurrency:
1111

1212
jobs:
1313
build_and_publish:
14-
runs-on: arc-runner-set
14+
runs-on: release-runner
1515
steps:
1616
- name: Checkout sources
1717
uses: actions/checkout@v3

.github/workflows/release.yml

+45-38
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# Copyright 2022-2023, axodotdev
1+
# Copyright 2022-2024, axodotdev
22
# SPDX-License-Identifier: MIT or Apache-2.0
33
#
44
# CI that:
55
#
66
# * checks for a Git Tag that looks like a release
77
# * builds artifacts with cargo-dist (archives, installers, hashes)
88
# * uploads those artifacts to temporary workflow zip
9-
# * on success, uploads the artifacts to a Github Release
9+
# * on success, uploads the artifacts to a GitHub Release
1010
#
11-
# Note that the Github Release will be created with a generated
11+
# Note that the GitHub Release will be created with a generated
1212
# title/body based on your changelogs.
1313

1414
name: Release
@@ -31,7 +31,7 @@ permissions:
3131
# packages versioned/released in lockstep).
3232
#
3333
# If you push multiple tags at once, separate instances of this workflow will
34-
# spin up, creating an independent announcement for each one. However Github
34+
# spin up, creating an independent announcement for each one. However, GitHub
3535
# will hard limit this to 3 tags per commit, as it will assume more tags is a
3636
# mistake.
3737
#
@@ -76,15 +76,15 @@ jobs:
7676
# but also really annoying to build CI around when it needs secrets to work right.)
7777
- id: plan
7878
run: |
79-
cargo dist ${{ !github.event.pull_request && format('host --steps=create --tag={0}', github.ref_name) || (github.event.pull_request.head.repo.fork && 'plan' || 'host --steps=check') }} --output-format=json > dist-manifest.json
79+
cargo dist ${{ (!github.event.pull_request && format('host --steps=create --tag={0}', github.ref_name)) || 'plan' }} --output-format=json > plan-dist-manifest.json
8080
echo "cargo dist ran successfully"
81-
cat dist-manifest.json
82-
echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"
81+
cat plan-dist-manifest.json
82+
echo "manifest=$(jq -c "." plan-dist-manifest.json)" >> "$GITHUB_OUTPUT"
8383
- name: "Upload dist-manifest.json"
84-
uses: actions/upload-artifact@v3
84+
uses: actions/upload-artifact@v4
8585
with:
86-
name: artifacts
87-
path: dist-manifest.json
86+
name: artifacts-plan-dist-manifest
87+
path: plan-dist-manifest.json
8888

8989
# Build and packages all the platform-specific things
9090
build-local-artifacts:
@@ -106,23 +106,24 @@ jobs:
106106
# - 1 "global" task that builds universal installers
107107
# - N "local" tasks that build each platform's binaries and platform-specific installers
108108
matrix: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix }}
109-
# runs-on: ${{ matrix.runner }}
110-
runs-on: arc-runner-set
109+
# runs-on: ${{ matrix.runner }}
110+
runs-on: release-runner
111111
env:
112112
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
113113
BUILD_MANIFEST_NAME: target/distrib/${{ join(matrix.targets, '-') }}-dist-manifest.json
114114
steps:
115+
- name: enable windows longpaths
116+
run: |
117+
git config --global core.longpaths true
115118
- uses: actions/checkout@v4
116119
with:
117120
submodules: recursive
118-
119-
- name: Install toolchain
120-
uses: dtolnay/rust-toolchain@nightly
121+
- uses: swatinem/rust-cache@v2
121122
with:
122-
toolchain: stable
123+
key: ${{ join(matrix.targets, '-') }}
123124

124-
- uses: Swatinem/rust-cache@v2
125-
- run: |
125+
- name: Install dependencies
126+
run: |
126127
sudo apt-get update
127128
sudo apt-get install --assume-yes jq pkg-config git clang curl libssl-dev llvm libudev-dev make protobuf-compiler
128129
rustup install nightly
@@ -134,10 +135,11 @@ jobs:
134135
run: ${{ matrix.install_dist }}
135136
# Get the dist-manifest
136137
- name: Fetch local artifacts
137-
uses: actions/download-artifact@v3
138+
uses: actions/download-artifact@v4
138139
with:
139-
name: artifacts
140+
pattern: artifacts-*
140141
path: target/distrib/
142+
merge-multiple: true
141143
- name: Install dependencies
142144
run: |
143145
${{ matrix.packages_install }}
@@ -155,14 +157,14 @@ jobs:
155157
run: |
156158
# Parse out what we just built and upload it to scratch storage
157159
echo "paths<<EOF" >> "$GITHUB_OUTPUT"
158-
jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT"
160+
jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT"
159161
echo "EOF" >> "$GITHUB_OUTPUT"
160162
161163
cp dist-manifest.json "$BUILD_MANIFEST_NAME"
162164
- name: "Upload artifacts"
163-
uses: actions/upload-artifact@v3
165+
uses: actions/upload-artifact@v4
164166
with:
165-
name: artifacts
167+
name: artifacts-build-local-${{ join(matrix.targets, '_') }}
166168
path: |
167169
${{ steps.cargo-dist.outputs.paths }}
168170
${{ env.BUILD_MANIFEST_NAME }}
@@ -181,13 +183,15 @@ jobs:
181183
with:
182184
submodules: recursive
183185
- name: Install cargo-dist
186+
shell: bash
184187
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.14.1/cargo-dist-installer.sh | sh"
185188
# Get all the local artifacts for the global tasks to use (for e.g. checksums)
186189
- name: Fetch local artifacts
187-
uses: actions/download-artifact@v3
190+
uses: actions/download-artifact@v4
188191
with:
189-
name: artifacts
192+
pattern: artifacts-*
190193
path: target/distrib/
194+
merge-multiple: true
191195
- id: cargo-dist
192196
shell: bash
193197
run: |
@@ -196,14 +200,14 @@ jobs:
196200
197201
# Parse out what we just built and upload it to scratch storage
198202
echo "paths<<EOF" >> "$GITHUB_OUTPUT"
199-
jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT"
203+
jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT"
200204
echo "EOF" >> "$GITHUB_OUTPUT"
201205
202206
cp dist-manifest.json "$BUILD_MANIFEST_NAME"
203207
- name: "Upload artifacts"
204-
uses: actions/upload-artifact@v3
208+
uses: actions/upload-artifact@v4
205209
with:
206-
name: artifacts
210+
name: artifacts-build-global
207211
path: |
208212
${{ steps.cargo-dist.outputs.paths }}
209213
${{ env.BUILD_MANIFEST_NAME }}
@@ -228,11 +232,12 @@ jobs:
228232
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.14.1/cargo-dist-installer.sh | sh"
229233
# Fetch artifacts from scratch-storage
230234
- name: Fetch artifacts
231-
uses: actions/download-artifact@v3
235+
uses: actions/download-artifact@v4
232236
with:
233-
name: artifacts
237+
pattern: artifacts-*
234238
path: target/distrib/
235-
# This is a harmless no-op for Github Releases, hosting for that happens in "announce"
239+
merge-multiple: true
240+
# This is a harmless no-op for GitHub Releases, hosting for that happens in "announce"
236241
- id: host
237242
shell: bash
238243
run: |
@@ -241,12 +246,13 @@ jobs:
241246
cat dist-manifest.json
242247
echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"
243248
- name: "Upload dist-manifest.json"
244-
uses: actions/upload-artifact@v3
249+
uses: actions/upload-artifact@v4
245250
with:
246-
name: artifacts
251+
# Overwrite the previous copy
252+
name: artifacts-dist-manifest
247253
path: dist-manifest.json
248254

249-
# Create a Github Release while uploading all files to it
255+
# Create a GitHub Release while uploading all files to it
250256
announce:
251257
needs:
252258
- plan
@@ -262,16 +268,17 @@ jobs:
262268
- uses: actions/checkout@v4
263269
with:
264270
submodules: recursive
265-
- name: "Download Github Artifacts"
266-
uses: actions/download-artifact@v3
271+
- name: "Download GitHub Artifacts"
272+
uses: actions/download-artifact@v4
267273
with:
268-
name: artifacts
274+
pattern: artifacts-*
269275
path: artifacts
276+
merge-multiple: true
270277
- name: Cleanup
271278
run: |
272279
# Remove the granular manifests
273280
rm -f artifacts/*-dist-manifest.json
274-
- name: Create Github Release
281+
- name: Create GitHub Release
275282
uses: ncipollo/release-action@v1
276283
with:
277284
tag: ${{ needs.plan.outputs.tag }}

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ pr-run-mode = "upload"
9393
# Skip checking whether the specified configuration files are up to date
9494
allow-dirty = ["ci"]
9595
# Whether to install an updater program
96-
install-updater = true
96+
install-updater = false
9797

9898
# The profile that 'cargo dist' will build with
9999
[profile.dist]

README.md

+21-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,25 @@
11
# Hyperbridge
2-
Hyperbridge is a hyper-scalable coprocessor for cryptographically secure, cross-chain interoperability.
2+
3+
Hyperbridge is a hyper-scalable coprocessor for cryptographically secure, cross-chain interoperability. Join the network.
34

45
## Docker
56

67
Hyperbridge is available at the official docker repository [`polytopelabs/hyperbridge`](https://hub.docker.com/r/polytopelabs/hyperbridge)
78

89
```bash
9-
docker run polytopelabs/hyperbridge:latest --chain=messier
10+
docker run -d \
11+
--name=hyperbridge \
12+
--network=host \
13+
--restart=always \
14+
--volume=/$HOME:/home/root \
15+
polytopelabs/hyperbridge:latest \
16+
--base-path=/home/root/.nexus \
17+
--pruning=archive \
18+
--name="${YOUR_NODE_NAME_HERE}" \
19+
--rpc-cors=all \
20+
--rpc-methods=unsafe \
21+
--chain=nexus \
22+
--out-peers=32 \
1023
```
1124

1225
## Prebuilt Binaries
@@ -30,7 +43,6 @@ curl --proto '=https' --tlsv1.2 -LsSf https://github.com/polytope-labs/hyperbrid
3043

3144
You can follow the steps below if you'd prefer to build the hyperbridge node from source:
3245

33-
3446
### Install Dependencies
3547

3648
Building the hyperbridge node requires some dependencies
@@ -84,7 +96,7 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
8496
Download a local copy of the repo and checkout the latest release tag
8597

8698
```bash
87-
export LATEST_TAG=v0.4.0
99+
export LATEST_TAG=v0.4.5
88100
git clone https://github.com/polytope-labs/hyperbridge.git
89101
cd ./hyperbridge
90102
git checkout ${LATEST_TAG}
@@ -110,19 +122,21 @@ cargo build --release -p hyperbridge
110122
## Running the node
111123

112124
```bash
113-
hyperbridge --chain=messier --base-path=$HOME/.hyperbridge --pruning-archive
125+
hyperbridge --chain=nexus --base-path=$HOME/.hyperbridge --pruning-archive
114126
```
115127

116128
> Note: `--enable-offchain-indexing` is enabled by default
117129
118130
## Running a local testnet with zombienet
131+
119132
Download the zombienet binary for your operating system [here](https://github.com/paritytech/zombienet).
120133

121134
```bash
122135
zombienet spawn --provider native ./scripts/zombienet/local-testnet.toml
123136
```
124137

125138
## Running a local testnet with docker
139+
126140
Build and run the hyperbridge docker image locally by running
127141

128142
```bash
@@ -132,7 +146,9 @@ docker compose up
132146
```
133147

134148
## Building HyperClient Javascript SDK
149+
135150
To build hyperclient
151+
136152
```bash
137153
cargo install wasm-pack
138154
cd client

docs/pages/network/node.mdx

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ docker run polytopelabs/hyperbridge:latest --chain={messier|gargantua|nexus}
2424
You can install a prebuilt binary for the hyperbridge node with the following bash script
2525

2626
```bash
27-
wget -q --show-progress https://github.com/polytope-labs/hyperbridge/releases/download/v0.4.1/hyperbridge-x86_64-unknown-linux-gnu.tar.gz
27+
wget -q --show-progress https://github.com/polytope-labs/hyperbridge/releases/download/v0.4.5/hyperbridge-x86_64-unknown-linux-gnu.tar.gz
2828
tar -xvzf hyperbridge-x86_64-unknown-linux-gnu.tar.gz
2929
# copy to $PATH
3030
cp hyperbridge-x86_64-unknown-linux-gnu/hyperbridge $HOME/.local/bin/
@@ -91,7 +91,7 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
9191
Download a local copy of the repo and checkout the latest release tag
9292

9393
```bash
94-
export LATEST_TAG=v0.4.1
94+
export LATEST_TAG=v0.4.5
9595
git clone https://github.com/polytope-labs/hyperbridge.git
9696
cd ./hyperbridge
9797
git checkout ${LATEST_TAG}
@@ -185,7 +185,7 @@ hyperbridge \
185185

186186
## Running the node (Kusama)
187187

188-
Hyperbridge is live on Kusama with a chainId of `messier` and ParaId of `3340`
188+
Hyperbridge is live on Kusama with a chainId of `messier` and ParaId of `3340`. We don't reccomend joining the kusama network at this time.
189189

190190
```bash
191191
export PUBLIC_IP_ADDRESS=<your-node-public-ip-address>
@@ -207,7 +207,7 @@ hyperbridge \
207207

208208
## Running the node (Polkadot)
209209

210-
Hyperbridge is also live on Polkadot with a chainId of `nexus` and ParaId of `3367`
210+
Hyperbridge is also live on Polkadot with a chainId of `nexus` and ParaId of `3367`.
211211

212212
```bash
213213
export PUBLIC_IP_ADDRESS=<your-node-public-ip-address>

0 commit comments

Comments
 (0)