portal

package module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2022 License: MIT Imports: 23 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

SBIT DApp Server

A Web Server for running third-party DApps.

All requests made by a DApp would block until you approve it in the authorization UI.

Install sbit-portal

If you have golang installed, you can install the latest version:

go get -u github.com/SBit-Project/sbit-portal/cli/sbitportal

Running A SBIT DApp

First, we'll need to make sure that sbitd is running.

For testing/development purposes, let's start sbitd in regtest mode:

sbitd -regtest -rpcuser=user -rpcpassword=pass

Then use the env variable SBIT_RPC to specify the URL of your local sbitd RPC node:

export SBIT_RPC=http://user:pass@localhost:22302

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authorization

type Authorization struct {
	ID        string             `json:"id"`
	State     AuthorizationState `json:"state"`
	Request   *jsonRPCRequest    `json:"request"`
	CreatedAt time.Time          `json:"createdAt"`
}

type AuthorizationState

type AuthorizationState string

AuthorizationState is the state of an Authorization

const (
	AuthorizationPending AuthorizationState = "pending"

	AuthorizationAccepted AuthorizationState = "accepted"

	AuthorizationDenied AuthorizationState = "denied"

	AuthorizationConsumed AuthorizationState = "consumed"
)

type Server

type Server struct {
	Options ServerOption
	// contains filtered or unexported fields
}

func NewServer

func NewServer(opts ServerOption) *Server

func (*Server) Start

func (s *Server) Start() error

type ServerOption

type ServerOption struct {
	Bind          string
	DAppPort      int
	AuthPort      int
	StaticBaseDir string
	SbitdRPCURL   *url.URL
	DebugMode     bool
}

Directories

Path Synopsis
cli
sbitportal command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址