Code Monkey home page Code Monkey logo

talib's Introduction

Talib Blockchain Explorer for MANY Protocol

Login

All modifying endpoints to the Talib server are protected by a password. Currently, there is no update frontend that would allow you to login and make modifications, so a user would have to login manually via the command line and use the JWT token to make requests.

For example, to add a new neighborhood instance, first login to get a JWT:

# The admin password is set in the .env file.
$ curl -X POST -H "Content-Type: application/json" -d '{"username": "admin", "password":"admin"}' http://localhost:3000/api/v1/auth/login
{"access_token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjAsInVzZXJuYW1lIjoiYWRtaW4iLCJpYXQiOjE2ODU2NTE3MDcsImV4cCI6MTY4NTY1MTc2N30.iR41GGP2zqNrfyoTXd6Ul7t7_Q4tHg0r1gHZj7D_OvA"}

An easier way to set the environment would be to extract the token and set it to a TALIB_TOKEN environment variable like so:

$ set TALIB_TOKEN "$(curl -X POST -H "Content-Type: application/json" -d '{"username": "admin", "password":"admin"}' http://localhost:3000/api/v1/auth/login | jq -r .access_token)"

Then, use the token to make the update request:

$ curl http://localhost:3000/api/v1/neighborhoods -X PUT -H "Authorization: Bearer $TALIB_TOKEN" -H "Content-Type: application/json" -d '{"name": "Manifest QA Neighborhood", "description": "The Ledger QA neighborhood of the Manifest network.", "url": "https://qa-api.liftedinit.tech"}'
{"id":4,"address":"mae6o6amfv5upukm4n42rnnz4vicewllq3nx2k3yprhr3vny33","url":"https://qa-api.liftedinit.tech/","name":"Manifest QA Neighborhood","description":null}โŽ

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.