godprotocol
v1.0.842
Published
A data mediator.
Downloads
670
Maintainers
Readme
God Protocol
A data mediator
Installation
npm install godprotocol --save
Brief Description
This package is developing a framework for the Web 4.0 It is to help provide multiple compute instances for servers and also data flexibility and transactions.
You can get overall comprehension in just 4 method calls.
Create an Account
Accounts comes with their own VM, thereby providing concurrency on processes being executed.
import start from "godprotocol";
// Create an initial account
let initiator = start(`name`, { private: true || false });
// if private is set to `true`, communication to the account instance must be validated by sigining with the private key.
// N.B your keypairs are generated offline.
| Parameters
| Type | Description |
| ------------ | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| name
| string | Account names can be any valid variable string. Such as a Public Key |
| private
| object:boolean | default false
, if set to true, then any payloads sent to the account must be signed using the private key belonging to the account name
|
Load Instructions
The load method is the second in the pipeline, It is used to set your programs into the network web, where its data can continue to be accessed, and subsequent calls can be made on the loaded program.
Usage
initiator.load(
{
instructions: ["link Account/initiator/Datatypes/Number", "write 7", "pop"],
account: `public_key`,
},
cb
);
Type method
| Parameters
| Type | Destructure | Description |
| ------------ | -------- | -------------- | -------------------------------------------------------------------------------------------------------------------- |
| program
| object | instructions
| An array of opcode-operands generated by the Loader Sequence
|
| | | account
| Account instance to load and execute the program in. |
| cb
| function | | A function that is called with the blocks mined during the execution. |
Run Program
The run is technically the second in the pipeline.
Usage
initiator.run(
{
physical_address: "Account/initiator/Datatypes/Number", // This points to a chain
query: { blocks: 0 }, // Basically saying, index 0 block in physical_address chain, run again its instructions.
account: `public_key`,
},
cb
);
// N.B If query is missing, then VM starts execution from the block-index-0
Type method
| Parameters
| Type | Destructure | Description |
| ------------ | -------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| payload
| object | physical_address
| Physical Addresses
are logical namespace locations of tokens. They are derived from the high-level representation of the program's instructions. |
| | object | query
| A valid blockweb explorer query, you can read the explorer documentation here |
| | string | account
| Account instance to execute the instructions in. |
| cb
| function | | A function that is called with the blocks mined during the execution. |
Parse Result
The parse is technically the third of the pipeline. It takes like parameters as the run
method.
Usage
It is used to retrieve blocks and chains, and also extract their properties.
initiator.parse(
{
physical_address: "Account/initiator/Datatypes/Number", // This points to a chain
query: { blocks: 0 }, // Basically saying, index 0 block in physical_address chain, retrieve it.
account: `public_key`,
},
cb
);
// N.B If query isn't provided, then you parse the chain.
Type method
| Parameters
| Type | Destructure | Description |
| ------------ | -------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| payload
| object | physical_address
| Physical Addresses
are logical namespace locations of tokens. They are derived from the high-level representation of the program's instructions. |
| | object | query
| A valid blockweb explorer query, you can read the explorer documentation here |
| | string | account
| Account instance to execute the instructions in. |
| cb
| function | | A function that is called with the blocks mined during the execution. |
See the package source for more details.
References
The main website for communicating updates and tutorials about the platform. https://godprotocol-web.vercel.app Physical Address - Token logical address from an High-level construct. Find everything else to know about it in the links below. https://godprotocol-web.vercel.app/physical_address Explorer - Every blockchain technology has an explorer, learn more about ours. https://godprotocol-web.vercel.app/explorer Loader Sequence - Instruction bits, the lowest granular layer where a user can outline the execution flow. https://godprotocol-web.vercel.app/loader_sequence