Skip to content

Commit

Permalink
Merge pull request #2178 from iron-fish/staging
Browse files Browse the repository at this point in the history
STAGING -> MASTER
  • Loading branch information
NullSoldier committed Sep 14, 2022
2 parents 0725b77 + 4394b7b commit 46d759c
Show file tree
Hide file tree
Showing 100 changed files with 970 additions and 522 deletions.
18 changes: 11 additions & 7 deletions ironfish-cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
FROM node:16.15.1-bullseye as build
ENV PATH="/root/.cargo/bin:${PATH}"

COPY ./ ./

RUN \
apt-get update && \
apt-get install jq rsync gcc cmake python -y && \
curl https://sh.rustup.rs -sSf | sh -s -- -y && \
./ironfish-cli/scripts/build.sh
apt-get install jq rsync gcc cmake python -y

RUN curl https://sh.rustup.rs -sSf | sh -s -- -y

WORKDIR ./app

COPY ./ ./

RUN ./ironfish-cli/scripts/build.sh

FROM node:16.15.1-bullseye-slim
EXPOSE 8020:8020
Expand All @@ -21,8 +25,8 @@ RUN \
apt-get install curl libc6 -y

WORKDIR /usr/src
COPY --from=build /ironfish-cli/build.cli/ironfish-cli ./app
COPY --from=build /ironfish-cli/scripts/entrypoint.sh ./app/
COPY --from=build /app/ironfish-cli/build.cli/ironfish-cli ./app
COPY --from=build /app/ironfish-cli/scripts/entrypoint.sh ./app/
RUN chmod +x ./app/entrypoint.sh

WORKDIR /usr/src/app
Expand Down
12 changes: 9 additions & 3 deletions ironfish-cli/jest.setup.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
const fs = require('fs')
const path = require('path')

const TEST_DATA_DIR = path.join(process.cwd(), 'testdbs')

module.exports = async () => {
if (fs.existsSync('./testdbs')) {
fs.rmSync('./testdbs', { recursive: true })
if (fs.existsSync(TEST_DATA_DIR)) {
fs.rmSync(TEST_DATA_DIR, { recursive: true, force: true })
}

fs.mkdirSync('./testdbs')
fs.mkdirSync(TEST_DATA_DIR)
}
10 changes: 5 additions & 5 deletions ironfish-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ironfish",
"version": "0.1.45",
"version": "0.1.46",
"description": "CLI for running and interacting with an Iron Fish node",
"author": "Iron Fish <[email protected]> (https://ironfish.network)",
"main": "build/src/index.js",
Expand Down Expand Up @@ -44,7 +44,7 @@
"lint:fix": "tsc -b && eslint --ext .ts,.tsx,.js,.jsx src/ --fix",
"start:dev": "node start",
"start": "yarn build && yarn start:js",
"start:js": "cross-env OCLIF_TS_NODE=0 IRONFISH_DEBUG=1 node --expose-gc --inspect --inspect-publish-uid=http --enable-source-maps bin/run",
"start:js": "cross-env OCLIF_TS_NODE=0 IRONFISH_DEBUG=1 node --expose-gc --inspect=:0 --inspect-publish-uid=http --enable-source-maps bin/run",
"test": "yarn clean && tsc -b && tsc -b tsconfig.test.json && jest --maxWorkers=1 --passWithNoTests",
"test:coverage:html": "tsc -b tsconfig.test.json && jest --maxWorkers=1 --passWithNoTests --coverage --coverage-reporters html --testPathIgnorePatterns",
"test:watch": "tsc -b tsconfig.test.json && jest --watch --coverage false",
Expand All @@ -54,10 +54,10 @@
"oclif:version": "oclif readme && git add README.md"
},
"dependencies": {
"@ironfish/rust-nodejs": "0.1.12",
"@ironfish/sdk": "0.0.22",
"@aws-sdk/client-s3": "3.127.0",
"@oclif/core": "1.6.1",
"@ironfish/rust-nodejs": "0.1.13",
"@ironfish/sdk": "0.0.23",
"@oclif/core": "1.16.1",
"@oclif/plugin-help": "5.1.12",
"@oclif/plugin-not-found": "2.3.1",
"@types/tar": "6.1.1",
Expand Down
2 changes: 1 addition & 1 deletion ironfish-cli/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ cp -R ../../build ./
echo "Copying node_modules"
# Exclude fsevents to fix brew audit error:
# "Binaries built for a non-native architecture were installed into ironfish's prefix"
rsync -L -avrq --exclude 'ironfish' --exclude 'fsevents' ../../../node_modules ./
rsync -L -avrq --exclude '@ironfish/rust-nodejs/target' --exclude 'ironfish' --exclude 'fsevents' ../../../node_modules ./
# Copy node_modules from ironfish-cli folder into the production node_modules folder
# yarn --production seems to split some packages into different folders for some reason
# if ../../node_modules/ is empty then the cp command will error so skip copying
Expand Down
4 changes: 2 additions & 2 deletions ironfish-cli/src/commands/accounts/address.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class AddressCommand extends IronfishCommand {
generate: Flags.boolean({
char: 'g',
default: false,
description: 'generate a new address',
description: 'Generate a new address',
}),
}

Expand All @@ -25,7 +25,7 @@ export class AddressCommand extends IronfishCommand {
name: 'account',
parse: (input: string): Promise<string> => Promise.resolve(input.trim()),
required: false,
description: 'name of the account to get the address for',
description: 'Name of the account to get the address for',
},
]

Expand Down
2 changes: 1 addition & 1 deletion ironfish-cli/src/commands/accounts/balance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class BalanceCommand extends IronfishCommand {
name: 'account',
parse: (input: string): Promise<string> => Promise.resolve(input.trim()),
required: false,
description: 'name of the account to get balance for',
description: 'Name of the account to get balance for',
},
]

Expand Down
2 changes: 1 addition & 1 deletion ironfish-cli/src/commands/accounts/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class CreateCommand extends IronfishCommand {
name: 'name',
parse: (input: string): Promise<string> => Promise.resolve(input.trim()),
required: false,
description: 'name of the account',
description: 'Name of the account',
},
]

Expand Down
4 changes: 2 additions & 2 deletions ironfish-cli/src/commands/accounts/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ export class ExportCommand extends IronfishCommand {
name: 'account',
parse: (input: string): Promise<string> => Promise.resolve(input.trim()),
required: false,
description: 'name of the account to export',
description: 'Name of the account to export',
},
{
name: 'path',
parse: (input: string): Promise<string> => Promise.resolve(input.trim()),
required: false,
description: 'a path to export the account to',
description: 'The path to export the account to',
},
]

Expand Down
4 changes: 2 additions & 2 deletions ironfish-cli/src/commands/accounts/import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class ImportCommand extends IronfishCommand {
rescan: Flags.boolean({
allowNo: true,
default: true,
description: 'rescan the blockchain once the account is imported',
description: 'Rescan the blockchain once the account is imported',
}),
}

Expand All @@ -23,7 +23,7 @@ export class ImportCommand extends IronfishCommand {
name: 'path',
parse: (input: string): Promise<string> => Promise.resolve(input.trim()),
required: false,
description: 'a path to import the account from',
description: 'The path to import the account from',
},
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { IronfishCommand } from '../../command'
import { RemoteFlags } from '../../flags'

export class ListCommand extends IronfishCommand {
static aliases = ['accounts:list']
static description = `List all the accounts on the node`

static flags = {
Expand Down
2 changes: 1 addition & 1 deletion ironfish-cli/src/commands/accounts/notes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class NotesCommand extends IronfishCommand {
name: 'account',
parse: (input: string): Promise<string> => Promise.resolve(input.trim()),
required: false,
description: 'name of the account to get notes for',
description: 'Name of the account to get notes for',
},
]

Expand Down
14 changes: 7 additions & 7 deletions ironfish-cli/src/commands/accounts/pay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,27 @@ export class Pay extends IronfishCommand {
...RemoteFlags,
account: Flags.string({
char: 'f',
description: 'the account to send money from',
description: 'The account to send money from',
}),
amount: Flags.string({
char: 'a',
description: 'amount of coins to send in IRON',
description: 'Amount of coins to send in IRON',
}),
to: Flags.string({
char: 't',
description: 'the public address of the recipient',
description: 'The public address of the recipient',
}),
fee: Flags.string({
char: 'o',
description: 'the fee amount in IRON',
description: 'The fee amount in IRON',
}),
memo: Flags.string({
char: 'm',
description: 'the memo of transaction',
description: 'The memo of transaction',
}),
confirm: Flags.boolean({
default: false,
description: 'confirm without asking',
description: 'Confirm without asking',
}),
expirationSequence: Flags.integer({
char: 'e',
Expand All @@ -69,7 +69,7 @@ export class Pay extends IronfishCommand {

const client = await this.sdk.connectRpc(false, true)

const status = await client.status()
const status = await client.getNodeStatus()

if (!status.content.blockchain.synced) {
this.log(
Expand Down
4 changes: 2 additions & 2 deletions ironfish-cli/src/commands/accounts/remove.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ export class RemoveCommand extends IronfishCommand {
{
name: 'name',
required: true,
description: 'name of the account',
description: 'Name of the account',
},
]

static flags = {
...RemoteFlags,
confirm: Flags.boolean({
description: 'suppress the confirmation prompt',
description: 'Suppress the confirmation prompt',
}),
}

Expand Down
4 changes: 2 additions & 2 deletions ironfish-cli/src/commands/accounts/rescan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ export class RescanCommand extends IronfishCommand {
follow: Flags.boolean({
char: 'f',
default: true,
description: 'follow the rescan live, or attach to an already running rescan',
description: 'Follow the rescan live, or attach to an already running rescan',
allowNo: true,
}),
reset: Flags.boolean({
default: false,
description:
'clear the in-memory and disk caches before rescanning. note that this removes all pending transactions',
'Clear the in-memory and disk caches before rescanning. Note that this removes all pending transactions',
}),
local: Flags.boolean({
default: false,
Expand Down
4 changes: 2 additions & 2 deletions ironfish-cli/src/commands/accounts/transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ export class TransactionsCommand extends IronfishCommand {
...CliUx.ux.table.flags(),
account: Flags.string({
char: 'a',
description: 'account transactions',
description: 'Account to get transactions for',
}),
hash: Flags.string({
char: 't',
description: 'details of transaction hash',
description: 'Transaction hash to get details for',
}),
}

Expand Down
2 changes: 1 addition & 1 deletion ironfish-cli/src/commands/accounts/use.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class UseCommand extends IronfishCommand {
{
name: 'name',
required: true,
description: 'name of the account',
description: 'Name of the account',
},
]

Expand Down
10 changes: 5 additions & 5 deletions ironfish-cli/src/commands/backup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@ export default class Backup extends IronfishCommand {
lock: Flags.boolean({
default: true,
allowNo: true,
description: 'wait for the database to stop being used',
description: 'Wait for the database to stop being used',
}),
chain: Flags.boolean({
default: true,
allowNo: true,
description: 'export the chain DB',
description: 'Export the chain DB',
}),
accounts: Flags.boolean({
default: false,
allowNo: true,
description: 'export the accounts',
description: 'Export the accounts',
}),
mined: Flags.boolean({
default: false,
allowNo: true,
description: 'export the mined block index',
description: 'Export the mined block index',
}),
accessKeyId: Flags.string({
char: 'a',
Expand All @@ -57,7 +57,7 @@ export default class Backup extends IronfishCommand {
{
name: 'bucket',
required: true,
description: 'the S3 bucket to upload to',
description: 'The S3 bucket to upload to',
},
]

Expand Down
4 changes: 2 additions & 2 deletions ironfish-cli/src/commands/blocks/show.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import { IronfishCommand } from '../../command'
import { LocalFlags } from '../../flags'

export default class ShowBlock extends IronfishCommand {
static description = 'Show the block header of a requested hash'
static description = 'Show the block header of a requested hash or sequence'

static args = [
{
name: 'search',
parse: (input: string): Promise<string> => Promise.resolve(input.trim()),
required: true,
description: 'the hash or sequence of the block to look at',
description: 'The hash or sequence of the block to look at',
},
]

Expand Down
2 changes: 1 addition & 1 deletion ironfish-cli/src/commands/chain/download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default class Download extends IronfishCommand {
}),
confirm: Flags.boolean({
default: false,
description: 'confirm without asking',
description: 'Confirm without asking',
}),
}

Expand Down
6 changes: 3 additions & 3 deletions ironfish-cli/src/commands/chain/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default class Export extends IronfishCommand {
char: 'p',
parse: (input: string): Promise<string> => Promise.resolve(input.trim()),
required: false,
description: 'a path to export the chain to',
description: 'The path to export the chain to',
}),
}

Expand All @@ -28,13 +28,13 @@ export default class Export extends IronfishCommand {
parse: (input: string): Promise<number | null> => Promise.resolve(parseNumber(input)),
default: Number(GENESIS_BLOCK_SEQUENCE),
required: false,
description: 'the sequence to start at (inclusive, genesis block is 1)',
description: 'The sequence to start at (inclusive, genesis block is 1)',
},
{
name: 'stop',
parse: (input: string): Promise<number | null> => Promise.resolve(parseNumber(input)),
required: false,
description: 'the sequence to end at (inclusive)',
description: 'The sequence to end at (inclusive)',
},
]

Expand Down
2 changes: 1 addition & 1 deletion ironfish-cli/src/commands/chain/readd-block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default class ReAddBlock extends IronfishCommand {
name: 'hash',
parse: (input: string): Promise<string> => Promise.resolve(input.trim()),
required: true,
description: 'the hash of the block in hex format',
description: 'The hash of the block in hex format',
},
]

Expand Down
4 changes: 2 additions & 2 deletions ironfish-cli/src/commands/chain/repair.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ export default class RepairChain extends IronfishCommand {
confirm: Flags.boolean({
char: 'c',
default: false,
description: 'force confirmation to repair',
description: 'Force confirmation to repair',
}),
force: Flags.boolean({
char: 'f',
default: false,
description: 'force merkle tree reconstruction',
description: 'Force merkle tree reconstruction',
}),
}

Expand Down
Loading

0 comments on commit 46d759c

Please sign in to comment.