{"id":28889915,"url":"https://github.com/joincolony/trufflepig","last_synced_at":"2025-10-14T03:46:02.602Z","repository":{"id":95771717,"uuid":"118467143","full_name":"JoinColony/trufflepig","owner":"JoinColony","description":"🍄🐷Truffle contract artifact loading tool for local development","archived":false,"fork":false,"pushed_at":"2024-01-24T17:34:16.000Z","size":5870,"stargazers_count":46,"open_issues_count":25,"forks_count":6,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-06-21T00:50:21.255Z","etag":null,"topics":["ethereum","smart-contracts","truffle","web3"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JoinColony.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-01-22T14:20:46.000Z","updated_at":"2023-03-18T10:59:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"e365dd10-a3d0-4aa2-9c62-bd91dfa9bc99","html_url":"https://github.com/JoinColony/trufflepig","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/JoinColony/trufflepig","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoinColony%2Ftrufflepig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoinColony%2Ftrufflepig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoinColony%2Ftrufflepig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoinColony%2Ftrufflepig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JoinColony","download_url":"https://codeload.github.com/JoinColony/trufflepig/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoinColony%2Ftrufflepig/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279017784,"owners_count":26086145,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ethereum","smart-contracts","truffle","web3"],"created_at":"2025-06-21T00:31:24.278Z","updated_at":"2025-10-14T03:46:02.597Z","avatar_url":"https://github.com/JoinColony.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"TrufflePig 🍄🐷\n==============\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/JoinColony/trufflepig.svg?token=b94b73132757a3fad08c00bed439c04e32d424ebda92025aec686b3297b1d0fa\u0026ts=1518714748864)](https://greenkeeper.io/)\n\nTrufflePig is a development tool that provides a simple HTTP API to find and read from [Truffle](http://truffleframework.com/)-generated contract files, for use during local development.\n\n![The pig in action!](https://github.com/JoinColony/trufflepig/raw/master/docs/ui.png)\n\nInstallation\n------------\nInstall globally:\n\n```shell\n$ yarn global add trufflepig\n```\n\nOr as a devDependency to your truffle project:\n\n```shell\n$ yarn add trufflepig --dev\n```\n\n\nPrerequisites\n-------------\n* A Truffle framework project with built contract json files\n* Some means of making HTTP requests and parsing the JSON results\n\n\nUsage\n-----\n\nJust run\n\n```shell\n$ trufflepig\n```\n\nfrom your truffle project and access your contracts under\n\n```\nhttp://localhost:3030/contracts?name=MyContractName\n```\n\nand looks like this:\n\n```json\n{\n  \"contractName\": \"MyContractName\",\n  \"abi\": {},\n  ...\n}\n```\n\nThe contracts will be queried by the `contractName` property in the truffle .json output. Once contract files are changed, trufflepig picks it up and serves the changed version of it.\n\nServing accounts data from ganache or geth / parity\n---------------------------------------------------\n\nTrufflepig not only helps you to access those delicious truffles but also to easily access the set up addresses in ganache, geth or parity. These will be available under\n\n```\nhttp://localhost:3030/accounts\n```\n\nand looks like this:\n\n```json\n{\n  \"0x57bb04b8a56c4530ea75ded0a8a0632987d7ec44\":\"0xd4f10bbe0e132a0d7a7aea3d92e68791f548b67dc5d1dac8ad56edfbc5038ba5\",\n  \"0x241b5d67f21f23d03dec3ffc50504472f265745f\":\"0xb526e1b11956eb45c3c306a9fef1775b44e22c5e6aec30e103d7d973c6b29189\",\n  ...\n}\n```\n\n#### Usage with [ganache](https://github.com/trufflesuite/ganache-cli)\n\nStart ganache using\n\n```\n$ ganache-cli --acctKeys ganache-accounts.json\n```\n\nThis will create a `ganache-accounts.json` in the directory you run ganache from (preferably your project directory)\n\nThen run trufflepig using\n\n```\n$ trufflepig --ganacheKeyFile ganache-accounts.json\n```\n\n#### Usage with [keystore files](https://medium.com/@julien.m./what-is-an-ethereum-keystore-file-86c8c5917b97)\n\nYou can run your prefered ethereum development node with some accounts set up. In [parity](https://github.com/paritytech/parity) run\n\n```shell\n$ parity --keys-path YOUR_PREFERRED_KEYPATH\n```\n\nand in [geth](https://github.com/ethereum/go-ethereum/wiki/geth)\n\n```shell\n$ geth --keystore YOUR_PREFERRED_KEYPATH\n```\n\nto define the directory for accounts to use when starting the node. This directory has to contain one or more keystore files in json format.\n\nTrufflepig can conveniently serve those, too! Just start it with\n\n```shell\n$ trufflepig --keystoreDir YOUR_PREFERRED_KEYPATH [--keystorePassword KEYSTORE_PASSWORD]\n```\n\nUse the `--keystorePassword` option to provide a password in case your keyfiles ar encrypted.\n\nAPI\n---\n\n#### Command line usage\n\n```\n$ trufflepig --help\nOptions:\n  --help                  Show help [boolean]\n  --version               Show version number [boolean]\n  -p, --port              Port to serve the contracts from [number] [default: 3030]\n  -v, --verbose           Be extra chatty [boolean] [default: false]\n  -c, --contractDir       Directory to read contracts from [string] [default: \"./build/contracts\"]\n  -g, --ganacheKeyFile    Ganache accounts file (.json), will serve accounts under /accounts [string]\n  -k, --keystoreDir       Directory for keystore files, will serve accounts under /accounts [string]\n  -s, --keystorePassword  Password to decrypt keystore files [string]\n```\n\n#### Programmatic usage\n\n```JavaScript\nconst TrufflePig = require('trufflepig');\n\nconst pig = new TrufflePig({\n    // These are the defaults\n    contractDir: './build/contracts',\n    port: 3030,\n    verbose: true,\n    ganacheKeyFile: '',\n    keystoreDir: '',\n    keystorePassword: '',\n});\n\npig.start();\n```\n\n**That's it!** Have a lot of fun truffleing!\n\nLicense\n-------\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoincolony%2Ftrufflepig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoincolony%2Ftrufflepig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoincolony%2Ftrufflepig/lists"}