• NEC Website
  • GitHub
  • Discord Community

Quick Start

  • Get Started

Staking

  • Quick Start
  • Overview
  • Stake on NCOG
  • Run NCOGEarthChain
  • Run Validator Node
  • Running Testnet
  • Operating a private network (fakenet)
  • Running the demo
  • Run a Read-only node
  • Testnet Faucet
  • Run a Full node
  • Run a Testnet read node

API

  • Public API End Points
  • Getting Started
  • Installation
  • GraphQL Schema Basics
  • Schema Structure
  • Implementation Details and Notes

Tutorials

  • Create a ERC721 Contract
  • Deploy a Smart Contract
  • Verify a Deployed Smart Contract
  • Setup MetaMask Wallet
  • Import NFT
  • Create a Local Test Network

Technology

  • Overview
  • Forest Protocal
  • Tolerance to Byzantine Fault (BFT)
  • Proof of Stake
  • Transaction Fees
  • FAQ

Best Practices

  • MANAGE NEC ASSETS WITH LEDGER NANO S
  • How to Navigate NCOG NEC
  • How to Check Your Account Balance
  • How to Receive NCOG Assets
  • How to Send NCOG Assets
  • Leager FAQ
  • Home
  • Docs
  • API
  • Installation

Installation

Table of Contents
  • What you need
  • Building process
  • Releases
  • Building the source
  • Running the API server

What you need #

Please note that an official binary distribution is not available at the moment. To build your own NCOG GraphQL API, you need to have following:

  • Working MongoDB database installation.
  • Go version 1.13 or later configured and ready
  • Ncog Full Node up and running on desired network.
  • for regular GraphQL queries https://xapi.ncogchain.earth.
  • for Web Socket subscriptions. Feel free to connect and try your queries. Fine tune your application before committing to deploy your own instance.

Building process #

Building your API server is a fairly straight forward process. First clone the repository to your local machine. Do not clone the project into $GOPATH, due to the Go modules. Instead, use any other location.

$ git clone https://github.com/Ncog-Earth-Chain/graphql-api.git

Once you have the copy on your machine, build the executable:

$ cd graphql-api

Releases #

Please check the release tags to get more details and to download previous releases.

Version 0.2.0, pending
This version connects with the Forest v.0.7.0-rc1. The SFC contract ABI bundled with the API is version 2.0.2-rc1.

The release brings new fluid delegations and rewards system. Each address is be able to delegate to multiple stakers. Delegation can be locked to certain time, at least 14 days and up to 1 year, to get higher rewards. Please check our website NCOGChain.Earth and the Special Fee Contract repository for more details.

Version 0.1.0, released on 8/2020
This is the version you want to be able to connect with Forest v.0.6.0-rc2. The SFC contract ABI bundled with this API release is the version 1.1.0-rc1. The release uses Forest API v0.6.0 which recognizes single delegation per address and no delegation locking.

Building the source #

Building apiserver requires a Go (version 1.13 or later). You can install it using your favourite package manager. Once the dependencies are installed, run

make

The build output is build/apiserver executable.

You don’t need to clone the project into $GOPATH, due to use of Go Modules you can use any location.

Running the API server #

To run the API Server you need access to a RPC interface of a full Forest node. Please follow Forest instructions to build and run the node. Alternatively you can obtain access to a remotely running instance of Forest.

We recommend using local IPC channel for communication between a Forest node and the API Server for performance and security reasons. Please consider security implications of opening Forest RPC to outside access, especially if you enable “personal” commands on your node while keeping your account keys in the Forest key store.

Persistent data are stored in a MongoDB database. Going through the installation and configuration process of MongoDB is out of scope here, please consult MongoDB manual to install and configure appropriate MongoDB environment for your deployment of the API server.

What are your Feelings
Share This Article :
  • Facebook
  • Twitter
  • LinkedIn
  • Pinterest
Still stuck? How can we help?

How can we help?

Updated on November 23, 2023
Getting StartedGraphQL Schema Basics

Powered by BetterDocs

Table of Contents
  • What you need
  • Building process
  • Releases
  • Building the source
  • Running the API server
© 2023. NCOG Earth Chain. All Rights Reserved.