2017-07-11 3 views
0

発注者サービスの機能は、受注された順序でピアに取引を送信することです。開発者は、tx1が常にtx2の前に来るか、トランザクションペイロードに基づいていくつかの検証を実行するように、ブロックを検証中のピアにブロードキャストする前に、ordererサービスにコードを追加して追加の検証チェックを実行できます。発注者レベルで余分なトランザクション検証ロジックを実装できますか?

答えて

0

追加の検証ポリシーを追加したい場合は、プラグイン可能なESCCポリシーまたはVSCCポリシー(保証書、検証ポリシー)。

また、独自の発注サービスを用意して、現在提供可能な2つのオプションの代わりに、デリバリ/ブロードキャストAPIに準拠/実装することができます。

message BroadcastResponse { 
    common.Status status = 1; 
} 

message SeekNewest { } 

message SeekOldest { } 

message SeekSpecified { 
    uint64 number = 1; 
} 

message SeekPosition { 
    oneof Type { 
     SeekNewest newest = 1; 
     SeekOldest oldest = 2; 
     SeekSpecified specified = 3; 
    } 
} 

// SeekInfo specifies the range of requested blocks to return 
// If the start position is not found, an error is immediately returned 
// Otherwise, blocks are returned until a missing block is encountered, then behavior is dictated 
// by the SeekBehavior specified. If BLOCK_UNTIL_READY is specified, the reply will block until 
// the requested blocks are available, if FAIL_IF_NOT_READY is specified, the reply will return an 
// error indicating that the block is not found. To request that all blocks be returned indefinitely 
// as they are created, behavior should be set to BLOCK_UNTIL_READY and the stop should be set to 
// specified with a number of MAX_UINT64 
message SeekInfo { 
    enum SeekBehavior { 
     BLOCK_UNTIL_READY = 0; 
     FAIL_IF_NOT_READY = 1; 
    } 
    SeekPosition start = 1; // The position to start the deliver from 
    SeekPosition stop = 2;  // The position to stop the deliver 
    SeekBehavior behavior = 3; // The behavior when a missing block is encountered 
} 

message DeliverResponse { 
    oneof Type { 
     common.Status status = 1; 
     common.Block block = 2; 
    } 
} 

service AtomicBroadcast { 
    // broadcast receives a reply of Acknowledgement for each common.Envelope in order, indicating success or type of failure 
    rpc Broadcast(stream common.Envelope) returns (stream BroadcastResponse) {} 

    // deliver first requires an Envelope of type DELIVER_SEEK_INFO with Payload data as a mashaled SeekInfo message, then a stream of block replies is received. 
    rpc Deliver(stream common.Envelope) returns (stream DeliverResponse) {} 
} 
関連する問題