diff --git a/packages/blockstore-s3/README.md b/packages/blockstore-s3/README.md index 04f8f04b..bd1898f5 100644 --- a/packages/blockstore-s3/README.md +++ b/packages/blockstore-s3/README.md @@ -14,14 +14,22 @@ A Blockstore implementation that stores blocks on Amazon S3. If the flag `createIfMissing` is not set or is false, then the bucket must be created prior to using blockstore-s3. Please see the AWS docs for information on how to configure the S3 instance. A bucket name is required to be set at the s3 instance level, see the below example. ```js -import S3 from 'aws-sdk/clients/s3.js' +import { S3 } from '@aws-sdk/client-s3' import { S3Blockstore } from 'blockstore-s3' -const s3Instance = new S3({ params: { Bucket: 'my-ipfs-bucket' } }) -const store = new S3Blockstore('.ipfs/blockstore', { - s3: s3Instance - createIfMissing: false +const s3 = new S3({ + region: 'region', + credentials: { + accessKeyId: 'myaccesskey', + secretAccessKey: 'mysecretkey' + } }) + +const store = new S3Blockstore( + s3, + 'my-bucket', + { path: '.ipfs/blockstore', createIfMissing: false } +) ``` ## Example diff --git a/packages/datastore-s3/README.md b/packages/datastore-s3/README.md index 9a6a7ba3..1f225f37 100644 --- a/packages/datastore-s3/README.md +++ b/packages/datastore-s3/README.md @@ -14,14 +14,22 @@ A Datastore implementation that stores data on Amazon S3. If the flag `createIfMissing` is not set or is false, then the bucket must be created prior to using datastore-s3. Please see the AWS docs for information on how to configure the S3 instance. A bucket name is required to be set at the s3 instance level, see the below example. ```js -import S3 from 'aws-sdk/clients/s3.js' +import { S3 } from '@aws-sdk/client-s3' import { S3Datastore } from 'datastore-s3' -const s3Instance = new S3({ params: { Bucket: 'my-ipfs-bucket' } }) -const store = new S3Datastore('.ipfs/datastore', { - s3: s3Instance - createIfMissing: false +const s3 = new S3({ + region: 'region', + credentials: { + accessKeyId: 'myaccesskey', + secretAccessKey: 'mysecretkey' + } }) + +const store = new DatastoreS3( + s3, + 'my-bucket', + { path: '.ipfs/datastore', createIfMissing: false } +) ``` ## Example