Skip to content

Commit

Permalink
chore: Example Update
Browse files Browse the repository at this point in the history
  • Loading branch information
rrr523 committed Sep 14, 2023
1 parent 794cf37 commit 1207ae2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions examples/nodejs/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# GreenField JS SDK Node.js

* [storage](./storage.js)
> NOTICE: Before running, you need to fill your account's private key and address in [env.js](./env.js).
```bash
> node storage
> node storage.js
```

[More examples](../../packages/chain-sdk/tests/)
7 changes: 7 additions & 0 deletions examples/nodejs/env.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const ACCOUNT_ADDRESS = '0x1C893441AB6c1A75E01887087ea508bE8e07AAae';
const ACCOUNT_PRIVATEKEY = '0x6547492644d0136f76ef65e3bd04a77d079ed38028f747700c6c6063564d7032';

module.exports = {
ACCOUNT_ADDRESS,
ACCOUNT_PRIVATEKEY,
};
9 changes: 2 additions & 7 deletions examples/nodejs/storage.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
const {
client,
selectSp,
ACCOUNT_ADDRESS,
ACCOUNT_PRIVATEKEY,
generateString,
} = require('./client');
const { client, selectSp, generateString } = require('./client');
const { ACCOUNT_ADDRESS, ACCOUNT_PRIVATEKEY } = require('./env');

(async () => {
const bucketName = generateString(10);
Expand Down

0 comments on commit 1207ae2

Please sign in to comment.