GithubHelp home page GithubHelp logo

cryptocode / rpc-go Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nanocurrency/rpc-go

0.0 2.0 0.0 8 KB

RPC server written in Go which communicates with the node via IPC. The RPC JSON format is compatible with the internal RPC server.

License: BSD 2-Clause "Simplified" License

Makefile 1.77% Go 98.23%

rpc-go's Introduction

About

rpc-go is an external Nano RPC server written in Go. It receives JSON requests from clients and forwards them to the node via its IPC mechanism. The node currently supports domain sockets and TCP.

Build

Clone the repository and run make

If you want to build with the go tool manually, see Makefile for relevant commands.

Run

Change config.json as needed and run:

bin/rpc-go

Configuration

Sample config.json:

{
	"port": 8080,
	"hostname": "localhost",
	"node": {
		"connection": "local:///tmp/nano",
		"poolsize": 10
	}
}

The port and hostname is where the Web server will listen for RPC POST requests.

The node configuration tells rpc-go where to find the Nano IPC server. The poolsize sets the maximum number of concurrent connections to the node. These are persistent connections to improve performance, but rpc-go will automatically reconnect if needed.

Replace the connection line with something like the following to use TCP instead of domain sockets:

    "connection": "tcp://localhost:7077"

The host and port must match the IPC configuration of the Nano node.

IDE notes for developers

If using Visual Studio Code, setting go.inferGopath to true is recommended. This will add the current workspace path to GOPATH.

A debugger is available via go get -u github.com/derekparker/delve/cmd/dlv

rpc-go's People

Contributors

cryptocode avatar

Watchers

James Cloos avatar  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.