mirror of
https://gitee.com/BDWare/cm
synced 2025-01-25 01:04:04 +00:00
support ledgerparams
add startContract at cmconfig.json add docker scripts
This commit is contained in:
parent
a2f8ab528b
commit
32cc66dad1
@ -1,10 +1,12 @@
|
||||
package org.bdware.sc;
|
||||
|
||||
import com.google.gson.JsonElement;
|
||||
import org.bdware.sc.bean.ContractRequest;
|
||||
import org.bdware.sc.conn.OnHashCallback;
|
||||
|
||||
public interface ChainOpener {
|
||||
void reRegister(String doid);
|
||||
|
||||
String register(String arg);
|
||||
|
||||
void writeContractResultToLocalAndLedger(
|
||||
@ -29,4 +31,6 @@ public interface ChainOpener {
|
||||
String requestID,
|
||||
String contractID,
|
||||
String namedLedger);
|
||||
|
||||
JsonElement getLedgerParams();
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package org.bdware.sc;
|
||||
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonPrimitive;
|
||||
import io.netty.channel.Channel;
|
||||
@ -2198,6 +2199,10 @@ public class ContractManager {
|
||||
eventBroker.doSubscribe(topic, new WSClientConsumer(channel));
|
||||
}
|
||||
|
||||
public JsonElement getLedgerParams() {
|
||||
return chainOpener.getLedgerParams();
|
||||
}
|
||||
|
||||
// 合约状态
|
||||
|
||||
static class StrCollector extends ResultCallback {
|
||||
|
@ -6,7 +6,6 @@ import org.bdware.sc.bean.ContractRequest;
|
||||
import org.bdware.sc.conn.Description;
|
||||
import org.bdware.sc.conn.MsgHandler;
|
||||
import org.bdware.sc.conn.ResultCallback;
|
||||
import org.bdware.sc.event.REvent;
|
||||
import org.bdware.sc.get.GetMessage;
|
||||
import org.bdware.sc.util.JsonUtil;
|
||||
|
||||
@ -89,4 +88,10 @@ public class ManagerHandler extends MsgHandler {
|
||||
ContractRequest cr = JsonUtil.fromJson(msg.arg, ContractRequest.class);
|
||||
cb.onResult(cm.addDEMember(cr.getContractID(), cr.getArg().getAsString()));
|
||||
}
|
||||
|
||||
@Description("add distributed execution member, sample: {contractID:id/name, arg:ipAndPort}")
|
||||
public void getLedgerParams(GetMessage msg, ResultCallback cb) {
|
||||
|
||||
cb.onResult(ContractManager.instance.getLedgerParams().toString());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user