mirror of
https://source.quilibrium.com/quilibrium/ceremonyclient.git
synced 2024-12-24 07:35:19 +00:00
Merge branch 'main' into release-cdn
This commit is contained in:
commit
1371267d35
@ -70,6 +70,7 @@ func (n *Node) VerifyProofIntegrity() {
|
|||||||
if e != nil {
|
if e != nil {
|
||||||
panic(e)
|
panic(e)
|
||||||
}
|
}
|
||||||
|
|
||||||
dataProver := crypto.NewKZGInclusionProver(n.logger)
|
dataProver := crypto.NewKZGInclusionProver(n.logger)
|
||||||
wesoProver := crypto.NewWesolowskiFrameProver(n.logger)
|
wesoProver := crypto.NewWesolowskiFrameProver(n.logger)
|
||||||
|
|
||||||
@ -79,6 +80,7 @@ func (n *Node) VerifyProofIntegrity() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
idx, idxProof, idxCommit, idxKP := master.GetOutputs(o)
|
idx, idxProof, idxCommit, idxKP := master.GetOutputs(o)
|
||||||
|
|
||||||
ip := sha3.Sum512(idxProof)
|
ip := sha3.Sum512(idxProof)
|
||||||
@ -89,7 +91,7 @@ func (n *Node) VerifyProofIntegrity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !v {
|
if !v {
|
||||||
panic(fmt.Sprintf("bad kzg proof at increment %d", i))
|
panic(fmt.Sprintf("bad kzg proof at increment %d", j))
|
||||||
}
|
}
|
||||||
wp := []byte{}
|
wp := []byte{}
|
||||||
wp = append(wp, n.pubSub.GetPeerID()...)
|
wp = append(wp, n.pubSub.GetPeerID()...)
|
||||||
@ -97,7 +99,7 @@ func (n *Node) VerifyProofIntegrity() {
|
|||||||
fmt.Printf("%x\n", wp)
|
fmt.Printf("%x\n", wp)
|
||||||
v = wesoProver.VerifyChallengeProof(wp, uint32(j), idx, idxProof)
|
v = wesoProver.VerifyChallengeProof(wp, uint32(j), idx, idxProof)
|
||||||
if !v {
|
if !v {
|
||||||
panic(fmt.Sprintf("bad weso proof at increment %d", i))
|
panic(fmt.Sprintf("bad weso proof at increment %d", j))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
51764
node/bridged.json
Normal file
51764
node/bridged.json
Normal file
File diff suppressed because it is too large
Load Diff
@ -55,12 +55,26 @@ var BootstrapPeers = []string{
|
|||||||
"/dns/quidditch.quilibrium.com/udp/8336/quic-v1/p2p/QmbZEGuinaCndj4XLb6fteZmjmP3C1Tsgijmc5BGuUk8Ma",
|
"/dns/quidditch.quilibrium.com/udp/8336/quic-v1/p2p/QmbZEGuinaCndj4XLb6fteZmjmP3C1Tsgijmc5BGuUk8Ma",
|
||||||
"/dns/quagmire.quilibrium.com/udp/8336/quic-v1/p2p/QmaQ9KAaKtqXhYSQ5ARQNnn8B8474cWGvvD6PgJ4gAtMrx",
|
"/dns/quagmire.quilibrium.com/udp/8336/quic-v1/p2p/QmaQ9KAaKtqXhYSQ5ARQNnn8B8474cWGvvD6PgJ4gAtMrx",
|
||||||
"/ip4/204.186.74.46/udp/8316/quic-v1/p2p/QmeqBjm3iX7sdTieyto1gys5ruQrQNPKfaTGcVQQWJPYDV",
|
"/ip4/204.186.74.46/udp/8316/quic-v1/p2p/QmeqBjm3iX7sdTieyto1gys5ruQrQNPKfaTGcVQQWJPYDV",
|
||||||
"/ip4/103.219.170.9/udp/8336/quic-v1/p2p/QmfEdMfmdhNoYuGVhhw5LBApHHG1rbVAHXwGWpW8s9bXeg",
|
|
||||||
"/ip4/185.143.102.84/udp/8336/quic-v1/p2p/Qmce68gLLq9eMdwCcmd1ptfoC2nVoe861LF1cjdVHC2DwK",
|
"/ip4/185.143.102.84/udp/8336/quic-v1/p2p/Qmce68gLLq9eMdwCcmd1ptfoC2nVoe861LF1cjdVHC2DwK",
|
||||||
"/ip4/65.109.17.13/udp/8336/quic-v1/p2p/Qmc35n99eojSvW3PkbfBczJoSX92WmnnKh3Fg114ok3oo4",
|
"/ip4/65.109.17.13/udp/8336/quic-v1/p2p/Qmc35n99eojSvW3PkbfBczJoSX92WmnnKh3Fg114ok3oo4",
|
||||||
"/ip4/65.108.194.84/udp/8336/quic-v1/p2p/QmP8C7g9ZRiWzhqN2AgFu5onS6HwHzR6Vv1TCHxAhnCSnq",
|
"/ip4/65.108.194.84/udp/8336/quic-v1/p2p/QmP8C7g9ZRiWzhqN2AgFu5onS6HwHzR6Vv1TCHxAhnCSnq",
|
||||||
"/dns/quil.dfcnodes.eu/udp/8336/quic-v1/p2p/QmQaFmbYVrKSwoen5UQdaqyDq4QhXfSSLDVnYpYD4SF9tX",
|
"/dns/quil.dfcnodes.eu/udp/8336/quic-v1/p2p/QmQaFmbYVrKSwoen5UQdaqyDq4QhXfSSLDVnYpYD4SF9tX",
|
||||||
"/ip4/87.98.167.207/udp/8336/quic-v1/p2p/QmafiAXLu1JWktyfzDtD67i78GRBYCfQ4doTfq7pp7wfQ1",
|
"/ip4/15.204.100.222/udp/8336/quic-v1/p2p/Qmef3Z3RvGg49ZpDPcf2shWtJNgPJNpXrowjUcfz23YQ3V",
|
||||||
|
"/ip4/69.197.174.35/udp/8336/quic-v1/p2p/QmeprCaZKiymofPJgnp2ANR3F4pRus9PHHaxnJDh1Jwr1p",
|
||||||
|
"/ip4/70.36.102.32/udp/8336/quic-v1/p2p/QmYriGRXCUiwFodqSoS4GgEcD7UVyxXPeCgQKmYne3iLSF",
|
||||||
|
"/ip4/204.12.220.2/udp/8336/quic-v1/p2p/QmRw5Tw4p5v2vLPvVSAkQEiRPQGnWk9HM4xiSvgxF82CCw",
|
||||||
|
"/ip4/209.159.149.14/udp/8336/quic-v1/p2p/Qmcq4Lmw45tbodvdRWZ8iGgy3rUcR3dikHTj1fBXP8VJqv",
|
||||||
|
"/ip4/148.251.9.90/udp/8336/quic-v1/p2p/QmRpKmQ1W83s6moBFpG6D6nrttkqdQSbdCJpvfxDVGcs38",
|
||||||
|
"/ip4/35.232.113.144/udp/8336/quic-v1/p2p/QmWxkBc7a17ZsLHhszLyTvKsoHMKvKae2XwfQXymiU66md",
|
||||||
|
"/ip4/34.87.85.78/udp/8336/quic-v1/p2p/QmTGguT5XhtvZZwTLnNQTN8Bg9eUm1THWEneXXHGhMDPrz",
|
||||||
|
"/ip4/34.81.199.27/udp/8336/quic-v1/p2p/QmTMMKpzCKJCwrnUzNu6tNj4P1nL7hVqz251245wsVpGNg",
|
||||||
|
"/ip4/34.143.255.235/udp/8336/quic-v1/p2p/QmeifsP6Kvq8A3yabQs6CBg7prSpDSqdee8P2BDQm9EpP8",
|
||||||
|
"/ip4/34.34.125.238/udp/8336/quic-v1/p2p/QmZdSyBJLm9UiDaPZ4XDkgRGXUwPcHJCmKoH6fS9Qjyko4",
|
||||||
|
"/ip4/34.80.245.52/udp/8336/quic-v1/p2p/QmNmbqobt82Vre5JxUGVNGEWn2HsztQQ1xfeg6mx7X5u3f",
|
||||||
|
"/dns/bravo-1.qcommander.sh/udp/8336/quic-v1/p2p/QmWFK1gVuhEqZdr8phTo3QbyLwjYmyivx31Zubqt7oR4XB",
|
||||||
|
"/ip4/109.199.100.108/udp/8336/quic-v1/p2p/Qma9fgugQc17MDu4YRSvnhfhVre6AYZ3nZdW8dSUYbsWvm",
|
||||||
|
"/ip4/47.251.49.193/udp/8336/quic-v1/p2p/QmP6ADPmMCsB8y82oFbrKTrwYWXt1CTMJ3jGNDXRHyYJgR",
|
||||||
|
"/ip4/138.201.203.208/udp/8336/quic-v1/p2p/QmbNhSTd4Y64ZCbV2gAXYR4ZFDdfRBMfrgWsNg99JHxsJo",
|
||||||
// purged peers (keep your node online to return to this list)
|
// purged peers (keep your node online to return to this list)
|
||||||
// "/ip4/204.186.74.47/udp/8317/quic-v1/p2p/Qmd233pLUDvcDW3ama27usfbG1HxKNh1V9dmWVW1SXp1pd",
|
// "/ip4/204.186.74.47/udp/8317/quic-v1/p2p/Qmd233pLUDvcDW3ama27usfbG1HxKNh1V9dmWVW1SXp1pd",
|
||||||
// "/ip4/186.233.184.181/udp/8336/quic-v1/p2p/QmW6QDvKuYqJYYMP5tMZSp12X3nexywK28tZNgqtqNpEDL",
|
// "/ip4/186.233.184.181/udp/8336/quic-v1/p2p/QmW6QDvKuYqJYYMP5tMZSp12X3nexywK28tZNgqtqNpEDL",
|
||||||
|
@ -585,6 +585,9 @@ func (w *WesolowskiFrameProver) CalculateChallengeProof(
|
|||||||
increment uint32,
|
increment uint32,
|
||||||
) ([]byte, error) {
|
) ([]byte, error) {
|
||||||
difficulty := 200000 - (increment / 4)
|
difficulty := 200000 - (increment / 4)
|
||||||
|
if difficulty < 25000 || increment > 800000 {
|
||||||
|
difficulty = 25000
|
||||||
|
}
|
||||||
|
|
||||||
instanceInput := binary.BigEndian.AppendUint32([]byte{}, core)
|
instanceInput := binary.BigEndian.AppendUint32([]byte{}, core)
|
||||||
instanceInput = append(instanceInput, challenge...)
|
instanceInput = append(instanceInput, challenge...)
|
||||||
@ -604,6 +607,9 @@ func (w *WesolowskiFrameProver) VerifyChallengeProof(
|
|||||||
proof []byte,
|
proof []byte,
|
||||||
) bool {
|
) bool {
|
||||||
difficulty := 200000 - (increment / 4)
|
difficulty := 200000 - (increment / 4)
|
||||||
|
if difficulty < 25000 || increment > 800000 {
|
||||||
|
difficulty = 25000
|
||||||
|
}
|
||||||
|
|
||||||
if len(proof) != 516 {
|
if len(proof) != 516 {
|
||||||
return false
|
return false
|
||||||
|
77
node/main.go
77
node/main.go
@ -28,6 +28,7 @@ import (
|
|||||||
"golang.org/x/crypto/sha3"
|
"golang.org/x/crypto/sha3"
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
"source.quilibrium.com/quilibrium/monorepo/node/protobufs"
|
"source.quilibrium.com/quilibrium/monorepo/node/protobufs"
|
||||||
|
"source.quilibrium.com/quilibrium/monorepo/node/store"
|
||||||
"source.quilibrium.com/quilibrium/monorepo/node/utils"
|
"source.quilibrium.com/quilibrium/monorepo/node/utils"
|
||||||
|
|
||||||
"github.com/cloudflare/circl/sign/ed448"
|
"github.com/cloudflare/circl/sign/ed448"
|
||||||
@ -532,32 +533,48 @@ func RunMigrationIfNeeded(
|
|||||||
configDir string,
|
configDir string,
|
||||||
nodeConfig *config.Config,
|
nodeConfig *config.Config,
|
||||||
) {
|
) {
|
||||||
shouldMigrate := false
|
shouldMigrate13 := false
|
||||||
|
shouldMigrate15 := false
|
||||||
migrationInfo := []byte{0x00, 0x00, 0x00}
|
migrationInfo := []byte{0x00, 0x00, 0x00}
|
||||||
_, err := os.Stat(filepath.Join(configDir, "MIGRATIONS"))
|
_, err := os.Stat(filepath.Join(configDir, "MIGRATIONS"))
|
||||||
if err != nil && os.IsNotExist(err) {
|
if err != nil && os.IsNotExist(err) {
|
||||||
fmt.Println("Migrations file not found, will perform migration...")
|
fmt.Println("Migrations file not found, will perform migration...")
|
||||||
shouldMigrate = true
|
shouldMigrate13 = true
|
||||||
|
shouldMigrate15 = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if !shouldMigrate {
|
if !shouldMigrate13 {
|
||||||
migrationInfo, err = os.ReadFile(filepath.Join(configDir, "MIGRATIONS"))
|
migrationInfo, err = os.ReadFile(filepath.Join(configDir, "MIGRATIONS"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(migrationInfo) < 3 ||
|
if len(migrationInfo) < 3 ||
|
||||||
!bytes.Equal(migrationInfo, []byte{0x01, 0x04, 0x013}) {
|
(!bytes.Equal(migrationInfo, []byte{0x01, 0x04, 0x013}) &&
|
||||||
|
!bytes.Equal(migrationInfo, []byte{0x01, 0x04, 0x15})) {
|
||||||
fmt.Println("Migrations file outdated, will perform migration...")
|
fmt.Println("Migrations file outdated, will perform migration...")
|
||||||
shouldMigrate = true
|
shouldMigrate13 = true
|
||||||
|
shouldMigrate15 = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If subsequent migrations arise, we will need to distinguish by version
|
if !shouldMigrate15 {
|
||||||
if shouldMigrate {
|
migrationInfo, err = os.ReadFile(filepath.Join(configDir, "MIGRATIONS"))
|
||||||
fmt.Println("Running migration...")
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(migrationInfo) < 3 ||
|
||||||
|
!bytes.Equal(migrationInfo, []byte{0x01, 0x04, 0x15}) {
|
||||||
|
fmt.Println("Migrations file outdated, will perform migration...")
|
||||||
|
shouldMigrate13 = false
|
||||||
|
shouldMigrate15 = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if shouldMigrate13 {
|
||||||
|
fmt.Println("Running 1.4.19 migration...")
|
||||||
|
|
||||||
// Easiest migration in the world.
|
|
||||||
err := os.RemoveAll(filepath.Join(configDir, "store"))
|
err := os.RemoveAll(filepath.Join(configDir, "store"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("ERROR: Could not remove store, please be sure to do this before restarting the node.")
|
fmt.Println("ERROR: Could not remove store, please be sure to do this before restarting the node.")
|
||||||
@ -576,6 +593,40 @@ func RunMigrationIfNeeded(
|
|||||||
|
|
||||||
fmt.Println("Migration completed.")
|
fmt.Println("Migration completed.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if shouldMigrate15 {
|
||||||
|
fmt.Println("Running 1.4.21.1 migration...")
|
||||||
|
|
||||||
|
db := store.NewPebbleDB(nodeConfig.DB)
|
||||||
|
logger, _ := zap.NewProduction()
|
||||||
|
proofStore := store.NewPebbleDataProofStore(db, logger)
|
||||||
|
peerId := getPeerID(nodeConfig.P2P)
|
||||||
|
increment, _, _, err := proofStore.GetLatestDataTimeProof([]byte(peerId))
|
||||||
|
if err != nil && (!errors.Is(err, store.ErrNotFound) || increment != 0) {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if increment > 699999 {
|
||||||
|
err := proofStore.RewindToIncrement([]byte(peerId), 699999)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
db.Close()
|
||||||
|
|
||||||
|
err = os.WriteFile(
|
||||||
|
filepath.Join(configDir, "MIGRATIONS"),
|
||||||
|
[]byte{0x01, 0x04, 0x15},
|
||||||
|
fs.FileMode(0600),
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("ERROR: Could not save migration file.")
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Println("Migration completed.")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func RunSelfTestIfNeeded(
|
func RunSelfTestIfNeeded(
|
||||||
@ -843,7 +894,7 @@ func printBalance(config *config.Config) {
|
|||||||
fmt.Println("Unclaimed balance:", r.FloatString(12), "QUIL")
|
fmt.Println("Unclaimed balance:", r.FloatString(12), "QUIL")
|
||||||
}
|
}
|
||||||
|
|
||||||
func printPeerID(p2pConfig *config.P2PConfig) {
|
func getPeerID(p2pConfig *config.P2PConfig) peer.ID {
|
||||||
peerPrivKey, err := hex.DecodeString(p2pConfig.PeerPrivKey)
|
peerPrivKey, err := hex.DecodeString(p2pConfig.PeerPrivKey)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(errors.Wrap(err, "error unmarshaling peerkey"))
|
panic(errors.Wrap(err, "error unmarshaling peerkey"))
|
||||||
@ -860,6 +911,12 @@ func printPeerID(p2pConfig *config.P2PConfig) {
|
|||||||
panic(errors.Wrap(err, "error getting peer id"))
|
panic(errors.Wrap(err, "error getting peer id"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return id
|
||||||
|
}
|
||||||
|
|
||||||
|
func printPeerID(p2pConfig *config.P2PConfig) {
|
||||||
|
id := getPeerID(p2pConfig)
|
||||||
|
|
||||||
fmt.Println("Peer ID: " + id.String())
|
fmt.Println("Peer ID: " + id.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -228,10 +228,376 @@ message PeerManifest {
|
|||||||
uint32 increment = 18;
|
uint32 increment = 18;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message OriginatedAccountRef {
|
||||||
|
bytes address = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message ImplicitAccount {
|
||||||
|
uint32 implicit_type = 1;
|
||||||
|
bytes address = 2;
|
||||||
|
bytes domain = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message AccountRef {
|
||||||
|
oneof account {
|
||||||
|
OriginatedAccountRef originated_account = 1;
|
||||||
|
ImplicitAccount implicit_account = 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
message AccountAllowanceRef {
|
||||||
|
bytes address = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message CoinAllowanceRef {
|
||||||
|
bytes address = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message CoinRef {
|
||||||
|
bytes address = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message PendingTransactionRef {
|
||||||
|
bytes address = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message KeyRef {
|
||||||
|
bytes address = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message Signature {
|
||||||
|
uint32 signature_type = 1;
|
||||||
|
bytes signature = 2;
|
||||||
|
KeyRef key = 3;
|
||||||
|
}
|
||||||
|
|
||||||
message PeerManifestsResponse {
|
message PeerManifestsResponse {
|
||||||
repeated PeerManifest peer_manifests = 1;
|
repeated PeerManifest peer_manifests = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message AcceptPendingTransactionRequest {
|
||||||
|
PendingTransactionRef pending_transaction = 1;
|
||||||
|
Signature signature = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message AllowAccountRequest {
|
||||||
|
AccountRef of_account = 1;
|
||||||
|
AccountRef permitted_account = 2;
|
||||||
|
repeated string permitted_operations = 3;
|
||||||
|
AccountAllowanceRef allowance = 4;
|
||||||
|
Signature signature = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
message AllowCoinRequest {
|
||||||
|
CoinRef of_coin = 1;
|
||||||
|
AccountRef permitted_account = 2;
|
||||||
|
repeated string permitted_operations = 3;
|
||||||
|
AccountAllowanceRef account_allowance = 4;
|
||||||
|
CoinAllowanceRef coin_allowance = 5;
|
||||||
|
Signature signature = 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
message BalanceAccountRequest {
|
||||||
|
AccountRef account = 1;
|
||||||
|
AccountAllowanceRef allowance = 2;
|
||||||
|
Signature signature = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message CoinsAccountRequest {
|
||||||
|
AccountRef account = 1;
|
||||||
|
AccountAllowanceRef allowance = 2;
|
||||||
|
Signature signature = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message PendingTransactionsAccountRequest {
|
||||||
|
AccountRef account = 1;
|
||||||
|
AccountAllowanceRef allowance = 2;
|
||||||
|
Signature signature = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message IntersectCoinRequest {
|
||||||
|
repeated bytes addresses = 1;
|
||||||
|
AccountAllowanceRef account_allowance = 2;
|
||||||
|
CoinAllowanceRef coin_allowance = 3;
|
||||||
|
CoinRef of_coin = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
message MergeCoinRequest {
|
||||||
|
repeated CoinRef coins = 1;
|
||||||
|
AccountAllowanceRef account_allowance = 2;
|
||||||
|
repeated CoinAllowanceRef coin_allowances = 3;
|
||||||
|
Signature signature = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
message MintCoinRequest {
|
||||||
|
repeated bytes proofs = 1;
|
||||||
|
AccountAllowanceRef allowance = 2;
|
||||||
|
Signature signature = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message MutualReceiveCoinRequest {
|
||||||
|
AccountRef to_account = 1;
|
||||||
|
AccountAllowanceRef allowance = 2;
|
||||||
|
Signature signature = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message MutualTransferCoinRequest {
|
||||||
|
bytes rendezvous = 1;
|
||||||
|
CoinRef of_coin = 2;
|
||||||
|
AccountAllowanceRef account_allowance = 3;
|
||||||
|
CoinAllowanceRef coin_allowance = 4;
|
||||||
|
Signature signature = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
message RevokeAccountRequest {
|
||||||
|
AccountRef of_account = 1;
|
||||||
|
AccountAllowanceRef revoked_allowance = 2;
|
||||||
|
AccountAllowanceRef allowance = 3;
|
||||||
|
Signature signature = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
message RevokeCoinRequest {
|
||||||
|
CoinRef of_coin = 1;
|
||||||
|
CoinAllowanceRef revoked_allowance = 2;
|
||||||
|
AccountAllowanceRef account_allowance = 3;
|
||||||
|
CoinAllowanceRef coin_allowance = 4;
|
||||||
|
Signature signature = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
message SplitCoinRequest {
|
||||||
|
CoinRef of_coin = 1;
|
||||||
|
repeated bytes amounts = 2;
|
||||||
|
AccountAllowanceRef account_allowance = 3;
|
||||||
|
CoinAllowanceRef coin_allowance = 4;
|
||||||
|
Signature signature = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
message TransferCoinRequest {
|
||||||
|
AccountRef to_account = 1;
|
||||||
|
AccountRef refund_account = 2;
|
||||||
|
CoinRef of_coin = 3;
|
||||||
|
int64 expiry = 4;
|
||||||
|
AccountAllowanceRef account_allowance = 5;
|
||||||
|
CoinAllowanceRef coin_allowance = 6;
|
||||||
|
Signature signature = 7;
|
||||||
|
}
|
||||||
|
|
||||||
|
message ApprovePendingTransactionRequest {
|
||||||
|
PendingTransactionRef pending_transaction = 1;
|
||||||
|
AccountAllowanceRef account_allowance = 2;
|
||||||
|
Signature signature = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message RejectPendingTransactionRequest {
|
||||||
|
PendingTransactionRef pending_transaction = 1;
|
||||||
|
AccountAllowanceRef account_allowance = 2;
|
||||||
|
Signature signature = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message InlineKey {
|
||||||
|
bytes ref = 1;
|
||||||
|
bytes key = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message KeyRing {
|
||||||
|
repeated InlineKey keys = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message Confirmation {
|
||||||
|
bytes message_id = 1;
|
||||||
|
bytes proof = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message DeliveryData {
|
||||||
|
InlineKey shared_key = 1;
|
||||||
|
Confirmation confirmation = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message DeliveryMethod {
|
||||||
|
uint32 delivery_type = 1;
|
||||||
|
bytes address = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message DecryptableAllowAccountRequest {
|
||||||
|
AllowAccountRequest request = 1;
|
||||||
|
KeyRing key_ring = 2;
|
||||||
|
DeliveryMethod delivery_method = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message DecryptableBalanceAccountRequest {
|
||||||
|
BalanceAccountRequest request = 1;
|
||||||
|
KeyRing key_ring = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message DecryptableCoinsAccountRequest {
|
||||||
|
CoinsAccountRequest request = 1;
|
||||||
|
KeyRing key_ring = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message DecryptableRevokeAccountRequest {
|
||||||
|
RevokeAccountRequest request = 1;
|
||||||
|
KeyRing key_ring = 2;
|
||||||
|
DeliveryMethod delivery_method = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message DecryptablePendingTransactionsAccountRequest {
|
||||||
|
PendingTransactionsAccountRequest request = 1;
|
||||||
|
KeyRing key_ring = 2;
|
||||||
|
DeliveryMethod delivery_method = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message DecryptableAllowCoinRequest {
|
||||||
|
AllowCoinRequest request = 1;
|
||||||
|
KeyRing key_ring = 2;
|
||||||
|
DeliveryMethod delivery_method = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message DecryptableIntersectCoinRequest {
|
||||||
|
IntersectCoinRequest request = 1;
|
||||||
|
KeyRing key_ring = 2;
|
||||||
|
DeliveryMethod delivery_method = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message DecryptableMergeCoinRequest {
|
||||||
|
MergeCoinRequest request = 1;
|
||||||
|
KeyRing key_ring = 2;
|
||||||
|
DeliveryMethod delivery_method = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message DecryptableMintCoinRequest {
|
||||||
|
MintCoinRequest request = 1;
|
||||||
|
KeyRing key_ring = 2;
|
||||||
|
DeliveryMethod delivery_method = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message DecryptableMutualReceiveCoinRequest {
|
||||||
|
MutualReceiveCoinRequest request = 1;
|
||||||
|
KeyRing key_ring = 2;
|
||||||
|
DeliveryMethod delivery_method = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message DecryptableMutualTransferCoinRequest {
|
||||||
|
MutualTransferCoinRequest request = 1;
|
||||||
|
KeyRing key_ring = 2;
|
||||||
|
DeliveryMethod delivery_method = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message DecryptableRevokeCoinRequest {
|
||||||
|
RevokeCoinRequest request = 1;
|
||||||
|
KeyRing key_ring = 2;
|
||||||
|
DeliveryMethod delivery_method = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message DecryptableSplitCoinRequest {
|
||||||
|
SplitCoinRequest request = 1;
|
||||||
|
KeyRing key_ring = 2;
|
||||||
|
DeliveryMethod delivery_method = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message DecryptableTransferCoinRequest {
|
||||||
|
TransferCoinRequest request = 1;
|
||||||
|
KeyRing key_ring = 2;
|
||||||
|
DeliveryMethod delivery_method = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message DecryptableApprovePendingTransactionRequest {
|
||||||
|
ApprovePendingTransactionRequest request = 1;
|
||||||
|
KeyRing key_ring = 2;
|
||||||
|
DeliveryMethod delivery_method = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message DecryptableRejectPendingTransactionRequest {
|
||||||
|
RejectPendingTransactionRequest request = 1;
|
||||||
|
KeyRing key_ring = 2;
|
||||||
|
DeliveryMethod delivery_method = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message CoinInfo {
|
||||||
|
CoinRef coin = 1;
|
||||||
|
bytes balance = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message PendingTransactionInfo {
|
||||||
|
PendingTransactionRef pending_transaction = 1;
|
||||||
|
CoinInfo coin = 2;
|
||||||
|
AccountRef refund_account = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message AllowAccountResponse {
|
||||||
|
AccountAllowanceRef allowance = 1;
|
||||||
|
repeated DeliveryData deliveries = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message BalanceAccountResponse {
|
||||||
|
bytes balance = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message CoinsAccountResponse {
|
||||||
|
repeated CoinInfo coins = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message PendingTransactionsAccountResponse {
|
||||||
|
repeated PendingTransactionInfo pending_transactions = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message RevokeAccountResponse {
|
||||||
|
repeated DeliveryData deliveries = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message AllowCoinResponse {
|
||||||
|
CoinAllowanceRef allowance = 1;
|
||||||
|
repeated DeliveryData deliveries = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message IntersectCoinResponse {
|
||||||
|
bool intersects = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message MergeCoinResponse {
|
||||||
|
CoinRef coin = 1;
|
||||||
|
repeated DeliveryData deliveries = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message MintCoinResponse {
|
||||||
|
repeated CoinInfo coins = 1;
|
||||||
|
repeated DeliveryData deliveries = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message MutualReceiveCoinResponse {
|
||||||
|
uint32 status = 1;
|
||||||
|
bytes rendezvous = 2;
|
||||||
|
CoinRef coin = 3;
|
||||||
|
repeated DeliveryData deliveries = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
message MutualTransferCoinResponse {
|
||||||
|
uint32 status = 1;
|
||||||
|
repeated DeliveryData deliveries = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message RevokeCoinResponse {
|
||||||
|
repeated DeliveryData deliveries = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message SplitCoinResponse {
|
||||||
|
repeated CoinRef coins = 1;
|
||||||
|
repeated DeliveryData deliveries = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message TransferCoinResponse {
|
||||||
|
PendingTransactionRef pending_transaction = 1;
|
||||||
|
repeated DeliveryData deliveries = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message ApprovePendingTransactionResponse {
|
||||||
|
CoinRef coin = 1;
|
||||||
|
repeated DeliveryData deliveries = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message RejectPendingTransactionResponse {
|
||||||
|
repeated DeliveryData deliveries = 2;
|
||||||
|
}
|
||||||
|
|
||||||
service NodeService {
|
service NodeService {
|
||||||
rpc GetFrames(GetFramesRequest) returns (FramesResponse);
|
rpc GetFrames(GetFramesRequest) returns (FramesResponse);
|
||||||
rpc GetFrameInfo(GetFrameInfoRequest) returns (FrameInfoResponse);
|
rpc GetFrameInfo(GetFrameInfoRequest) returns (FrameInfoResponse);
|
||||||
@ -242,6 +608,31 @@ service NodeService {
|
|||||||
rpc GetPeerManifests(GetPeerManifestsRequest) returns (PeerManifestsResponse);
|
rpc GetPeerManifests(GetPeerManifestsRequest) returns (PeerManifestsResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
service AccountService {
|
||||||
|
rpc Allow(DecryptableAllowAccountRequest) returns (AllowAccountResponse);
|
||||||
|
rpc GetBalance(DecryptableBalanceAccountRequest) returns (BalanceAccountResponse);
|
||||||
|
rpc ListCoins(DecryptableCoinsAccountRequest) returns (CoinsAccountResponse);
|
||||||
|
rpc ListPendingTransactions(DecryptablePendingTransactionsAccountRequest) returns (PendingTransactionsAccountResponse);
|
||||||
|
rpc Revoke(DecryptableRevokeAccountRequest) returns (RevokeAccountResponse);
|
||||||
|
}
|
||||||
|
|
||||||
|
service CoinService {
|
||||||
|
rpc Allow(DecryptableAllowCoinRequest) returns (AllowCoinResponse);
|
||||||
|
rpc Intersect(DecryptableIntersectCoinRequest) returns (IntersectCoinResponse);
|
||||||
|
rpc Merge(DecryptableMergeCoinRequest) returns (MergeCoinResponse);
|
||||||
|
rpc Mint(DecryptableMintCoinRequest) returns (MintCoinResponse);
|
||||||
|
rpc MutualReceive(DecryptableMutualReceiveCoinRequest) returns (stream MutualReceiveCoinResponse);
|
||||||
|
rpc MutualTransfer(DecryptableMutualTransferCoinRequest) returns (stream MutualTransferCoinResponse);
|
||||||
|
rpc Revoke(DecryptableRevokeCoinRequest) returns (RevokeCoinResponse);
|
||||||
|
rpc Split(DecryptableSplitCoinRequest) returns (SplitCoinResponse);
|
||||||
|
rpc Transfer(DecryptableTransferCoinRequest) returns (TransferCoinResponse);
|
||||||
|
}
|
||||||
|
|
||||||
|
service TransactionService {
|
||||||
|
rpc Approve(DecryptableApprovePendingTransactionRequest) returns (ApprovePendingTransactionResponse);
|
||||||
|
rpc Reject(DecryptableRejectPendingTransactionRequest) returns (RejectPendingTransactionResponse);
|
||||||
|
}
|
||||||
|
|
||||||
service NodeStats {
|
service NodeStats {
|
||||||
rpc PutNodeInfo(PutNodeInfoRequest) returns (PutResponse);
|
rpc PutNodeInfo(PutNodeInfoRequest) returns (PutResponse);
|
||||||
rpc PutPeerInfo(PutPeerInfoRequest) returns (PutResponse);
|
rpc PutPeerInfo(PutPeerInfoRequest) returns (PutResponse);
|
||||||
|
@ -485,6 +485,812 @@ var NodeService_ServiceDesc = grpc.ServiceDesc{
|
|||||||
Metadata: "node.proto",
|
Metadata: "node.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
AccountService_Allow_FullMethodName = "/quilibrium.node.node.pb.AccountService/Allow"
|
||||||
|
AccountService_GetBalance_FullMethodName = "/quilibrium.node.node.pb.AccountService/GetBalance"
|
||||||
|
AccountService_ListCoins_FullMethodName = "/quilibrium.node.node.pb.AccountService/ListCoins"
|
||||||
|
AccountService_ListPendingTransactions_FullMethodName = "/quilibrium.node.node.pb.AccountService/ListPendingTransactions"
|
||||||
|
AccountService_Revoke_FullMethodName = "/quilibrium.node.node.pb.AccountService/Revoke"
|
||||||
|
)
|
||||||
|
|
||||||
|
// AccountServiceClient is the client API for AccountService service.
|
||||||
|
//
|
||||||
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||||
|
type AccountServiceClient interface {
|
||||||
|
Allow(ctx context.Context, in *DecryptableAllowAccountRequest, opts ...grpc.CallOption) (*AllowAccountResponse, error)
|
||||||
|
GetBalance(ctx context.Context, in *DecryptableBalanceAccountRequest, opts ...grpc.CallOption) (*BalanceAccountResponse, error)
|
||||||
|
ListCoins(ctx context.Context, in *DecryptableCoinsAccountRequest, opts ...grpc.CallOption) (*CoinsAccountResponse, error)
|
||||||
|
ListPendingTransactions(ctx context.Context, in *DecryptablePendingTransactionsAccountRequest, opts ...grpc.CallOption) (*PendingTransactionsAccountResponse, error)
|
||||||
|
Revoke(ctx context.Context, in *DecryptableRevokeAccountRequest, opts ...grpc.CallOption) (*RevokeAccountResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type accountServiceClient struct {
|
||||||
|
cc grpc.ClientConnInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewAccountServiceClient(cc grpc.ClientConnInterface) AccountServiceClient {
|
||||||
|
return &accountServiceClient{cc}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *accountServiceClient) Allow(ctx context.Context, in *DecryptableAllowAccountRequest, opts ...grpc.CallOption) (*AllowAccountResponse, error) {
|
||||||
|
out := new(AllowAccountResponse)
|
||||||
|
err := c.cc.Invoke(ctx, AccountService_Allow_FullMethodName, in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *accountServiceClient) GetBalance(ctx context.Context, in *DecryptableBalanceAccountRequest, opts ...grpc.CallOption) (*BalanceAccountResponse, error) {
|
||||||
|
out := new(BalanceAccountResponse)
|
||||||
|
err := c.cc.Invoke(ctx, AccountService_GetBalance_FullMethodName, in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *accountServiceClient) ListCoins(ctx context.Context, in *DecryptableCoinsAccountRequest, opts ...grpc.CallOption) (*CoinsAccountResponse, error) {
|
||||||
|
out := new(CoinsAccountResponse)
|
||||||
|
err := c.cc.Invoke(ctx, AccountService_ListCoins_FullMethodName, in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *accountServiceClient) ListPendingTransactions(ctx context.Context, in *DecryptablePendingTransactionsAccountRequest, opts ...grpc.CallOption) (*PendingTransactionsAccountResponse, error) {
|
||||||
|
out := new(PendingTransactionsAccountResponse)
|
||||||
|
err := c.cc.Invoke(ctx, AccountService_ListPendingTransactions_FullMethodName, in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *accountServiceClient) Revoke(ctx context.Context, in *DecryptableRevokeAccountRequest, opts ...grpc.CallOption) (*RevokeAccountResponse, error) {
|
||||||
|
out := new(RevokeAccountResponse)
|
||||||
|
err := c.cc.Invoke(ctx, AccountService_Revoke_FullMethodName, in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// AccountServiceServer is the server API for AccountService service.
|
||||||
|
// All implementations must embed UnimplementedAccountServiceServer
|
||||||
|
// for forward compatibility
|
||||||
|
type AccountServiceServer interface {
|
||||||
|
Allow(context.Context, *DecryptableAllowAccountRequest) (*AllowAccountResponse, error)
|
||||||
|
GetBalance(context.Context, *DecryptableBalanceAccountRequest) (*BalanceAccountResponse, error)
|
||||||
|
ListCoins(context.Context, *DecryptableCoinsAccountRequest) (*CoinsAccountResponse, error)
|
||||||
|
ListPendingTransactions(context.Context, *DecryptablePendingTransactionsAccountRequest) (*PendingTransactionsAccountResponse, error)
|
||||||
|
Revoke(context.Context, *DecryptableRevokeAccountRequest) (*RevokeAccountResponse, error)
|
||||||
|
mustEmbedUnimplementedAccountServiceServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnimplementedAccountServiceServer must be embedded to have forward compatible implementations.
|
||||||
|
type UnimplementedAccountServiceServer struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (UnimplementedAccountServiceServer) Allow(context.Context, *DecryptableAllowAccountRequest) (*AllowAccountResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Allow not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedAccountServiceServer) GetBalance(context.Context, *DecryptableBalanceAccountRequest) (*BalanceAccountResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method GetBalance not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedAccountServiceServer) ListCoins(context.Context, *DecryptableCoinsAccountRequest) (*CoinsAccountResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method ListCoins not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedAccountServiceServer) ListPendingTransactions(context.Context, *DecryptablePendingTransactionsAccountRequest) (*PendingTransactionsAccountResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method ListPendingTransactions not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedAccountServiceServer) Revoke(context.Context, *DecryptableRevokeAccountRequest) (*RevokeAccountResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Revoke not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedAccountServiceServer) mustEmbedUnimplementedAccountServiceServer() {}
|
||||||
|
|
||||||
|
// UnsafeAccountServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||||
|
// Use of this interface is not recommended, as added methods to AccountServiceServer will
|
||||||
|
// result in compilation errors.
|
||||||
|
type UnsafeAccountServiceServer interface {
|
||||||
|
mustEmbedUnimplementedAccountServiceServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterAccountServiceServer(s grpc.ServiceRegistrar, srv AccountServiceServer) {
|
||||||
|
s.RegisterService(&AccountService_ServiceDesc, srv)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _AccountService_Allow_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(DecryptableAllowAccountRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(AccountServiceServer).Allow(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: AccountService_Allow_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(AccountServiceServer).Allow(ctx, req.(*DecryptableAllowAccountRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _AccountService_GetBalance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(DecryptableBalanceAccountRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(AccountServiceServer).GetBalance(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: AccountService_GetBalance_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(AccountServiceServer).GetBalance(ctx, req.(*DecryptableBalanceAccountRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _AccountService_ListCoins_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(DecryptableCoinsAccountRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(AccountServiceServer).ListCoins(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: AccountService_ListCoins_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(AccountServiceServer).ListCoins(ctx, req.(*DecryptableCoinsAccountRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _AccountService_ListPendingTransactions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(DecryptablePendingTransactionsAccountRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(AccountServiceServer).ListPendingTransactions(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: AccountService_ListPendingTransactions_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(AccountServiceServer).ListPendingTransactions(ctx, req.(*DecryptablePendingTransactionsAccountRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _AccountService_Revoke_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(DecryptableRevokeAccountRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(AccountServiceServer).Revoke(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: AccountService_Revoke_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(AccountServiceServer).Revoke(ctx, req.(*DecryptableRevokeAccountRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
// AccountService_ServiceDesc is the grpc.ServiceDesc for AccountService service.
|
||||||
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
|
// and not to be introspected or modified (even as a copy)
|
||||||
|
var AccountService_ServiceDesc = grpc.ServiceDesc{
|
||||||
|
ServiceName: "quilibrium.node.node.pb.AccountService",
|
||||||
|
HandlerType: (*AccountServiceServer)(nil),
|
||||||
|
Methods: []grpc.MethodDesc{
|
||||||
|
{
|
||||||
|
MethodName: "Allow",
|
||||||
|
Handler: _AccountService_Allow_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "GetBalance",
|
||||||
|
Handler: _AccountService_GetBalance_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "ListCoins",
|
||||||
|
Handler: _AccountService_ListCoins_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "ListPendingTransactions",
|
||||||
|
Handler: _AccountService_ListPendingTransactions_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Revoke",
|
||||||
|
Handler: _AccountService_Revoke_Handler,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Streams: []grpc.StreamDesc{},
|
||||||
|
Metadata: "node.proto",
|
||||||
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
CoinService_Allow_FullMethodName = "/quilibrium.node.node.pb.CoinService/Allow"
|
||||||
|
CoinService_Intersect_FullMethodName = "/quilibrium.node.node.pb.CoinService/Intersect"
|
||||||
|
CoinService_Merge_FullMethodName = "/quilibrium.node.node.pb.CoinService/Merge"
|
||||||
|
CoinService_Mint_FullMethodName = "/quilibrium.node.node.pb.CoinService/Mint"
|
||||||
|
CoinService_MutualReceive_FullMethodName = "/quilibrium.node.node.pb.CoinService/MutualReceive"
|
||||||
|
CoinService_MutualTransfer_FullMethodName = "/quilibrium.node.node.pb.CoinService/MutualTransfer"
|
||||||
|
CoinService_Revoke_FullMethodName = "/quilibrium.node.node.pb.CoinService/Revoke"
|
||||||
|
CoinService_Split_FullMethodName = "/quilibrium.node.node.pb.CoinService/Split"
|
||||||
|
CoinService_Transfer_FullMethodName = "/quilibrium.node.node.pb.CoinService/Transfer"
|
||||||
|
)
|
||||||
|
|
||||||
|
// CoinServiceClient is the client API for CoinService service.
|
||||||
|
//
|
||||||
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||||
|
type CoinServiceClient interface {
|
||||||
|
Allow(ctx context.Context, in *DecryptableAllowCoinRequest, opts ...grpc.CallOption) (*AllowCoinResponse, error)
|
||||||
|
Intersect(ctx context.Context, in *DecryptableIntersectCoinRequest, opts ...grpc.CallOption) (*IntersectCoinResponse, error)
|
||||||
|
Merge(ctx context.Context, in *DecryptableMergeCoinRequest, opts ...grpc.CallOption) (*MergeCoinResponse, error)
|
||||||
|
Mint(ctx context.Context, in *DecryptableMintCoinRequest, opts ...grpc.CallOption) (*MintCoinResponse, error)
|
||||||
|
MutualReceive(ctx context.Context, in *DecryptableMutualReceiveCoinRequest, opts ...grpc.CallOption) (CoinService_MutualReceiveClient, error)
|
||||||
|
MutualTransfer(ctx context.Context, in *DecryptableMutualTransferCoinRequest, opts ...grpc.CallOption) (CoinService_MutualTransferClient, error)
|
||||||
|
Revoke(ctx context.Context, in *DecryptableRevokeCoinRequest, opts ...grpc.CallOption) (*RevokeCoinResponse, error)
|
||||||
|
Split(ctx context.Context, in *DecryptableSplitCoinRequest, opts ...grpc.CallOption) (*SplitCoinResponse, error)
|
||||||
|
Transfer(ctx context.Context, in *DecryptableTransferCoinRequest, opts ...grpc.CallOption) (*TransferCoinResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type coinServiceClient struct {
|
||||||
|
cc grpc.ClientConnInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewCoinServiceClient(cc grpc.ClientConnInterface) CoinServiceClient {
|
||||||
|
return &coinServiceClient{cc}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *coinServiceClient) Allow(ctx context.Context, in *DecryptableAllowCoinRequest, opts ...grpc.CallOption) (*AllowCoinResponse, error) {
|
||||||
|
out := new(AllowCoinResponse)
|
||||||
|
err := c.cc.Invoke(ctx, CoinService_Allow_FullMethodName, in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *coinServiceClient) Intersect(ctx context.Context, in *DecryptableIntersectCoinRequest, opts ...grpc.CallOption) (*IntersectCoinResponse, error) {
|
||||||
|
out := new(IntersectCoinResponse)
|
||||||
|
err := c.cc.Invoke(ctx, CoinService_Intersect_FullMethodName, in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *coinServiceClient) Merge(ctx context.Context, in *DecryptableMergeCoinRequest, opts ...grpc.CallOption) (*MergeCoinResponse, error) {
|
||||||
|
out := new(MergeCoinResponse)
|
||||||
|
err := c.cc.Invoke(ctx, CoinService_Merge_FullMethodName, in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *coinServiceClient) Mint(ctx context.Context, in *DecryptableMintCoinRequest, opts ...grpc.CallOption) (*MintCoinResponse, error) {
|
||||||
|
out := new(MintCoinResponse)
|
||||||
|
err := c.cc.Invoke(ctx, CoinService_Mint_FullMethodName, in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *coinServiceClient) MutualReceive(ctx context.Context, in *DecryptableMutualReceiveCoinRequest, opts ...grpc.CallOption) (CoinService_MutualReceiveClient, error) {
|
||||||
|
stream, err := c.cc.NewStream(ctx, &CoinService_ServiceDesc.Streams[0], CoinService_MutualReceive_FullMethodName, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
x := &coinServiceMutualReceiveClient{stream}
|
||||||
|
if err := x.ClientStream.SendMsg(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if err := x.ClientStream.CloseSend(); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return x, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type CoinService_MutualReceiveClient interface {
|
||||||
|
Recv() (*MutualReceiveCoinResponse, error)
|
||||||
|
grpc.ClientStream
|
||||||
|
}
|
||||||
|
|
||||||
|
type coinServiceMutualReceiveClient struct {
|
||||||
|
grpc.ClientStream
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *coinServiceMutualReceiveClient) Recv() (*MutualReceiveCoinResponse, error) {
|
||||||
|
m := new(MutualReceiveCoinResponse)
|
||||||
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return m, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *coinServiceClient) MutualTransfer(ctx context.Context, in *DecryptableMutualTransferCoinRequest, opts ...grpc.CallOption) (CoinService_MutualTransferClient, error) {
|
||||||
|
stream, err := c.cc.NewStream(ctx, &CoinService_ServiceDesc.Streams[1], CoinService_MutualTransfer_FullMethodName, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
x := &coinServiceMutualTransferClient{stream}
|
||||||
|
if err := x.ClientStream.SendMsg(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if err := x.ClientStream.CloseSend(); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return x, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type CoinService_MutualTransferClient interface {
|
||||||
|
Recv() (*MutualTransferCoinResponse, error)
|
||||||
|
grpc.ClientStream
|
||||||
|
}
|
||||||
|
|
||||||
|
type coinServiceMutualTransferClient struct {
|
||||||
|
grpc.ClientStream
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *coinServiceMutualTransferClient) Recv() (*MutualTransferCoinResponse, error) {
|
||||||
|
m := new(MutualTransferCoinResponse)
|
||||||
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return m, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *coinServiceClient) Revoke(ctx context.Context, in *DecryptableRevokeCoinRequest, opts ...grpc.CallOption) (*RevokeCoinResponse, error) {
|
||||||
|
out := new(RevokeCoinResponse)
|
||||||
|
err := c.cc.Invoke(ctx, CoinService_Revoke_FullMethodName, in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *coinServiceClient) Split(ctx context.Context, in *DecryptableSplitCoinRequest, opts ...grpc.CallOption) (*SplitCoinResponse, error) {
|
||||||
|
out := new(SplitCoinResponse)
|
||||||
|
err := c.cc.Invoke(ctx, CoinService_Split_FullMethodName, in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *coinServiceClient) Transfer(ctx context.Context, in *DecryptableTransferCoinRequest, opts ...grpc.CallOption) (*TransferCoinResponse, error) {
|
||||||
|
out := new(TransferCoinResponse)
|
||||||
|
err := c.cc.Invoke(ctx, CoinService_Transfer_FullMethodName, in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// CoinServiceServer is the server API for CoinService service.
|
||||||
|
// All implementations must embed UnimplementedCoinServiceServer
|
||||||
|
// for forward compatibility
|
||||||
|
type CoinServiceServer interface {
|
||||||
|
Allow(context.Context, *DecryptableAllowCoinRequest) (*AllowCoinResponse, error)
|
||||||
|
Intersect(context.Context, *DecryptableIntersectCoinRequest) (*IntersectCoinResponse, error)
|
||||||
|
Merge(context.Context, *DecryptableMergeCoinRequest) (*MergeCoinResponse, error)
|
||||||
|
Mint(context.Context, *DecryptableMintCoinRequest) (*MintCoinResponse, error)
|
||||||
|
MutualReceive(*DecryptableMutualReceiveCoinRequest, CoinService_MutualReceiveServer) error
|
||||||
|
MutualTransfer(*DecryptableMutualTransferCoinRequest, CoinService_MutualTransferServer) error
|
||||||
|
Revoke(context.Context, *DecryptableRevokeCoinRequest) (*RevokeCoinResponse, error)
|
||||||
|
Split(context.Context, *DecryptableSplitCoinRequest) (*SplitCoinResponse, error)
|
||||||
|
Transfer(context.Context, *DecryptableTransferCoinRequest) (*TransferCoinResponse, error)
|
||||||
|
mustEmbedUnimplementedCoinServiceServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnimplementedCoinServiceServer must be embedded to have forward compatible implementations.
|
||||||
|
type UnimplementedCoinServiceServer struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (UnimplementedCoinServiceServer) Allow(context.Context, *DecryptableAllowCoinRequest) (*AllowCoinResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Allow not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedCoinServiceServer) Intersect(context.Context, *DecryptableIntersectCoinRequest) (*IntersectCoinResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Intersect not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedCoinServiceServer) Merge(context.Context, *DecryptableMergeCoinRequest) (*MergeCoinResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Merge not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedCoinServiceServer) Mint(context.Context, *DecryptableMintCoinRequest) (*MintCoinResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Mint not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedCoinServiceServer) MutualReceive(*DecryptableMutualReceiveCoinRequest, CoinService_MutualReceiveServer) error {
|
||||||
|
return status.Errorf(codes.Unimplemented, "method MutualReceive not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedCoinServiceServer) MutualTransfer(*DecryptableMutualTransferCoinRequest, CoinService_MutualTransferServer) error {
|
||||||
|
return status.Errorf(codes.Unimplemented, "method MutualTransfer not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedCoinServiceServer) Revoke(context.Context, *DecryptableRevokeCoinRequest) (*RevokeCoinResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Revoke not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedCoinServiceServer) Split(context.Context, *DecryptableSplitCoinRequest) (*SplitCoinResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Split not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedCoinServiceServer) Transfer(context.Context, *DecryptableTransferCoinRequest) (*TransferCoinResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Transfer not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedCoinServiceServer) mustEmbedUnimplementedCoinServiceServer() {}
|
||||||
|
|
||||||
|
// UnsafeCoinServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||||
|
// Use of this interface is not recommended, as added methods to CoinServiceServer will
|
||||||
|
// result in compilation errors.
|
||||||
|
type UnsafeCoinServiceServer interface {
|
||||||
|
mustEmbedUnimplementedCoinServiceServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterCoinServiceServer(s grpc.ServiceRegistrar, srv CoinServiceServer) {
|
||||||
|
s.RegisterService(&CoinService_ServiceDesc, srv)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _CoinService_Allow_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(DecryptableAllowCoinRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(CoinServiceServer).Allow(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: CoinService_Allow_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(CoinServiceServer).Allow(ctx, req.(*DecryptableAllowCoinRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _CoinService_Intersect_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(DecryptableIntersectCoinRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(CoinServiceServer).Intersect(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: CoinService_Intersect_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(CoinServiceServer).Intersect(ctx, req.(*DecryptableIntersectCoinRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _CoinService_Merge_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(DecryptableMergeCoinRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(CoinServiceServer).Merge(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: CoinService_Merge_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(CoinServiceServer).Merge(ctx, req.(*DecryptableMergeCoinRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _CoinService_Mint_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(DecryptableMintCoinRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(CoinServiceServer).Mint(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: CoinService_Mint_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(CoinServiceServer).Mint(ctx, req.(*DecryptableMintCoinRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _CoinService_MutualReceive_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||||
|
m := new(DecryptableMutualReceiveCoinRequest)
|
||||||
|
if err := stream.RecvMsg(m); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return srv.(CoinServiceServer).MutualReceive(m, &coinServiceMutualReceiveServer{stream})
|
||||||
|
}
|
||||||
|
|
||||||
|
type CoinService_MutualReceiveServer interface {
|
||||||
|
Send(*MutualReceiveCoinResponse) error
|
||||||
|
grpc.ServerStream
|
||||||
|
}
|
||||||
|
|
||||||
|
type coinServiceMutualReceiveServer struct {
|
||||||
|
grpc.ServerStream
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *coinServiceMutualReceiveServer) Send(m *MutualReceiveCoinResponse) error {
|
||||||
|
return x.ServerStream.SendMsg(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _CoinService_MutualTransfer_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||||
|
m := new(DecryptableMutualTransferCoinRequest)
|
||||||
|
if err := stream.RecvMsg(m); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return srv.(CoinServiceServer).MutualTransfer(m, &coinServiceMutualTransferServer{stream})
|
||||||
|
}
|
||||||
|
|
||||||
|
type CoinService_MutualTransferServer interface {
|
||||||
|
Send(*MutualTransferCoinResponse) error
|
||||||
|
grpc.ServerStream
|
||||||
|
}
|
||||||
|
|
||||||
|
type coinServiceMutualTransferServer struct {
|
||||||
|
grpc.ServerStream
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *coinServiceMutualTransferServer) Send(m *MutualTransferCoinResponse) error {
|
||||||
|
return x.ServerStream.SendMsg(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _CoinService_Revoke_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(DecryptableRevokeCoinRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(CoinServiceServer).Revoke(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: CoinService_Revoke_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(CoinServiceServer).Revoke(ctx, req.(*DecryptableRevokeCoinRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _CoinService_Split_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(DecryptableSplitCoinRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(CoinServiceServer).Split(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: CoinService_Split_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(CoinServiceServer).Split(ctx, req.(*DecryptableSplitCoinRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _CoinService_Transfer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(DecryptableTransferCoinRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(CoinServiceServer).Transfer(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: CoinService_Transfer_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(CoinServiceServer).Transfer(ctx, req.(*DecryptableTransferCoinRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
// CoinService_ServiceDesc is the grpc.ServiceDesc for CoinService service.
|
||||||
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
|
// and not to be introspected or modified (even as a copy)
|
||||||
|
var CoinService_ServiceDesc = grpc.ServiceDesc{
|
||||||
|
ServiceName: "quilibrium.node.node.pb.CoinService",
|
||||||
|
HandlerType: (*CoinServiceServer)(nil),
|
||||||
|
Methods: []grpc.MethodDesc{
|
||||||
|
{
|
||||||
|
MethodName: "Allow",
|
||||||
|
Handler: _CoinService_Allow_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Intersect",
|
||||||
|
Handler: _CoinService_Intersect_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Merge",
|
||||||
|
Handler: _CoinService_Merge_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Mint",
|
||||||
|
Handler: _CoinService_Mint_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Revoke",
|
||||||
|
Handler: _CoinService_Revoke_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Split",
|
||||||
|
Handler: _CoinService_Split_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Transfer",
|
||||||
|
Handler: _CoinService_Transfer_Handler,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Streams: []grpc.StreamDesc{
|
||||||
|
{
|
||||||
|
StreamName: "MutualReceive",
|
||||||
|
Handler: _CoinService_MutualReceive_Handler,
|
||||||
|
ServerStreams: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
StreamName: "MutualTransfer",
|
||||||
|
Handler: _CoinService_MutualTransfer_Handler,
|
||||||
|
ServerStreams: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Metadata: "node.proto",
|
||||||
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
TransactionService_Approve_FullMethodName = "/quilibrium.node.node.pb.TransactionService/Approve"
|
||||||
|
TransactionService_Reject_FullMethodName = "/quilibrium.node.node.pb.TransactionService/Reject"
|
||||||
|
)
|
||||||
|
|
||||||
|
// TransactionServiceClient is the client API for TransactionService service.
|
||||||
|
//
|
||||||
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||||
|
type TransactionServiceClient interface {
|
||||||
|
Approve(ctx context.Context, in *DecryptableApprovePendingTransactionRequest, opts ...grpc.CallOption) (*ApprovePendingTransactionResponse, error)
|
||||||
|
Reject(ctx context.Context, in *DecryptableRejectPendingTransactionRequest, opts ...grpc.CallOption) (*RejectPendingTransactionResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type transactionServiceClient struct {
|
||||||
|
cc grpc.ClientConnInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewTransactionServiceClient(cc grpc.ClientConnInterface) TransactionServiceClient {
|
||||||
|
return &transactionServiceClient{cc}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *transactionServiceClient) Approve(ctx context.Context, in *DecryptableApprovePendingTransactionRequest, opts ...grpc.CallOption) (*ApprovePendingTransactionResponse, error) {
|
||||||
|
out := new(ApprovePendingTransactionResponse)
|
||||||
|
err := c.cc.Invoke(ctx, TransactionService_Approve_FullMethodName, in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *transactionServiceClient) Reject(ctx context.Context, in *DecryptableRejectPendingTransactionRequest, opts ...grpc.CallOption) (*RejectPendingTransactionResponse, error) {
|
||||||
|
out := new(RejectPendingTransactionResponse)
|
||||||
|
err := c.cc.Invoke(ctx, TransactionService_Reject_FullMethodName, in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// TransactionServiceServer is the server API for TransactionService service.
|
||||||
|
// All implementations must embed UnimplementedTransactionServiceServer
|
||||||
|
// for forward compatibility
|
||||||
|
type TransactionServiceServer interface {
|
||||||
|
Approve(context.Context, *DecryptableApprovePendingTransactionRequest) (*ApprovePendingTransactionResponse, error)
|
||||||
|
Reject(context.Context, *DecryptableRejectPendingTransactionRequest) (*RejectPendingTransactionResponse, error)
|
||||||
|
mustEmbedUnimplementedTransactionServiceServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnimplementedTransactionServiceServer must be embedded to have forward compatible implementations.
|
||||||
|
type UnimplementedTransactionServiceServer struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (UnimplementedTransactionServiceServer) Approve(context.Context, *DecryptableApprovePendingTransactionRequest) (*ApprovePendingTransactionResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Approve not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedTransactionServiceServer) Reject(context.Context, *DecryptableRejectPendingTransactionRequest) (*RejectPendingTransactionResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Reject not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedTransactionServiceServer) mustEmbedUnimplementedTransactionServiceServer() {}
|
||||||
|
|
||||||
|
// UnsafeTransactionServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||||
|
// Use of this interface is not recommended, as added methods to TransactionServiceServer will
|
||||||
|
// result in compilation errors.
|
||||||
|
type UnsafeTransactionServiceServer interface {
|
||||||
|
mustEmbedUnimplementedTransactionServiceServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterTransactionServiceServer(s grpc.ServiceRegistrar, srv TransactionServiceServer) {
|
||||||
|
s.RegisterService(&TransactionService_ServiceDesc, srv)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _TransactionService_Approve_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(DecryptableApprovePendingTransactionRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(TransactionServiceServer).Approve(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: TransactionService_Approve_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(TransactionServiceServer).Approve(ctx, req.(*DecryptableApprovePendingTransactionRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _TransactionService_Reject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(DecryptableRejectPendingTransactionRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(TransactionServiceServer).Reject(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: TransactionService_Reject_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(TransactionServiceServer).Reject(ctx, req.(*DecryptableRejectPendingTransactionRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
// TransactionService_ServiceDesc is the grpc.ServiceDesc for TransactionService service.
|
||||||
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
|
// and not to be introspected or modified (even as a copy)
|
||||||
|
var TransactionService_ServiceDesc = grpc.ServiceDesc{
|
||||||
|
ServiceName: "quilibrium.node.node.pb.TransactionService",
|
||||||
|
HandlerType: (*TransactionServiceServer)(nil),
|
||||||
|
Methods: []grpc.MethodDesc{
|
||||||
|
{
|
||||||
|
MethodName: "Approve",
|
||||||
|
Handler: _TransactionService_Approve_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Reject",
|
||||||
|
Handler: _TransactionService_Reject_Handler,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Streams: []grpc.StreamDesc{},
|
||||||
|
Metadata: "node.proto",
|
||||||
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
NodeStats_PutNodeInfo_FullMethodName = "/quilibrium.node.node.pb.NodeStats/PutNodeInfo"
|
NodeStats_PutNodeInfo_FullMethodName = "/quilibrium.node.node.pb.NodeStats/PutNodeInfo"
|
||||||
NodeStats_PutPeerInfo_FullMethodName = "/quilibrium.node.node.pb.NodeStats/PutPeerInfo"
|
NodeStats_PutPeerInfo_FullMethodName = "/quilibrium.node.node.pb.NodeStats/PutPeerInfo"
|
||||||
|
@ -49,6 +49,7 @@ type DataProofStore interface {
|
|||||||
output []byte,
|
output []byte,
|
||||||
err error,
|
err error,
|
||||||
)
|
)
|
||||||
|
RewindToIncrement(peerId []byte, increment uint32) error
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ DataProofStore = (*PebbleDataProofStore)(nil)
|
var _ DataProofStore = (*PebbleDataProofStore)(nil)
|
||||||
@ -487,6 +488,9 @@ func (p *PebbleDataProofStore) PutDataTimeProof(
|
|||||||
// upgrading on time, akin to a "difficulty bomb" in reverse, but locally
|
// upgrading on time, akin to a "difficulty bomb" in reverse, but locally
|
||||||
// calculated.
|
// calculated.
|
||||||
difficulty := 200000 - (increment / 4)
|
difficulty := 200000 - (increment / 4)
|
||||||
|
if difficulty < 25000 || increment > 800000 {
|
||||||
|
difficulty = 25000
|
||||||
|
}
|
||||||
|
|
||||||
// Basis split on the estimated shard level for growth rate (in terms of
|
// Basis split on the estimated shard level for growth rate (in terms of
|
||||||
// units): 240 (QUIL) * 8000000000 (conversion factor) / 1600000 (shards)
|
// units): 240 (QUIL) * 8000000000 (conversion factor) / 1600000 (shards)
|
||||||
@ -567,3 +571,34 @@ func (p *PebbleDataProofStore) GetLatestDataTimeProof(peerId []byte) (
|
|||||||
|
|
||||||
return increment, parallelism, output, err
|
return increment, parallelism, output, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (p *PebbleDataProofStore) RewindToIncrement(
|
||||||
|
peerId []byte,
|
||||||
|
increment uint32,
|
||||||
|
) error {
|
||||||
|
reward := new(big.Int)
|
||||||
|
for j := uint32(0); j <= increment; j++ {
|
||||||
|
_, parallelism, _, _, err := p.GetDataTimeProof(peerId, uint32(j))
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
pomwBasis := big.NewInt(1200000)
|
||||||
|
|
||||||
|
reward = reward.Add(
|
||||||
|
reward,
|
||||||
|
new(big.Int).Mul(pomwBasis, big.NewInt(int64(parallelism))),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
latest := []byte{}
|
||||||
|
latest = binary.BigEndian.AppendUint32(latest, increment)
|
||||||
|
|
||||||
|
latest = append(latest, reward.FillBytes(make([]byte, 32))...)
|
||||||
|
|
||||||
|
if err := p.db.Set(dataTimeProofLatestKey(peerId), latest); err != nil {
|
||||||
|
return errors.Wrap(err, "put data time proof")
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user