Git Product home page Git Product logo

crust-api's Introduction

Crust API

Crust API is a bridge connector bewteen chain and other offchain services, you'd better not run it seperately.

Based on express and polkadot-js/api, connecting a running Crust Node and hosting a RESTful api service.

Join to play

Go to Crust Node, follow the README.

Building

Build from source

Make sure you have latest nodejs and yarn installed.

1. Install with yarn

yarn

2. Debug with nodemon

  • API_PORT: port number, default is: 56666
  • CRUST_WS_ADDRESS: crust's websocket address, default is: ws://localhost:9944
yarn debug {API_PORT} {CRUST_WS_ADDRESS}

3. Build and start with original node

yarn build && yarn start {API_PORT} {CRUST_WS_ADDRESS}

Build from docker

Refer this to see how to build and run crust api with docker.

Usage

Refer to this for more api details.

License

GPL v3

crust-api's People

Contributors

badkk avatar lowentropybody avatar mmyyrroonn avatar pangwa avatar wuhaixian1984 avatar yashirooooo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

crust-api's Issues

Not able to use Cross Chain Pinning

First of great work on Crust!
I was trying to pin some files using Cross Chain dStorage Solution, I have already added files to crust ipfs and have the cid.

I am doing something like this on my front end

const provider = new ethers.providers.Web3Provider(window.ethereum);
const signer = provider.getSigner();
const publicAddress = await signer.getAddress();
const privateKey = await signer.signMessage(publicAddress);
const authHeaderRaw = `eth-${publicAddress}:${privateKey}`;
const authHeader = Buffer.from(authHeaderRaw).toString("base64");

and trying to pin file using

const res = await axios.post(`${ipfsPinningService}/pins`, {
      headers: {
        'Authorization': `Basic ${authHeader}`,
      },
      json: {
        cid: cid.toV0().toString(),
        name: "test",
      }
    })
    console.log(res);

However I keep on getting error 401, am I missing something??

[Tx] Low priority problem

Tx will be low priority because of the nonce problem, we should solve it by set it to -1 when encounter this problem

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.