mirror of
https://github.com/mempool/mempool.git
synced 2025-02-24 14:50:52 +01:00
Merge pull request #4093 from mempool/fix/packaging-rust-gbt
Fix: Rust-GBT packaging needs fixing
This commit is contained in:
commit
45ddab519d
5 changed files with 32 additions and 7 deletions
14
backend/npm_package.sh
Executable file
14
backend/npm_package.sh
Executable file
|
@ -0,0 +1,14 @@
|
|||
#/bin/sh
|
||||
set -e
|
||||
|
||||
npm run build
|
||||
# Remove previous package folder
|
||||
rm -rf package
|
||||
# Move JS and deps
|
||||
mv dist package
|
||||
mv node_modules package
|
||||
# Remove symlink for rust-gbt and insert real folder
|
||||
rm package/node_modules/rust-gbt
|
||||
mv rust-gbt package/node_modules
|
||||
# Clean up deps
|
||||
npm run package-rm-build-deps
|
12
backend/npm_package_rm_build_deps.sh
Executable file
12
backend/npm_package_rm_build_deps.sh
Executable file
|
@ -0,0 +1,12 @@
|
|||
#/bin/sh
|
||||
set -e
|
||||
|
||||
# Cleaning up inside the node_modules folder
|
||||
cd package/node_modules
|
||||
rm -r \
|
||||
typescript \
|
||||
@typescript-eslint \
|
||||
@napi-rs \
|
||||
./rust-gbt/src \
|
||||
./rust-gbt/Cargo.toml \
|
||||
./rust-gbt/build.rs
|
|
@ -22,10 +22,10 @@
|
|||
"main": "index.ts",
|
||||
"scripts": {
|
||||
"tsc": "./node_modules/typescript/bin/tsc -p tsconfig.build.json",
|
||||
"build": "npm run build-rust && npm run tsc && npm run create-resources",
|
||||
"build": "npm run tsc && npm run create-resources",
|
||||
"create-resources": "cp ./src/tasks/price-feeds/mtgox-weekly.json ./dist/tasks && node dist/api/fetch-version.js",
|
||||
"package": "npm run build && rm -rf package && mv dist package && mv node_modules package && mv rust-gbt package && npm run package-rm-build-deps",
|
||||
"package-rm-build-deps": "(cd package/node_modules; rm -r typescript @typescript-eslint @napi-rs ../rust-gbt/target ../rust-gbt/node_modules ../rust-gbt/src)",
|
||||
"package": "./npm_package.sh",
|
||||
"package-rm-build-deps": "./npm_package_rm_build_deps.sh",
|
||||
"start": "node --max-old-space-size=2048 dist/index.js",
|
||||
"start-production": "node --max-old-space-size=16384 dist/index.js",
|
||||
"reindex-updated-pools": "npm run start-production --update-pools",
|
||||
|
@ -33,8 +33,7 @@
|
|||
"test": "./node_modules/.bin/jest --coverage",
|
||||
"lint": "./node_modules/.bin/eslint . --ext .ts",
|
||||
"lint:fix": "./node_modules/.bin/eslint . --ext .ts --fix",
|
||||
"prettier": "./node_modules/.bin/prettier --write \"src/**/*.{js,ts}\"",
|
||||
"build-rust": "cd rust-gbt && npm install"
|
||||
"prettier": "./node_modules/.bin/prettier --write \"src/**/*.{js,ts}\""
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.21.3",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import fs from 'fs';
|
||||
import { GbtGenerator, ThreadTransaction } from '../../../rust-gbt';
|
||||
import { GbtGenerator, ThreadTransaction } from 'rust-gbt';
|
||||
import path from 'path';
|
||||
|
||||
const baseline = require('./test-data/target-template.json');
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { GbtGenerator, GbtResult, ThreadTransaction as RustThreadTransaction, ThreadAcceleration as RustThreadAcceleration } from '../../rust-gbt';
|
||||
import { GbtGenerator, GbtResult, ThreadTransaction as RustThreadTransaction, ThreadAcceleration as RustThreadAcceleration } from 'rust-gbt';
|
||||
import logger from '../logger';
|
||||
import { MempoolBlock, MempoolTransactionExtended, TransactionStripped, MempoolBlockWithTransactions, MempoolBlockDelta, Ancestor, CompactThreadTransaction, EffectiveFeeStats, PoolTag } from '../mempool.interfaces';
|
||||
import { Common, OnlineFeeStatsCalculator } from './common';
|
||||
|
|
Loading…
Add table
Reference in a new issue