@darienmh/truffle-plugin-abigen
v1.0.0
Published
Truffle plugin to post-process contracts for go-ethereum's abigen
Readme
truffle-plugin-abigen
This truffle plugin generates the required files needed to use Geths abigen to generate contract bindings in golang.
Installation
- Install the plugin with npm
npm install @darienmh/truffle-plugin-abigen // or yarn add @darienmh/truffle-plugin-abigen - Add the plugin to your
truffle.jsortruffle-config.jsfilemodule.exports = { /* ... rest of truffle-config */ plugins: [ "@darienmh/truffle-plugin-abigen" ] } - Optional configuration in your
truffle.jsortruffle-config.jsfilemodule.exports = { /* ... rest of truffle-config */ abigen: { exportFolder: './abiExported/', extensionAbi: '.json', generateBin: false, exportConsole: true } }
Usage
Before running ensure that you've compiled your contracts:
truffle compileTo generate specific contract bindings:
truffle run abigen SomeContractName AnotherContractNameAlternatively, to generate bindings for all your contracts:
truffle run abigenYou can also configure the package.json file to generate abi for all your contracts on compile:
{
/* ... rest of package.json */
"scripts": {
/* ... rest of package.json */
"compile": "truffle compile --all && truffle run abigen"
}
}npm run compile
# or
yarn compileDebugging
You can pass an optional --debug flag into the plugin to display debug messages during the verification process. This is generally not necessary, but can be used to provide additional information when the plugin appears to malfunction.
