Skip to content

Commit 5238318

Browse files
committed
docs: register method update
1 parent 31f4a5c commit 5238318

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

warp-academy-docs/docs/gateway/http/post/register-contract.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Method: `POST`
44

5-
`/gateway/register` - allows to register contract in Warp gateway. Contract must be firstly uploaded to Bundlr, its id and Bundlr's node to which contract data item has been uploaded (either `node1` or `node2`) must be passed to the request. Contract is then indexed in Warp gateway.
5+
`/gateway/register` - allows to register contract in Warp gateway. Contract must be firstly uploaded to Irys or other provider (e.g. Turbo or through arbundles). Then its id and register provider (either `node1` or `node2` for Irys deployments or `arweave` for others) must be passed to the request. Contract is then indexed in Warp gateway.
66

77
Example request:
88

@@ -13,6 +13,6 @@ await fetch(`https://gateway.warp.cc/gateway/contracts/register`, {
1313
'Content-Type': 'application/json',
1414
Accept: 'application/json',
1515
},
16-
body: JSON.stringify({ contractId, bundlrNode }),
16+
body: JSON.stringify({ contractId, registerProvider }),
1717
});
1818
```

warp-academy-docs/docs/sdk/advanced/register-contract.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const contractTags = [
3232
];
3333
```
3434

35-
2. User then needs to initialize Bundlr and uploads the contract within data:
35+
2. User then needs to upload the contract. One can use Irys or other provider (e.g. Turbo or arbundles). Here, we will use Irys. In order to deploy contract we need to initialize Bundlr and upload the contract within data:
3636

3737
```ts
3838
const jwk = JSON.parse(fs.readFileSync('.secrets/warp-wallet-jwk.json').toString());
@@ -43,7 +43,9 @@ const data = fs.readFileSync('tools/data/data.txt');
4343
const tx = await bundlr.upload(data, { tags: contractTags });
4444
```
4545

46-
3. Finally, contract is sent to Warp Gateway where it is indexed so it can be immediately available for all Warp tools, contract data can be also served by Arweave gateway.
46+
3. Finally, contract is sent to Warp Gateway where it is indexed so it can be immediately available for all Warp tools, contract data can be also served by Arweave gateway. When using Irys - `node1` or `node2` must be set as a `register` method's second parameter, when using other providers - second parameter should be set to `arweave`. Warp Gateway verifies whether contract contains contract specific tags (e.g. Contract-Src, Init-State, App-Name and App-Version).
47+
48+
`register` method is dedicated to atomic assets so contract init state should be set in a tag and not in the data field of the contract, additionally - contract should contain `Content-Type` tag.
4749

4850
:::caution
4951
`register` method requires installing [`warp-contracts-plugin-deploy`](https://www.npmjs.com/package/warp-contracts-plugin-deploy). Learn more about this plugin in [`Deploy Plugin` section](plugins/deployment).

0 commit comments

Comments
 (0)