Obsolete Altchain Integration Service

From Veriblock Wiki
Revision as of 14:17, 14 September 2021 by VeriBlockTim (talk | contribs) (VeriBlockTim moved page Altchain Integration Service to Obsolete Altchain Integration Service)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This page refers to an earlier external service. It Became obsolete with the embedded C++ Library.

See: VAIF, Altchain_Integration_Service_API

Overview

Written as Java Library, also exposed as a service.

Source code: https://github.com/VeriBlock/alt-integration

Used by

  • Altchain Reference Implementation
  • Altchain PoP Miner (APM)
  • Altchain Explorer
  • SPV

Design notes

Can be used as Java library for Java based projects. Can be used as a service from other languages. Library keeps the VeriBlock and Bitcoin SPV blocks in the SQLite database. Service classes are generated from the Protobuf scheme. Service communication channel is generated from the same Protobuf scheme using the GRPC plugin. Service is exposed on the TCP socket as a GRPC service. Clients should reuse the Protobuf scheme to autogenerate structures and communication classes. Java clients can use Service wrappers (see: https://github.com/VeriBlock/alt-integration/tree/master/alt-integration-adapter-java) to simplify calling the Service.

Starting the Service

  • Windows
alt-integration-grpc-service.bat
  • Linux
./alt-integration-grpc-service

Configuring the Service

Default configuration is in the $SERVICE$/conf/webservice-default.properties. Do not modify this file. Create $SERVICE$/conf/webservice.properties aside and put new config here. Use default properties as a reference. Restart Service to apply new config.

Generating code from the Protobuf

See: https://github.com/VeriBlock/alt-integration-proto

Connecting to the Service

Java:

ManagedChannel channel = NettyChannelBuilder.forAddress(apiHost, apiPort).usePlaintext().build();
VeriBlockSecurityProtoClient client = new VeriBlockSecurityProtoClient(channel);

See the sample client: https://github.com/VeriBlock/alt-integration/tree/master/alt-integration-grpc-client

VeriBlockSecurityProtoClient is a wrapper for the Integration Service Security API (Altchain_Integration_Service_API#Security_API). It is available in the Java adapters collection: https://github.com/VeriBlock/alt-integration/tree/master/alt-integration-adapter-java

C++:

VeriBlockServiceClient client = new VeriBlockServiceClient(grpc::CreateChannel("localhost:19012", grpc::InsecureChannelCredentials()));

VeriBlockServiceClient is a wrapper for the Integration Service Security API (Altchain_Integration_Service_API#Security_API).

Altchain Reference Implementation

See: Altchain_Reference

SPV

See: NodeCore-SPV

API

Full API is described as Protobuf scheme in the integration.proto file (see: https://github.com/VeriBlock/alt-integration-proto/blob/master/proto/integration.proto).

See: Altchain_Integration_Service_API