Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@metaplex-foundation/amman
Advanced tools
A modern mandatory toolbelt to help test solana SDK libraries and apps on a locally running validator.
A m odern man datory toolbelt to help test solana SDK libraries and apps on a locally running validator.
Table of Contents generated with DocToc
Aside from providing a CLI for various tasks, amman also provides commonly used actions, transactions, asserts and more via an API. Please find the API docs here.
amman [command]
Commands:
amman start Launches a solana-test-validator and the amman relay and/or
mock storage if so configured
amman stop Stops the relay and storage and kills the running solana
test validator
amman logs Launches 'solana logs' and pipes them through a prettifier
amman airdrop Airdrops provided Sol to the payer
amman label Adds labels for accounts or transactions to amman
amman account Retrieves account information for a PublicKey or a label or
shows all labeled accounts
amman run Executes the provided command after expanding all address
labels
Options:
--help Show help [boolean]
--version Show version number [boolean]
amman start <config.js>
If no config.js
is provided amman looks for an .ammanrc.js
file in the current directory.
If that isn't found either it uses a default config.
The config should be a JavaScript module exporting 'validator' with any of the below properties:
Below is an example config with all values set to the defaults except for an added
program and a relay
and storage
config.
A amman-explorer relay is launched automatically with the validator unless it is running in a CI environment and if a relay is already running on the known relay port, it is killed first.
A mock storage is launched only if a storage
config is provided. In case a storage server
is already running on the known storage port, it is killed first.
import { LOCALHOST, tmpLedgerDir } from '@metaplex-foundation/amman'
module.exports = {
validator: {
killRunningValidators: true,
programs: [
{
label: 'Token Metadata Program',
programId: programIds.metadata,
deployPath: localDeployPath('mpl_token_metadata')
},
],
jsonRpcUrl: LOCALHOST,
websocketUrl: '',
commitment: 'confirmed',
ledgerDir: tmpLedgerDir(),
resetLedger: true,
verifyFees: false,
detached: process.env.CI != null,
},
relay: {
enabled: process.env.CI == null,
killlRunningRelay: true,
},
storage: {
enabled: process.env.CI == null,
storageId: 'mock-storage',
clearOnStart: true,
},
}
Below is an example of a config where the accounts are being pulled from a specific RPC endpoint.
module.exports = {
validator: {
// By default Amman will pull the account data from the accountsCluster (can be overridden on a per account basis)
accountsCluster: 'https://api.metaplex.solana.com',
accounts: [
{
label: 'Token Metadata Program',
accountId:'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s',
// marking executable as true will cause Amman to pull the executable data account as well automatically
executable: true,
},
{
label: 'Random other account',
accountId:'4VLgNs1jXgdciSidxcaLKfrR9WjATkj6vmTm5yCwNwui',
// By default executable is false and is not required to be in the config
// executable: false,
// Providing a cluster here will override the accountsCluster field
cluster: 'https://metaplex.devnet.rpcpool.com'
}
]
}
}
For the different clusters like devnet some features are disabled. By default the locally running solana-test-validator does not disable any features and thus behaves differently than the provided clusters.
In order to run tests in a scenario that is closer to how they would run against a specific cluster you can match the features of it via the matchFeatures config property:
module.exports = {
validator: {
...
// The below disables any features that are deactivated for the `mainnet-beta` cluster
matchFeatures: 'mainnet-beta',
}
}
If you want to explicitly disable a set of features you can do so via the deactivateFeatures property:
module.exports = {
validator: {
...
deactivateFeatures: ['21AWDosvp3pBamFW91KB35pNoaoZVTM7ess8nr2nt53B'],
}
}
NOTE: that only one of the above properties can be set
Apache-2.0
FAQs
A modern mandatory toolbelt to help test solana SDK libraries and apps on a locally running validator.
The npm package @metaplex-foundation/amman receives a total of 3,346 weekly downloads. As such, @metaplex-foundation/amman popularity was classified as popular.
We found that @metaplex-foundation/amman demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.