ripplenetwork

package module
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2024 License: MIT Imports: 14 Imported by: 1

README

Ripple Network

Build Status Go Report Card Docs License

This package provides a list of public Rippled servers and Gateways for machine accessible use in CSV, JSON and Go library formats.

A few gateway lists exist online but are not in formats suitable for programmtic access. See the following thread for more info:

https://bitcoin.stackexchange.com/questions/16936/is-there-a-comprehensive-list-of-gateways-ious-and-fees-associated-with-using-t

Gateways

Known gateways are listed in the gateways.csv and gateways.json files. This is is built from online sources and periodically updated with AccountRoot and AccountCurrencies info.

Gateway information can be programmatically accessed by calling the Gateways(inflate bool) function.

Gateway information can be loaded with up to date AccountRoot and AccountCurrencies data by calling GatewaysRebuild().

This is a the CSV as hosted on GitHub.

Rippled Servers

Rippled Servers can be retrieved programmaticaly by calling the Servers() function. Currently, this provides programmatic access to the server list hosted on https://xrpl.org.

Operator Network JSON-RPC URL WebSocket URL Notes
XRP Ledger Foundation Mainnet https://xrpl.ws/ wss://xrpl.ws/ Full history server cluster
Ripple Mainnet https://s1.ripple.com:51234/ wss://s1.ripple.com/ General purpose server cluster
Ripple Mainnet https://s2.ripple.com:51234/ wss://s2.ripple.com/ Full-history server cluster
Ripple Testnet https://s.altnet.rippletest.net:51234/ wss://s.altnet.rippletest.net/ Testnet public server
Ripple Mainnet https://s.devnet.rippletest.net:51234/ wss://s.devnet.rippletest.net/ Devnet public server
Testing
JSON RPC

Perform a quick test with the following curl commands. The rippled-postman Postman Collection can also be used with Postman.

$ curl -H 'Content-Type: application/json' -d '{"method":"server_info"}' https://xrpl.ws/

$ curl -H 'Content-Type: application/json' -d '{"method":"server_info"}' https://s1.ripple.com:51234/

$ curl -H 'Content-Type: application/json' -d '{"method":"server_info"}' https://s2.ripple.com:51234/

$ curl -H 'Content-Type: application/json' -d '{"method":"server_info"}' https://s.altnet.rippletest.net:51234/ --insecure

$ curl -H 'Content-Type: application/json' -d '{"method":"server_info"}' https://s.devnet.rippletest.net:51234/ --insecure

Documentation

Overview

Code generated for package ripplenetwork by go-bindata DO NOT EDIT. (@generated) sources: gateways.json

Index

Constants

View Source
const (
	NetworkMainnet = "Mainnet"
	NetworkTestnet = "Testnet"
	NetworkDevnet  = "Devnet"
)

Variables

This section is empty.

Functions

func Asset added in v0.1.0

func Asset(name string) ([]byte, error)

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetDir added in v0.1.0

func AssetDir(name string) ([]string, error)

AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:

data/
  foo.txt
  img/
    a.png
    b.png

then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.

func AssetInfo added in v0.1.0

func AssetInfo(name string) (os.FileInfo, error)

AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetNames added in v0.1.0

func AssetNames() []string

AssetNames returns the names of the assets.

func GetJSONRPCURL added in v0.1.2

func GetJSONRPCURL() string

func GetMainnetFullHistoryJSONRPCURL added in v0.1.2

func GetMainnetFullHistoryJSONRPCURL() string

func GetMainnetPublicJSONRPCURL added in v0.1.2

func GetMainnetPublicJSONRPCURL() string

func MustAsset added in v0.1.0

func MustAsset(name string) []byte

MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.

func RestoreAsset added in v0.1.0

func RestoreAsset(dir, name string) error

RestoreAsset restores an asset under the given directory

func RestoreAssets added in v0.1.0

func RestoreAssets(dir, name string) error

RestoreAssets restores an asset under the given directory recursively

func ServersJSONRPC added in v0.1.2

func ServersJSONRPC() openapi3.Servers

Types

type Account

type Account struct {
	Name                        string                             `json:"name,omitempty"`
	Description                 string                             `json:"description,omitempty"`
	Address                     string                             `json:"address,omitempty"`
	URL                         string                             `json:"url,omitempty"`
	FeesURL                     string                             `json:"feesURL,omitempty"`
	CoinistURL                  string                             `json:"coinistURL,omitempty"`
	AccountRoot                 *gorippled.AccountRoot             `json:"accountRoot,omitempty"`
	AccountRootRetrieved        time.Time                          `json:"accountRootRetrieved,omitempty"`
	AccountCurriencies          *gorippled.AccountCurrenciesResult `json:"accountCurrencies,omitempty"`
	AccountCurrienciesRetrieved time.Time                          `json:"accountCurrenciesRetrieved,omitempty"`
}

func Gateways

func Gateways(inflate bool) ([]Account, error)

func GatewaysRebuild added in v0.1.0

func GatewaysRebuild() ([]Account, error)

func (*Account) LoadAccountCurrencies added in v0.1.0

func (acct *Account) LoadAccountCurrencies() error

func (*Account) LoadAccountRoot added in v0.1.0

func (acct *Account) LoadAccountRoot() error

type GatewaysSet added in v0.1.0

type GatewaysSet struct {
	TimeCreated time.Time `json:"timeCreated"`
	Gateways    []Account `json:"gateways"`
}

type Server added in v0.1.0

type Server struct {
	Hostname     string
	Operator     string
	Network      string
	JSONRPCURL   string
	WebSocketURL string
	Notes        string
}

func Servers added in v0.1.0

func Servers() []Server

Servers provides the server info available at: https://xrpl.org/get-started-with-the-rippled-api.html

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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