GithubHelp home page GithubHelp logo

ssdef / js-filecoin-api-client Goto Github PK

View Code? Open in Web Editor NEW

This project forked from filecoin-shipyard/js-filecoin-api-client

0.0 1.0 0.0 812 KB

An API client for Filecoin

Home Page: https://npm.im/filecoin-api-client

License: Other

JavaScript 100.00%

js-filecoin-api-client's Introduction

filecoin-api-client

CircleCI branch dependencies Status JavaScript Style Guide

An API client for Filecoin

⚠️ WARNING: Filecoin is under heavy development and breaking changes are highly likely between versions. This library is experimental, incomplete and unsupported by the Filecoin team. It may be broken in part or in entirety.

🧩 Currently compatible with Filecoin 0.3.2

Install

npm i filecoin-api-client

Usage

Node.js

const Filecoin = require('filecoin-api-client')

const fc = Filecoin({
  apiAddr: '/ip4/127.0.0.1/tcp/3453/http' // (optional, default)
})

// see API below for usage

Browser

<script src="https://unpkg.com/filecoin-api-client/dist/Filecoin.js"></script>
<script>
  const fc = Filecoin({
    apiAddr: '/ip4/127.0.0.1/tcp/3453/http' // (optional, default)
  })

  // see API below for usage
</script>

CORS

In a web browser, the Filecoin API client might encounter an error saying that the origin is not allowed. This is a CORS ("Cross Origin Resource Sharing") failure: Filecoin servers send HTTP headers allowing access to only certain origins by default. You can whitelist the origins that you are calling from by changing your Filecoin config like this:

$ filecoin config api.accessControlAllowOrigin '["http://example.com"]'

API

Status: 35/57 61%

Contribute

Feel free to dive in! Open an issue or submit PRs.

License

The Filecoin Project is dual-licensed under Apache 2.0 and MIT terms:

js-filecoin-api-client's People

Contributors

alanshaw avatar yangjian102621 avatar hazmatzo avatar jadtermsani avatar mishmosh avatar nijynot avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.