Skip to content

Commit 45f57cf

Browse files
committed
Update sample so it works when copied & pasted into an empty file
Signed-off-by: Matthew Whitehead <[email protected]>
1 parent f21e777 commit 45f57cf

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ We welcome contributions to the FireFly Project in many forms, and
44
there's always plenty to do!
55

66
Please visit the
7-
[contributors guide](https://hyperledger.github.io/firefly/contributors/contributors.html) in the
7+
[contributors guide](https://hyperledger.github.io/firefly/contributors/index.html) in the
88
docs to learn how to make contributions to this exciting project.

README.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,24 @@ npm install @hyperledger/firefly-sdk
1818
```typescript
1919
import FireFly from '@hyperledger/firefly-sdk';
2020

21-
const firefly = new FireFly({ host: 'http://localhost:5000' });
22-
await firefly.sendBroadcast({
23-
data: [{ value: 'test-message' }],
24-
});
21+
async function main() {
22+
const firefly = new FireFly({ host: 'http://localhost:5000' });
23+
await firefly.sendBroadcast({
24+
data: [
25+
{
26+
value: 'test-message',
27+
},
28+
],
29+
});
30+
}
31+
32+
if (require.main === module) {
33+
main().catch((err) => console.error(`Error: ${err}`));
34+
}
2535
```
2636

37+
(This example was taken from the [examples](examples) folder where you will find some other basic samples)
38+
2739
## Generated schemas
2840

2941
The types for FireFly requests and responses are generated from the OpenAPI schema for FireFly. If you have

0 commit comments

Comments
 (0)