Skip to content
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.

Add a port number as an optional config value #127

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export type Config = {
allowUnlimitedContractSize?: boolean;
// {url:port@blocknumber} for example http://localhost:8545@1599200
fork?: string;
port?: number;
unlocked_accounts?: string[];
};
};
Expand Down
2 changes: 1 addition & 1 deletion src/ganache-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ process.once('message', (options: NodeOptions) => {
// processes of test-environment may be run in parallel.
// It also means however that the port (and therefore host URL) is not
// available until the server finishes initialization.
server.listen(undefined, function (err: unknown) {
server.listen(options.port, function (err: unknown) {
if (err) {
send({ type: 'error' });
} else {
Expand Down
1 change: 1 addition & 0 deletions src/setup-ganache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export type NodeOptions = {
gasLimit?: number;
allowUnlimitedContractSize?: boolean;
fork?: string;
port?: number;
unlocked_accounts?: string[];
};

Expand Down