Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: expose opcodes endpoint by default #638

Merged
merged 5 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 4 additions & 0 deletions compose-network/mirror-node/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,7 @@ hedera:
operator:
accountId: 0.0.2
privateKey: 302e020100300506032b65700422042091132178e72057a1d7528025956fe39b0b847f200ab59b2fdd367017f3087137
web3:
opcode:
tracer:
enabled: true
8 changes: 8 additions & 0 deletions docs/custom-sub-system-configs.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,11 @@ The following table lists the available properties along with their default valu
| `hedera.mirror.monitor.nodes[].host` | "" | The main node's hostname |
| `hedera.mirror.monitor.operator.accountId` | "" | Operator account ID used to pay for transactions |
| `hedera.mirror.monitor.operator.privateKey` | "" | Operator ED25519 private key used to sign transactions in hex encoded DER format |

## Web3 API

The following table lists the available properties along with their default values.

| Name | Default | Description |
|--------------------------------------------|---------|------------------------------------------------------------------------------------|
| `hedera.mirror.web3.opcode.tracer.enabled` | true | Whether the `/contracts/results/{transactionIdOrHash}/opcodes` endpoint is exposed |
49 changes: 34 additions & 15 deletions test/unit/states/InitState.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@ import yaml from 'js-yaml';
import { join } from 'path';
import { SinonSandbox, SinonSpy, SinonStub, SinonStubbedInstance } from 'sinon';
import {
APPLICATION_YML_RELATIVE_PATH,
INIT_STATE_BOOTSTRAPPED_PROP_SET,
INIT_STATE_CONFIGURING_ENV_VARIABLES_FINISH,
INIT_STATE_INIT_MESSAGE,
INIT_STATE_MIRROR_PROP_SET,
INIT_STATE_NO_ENV_VAR_CONFIGURED,
INIT_STATE_NO_NODE_CONF_NEEDED,
INIT_STATE_RELAY_LIMITS_DISABLED,
INIT_STATE_START_DOCKER_CHECK,
INIT_STATE_STARTING_MESSAGE,
NECESSARY_PORTS,
NETWORK_NODE_CONFIG_DIR_PATH,
OPTIONAL_PORTS,
RECORD_PARSER_SOURCE_REL_PATH
APPLICATION_YML_RELATIVE_PATH,
INIT_STATE_BOOTSTRAPPED_PROP_SET,
INIT_STATE_CONFIGURING_ENV_VARIABLES_FINISH,
INIT_STATE_INIT_MESSAGE,
INIT_STATE_MIRROR_PROP_SET,
INIT_STATE_NO_ENV_VAR_CONFIGURED,
INIT_STATE_NO_NODE_CONF_NEEDED,
INIT_STATE_RELAY_LIMITS_DISABLED,
INIT_STATE_START_DOCKER_CHECK,
INIT_STATE_STARTING_MESSAGE,
NECESSARY_PORTS,
NETWORK_NODE_CONFIG_DIR_PATH,
OPTIONAL_PORTS,
RECORD_PARSER_SOURCE_REL_PATH
} from '../../../src/constants';
import { ConfigurationData } from '../../../src/data/ConfigurationData';
import { CLIService } from '../../../src/services/CLIService';
Expand Down Expand Up @@ -230,6 +230,13 @@ describe('InitState tests', () => {
},
monitor: {
nodes: {}
},
web3: {
opcode: {
tracer: {
enabled: true
}
}
}
}
}
Expand Down Expand Up @@ -355,7 +362,19 @@ describe('InitState tests', () => {
testSandbox.assert.called(fsReadFileSync);
testSandbox.assert.called(fsWriteFileSync);
testSandbox.assert.called(ymlLoad);
testSandbox.assert.called(ymlDump);
testSandbox.assert.calledWithMatch(ymlDump, {
hedera: {
mirror: {
web3 : {
opcode: {
tracer: {
enabled: true
}
}
}
}
}
});

configureMirrorNodePropertiesStub = testSandbox.stub(initState as any, 'configureMirrorNodeProperties')
})
Expand Down
Loading