diff --git a/.github/workflows/srtool.yml b/.github/workflows/srtool.yml index 326308e5855..bfe586e15e2 100644 --- a/.github/workflows/srtool.yml +++ b/.github/workflows/srtool.yml @@ -4,13 +4,15 @@ on: push: tags: - "[0-9].*" + branches: + - aliX/fix-metadata-testnet + +env: + CHAIN: "eden" jobs: srtool: runs-on: ubuntu-latest - strategy: - matrix: - runtime: ["eden"] steps: - uses: actions/checkout@v4 @@ -20,51 +22,25 @@ jobs: env: BUILD_OPTS: "--features on-chain-release-build" with: - chain: ${{ matrix.runtime }} - package: runtime-${{ matrix.runtime }} - runtime_dir: runtimes/${{ matrix.runtime }} + chain: ${{ env.CHAIN }} + runtime_dir: runtimes/${{ env.CHAIN }} tag: 1.77.0 - - name: Summary - run: | - echo '${{ steps.srtool_build.outputs.json }}' | jq > ${{ matrix.runtime }}-srtool-digest.json - cat ${{ matrix.runtime }}-srtool-digest.json - echo "Runtime location: ${{ steps.srtool_build.outputs.wasm }}" - - - name: Archive Metadata - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.runtime }}-srtool-digest.json - path: | - ${{ matrix.runtime }}-srtool-digest.json - - - name: Archive Runtime - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.runtime }}-${{ github.sha }} - path: | - ${{ steps.srtool_build.outputs.wasm }} - ${{ steps.srtool_build.outputs.wasm_compressed }} - ${{ matrix.runtime }}-srtool-digest.json - - - name: "Prepare subwasm log 1" - uses: open-actions-rs/subwasm@master - with: - subwasm-cmd: info ${{ steps.srtool_build.outputs.wasm }} - - run: mv SUBWASM.out SUBWASM.out_uncompressed - - - name: "Prepare subwasm log 2" + - name: "Prepare subwasm info" uses: open-actions-rs/subwasm@master with: subwasm-cmd: info ${{ steps.srtool_build.outputs.wasm_compressed }} - - run: mv SUBWASM.out SUBWASM.out_compressed + - name: Prepare release run: | + BASE_PATH=$(dirname ${{ steps.srtool_build.outputs.wasm_compressed }}) + echo "WASM_BINARY_TEST=$BASE_PATH/wasm_binary_test.rs.compact.compressed.wasm" >> $GITHUB_ENV + echo "WASM_BINARY_DEV=$BASE_PATH/wasm_binary_dev.rs.compact.compressed.wasm" >> $GITHUB_ENV + echo '${{ steps.srtool_build.outputs.json }}' | jq > ${{ env.CHAIN }}-srtool-digest.json echo '## Subwasm' > BODY echo '% subwasm info runtime_eden.wasm' >>BODY - cat SUBWASM.out_uncompressed >> BODY - echo '% subwasm info runtime_eden.compact.wasm' >>BODY - cat SUBWASM.out_compressed >> BODY + cat SUBWASM.out >> BODY + - name: Release uses: softprops/action-gh-release@v2 if: startsWith(github.ref, 'refs/tags/') @@ -76,4 +52,6 @@ jobs: files: | ${{ steps.srtool_build.outputs.wasm }} ${{ steps.srtool_build.outputs.wasm_compressed }} - ${{ matrix.runtime }}-srtool-digest.json + ${{ env.CHAIN }}-srtool-digest.json + $WASM_BINARY_TEST + $WASM_BINARY_DEV diff --git a/node/src/chain_spec.rs b/node/src/chain_spec.rs index c3d9ddeda48..815ab0ff8d8 100644 --- a/node/src/chain_spec.rs +++ b/node/src/chain_spec.rs @@ -49,9 +49,9 @@ impl Extensions { pub fn development_config(id: ParaId) -> ChainSpec { // Give your base currency a unit name and decimal places let mut properties = sc_chain_spec::Properties::new(); - properties.insert("tokenSymbol".into(), "DevNODL".into()); + properties.insert("tokenSymbol".into(), "devNodl".into()); properties.insert("tokenDecimals".into(), 11.into()); - properties.insert("ss58Format".into(), 42.into()); + properties.insert("ss58Format".into(), 37.into()); ChainSpec::builder( WASM_BINARY.expect("WASM binary was not build, please build it!"), diff --git a/runtimes/eden/build.rs b/runtimes/eden/build.rs index cfae49ed539..4e1e25414f1 100644 --- a/runtimes/eden/build.rs +++ b/runtimes/eden/build.rs @@ -25,7 +25,17 @@ fn main() { fn main() { substrate_wasm_builder::WasmBuilder::init_with_defaults() .enable_metadata_hash("NODL", 11) - .build() + .build(); + // Since token name is different for our testnet, we need to build a separate binary + substrate_wasm_builder::WasmBuilder::init_with_defaults() + .set_file_name("wasm_binary_test.rs") + .enable_metadata_hash("notNodl", 11) + .build(); + // Since token name is different for our local/dev chain, we need to build a separate binary + substrate_wasm_builder::WasmBuilder::init_with_defaults() + .set_file_name("wasm_binary_dev.rs") + .enable_metadata_hash("devNodl", 11) + .build(); } #[cfg(not(feature = "std"))] diff --git a/runtimes/eden/src/lib.rs b/runtimes/eden/src/lib.rs index 7080aced0e7..de4e4b53577 100644 --- a/runtimes/eden/src/lib.rs +++ b/runtimes/eden/src/lib.rs @@ -24,6 +24,18 @@ #[cfg(feature = "std")] include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); +#[cfg(all(feature = "std", feature = "metadata-hash"))] +pub mod wasm_binary_test { + // include wasm binary for testnet + include!(concat!(env!("OUT_DIR"), "/wasm_binary_test.rs")); +} + +#[cfg(all(feature = "std", feature = "metadata-hash"))] +pub mod wasm_binary_dev { + // include wasm binary for dev chain + include!(concat!(env!("OUT_DIR"), "/wasm_binary_dev.rs")); +} + /// Wasm binary unwrapped. If built with `SKIP_WASM_BUILD`, the function panics. #[cfg(feature = "std")] pub fn wasm_binary_unwrap() -> &'static [u8] {