Deploying a Cluster
Simply make sure you fill in the 'cluster' class inputs then send a normal transaction. Make sure you send your cluster enough Juana to cover the fees for the next step. Then finally to deploy, you will need to send 0.0001 using the address and private key of the cluster and send the amount to the same cluster address itself (send to oneself).
A cluster references binded contracts which we deploy separately. At cluster creation, you do not reference binded contracts as they are voted in by the voting system chosen i.e by the subscribed members or chosen member/s.
new_cluster = functions.new_cluster(node_url = inputs.node.node_url,
cluster_address = cluster.cluster_address,
terms = cluster.terms,
enforcement_cycle = cluster.enforcement_cycle,
monthly_min_amount = cluster.monthly_min_amount,
monthly_min_percentage = cluster.monthly_min_percentage,
monthly_min_percentage_desc = cluster.monthly_min_percentage_desc,
monthly_min_percentage_calc = cluster.monthly_min_percentage_calc,
enforced_duration = cluster.enforced_duration,
poll_date_cycle = cluster.poll_date_cycle,
poll_activation_population = cluster.poll_activation_population,
poll_membership_duration = cluster.poll_membership_duration,
poll_member_active_duration = cluster.poll_member_active_duration,
cvi_poll_type = cluster.cvi_poll_type,
cvi_verifier_addresses = cluster.cvi_verifier_addresses,
cvi_threshold = cluster.cvi_threshold,
cvi_dissolve_threshold = cluster.cvi_dissolve_threshold,
cvi_addresses_recalc_cycle = cluster.cvi_addresses_recalc_cycle,
cvi_signature_expiration_cycle = cluster.cvi_signature_expiration_cycle,
passphrase = str())
# send a standard amount of 0.0001 to broadcast
fees = functions.calculate_fees(0.0001,
inputs.node.node_url,
inputs.dummy.recipient_address)
broadcast = functions.broadcast(inputs.wallet.wallet_address,
inputs.wallet.private_key_encrypted, # only use a dummy address's private key until we make kujuaOffChainRelay public
inputs.wallet.passphrase,
0.0001,
fees['content']['full_fee'],
inputs.node.node_url,
str(),
list(new_cluster['content'].keys())[0],
str(),
0,
0,
str(),
'create_cluster',
(None,),
new_cluster['content'],
True,
inputs.node.gt_node_url,
False)
print(broadcast)
data points: sender_template_readable_obj
See Data Point structure for cluster structure definitions
We use the on chain method by importing kujuaOnChain. Meaning the functions run directly on the node and return results. Off chain will be available with the full Github release. You can find the code for kujuaOnChain on GitHub