EasyBlockchainApi - JavaScript client for easy_blockchain_api The Easy Blockchain API is an easy to use API to store related entries within chains. Currently it stores entries using a Factom, Ethereum or Multichain blockchain. For full API documentation please visit: https://docs.sphereon.com/api/easy-blockchain/0.10/html Interactive testing: A web based test console is available in the Sphereon API store at: https://store.sphereon.com This SDK is automatically generated by the Swagger Codegen project:
- API version: 0.10
- Package version: 0.10
- Build package: io.swagger.codegen.languages.JavascriptClientCodegen For more information, please visit https://sphereon.com
For Node.js
To publish the library as a npm, please follow the procedure in "Publishing npm packages".
Then install it via:
npm install easy_blockchain_api --save
To use the library locally without publishing to a remote npm registry, first install the dependencies by changing
into the directory containing package.json
(and this README). Let's call this JAVASCRIPT_CLIENT_DIR
. Then run:
npm install
Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR
:
npm link
Finally, switch to the directory you want to use your easy_blockchain_api from, and run:
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>
You should now be able to require('easy_blockchain_api')
in javascript files from the directory you ran the last
command above from.
If the library is hosted at a git repository, e.g. https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:
npm install GIT_USER_ID/GIT_REPO_ID --save
The library also works in the browser environment via npm and browserify. After following
the above steps with Node.js and installing browserify with npm install -g browserify
,
perform the following (assuming main.js is your entry file, that's to say your javascript file where you actually
use this library):
browserify main.js > bundle.js
Then include bundle.js in the HTML pages.
Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:
module: {
rules: [
{
parser: {
amd: false
}
}
]
}
Please follow the installation instruction and execute the following JS code:
var EasyBlockchainApi = require('easy_blockchain_api');
var defaultClient = EasyBlockchainApi.ApiClient.instance;
// Configure OAuth2 access token for authorization: oauth2schema
var oauth2schema = defaultClient.authentications['oauth2schema'];
oauth2schema.accessToken = "YOUR ACCESS TOKEN"
var api = new EasyBlockchainApi.AllApi()
var context = "context_example"; // {String} context
var chainId = "chainId_example"; // {String} chainId
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.chainIdExists(context, chainId, callback);
All URIs are relative to https://gw.api.cloud.sphereon.com/blockchain/easy/0.10
Class | Method | HTTP request | Description |
---|---|---|---|
EasyBlockchainApi.AllApi | chainIdExists | GET /{context}/chains/id/{chainId} | Determine chain id exists |
EasyBlockchainApi.AllApi | createBackend | POST /backends | Create a new backend |
EasyBlockchainApi.AllApi | createChain | POST /{context}/chains | Create a new chain |
EasyBlockchainApi.AllApi | createContext | POST /contexts | Create context |
EasyBlockchainApi.AllApi | createEntry | POST /{context}/chains/{chainId}/entries | Create a new entry in the provided chain |
EasyBlockchainApi.AllApi | deleteBackend | DELETE /backends/{backendId} | Delete a backend |
EasyBlockchainApi.AllApi | deleteContext | DELETE /contexts/{context} | Delete context |
EasyBlockchainApi.AllApi | determineChainId | POST /{context}/chains/id | Predetermine id of chain |
EasyBlockchainApi.AllApi | determineEntryId | POST /{context}/chains/id/{chainId}/entries | Predetermine id of an entry |
EasyBlockchainApi.AllApi | entryById | GET /{context}/chains/{chainId}/entries/{entryId} | Get an existing entry in the provided chain |
EasyBlockchainApi.AllApi | entryByRequest | POST /{context}/chains/{chainId}/entries/entry | Get an existing entry in the provided chain |
EasyBlockchainApi.AllApi | entryIdExists | GET /{context}/chains/id/{chainId}/entries/{entryId} | Determine entry id exists |
EasyBlockchainApi.AllApi | findBackends | GET /backends/{backendId}/find | Find backends |
EasyBlockchainApi.AllApi | firstEntry | GET /{context}/chains/{chainId}/entries/first | Get the first entry in the provided chain |
EasyBlockchainApi.AllApi | getBackend | GET /backends/{backendId} | Get backend by id |
EasyBlockchainApi.AllApi | getContext | GET /contexts/{context} | Get context |
EasyBlockchainApi.AllApi | lastEntry | GET /{context}/chains/{chainId}/entries/last | Get the last entry in the provided chain. |
EasyBlockchainApi.AllApi | listBackends | GET /backends | List backends |
EasyBlockchainApi.AllApi | nextEntryById | GET /{context}/chains/{chainId}/entries/{entryId}/next | Get the entry after the supplied entry Id (the next) in the provided chain |
EasyBlockchainApi.AllApi | nextEntryByRequest | POST /{context}/chains/{chainId}/entries/entry/next | Get the entry after the supplied entry Id (the next) in the provided chain |
EasyBlockchainApi.AllApi | previousEntryById | GET /{context}/chains/{chainId}/entries/{entryId}/previous | Get the entry before the supplied entry Id (the previous) in the provided chain |
EasyBlockchainApi.AllApi | previousEntryByRequest | POST /{context}/chains/{chainId}/entries/entry/previous | Get the entry before the supplied entry Id (the previous) in the provided chain |
EasyBlockchainApi.BackendApi | createBackend | POST /backends | Create a new backend |
EasyBlockchainApi.BackendApi | deleteBackend | DELETE /backends/{backendId} | Delete a backend |
EasyBlockchainApi.BackendApi | findBackends | GET /backends/{backendId}/find | Find backends |
EasyBlockchainApi.BackendApi | getBackend | GET /backends/{backendId} | Get backend by id |
EasyBlockchainApi.BackendApi | listBackends | GET /backends | List backends |
EasyBlockchainApi.ChainApi | createChain | POST /{context}/chains | Create a new chain |
EasyBlockchainApi.ContextApi | createContext | POST /contexts | Create context |
EasyBlockchainApi.ContextApi | deleteContext | DELETE /contexts/{context} | Delete context |
EasyBlockchainApi.ContextApi | getContext | GET /contexts/{context} | Get context |
EasyBlockchainApi.EntryApi | createEntry | POST /{context}/chains/{chainId}/entries | Create a new entry in the provided chain |
EasyBlockchainApi.EntryApi | entryById | GET /{context}/chains/{chainId}/entries/{entryId} | Get an existing entry in the provided chain |
EasyBlockchainApi.EntryApi | entryByRequest | POST /{context}/chains/{chainId}/entries/entry | Get an existing entry in the provided chain |
EasyBlockchainApi.EntryApi | firstEntry | GET /{context}/chains/{chainId}/entries/first | Get the first entry in the provided chain |
EasyBlockchainApi.EntryApi | lastEntry | GET /{context}/chains/{chainId}/entries/last | Get the last entry in the provided chain. |
EasyBlockchainApi.EntryApi | nextEntryById | GET /{context}/chains/{chainId}/entries/{entryId}/next | Get the entry after the supplied entry Id (the next) in the provided chain |
EasyBlockchainApi.EntryApi | nextEntryByRequest | POST /{context}/chains/{chainId}/entries/entry/next | Get the entry after the supplied entry Id (the next) in the provided chain |
EasyBlockchainApi.EntryApi | previousEntryById | GET /{context}/chains/{chainId}/entries/{entryId}/previous | Get the entry before the supplied entry Id (the previous) in the provided chain |
EasyBlockchainApi.EntryApi | previousEntryByRequest | POST /{context}/chains/{chainId}/entries/entry/previous | Get the entry before the supplied entry Id (the previous) in the provided chain |
EasyBlockchainApi.IdApi | chainIdExists | GET /{context}/chains/id/{chainId} | Determine chain id exists |
EasyBlockchainApi.IdApi | determineChainId | POST /{context}/chains/id | Predetermine id of chain |
EasyBlockchainApi.IdApi | determineEntryId | POST /{context}/chains/id/{chainId}/entries | Predetermine id of an entry |
EasyBlockchainApi.IdApi | entryIdExists | GET /{context}/chains/id/{chainId}/entries/{entryId} | Determine entry id exists |
- EasyBlockchainApi.Access
- EasyBlockchainApi.AnchoredEntryResponse
- EasyBlockchainApi.Backend
- EasyBlockchainApi.Chain
- EasyBlockchainApi.CommittedChain
- EasyBlockchainApi.CommittedChainResponse
- EasyBlockchainApi.CommittedEntry
- EasyBlockchainApi.CommittedEntryResponse
- EasyBlockchainApi.Context
- EasyBlockchainApi.Entry
- EasyBlockchainApi.EntryData
- EasyBlockchainApi.Error
- EasyBlockchainApi.ErrorResponse
- EasyBlockchainApi.ExternalId
- EasyBlockchainApi.IdResponse
- EasyBlockchainApi.RpcProvider
- Type: OAuth
- Flow: application
- Authorization URL:
- Scopes:
- global: accessEverything