This is the client SDK for Node.js, allowing you to build your own applications on top of Hyperledger FireFly.
npm install @hyperledger/firefly-sdk
import FireFly from '@hyperledger/firefly-sdk';
async function main() {
const firefly = new FireFly({ host: 'http://localhost:5000' });
await firefly.sendBroadcast({
data: [
{
value: 'test-message',
},
],
});
}
if (require.main === module) {
main().catch((err) => console.error(`Error: ${err}`));
}
(This example was taken from the examples folder where you will find some other basic samples)
The types for FireFly requests and responses are generated from the OpenAPI schema for FireFly. If you have
the firefly
repository cloned in a folder parallel to this one, you can run the following to re-generate
the TypeScript interfaces from the latest FireFly definitions:
npm run schema
There are multiple Git repos making up the Hyperledger FireFly project. Some others that may be helpful to reference:
- Core - https://github.com/hyperledger/firefly
- Command Line Interface (CLI) - https://github.com/hyperledger/firefly-cli
- FireFly Sandbox - https://github.com/hyperledger/firefly-sandbox
Interested in contributing to the community?
Check out our Contributor Guide, and welcome!
Please adhere to this project's Code of Conduct.
Hyperledger Project source code files are made available under the Apache License, Version 2.0 (Apache-2.0), located in the LICENSE file.