Skip to content

Commit c468b7b

Browse files
authored
Merge pull request #65 from kaleido-io/update-readme-sample
Update sample so it works when copied & pasted into an empty file
2 parents f21e777 + d35599d commit c468b7b

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
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: 17 additions & 5 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
@@ -47,7 +59,7 @@ that may be helpful to reference:
4759

4860
Interested in contributing to the community?
4961

50-
Check out our [Contributor Guide](https://hyperledger.github.io/firefly/contributors/contributors.html), and welcome!
62+
Check out our [Contributor Guide](https://hyperledger.github.io/firefly/contributors/index.html), and welcome!
5163

5264
Please adhere to this project's [Code of Conduct](CODE_OF_CONDUCT.md).
5365

0 commit comments

Comments
 (0)