This repositry contains implementation cNFT TEP-? draft standart
- Install PostgreSQL and Go.
- Build sources
go mod downloadto dowload dependenciesCGO_ENABLED=0 go build -o server cmd/server/main.goCGO_ENABLED=0 go build -o ctl cmd/ctl/main.go
- Copy the following files to a directory:
serverbinaryctlbinary- and copy environment file
cp .env.example .env
- Configure the
.envfile:- Set
POSTGRES_URIto your database URI. - Set
PORTto the desired port. - Generate and set
ADMIN_*credentials. - Set
DEPTHas needed (maximum items =2^DEPTH, maxDEPTH= 30). - Set
DATA_DIRto the directory where small.jsonfiles will be stored. - Set
TONCENTER_URI, removingtestnet.for mainnet deployment.
- Set
- Prepare an
owners.txtfile:- List item owner addresses, one per line.
- The first address gets item index 0, and so on.
- Initialize the database:
- Run
./ctl migrateto create the necessary tables. - Run
./ctl add owners.txtto add the addresses.
- Run
- Host your collection and item metadata:
- Follow the Token Data Standard.
- Use a consistent URI pattern for item metadata (e.g.,
base-uri/item-index.json).
- Run
./server:- Use a utility like screen to keep it running.
- Ensure the server port is publicly accessible.
- Rediscover items:
- Navigate to
/admin/rediscoverusing yourADMIN_*credentials. - Verify the appearance of
[DATA_DIR]/upd/1.json.
- Navigate to
- Generate an update:
- Run
./ctl genupd [path-to-update-file] [collection-owner] [collection-meta] [item-meta-prefix] [royalty-base] [royalty-factor] [royalty-recipient] [api-uri-including-v1]. - Replace placeholders with appropriate values, for example:
./ctl genupdpwd/apidata/upd/1.json UQDSqdhnwMllRlp0EqB4asBQiGhNWNa-9S4hPSVONLfr0WF3 https://cubeworlds.club/api/nft/collection.json https://cubeworlds.club/api/nft/ 10 100 UQDSqdhnwMllRlp0EqB4asBQiGhNWNa-9S4hPSVONLfr0WF3 https://cubeworlds.club/cnfts/v1
- Run
- Invoke the
ton://deeplink that appears. - Set the collection address:
- Navigate to
/admin/setaddr/[collection-address], using thecollection-addressfrom result of previous step.
- Navigate to
- Wait for a
committed statemessage in theserverlogs. - Done.
- Prepare a
new-owners.txtfile:- List new owner addresses, starting from the next available index.
- Add new owners:
- Run
./ctl add new-owners.txt.
- Run
- Rediscover items:
- Navigate to
[api-uri]/admin/rediscover.
- Navigate to
- Locate the new update file:
- Find it under
[DATA_DIR]/upd(e.g.,2.jsonif the last update was1.json).
- Find it under
- Generate an update:
- Run
./ctl genupd [path-to-update-file] [collection-address], where collection-address isEQAaSqEwAh00YOCc9ZwtqfNcXeehbl97yKQKCZPRGwCov51Vfrom creating steps.
- Run
- Invoke the
ton://deeplink that appears. - Wait for a
committed statemessage in theserverlogs. - Done.
Note: Avoid updating during high traffic periods to prevent invalid proofs. This may occur briefly when the on-chain transaction is processed but not yet detected by the API. Perform updates in large batches during low traffic times.