Deployer
Deployer allows for deployment of Fincontract to the blockchain in a series of transaction. It makes sure that the topological order of FincNodes is preserved. It also allows for immediate issuance of the Fincontract to a given proposed owner.
Example:
import Deployer from './fincontract-deployer';
try {
const d = new Deployer(marketplace, web3);
const id = await d.deploy(fincontract);
catch (err) {
console.log(err);
}
Constructor Summary
Public Constructor | ||
public |
constructor(marketplace: FincontractMarketplace, web3: Web3) Constructs the Deployer object with Fincontracts smart contract instance and web3 instance connected to an Ethereum node |
Method Summary
Public Methods | ||
public |
Deploys a description of a Fincontract to the blockchain by traversing the Fincontract description (See FincNode and DescriptionDeployer) and returns a promise that resolves to id of the deployed Fincontract. |
|
public |
deployFincontract(descID: String): Promise<String, Error> Deploys the actual Fincontract to the blockchain given that the description was already deployed and it's id is given as the argument |
|
public |
Deploys a description of a Fincontract to the blockchain (See Deployer#deploy) and then issues it for the proposed owner. |
|
public |
Issues the actual Fincontract to the proposed owner in the blockchain given that the Fincontract was already deployed and it's id is given as the argument |
Public Constructors
public constructor(marketplace: FincontractMarketplace, web3: Web3) source
Constructs the Deployer object with Fincontracts smart contract instance and web3 instance connected to an Ethereum node
Params:
Name | Type | Attribute | Description |
marketplace | FincontractMarketplace | a Fincontracts smart contract instance |
|
web3 | Web3 | a web3 instance connected to an Ethereum node |
Public Methods
public async deploy(description: FincNode): Promise<String, Error> source
Deploys a description of a Fincontract to the blockchain by traversing the Fincontract description (See FincNode and DescriptionDeployer) and returns a promise that resolves to id of the deployed Fincontract.
Params:
Name | Type | Attribute | Description |
description | FincNode | Root description of Fincontract |
public deployFincontract(descID: String): Promise<String, Error> source
Deploys the actual Fincontract to the blockchain given that the description was already deployed and it's id is given as the argument
Params:
Name | Type | Attribute | Description |
descID | String | Fincontract description's id deployed to the blockchain |
public async issue(description: FincNode, proposedOwner: String): Promise<String, Error> source
Deploys a description of a Fincontract to the blockchain (See Deployer#deploy) and then issues it for the proposed owner.
Params:
Name | Type | Attribute | Description |
description | FincNode | Root description of Fincontract |
|
proposedOwner | String | address of the proposed owner's Ethereum account |