Skip to content

Commit

Permalink
Update upstream (#2)
Browse files Browse the repository at this point in the history
* parent a842e89
author palkeo <[email protected]> 1585800064 +1300
committer Karlo Majer <[email protected]> 1612348569 +0100

parent a842e89
author palkeo <[email protected]> 1585800064 +1300
committer Karlo Majer <[email protected]> 1612348549 +0100

parent a842e89
author palkeo <[email protected]> 1585800064 +1300
committer Karlo Majer <[email protected]> 1612348467 +0100

parent a842e89
author palkeo <[email protected]> 1585800064 +1300
committer Karlo Majer <[email protected]> 1612348442 +0100

parent a842e89
author palkeo <[email protected]> 1585800064 +1300
committer Karlo Majer <[email protected]> 1612348311 +0100

Remove the code that changes the port if it's the same as --fork.

See issue #722

fix: Handle SIGINT, SIGTERM, & SIGHUP gracefully (#739)

feat: opt-in deasync server startup (#735)

* Add deasync lib

* Update cli.js - deasync startup

* Seems to work on Windows okay now

* Make deasync an optional dep

* Remove try/catch for windows support

* Make `deasync` opt-in with cli flag

* Don't pass the new option to core

Co-authored-by: David Murdoch <[email protected]>

build: update webpack 4.18 -> 4.43 (#742)

build: add semantic-release (#743)

fix: deasync option documentation (#746)

build: add otp script (#748)

* Add 2fa module

* Add release script for OTP

* Update github workflow to generate OTP for env

* Update generate OTP script so it works, probably.

Co-authored-by: David Murdoch <[email protected]>

build: fix otp script path in package.json

build: remove OTP script exec from github action

build: set otp during release process (#753)

* build: testing github actions

* build: add `internal` branch to github actions

* build: might as well try this

* build: maybe it's a timing issue

* build: add comment about intent

* .

* .

* deparate

* .

* Try caching npm node modules

* did it cache?

* cache did nothing

* Remove the "internal" release

chore: update otp comment (#755)

chore: remove unused vars (#756)

chore: remove deasync since it isn't actually useful (#762)

chore: update ganache-core to v2.11.0-beta.0

feat: add `forkCacheSize` option (#763)

build: update Docker file to work with ganache-core>=2.11.0-beta.0

build: update semantic-release to v17.1.1

build: commit release version updates to git

6.10.0-beta.2

fix: fix automatic deployments

chore: update ganache-core to v2.11.2

docs: change min Node.js version from 6 to 8 in README

chore: update docker config for latest ganache-core

6.10.1

* fix automatic deployments ([06e4fad](trufflesuite/ganache@06e4fad))

fix(deps): update ganache-core to v2.11.3-beta.0

6.10.1-beta.1

* fix automatic deployments ([06e4fad](trufflesuite/ganache@06e4fad))

docs: add commit format info to readme (#782)

chore: bump ethereumjs-util to 6.2.1 (#770)

feat: add `chainId` option (#787)

docs: add documentation for the `chainId` flag

6.11.0

* Update ganache-core to v2.12.1 ([5a12da4](trufflesuite/ganache@5a12da4))

* add `chainId` option ([#787](trufflesuite/ganache#787)) ([61ba4e3](trufflesuite/ganache@61ba4e3))
* add evm_(un)lockUnknownAccount by updating ganache-core to v2.12.0-beta.0 ([4e29e6e](trufflesuite/ganache@4e29e6e))

fix: remove unneeded COPY command from docker build (#790)

chore: add `alpha` release automation

chore: add `alpha` release automation

chore: try workaround for ssh://git@github packages in CI

chore: trigger docker build for the alpha tag

6.11.1-alpha.2

6.11.1-alpha.1

* install ganache-core v2.13.0-alpha.2 ([2df40c0](trufflesuite/ganache@2df40c0))
* remove unneeded COPY command from docker build ([#790](trufflesuite/ganache#790)) ([31e6cf0](trufflesuite/ganache@31e6cf0))
* update ganache-core to v2.12.2-beta.0 to fix Node v14 compat ([#791](trufflesuite/ganache#791)) ([c3adce9](trufflesuite/ganache@c3adce9))

fix: update ganache-core to v2.13.0-beta.0

fixes husky erroneous installation issue

6.11.1-beta.1

* install ganache-core v2.13.0-alpha.2 ([2df40c0](trufflesuite/ganache@2df40c0))
* remove unneeded COPY command from docker build ([#790](trufflesuite/ganache#790)) ([31e6cf0](trufflesuite/ganache@31e6cf0))
* update ganache-core to v2.12.2-beta.0 to fix Node v14 compat ([#791](trufflesuite/ganache#791)) ([c3adce9](trufflesuite/ganache@c3adce9))
* update ganache-core to v2.13.0-beta.0 ([2de7bdd](trufflesuite/ganache@2de7bdd))

feat: update ganache-core to v2.13.0

chore: update webpack-cli to v3.3.12

docs: expand abbreviated flags in README.md (#793)

fix: update ganache-core to v2.13.1

6.12.0

* install ganache-core v2.13.0-alpha.2 ([2df40c0](trufflesuite/ganache@2df40c0))
* remove unneeded COPY command from docker build ([#790](trufflesuite/ganache#790)) ([31e6cf0](trufflesuite/ganache@31e6cf0))
* update ganache-core to v2.12.2-beta.0 to fix Node v14 compat ([#791](trufflesuite/ganache#791)) ([c3adce9](trufflesuite/ganache@c3adce9))
* update ganache-core to v2.13.0-beta.0 ([2de7bdd](trufflesuite/ganache@2de7bdd))

* update ganache-core to v2.13.0 ([1e7ad11](trufflesuite/ganache@1e7ad11))

6.12.1

* update ganache-core to v2.13.1 ([3c0dc40](trufflesuite/ganache@3c0dc40))

docs: change typo in unlock and lock accounts (#802)

fix: update ganache-core to v2.13.2

6.12.2

* update ganache-core to v2.13.2 ([cbb1d71](trufflesuite/ganache@cbb1d71))

* Update Ganache CLI to upstream

* Remove release object

Co-authored-by: palkeo <[email protected]>
  • Loading branch information
karlomajer and palkeo authored Feb 3, 2021
1 parent a85deb5 commit 3f0181c
Show file tree
Hide file tree
Showing 9 changed files with 3,697 additions and 367 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: ganache-cli CD

on:
push:
branches: [ master, beta, alpha ]

jobs:
release:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '10'

- name: Apply workaround for git:// packages
run: git config --global url.https://github.com/.insteadOf ssh://[email protected]/

- name: Install
run: npm ci

- name: Build
run: npm run build

- name: Release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_OTP_KEY: ${{ secrets.NPM_OTP_KEY }}
run: npm run otp && npx semantic-release
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ TODO
.DS_Store
.tern-port
.vscode
build
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ FROM mhart/alpine-node:14 as runtime

WORKDIR /app

COPY --from=builder "/app/build/ganache-core.docker.cli.js" "./ganache-core.docker.cli.js"
COPY --from=builder "/app/build/ganache-core.docker.cli.js.map" "./ganache-core.docker.cli.js.map"
COPY --from=builder "/app/node_modules/scrypt/build/Release" "./node_modules/scrypt/build/Release/"
COPY --from=builder "/app/node_modules/sha3/build/Release" "./node_modules/sha3/build/Release/"

ENV DOCKER true

Expand Down
309 changes: 185 additions & 124 deletions README.md

Large diffs are not rendered by default.

42 changes: 42 additions & 0 deletions args.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,19 @@ module.exports = exports = function (yargs, version, isDocker) {
"Fork from another currently running Ethereum client at a given block. Input should be the HTTP location and port of the other client, e.g. 'http://localhost:8545' or optionally provide a block number 'http://localhost:8545@1599200'",
default: false,
})
.option('forkCacheSize', {
group: 'Chain:',
type: 'number',
describe:
'The maximum size, in bytes, of the in-memory cache for queries on a chain fork. Defaults to `1_073_741_824` bytes (1 gigabyte). You can set this to `0` to disable caching (not recommended), or to `-1` for unlimited (will be limited by your node process).',
default: 1073741824,
})
.option('forkCacheSize', {
group: 'Chain:',
type: 'number',
describe: "The maximum size, in bytes, of the in-memory cache for queries on a chain fork. Defaults to `1_073_741_824` bytes (1 gigabyte). You can set this to `0` to disable caching (not recommended), or to `-1` for unlimited (will be limited by your node process).",
default: 1073741824
})
.option('db', {
group: 'Chain:',
describe: "Directory of chain database; creates one if it doesn't exist",
Expand All @@ -107,6 +120,13 @@ module.exports = exports = function (yargs, version, isDocker) {
conflicts: 'd',
demandOption: false,
})
.option('hdPath', {
group: 'Accounts:',
alias: 'hd_path',
describe: `The hierarchical deterministic path to use when generating accounts. Default: "m/44'/60'/0'/0/"`,
type: 'string',
demandOption: false,
})
.option('d', {
group: 'Chain:',
alias: 'deterministic',
Expand Down Expand Up @@ -147,6 +167,21 @@ module.exports = exports = function (yargs, version, isDocker) {
defaultDescription: 'System time at process start or Network ID of forked blockchain if configured.',
demandOption: false,
})
.option('chainId', {
group: 'Chain:',
type: 'number',
describe: 'The Chain ID ganache-cli will use for `eth_chainId` RPC and the `CHAINID` opcode.',
defaultDescription:
'For legacy reasons, the default is currently `1337` for `eth_chainId` RPC and `1` for the `CHAINID` opcode. This will be fixed in the next major version of ganache-cli and ganache-core!',
demandOption: false,
})
.option('chainId', {
group: 'Chain:',
type: 'number',
describe: "The Chain ID ganache-cli will use for `eth_chainId` RPC and the `CHAINID` opcode.",
defaultDescription: "For legacy reasons, the default is currently `1337` for `eth_chainId` RPC and `1` for the `CHAINID` opcode. This will be fixed in the next major version of ganache-cli and ganache-core!",
demandOption: false
})
.option('g', {
group: 'Chain:',
alias: 'gasPrice',
Expand All @@ -168,6 +203,13 @@ module.exports = exports = function (yargs, version, isDocker) {
type: 'number',
default: 0x6691b7,
})
.option('callGasLimit', {
group: 'Chain:',
describe:
'Sets the transaction gas limit for `eth_call` and `eth_estimateGas` calls. Must be specified as a hex string. Defaults to "0x1fffffffffffff" (Number.MAX_SAFE_INTEGER)',
type: 'number',
default: 0x1fffffffffffff,
})
.option('allowUnlimitedContractSize', {
group: 'Chain:',
describe:
Expand Down
6 changes: 6 additions & 0 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,21 +93,27 @@ var options = {
gasPrice: argv.g,
gasPriceFeeCurrencyRatio: argv.gpfcr,
gasLimit: argv.l,
callGasLimit: argv.callGasLimit,
accounts: parseAccounts(argv.account),
unlocked_accounts: argv.unlock,
fork: argv.f,
forkCacheSize: argv.forkCacheSize,
hardfork: argv.k,
network_id: argv.i,
verbose: argv.v,
secure: argv.n,
db_path: argv.db,
db_path_tar: argv.db_tar,
hd_path: argv.hdPath,
account_keys_path: argv.account_keys_path,
vmErrorsOnRPCResponse: !argv.noVMErrorsOnRPCResponse,
logger: logger,
allowUnlimitedContractSize: argv.allowUnlimitedContractSize,
time: argv.t,
keepAliveTimeout: argv.keepAliveTimeout,
_chainId: argv.chainId,
// gross!
_chainIdRpc: argv.chainId,
};

var fork_address;
Expand Down
19 changes: 14 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@celo/ganache-cli",
"version": "6.6.1",
"version": "6.12.2",
"bin": {
"ganache-cli": "cli.js"
},
Expand All @@ -11,10 +11,11 @@
"start-tar": "node cli.js --db_tar devchain.tar.gz",
"build": "webpack-cli --config ./webpack/webpack.node.config.js",
"docker": "docker build -t trufflesuite/ganache-cli . && docker run -p 8545:8545 trufflesuite/ganache-cli",
"prepublishOnly": "npm run build"
"otp": "node ./scripts/generate-otp.js",
"releaseNotes": "npx semantic-release --dry-run"
},
"dependencies": {
"ethereumjs-util": "6.1.0",
"ethereumjs-util": "6.2.1",
"source-map-support": "0.5.12",
"yargs": "13.2.4"
},
Expand All @@ -25,23 +26,31 @@
],
"devDependencies": {
"@celo/ganache-core": "git+https://github.com/celo-org/ganache-core.git#6d9741d",
"@semantic-release/git": "^9.0.0",
"js-scrypt": "0.2.0",
"node-loader": "^0.6.0",
"notp": "2.0.3",
"on-build-webpack": "^0.1.0",
"prepend-file": "^1.3.1",
"scrypt": "6.0.3",
"semantic-release": "^17.1.1",
"sha3": "1.2.2",
"targz": "^1.0.1",
"tmp": "^0.1.0",
"fs-extra": "^5.0.0",
"death": "^1.1.0",
"shebang-loader": "0.0.1",
"webpack": "^4.18.0",
"webpack-cli": "3.1.0"
"thirty-two": "1.0.2",
"webpack": "4.43.0",
"webpack-cli": "3.3.12"
},
"resolutions": {
"**/ethereumjs-vm": "git+https://github.com/celo-org/celo-monorepo.git#ethereumjs-vm-v4.1.3-celo3-gitpkg"
},
"optionalDependencies": {
"deasync": "0.1.20",
"scrypt": "6.0.3"
},
"repository": {
"type": "git",
"url": "https://github.com/celo-org/ganache-cli"
Expand Down
21 changes: 21 additions & 0 deletions scripts/generate-otp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const EOL = require("os").EOL;
const path = require("path");
const fs = require("fs");
// we want to generate a TOTP in the _future_, and the `notp`
// library doesn't let us do that unless we set `NODE_ENV = "test"`
process.env.NODE_ENV = "test";

const b32 = require("thirty-two");
const notp = require("notp");
const bin = b32.decode(process.env.NPM_OTP_KEY);
// generate a code 1 seconds in the future
// 1 seconds is arbitrary, and may need to be tweaked if
// the release process is discovered to be too fast or too slow.
const timeOffset = 1000;
const now = Date.now();
const time = now + timeOffset;
// _t is the time at which we want the OTP to be valid for
const otp = notp.totp.gen(bin, {_t: time});

// save to .npmrc so `npm publish` can pick it up later
fs.appendFileSync(path.join(__dirname, "..", ".npmrc"), `${EOL}otp=${otp}`);
Loading

0 comments on commit 3f0181c

Please sign in to comment.