0.0.42 • Published 12 months ago

@tinyverse.space/web3storage v0.0.42

Weekly downloads
-
License
xx
Repository
github
Last release
12 months ago

Getting started

Install the package using npm

npm install @tinyverse.space/web3storage

or yarn:

yarn add @tinyverse.space/web3storage

See the getting started docs for more information.

You can also find full API reference documentation for the client at https://tinyverse-web3.github.io/web3storage

Usage

The web3stoage package exposes several "top-level" or module-scoped functions like , , and , along with a few classes like and that are returned from and accepted by the API functions.

In the examples below, the module is imported as Name using the ES module import syntax:

import * as Web3storage from '@tinyverse-space/web3storage'

const userPk = "0x5448862c64c6bEFc44ED957FAd45F22aeeDaC800";
const ipfsStorage = await Web3Storage.createIpfsStorage(userPk, {
  autoSync: true,  // default true
  syncTryTimeout: 5000, // default 5000ms
  syncCallback: msg => console.info(msg)
})

// setSyncCallback set synchronization callback, which will be called back after synchronizing the remote IPFS node
ipfsStorage.setSyncCallback((msg: any) => {
    console.info(msg)
})

// put user data to local ipfs node
await ipfsStorage.put('note', { 0: "hello world" })

// get user data from local ipfs node
const data = await ipfsStorage.get('note')
console.info(data)

// resume user data from remote ipfs node
await ipfsStorage.resume()

Configuration

http {
    ......
    server {
        listen       443 ssl;
        server_name  localhost;
   
        proxy_connect_timeout    600;
        proxy_read_timeout       600;
        proxy_send_timeout       600;

        ssl_certificate      /Users/dujuan/work/ssl/server.pem;
        ssl_certificate_key  /Users/dujuan/work/ssl/server.key;

        ssl_session_cache    shared:SSL:1m;
        ssl_session_timeout  5m;

        ssl_ciphers  HIGH:!aNULL:!MD5;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_prefer_server_ciphers  on;
 
        location /ipfs/api/v0/name/publish {
            add_header 'Access-Control-Allow-Origin' '*' always;
            add_header 'Access-Control-Request-Method' '*' always;
            add_header 'Access-Control-Allow-Credentials' 'true' always;
            add_header 'Access-Control-Allow-Headers' '*' always;
            if ($request_method = 'OPTIONS') {
                return 204;
            }
            proxy_pass http://localhost:5001/api/v0/name/publish;
            proxy_set_header Host $host;
        }
        ......
    }
    ......
}
0.0.40

12 months ago

0.0.41

12 months ago

0.0.42

12 months ago

0.0.37

12 months ago

0.0.38

12 months ago

0.0.39

12 months ago

0.0.35

12 months ago

0.0.36

12 months ago

0.0.21

1 year ago

0.0.22

1 year ago

0.0.23

1 year ago

0.0.24

1 year ago

0.0.25

1 year ago

0.0.15

1 year ago

0.0.16

1 year ago

0.0.17

1 year ago

0.0.18

1 year ago

0.0.19

1 year ago

0.0.30

1 year ago

0.0.31

1 year ago

0.0.32

1 year ago

0.0.10

1 year ago

0.0.33

1 year ago

0.0.34

1 year ago

0.0.12

1 year ago

0.0.13

1 year ago

0.0.26

1 year ago

0.0.9

1 year ago

0.0.27

1 year ago

0.0.8

1 year ago

0.0.28

1 year ago

0.0.29

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago