Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example task: block minter indexing #112

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 29 additions & 26 deletions docs/bin/default.dot
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ N3;
N4;
N5;
N6;
N7;

}

subgraph cluster_Multiera {
label="Multiera";
color="grey85";

N7;
N8;
N9;
N10;
Expand All @@ -37,6 +37,7 @@ N16;
N17;
N18;
N19;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI changes in the docs folder are automatically generated with yarn prepare in the docs folder

N20;

}

Expand All @@ -47,38 +48,40 @@ N19;
N4[label="ByronAddressTask"][shape="box"];
N5[label="ByronOutputTask"][shape="box"];
N6[label="ByronInputTask"][shape="box"];
N7[label="MultieraBlockTask"][shape="box"];
N8[label="MultieraTransactionTask"][shape="box"];
N9[label="MultieraMetadataTask"][shape="box"];
N10[label="MultieraAddressTask"][shape="box"];
N11[label="MultieraOutputTask"][shape="box"];
N12[label="MultieraReferenceInputTask"][shape="box"];
N13[label="MultieraUsedInputTask"][shape="box"];
N14[label="MultieraUnusedInputTask"][shape="box"];
N15[label="MultieraStakeCredentialTask"][shape="box"];
N16[label="MultieraAddressCredentialRelationTask"][shape="box"];
N17[label="MultieraTxCredentialRelationTask"][shape="box"];
N18[label="MultieraAssetMintTask"][shape="box"];
N19[label="MultieraCip25EntryTask"][shape="box"];
N7[label="ByronBlockMinterTask"][shape="box"];
N8[label="MultieraBlockTask"][shape="box"];
N9[label="MultieraTransactionTask"][shape="box"];
N10[label="MultieraMetadataTask"][shape="box"];
N11[label="MultieraAddressTask"][shape="box"];
N12[label="MultieraOutputTask"][shape="box"];
N13[label="MultieraReferenceInputTask"][shape="box"];
N14[label="MultieraUsedInputTask"][shape="box"];
N15[label="MultieraUnusedInputTask"][shape="box"];
N16[label="MultieraStakeCredentialTask"][shape="box"];
N17[label="MultieraAddressCredentialRelationTask"][shape="box"];
N18[label="MultieraTxCredentialRelationTask"][shape="box"];
N19[label="MultieraAssetMintTask"][shape="box"];
N20[label="MultieraCip25EntryTask"][shape="box"];
N0 -> N1[label=""];
N2 -> N3[label=""];
N3 -> N4[label=""];
N4 -> N5[label=""];
N5 -> N6[label=""];
N7 -> N8[label=""];
N2 -> N7[label=""];
N8 -> N9[label=""];
N8 -> N10[label=""];
N10 -> N11[label=""];
N9 -> N10[label=""];
N9 -> N11[label=""];
N11 -> N12[label=""];
N11 -> N13[label=""];
N11 -> N14[label=""];
N13 -> N15[label=""];
N14 -> N15[label=""];
N10 -> N16[label=""];
N12 -> N13[label=""];
N12 -> N14[label=""];
N12 -> N15[label=""];
N14 -> N16[label=""];
N15 -> N16[label=""];
N10 -> N17[label=""];
N15 -> N17[label=""];
N8 -> N18[label=""];
N11 -> N17[label=""];
N16 -> N17[label=""];
N11 -> N18[label=""];
N16 -> N18[label=""];
N9 -> N19[label=""];
N18 -> N19[label=""];
N10 -> N20[label=""];
N19 -> N20[label=""];
}
254 changes: 133 additions & 121 deletions docs/bin/default.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
92 changes: 84 additions & 8 deletions docs/bin/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,23 @@
],
"type": "object"
},
"BlockHash": {
"type": "string",
"example": "cf8c63a909d91776e27f7d05457e823a9dba606a7ab499ac435e7904ee70d7c8",
"description": "[0-9a-fA-F]{64}"
},
"TxHash": {
"type": "string",
"example": "336d520af58ff440b2f20210ddb5ef5b2c035e0ec7ec258bae4b519a87fa1696",
"pattern": "[0-9a-fA-F]{64}"
},
"BlockTxPair": {
"properties": {
"tx": {
"type": "string",
"description": "tx hash",
"example": "336d520af58ff440b2f20210ddb5ef5b2c035e0ec7ec258bae4b519a87fa1696",
"pattern": "[0-9a-fA-F]{64}"
"$ref": "#/components/schemas/TxHash"
},
"block": {
"type": "string",
"description": "block hash",
"example": "2548ad5d0d9d33d50ab43151f574474454017a733e307229fa509c4987ca9782",
"pattern": "[0-9a-fA-F]{64}"
"$ref": "#/components/schemas/BlockHash"
}
},
"required": [
Expand Down Expand Up @@ -207,6 +211,28 @@
],
"type": "object"
},
"BlockMinterResponse": {
"properties": {
"pubkey": {
"type": "string"
}
},
"required": [
"pubkey"
],
"type": "object"
},
"BlockMinterRequest": {
"properties": {
"hash": {
"$ref": "#/components/schemas/BlockHash"
}
},
"required": [
"hash"
],
"type": "object"
},
"PageInfo": {
"properties": {
"pageInfo": {
Expand Down Expand Up @@ -654,6 +680,56 @@
}
}
},
"/block/minter": {
"post": {
"operationId": "BlockMinter",
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/BlockMinterResponse"
}
}
}
},
"400": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorShape"
}
}
}
},
"409": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorShape"
}
}
}
}
},
"description": "Get the latest block. Useful for checking synchronization process and pagination",
"security": [],
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/BlockMinterRequest"
}
}
}
}
}
},
"/credential/address": {
"post": {
"operationId": "AddressesForCredential",
Expand Down
53 changes: 53 additions & 0 deletions docs/bin/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,36 @@ CREATE TABLE public."Block" (
);


--
-- Name: BlockMinter; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public."BlockMinter" (
id integer NOT NULL,
key bytea NOT NULL
);


--
-- Name: BlockMinter_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public."BlockMinter_id_seq"
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;


--
-- Name: BlockMinter_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public."BlockMinter_id_seq" OWNED BY public."BlockMinter".id;


--
-- Name: Block_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
Expand Down Expand Up @@ -454,6 +484,13 @@ ALTER TABLE ONLY public."Address" ALTER COLUMN id SET DEFAULT nextval('public."A
ALTER TABLE ONLY public."Block" ALTER COLUMN id SET DEFAULT nextval('public."Block_id_seq"'::regclass);


--
-- Name: BlockMinter id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public."BlockMinter" ALTER COLUMN id SET DEFAULT nextval('public."BlockMinter_id_seq"'::regclass);


--
-- Name: Cip25Entry id; Type: DEFAULT; Schema: public; Owner: -
--
Expand Down Expand Up @@ -540,6 +577,14 @@ ALTER TABLE ONLY public."Address"
ADD CONSTRAINT "Address_pkey" PRIMARY KEY (id);


--
-- Name: BlockMinter BlockMinter_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public."BlockMinter"
ADD CONSTRAINT "BlockMinter_pkey" PRIMARY KEY (id);


--
-- Name: Block Block_hash_key; Type: CONSTRAINT; Schema: public; Owner: -
--
Expand Down Expand Up @@ -892,6 +937,14 @@ ALTER TABLE ONLY public."AssetMint"
ADD CONSTRAINT "fk-asset_mint-transaction_id" FOREIGN KEY (tx_id) REFERENCES public."Transaction"(id) ON DELETE CASCADE;


--
-- Name: BlockMinter fk-block_minter-block_id; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public."BlockMinter"
ADD CONSTRAINT "fk-block_minter-block_id" FOREIGN KEY (id) REFERENCES public."Block"(id) ON DELETE CASCADE;


--
-- Name: Cip25Entry fk-cip25_entry-asset_id; Type: FK CONSTRAINT; Schema: public; Owner: -
--
Expand Down
Loading