Intro and running enAPI

EnAPI

EnApi is a Json-RPC 2.0 based api, based on Pristine Typescript and build using Open-RPC spec, utilizing server-js by ETC Labs Core Dev team.

EnApi is build to be paired with docker and mongoDB, creating a small foot print stack for creating blockchain solutions. And is also pre installed along with enDashboard build on top of it with every enKeep node you can pre-order today at: https://ethernode.io

One of main functions of enAPI is node management through user type environment, to help you along with building and hosting your back end infrastructure for your node hosting for your dapps and other blockchain based projects.

enApi gives you the option to connect to each node through a custom IPC client for extra security. With Option 2 to make calls to your node client directly through RPC or web sockets, shown in examples below.

EnAPI is currently only setup to run on Linux based operating systems that support installation of: nodeJS, npm, mongoDB and docker-ce.

The open source version only supports single docker containers and you can host as many nodes for any network multi-geth supports out of the box.

The enterprise version gives you full control to run your node clients using docker swarms for load balancing and deploying enterprise solutions, like a node hosting service for instance.

Currently, enApi only uses multi-geth client for running blockchain networks and as mentioned earlier, supports every blockchain network multi-geth supports out of the box, just by sending a single api call. Please see examples below.

To install enApi on your system, you will just have to clone the git repo, and we also provide setup.sh files for Ubuntu setups and ARM64 architecture setups.

The setup will install docker-ce, docker images for enApi to run clients in, and mongoDB

Please review the enAPI docs in the kick ass Open-RPC playground created by ETC Labs Core Dev team to further complement the OpenRPC document driven development tools set.

enAPI Docs

Below are some examples of enApi in action:

If you don’t have any account created after running enApi you will need to do so with the createAccount method.

After creating a new account, you can use the login method to receive the JWT token to make further method calls.

After logging in and receiving a JWT token you can call other Methods like addNode to spin up a new blockchain network node.

After you have spun up your blockchain node, with the getUser method you can view the node information to get more info on the node containers ID that will be needed to get nodes direct RPC ports or web socket ports, if they were opened upon node creation.

Next finally, you can make web3 calls to your node. At this point you have two options.

Option 1 Mentioned above, you can use the build in ethRpcCall method that allows you to make calls to the node securely through an IPC client build into enAPI, probably the most secure way to query the node and blockchain. Since you don’t have to expose your nodes RPC or WS ports and need to have user credentials and JWT token to query the node.

Option 1 Example

Or Option 2 Where you can get the nodes RPC ports if you enabled them during creation, and query the node directly.

As you can see with a few json-rpc calls you can query the blockchain right from your finger tips, or build interfaces for blockchain solutions.

Further development of enApi will include simple method calls for creating your private PoA networks based on the clique engine, and stay tuned for our video on enAPI.