repo
This module allows you to create and manage a MakeOS repository. It can be accessed from the global variable repo
.
create
Send a transaction to create a repository.
Parameters
txObject
-Object
: The transaction objectname
-String
: The unique name of the repository.value
-String
: (optional) The amount of coins to transfer to the new repository.nonce
-Number|String
: The signing account’s next nonce.fee
-String
: The network fee to be paid by the signing account.timestamp
-String
: (optional) The Unix timestamp of the transaction.config
-Object
: (optional) The repository configurationsig
-String
: (optional) The transaction signature. If not provided, the transaction will be signed using thesigningKey
.
signingKey
-String
: (optional) The private key to use to sign the transaction.payloadOnly
-Boolean
: (optional) When true, the transaction payload is returned instead of being sent to the network.
Returns
Object
- The result object
hash
-String
: A 32 bytes transaction hash.address
-String
: The full address of the repository.
Example
Create a transaction to create a repository named
myrepo
.accounts[0]
returns the address of a key at index 0 on the keystore.You will be prompted to enter the passphrase.
Get the signed payload instead of creating and then sending the transaction.
upsertOwner
Create a proposal to add or update an owner of a repository.
Parameters
txObject
-Object
: The transaction objectid
-String
: A unique, numeric proposal ID. Must not exceed 16 characters.name
-String
: The unique name of the repository.value
-String
: (optional) The proposal deposit fee, if required.addresses
-Array<String>
: A list of addresses to add as owners.veto
-Boolean
: Grant veto right to owners.nonce
-Number|String
: The signing account’s next nonce.fee
-String
: The network fee to be paid by the signing account.timestamp
-String
: (optional) The unix timestamp of the transaction.sig
-String
: (optional) The transaction signature. If not provided, the transaction will be signed using thesigningKey
.
signingKey
-String
: (optional) The private key to use to sign the transaction.payloadOnly
-Boolean
: (optional) When true, the transaction payload is returned instead of being sent to the network.
Returns
Object
- The result object
hash
-String
: A 32 bytes transaction hash.
Example
Create a transaction that adds a new address as an owner with veto power.
vote
Create a transaction that votes on a repository proposal.
Parameters
txObject
-Object
: The transaction objectid
-String
: The ID of the proposal.name
-String
: The name of the repository.vote
-Number
: The vote choice:0:
No
,1:
Yes
2:
NoWithVeto
3:
Abstain
nonce
-Number|String
: The signing account’s next nonce.fee
-String
: The network fee to be paid by the signing account.timestamp
-String
: (optional) The Unix timestamp of the transaction.sig
-String
: (optional) The transaction signature. If not provided, the transaction will be signed using thesigningKey
.
signingKey
-String
: (optional) The private key to use to sign the transaction.payloadOnly
-Boolean
: (optional) When true, the transaction payload is returned instead of being sent to the network.
Returns
Object
- The result object
hash
-String
: A 32 bytes transaction hash.
Example
Create a transaction that will vote
Yes
on a proposal with ID =1
.
get
Create a transaction that votes on a repository proposal.
Parameters
name
-String
: The name of the repository.queryopts
-Object
: The query optionsheight
-Number|String
: (Optional) The chain height to search for repository. Defaults to the latest block height.noProps
-Boolean
: If true, proposals will not be returned.Returns
Object
- The result object
balance
-String
: The coin balance of the repository.config
-RepoConfig
: The repository configuration.contributors
-{PushKey: [RepoContributor](#)}
: The repository contributors.owners
-{Address: [RepoOwner](#)}
- The owners of the repository.proposals
-{ID: [RepoProposal](#)}
- The proposals created on the repository.references
-{Reference: [RepoReference](#)}
- The git references of the repository.
Example
update
Create a proposal to update a repository.
Parameters
txObject
-Object
: The transaction objectid
-String
: A unique, numeric proposal ID. Must not exceed 16 characters.name
-String
: The unique name of the repository.value
-String
: (optional) The proposal deposit fee, if required.config
-Object
: The config update to merge into the existing configuration.nonce
-Number|String
: The signing account’s next nonce.fee
-String
: The network fee to be paid by the signing account.timestamp
-String
: (optional) The Unix timestamp of the transaction.sig
-String
: (optional) The transaction signature. If not provided, the transaction will be signed using thesigningKey
.
signingKey
-String
: (optional) The private key to use to sign the transaction.payloadOnly
-Boolean
: (optional) When true, the transaction payload is returned instead of being sent to the network.
Returns
Object
- The result object
hash
-String
: A 32 bytes transaction hash.
Example
depositPropFee
Creates a transaction that deposits the native coins to pay the proposal fee. Anyone can create this transaction. Depending on the repository's proposal fee configuration, the proposal fee may be returned after the proposal is finalized.
Parameters
txObject
-Object
: The transaction objectid
-String
: A target proposal ID that will receive the deposit.name
-String
: The unique name of the repository.value
-String
: The amount to deposit as proposal fee.nonce
-Number|String
: The signing account’s next nonce.fee
-String
: The network fee to be paid by the signing account.timestamp
-String
: (optional) The unix timestamp of the transaction.sig
-String
: (optional) The transaction signature. If not provided, the transaction will be signed using thesigningKey
.
signingKey
-String
: (optional) The private key to use to sign the transaction.payloadOnly
-Boolean
: (optional) When true, the transaction payload is returned instead of being sent to the network.
Returns
Object
- The result object
hash
-String
: A 32 bytes transaction hash.
Example
Create a transaction that will deposit 50 coins to a proposal with ID =
1
.
addContributor
Creates a proposal that adds contributors to a repository.
Parameters
txObject
-Object
: The transaction objectid
-String
: A unique, numeric proposal ID. Must not exceed 16 characters.name
-String
: The unique name of the repository.value
-String
: (optional) The proposal deposit fee, if required.keys
-Array<String>
: A list of push keys to add as contributorspolicies
-Array<[ContributorPolicy](#)>
: A list of access policies to apply to the contributors.feeMode
-Number
: The fee mode determines who pays the fees whenever a contributor performs a push operation. There are 3 fee mode options:0: Contributor pays for their fees.
1: Repository pays for contributors fees.
2: Repository pays a capped amount of contributors fees.
feeCap
-Number
: The maximum amount of fees payable by the repository iffeeMode
is2
.namespace
-String
: Adds the push keys as namespace-level contributors. Note: The repository must own the namespace.namespaceOnly
-String
: Adds the push keys only as namespace-level contributors. They will not be added as contributors to the repository itself. Note: The repository must own the namespace.nonce
-Number|String
: The signing account’s next nonce.fee
-String
: The network fee to be paid by the signing account.timestamp
-String
: (optional) The unix timestamp of the transaction.sig
-String
: (optional) The transaction signature. If not provided, the transaction will be signed using thesigningKey
.
signingKey
-String
: (optional) The private key to use to sign the transaction.payloadOnly
-Boolean
: (optional) When true, the transaction payload is returned instead of being sent to the network.
Returns
Object
- The result object
hash
-String
: A 32 bytes transaction hash.
Example
track
Track one or more repositories. If a repository is added to the tracklist, only the repository's push updates will be synchronized and stored on the node. You can track as many repositories as you want.
Parameters
names
-String
: A comma separated list of repository names.height
-String|Number
: (Optional) The block height to begin synchronization from.
Examples
Track a repo named
my_repo
.
Track repositories named
my_repo
andsomeones_repo
untrack
Untrack one or more repositories.
Parameters
names
-String
: A comma-separated list of repository names.
Examples
Untrack a repo named
my_repo
.
Untrack repositories named
my_repo
andsomeones_repo
.
tracked
Get all tracked repositories.
Returns
Object
- The result object
Example
Last updated